langchain_prefect.utilities
Utilities for the langchain_prefect package.
Classes
NotAnArtifact
Bases: BaseModel
Placeholder class for soon-to-come Artifact.
Source code in langchain_prefect/utilities.py
41 42 43 44 45 46 | |
Functions
flow_wrapped_fn
Define a function to be wrapped in a flow depending on whether the original function is sync or async.
Source code in langchain_prefect/utilities.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | |
get_prompt_content
Return the content of the prompts.
Source code in langchain_prefect/utilities.py
13 14 15 16 17 18 19 20 | |
llm_invocation_summary
Will eventually return an artifact.
Source code in langchain_prefect/utilities.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
num_tokens
Returns the number of tokens in a text string.
Source code in langchain_prefect/utilities.py
23 24 25 26 27 28 29 30 | |
parse_llm_result
Will eventually return an artifact.
Source code in langchain_prefect/utilities.py
78 79 80 81 82 83 84 | |
truncate
Truncate text to max_length.
Source code in langchain_prefect/utilities.py
33 34 35 36 37 38 | |