callbacks
#
Callback handlers allow listening to events in LangChain.
Class hierarchy:
BaseCallbackHandler --> <name>CallbackHandler # Example: AimCallbackHandler
Classes
Callback Handler that logs to Aim. |
|
Callback handler for the metadata and associated function states for callbacks. |
|
Callback Handler that logs into Argilla. |
|
Callback Handler that logs to Arize. |
|
Callback Handler that logs to Arthur platform. |
|
|
Callback Handler that tracks bedrock anthropic info. |
Callback Handler that logs to ClearML. |
|
Callback Handler that logs to Comet. |
|
|
Callback Handler that logs into deepeval. |
Callback Handler that records transcripts to the Context service. |
|
Initialize Fiddler callback handler. |
|
Callback handler that is used within a Flyte task. |
|
Asynchronous callback for manually validating values. |
|
Callback for manually validating values. |
|
Exception to raise when a person manually review and rejects a value. |
|
Callback Handler that logs to Infino. |
|
|
Label Studio callback handler. |
Label Studio mode enumerator. |
|
|
Callback Handler for LLMonitor`. |
Context manager for LLMonitor user context. |
|
Callback Handler that logs metrics and artifacts to mlflow server. |
|
|
Callback Handler that logs metrics and artifacts to mlflow server. |
Callback Handler that tracks OpenAI info. |
|
|
Token type enum. |
|
Callback handler for promptlayer. |
Callback Handler that logs prompt artifacts and metrics to SageMaker Experiments. |
|
Child record as a NamedTuple. |
|
Enumerator of the child type. |
|
Streamlit expander that can be renamed and dynamically expanded/collapsed. |
|
|
A thought in the LLM's thought stream. |
|
Generates markdown labels for LLMThought containers. |
|
Enumerator of the LLMThought state. |
|
Callback handler that writes to a Streamlit app. |
|
Tool record as a NamedTuple. |
|
Comet Tracer. |
Arguments for the WandbTracer. |
|
Callback Handler that logs to Weights and Biases. |
|
Callback handler for Trubrics. |
|
|
Upstash Ratelimit Error |
|
Callback to handle rate limiting based on the number of requests or the number of tokens in the input. |
Callback Handler that logs evaluation results to uptrain and the console. |
|
The UpTrain data schema for tracking evaluation results. |
|
Handle the metadata and associated function states for callbacks. |
|
Callback Handler that logs to Weights and Biases. |
|
Callback Handler for logging to WhyLabs. |
Functions
Import the aim python package and raise an error if it is not installed. |
|
Import the clearml python package and raise an error if it is not installed. |
|
Import comet_ml and raise an error if it is not installed. |
|
Import the getcontext package. |
|
Import the fiddler python package and raise an error if it is not installed. |
|
Analyze text using textstat and spacy. |
|
Import flytekit and flytekitplugins-deck-standard. |
|
Calculate num tokens for OpenAI with tiktoken package. |
|
Import the infino client. |
|
Import tiktoken for counting tokens for OpenAI models. |
|
|
Get default Label Studio configs for the given mode. |
Builds an LLMonitor UserContextManager |
|
Get the Bedrock anthropic callback handler in a context manager. |
|
Get the OpenAI callback handler in a context manager. |
|
Get the WandbTracer in a context manager. |
|
Analyze text using textstat and spacy. |
|
|
Construct an html element from a prompt and a generation. |
Get the text complexity metrics from textstat. |
|
Import the mlflow python package and raise an error if it is not installed. |
|
Get the metrics to log to MLFlow. |
|
Get the cost in USD for a given model and number of tokens. |
|
Standardize the model name to a format that can be used in the OpenAI API. |
|
|
Save dict to local file path. |
Import comet_llm api and raise an error if it is not installed. |
|
Builds a nested dictionary from a list of runs. :param runs: The list of runs to build the tree from. :return: The nested dictionary representing the langchain Run in a tree structure compatible with WBTraceTree. |
|
Utility to flatten a nest run object into a list of runs. |
|
Utility to modify the serialized field of a list of runs dictionaries. removes any keys that match the exact_keys and any keys that contain any of the partial_keys. recursively moves the dictionaries under the kwargs key to the top level. changes the "id" field to a string "_kind" field that tells WBTraceTree how to visualize the run. promotes the "serialized" field to the top level. :param runs: The list of runs to modify. :param exact_keys: A tuple of keys to remove from the serialized field. :param partial_keys: A tuple of partial keys to remove from the serialized field. :return: The modified list of runs. |
|
Utility to truncate a list of runs dictionaries to only keep the specified |
|
Import the uptrain package. |
|
|
Flatten a nested dictionary into a flat dictionary. |
Hash a string using sha1. |
|
Import the pandas python package and raise an error if it is not installed. |
|
Import the spacy python package and raise an error if it is not installed. |
|
Import the textstat python package and raise an error if it is not installed. |
|
|
Load json file to a string. |
Analyze text using textstat and spacy. |
|
|
Construct an html element from a prompt and a generation. |
Import the wandb python package and raise an error if it is not installed. |
|
Load json file to a dictionary. |
|
Import the langkit python package and raise an error if it is not installed. |