Run managers.
Get the value of the debug global setting.
Convert a sequence of messages to strings and concatenate them into one string.
Check if an environment variable is set.
Generate a UUID from a Unix timestamp in nanoseconds and random bits.
UUIDv7 objects feature monotonicity within a millisecond.
Get a callback manager for a chain group in a context manager.
Useful for grouping different calls together as a single run even if they aren't composed in a single chain.
Get an async callback manager for a chain group in a context manager.
Useful for grouping different async calls together as a single run even if they aren't composed in a single chain.
Makes so an awaitable method is always shielded from cancellation.
Generic event handler for CallbackManager.
Async generic event handler for AsyncCallbackManager.
Dispatch an adhoc event to the handlers.
Dispatch an adhoc event.
Base callback handler.
Base callback manager.
Mixin for chain callbacks.
Mixin for LLM callbacks.
Mixin for Retriever callbacks.
Mixin for run manager.
Mixin for tool callbacks.
Callback handler that prints to std out.
Base abstract message class.
Messages are the inputs and outputs of a chat model.
Examples include HumanMessage,
AIMessage, and
SystemMessage.
Implementation of the SharedTracer that POSTS to the LangChain endpoint.
Tracer that prints to the console.
Represents a request to execute an action by an agent.
The action consists of the name of the tool to execute and the input to pass to the tool. The log is used to pass along extra information about the action.
Final return value of an ActionAgent.
Agents return an AgentFinish when they have reached a stopping condition.
Class for storing a piece of text and associated metadata.
Document is for retrieval workflows, not chat I/O. For sending text
to an LLM in a conversation, use message types from langchain.messages.
ChatGeneration chunk.
ChatGeneration chunks can be concatenated with other ChatGeneration chunks.
GenerationChunk, which can be concatenated with other Generation chunks.
A container for results of an LLM call.
Both chat models and LLMs generate an LLMResult object. This object contains the
generated outputs and any additional information that the model provider wants to
return.
Configuration for a Runnable.
Custom values
The TypedDict has total=False set intentionally to:
merge_configsvar_child_runnable_config (a ContextVar that automatically passes
config down the call stack without explicit parameter passing), where
configs are merged rather than replaced# Parent sets tags
chain.invoke(input, config={"tags": ["parent"]})
# Child automatically inherits and can add:
# ensure_config({"tags": ["child"]}) -> {"tags": ["parent", "child"]}Base class for run manager (a bound callback manager).
Synchronous run manager.
Synchronous parent run manager.
Async run manager.
Async parent run manager.
Callback manager for LLM run.
Async callback manager for LLM run.
Callback manager for chain run.
Async callback manager for chain run.
Callback manager for tool run.
Async callback manager for tool run.
Callback manager for retriever run.
Async callback manager for retriever run.
Callback manager for LangChain.
Callback manager for the chain group.
Async callback manager that handles callbacks from LangChain.
Async callback manager for the chain group.