Optional
exampleOptional
projectOptional
replicasProtected
runProtected
runA map of aliases for constructor args. Keys are the attribute names, e.g. "foo". Values are the alias that will replace the key in serialization. This is used to eg. make argument names match Python.
A map of additional attributes to merge with constructor args. Keys are the attribute names, e.g. "foo". Values are the attribute values, which will be serialized. These attributes need to be accepted by the constructor as arguments.
The final serialized identifier for the module.
A path to the module that contains the class, eg. ["langchain", "llms"] Usually should be the same as the entrypoint the class is exported from.
A map of secrets, which will be omitted from serialization. Keys are paths to the secret in constructor args, e.g. "foo.bar.baz". Values are the secret ids, which will be used when deserializing.
A manual list of keys that should be serialized. If not overridden, all fields passed into the constructor will be serialized.
Protected
_Optional
dotted_order?: stringThe dotted order for the run.
This is a string composed of {time}{run-uuid}.* so that a trace can be sorted in the order it was executed.
Example:
Optional
end_time?: numberThe epoch time at which the run ended, if applicable.
Events like 'start', 'end' linked to the run.
Optionally, a unique identifier for the run.
The epoch time at which the run started, if available.
Optional
trace_id?: stringUnique ID assigned to every run within this nested trace. *
Create and add a run to the run map for chain start events. This must sometimes be done synchronously to avoid race conditions when callbacks are backgrounded, so we expose it as a separate method here.
Optional
parentRunId: stringOptional
tags: string[]Optional
metadata: KVMapOptional
runType: stringOptional
name: stringOptional
dotted_order?: stringThe dotted order for the run.
This is a string composed of {time}{run-uuid}.* so that a trace can be sorted in the order it was executed.
Example:
Optional
end_time?: numberThe epoch time at which the run ended, if applicable.
Events like 'start', 'end' linked to the run.
Optionally, a unique identifier for the run.
The epoch time at which the run started, if available.
Optional
trace_id?: stringUnique ID assigned to every run within this nested trace. *
Create and add a run to the run map for chat model start events. This must sometimes be done synchronously to avoid race conditions when callbacks are backgrounded, so we expose it as a separate method here.
Optional
parentRunId: stringOptional
extraParams: KVMapOptional
tags: string[]Optional
metadata: KVMapOptional
name: stringOptional
dotted_order?: stringThe dotted order for the run.
This is a string composed of {time}{run-uuid}.* so that a trace can be sorted in the order it was executed.
Example:
Optional
end_time?: numberThe epoch time at which the run ended, if applicable.
Events like 'start', 'end' linked to the run.
Optionally, a unique identifier for the run.
The epoch time at which the run started, if available.
Optional
trace_id?: stringUnique ID assigned to every run within this nested trace. *
Create and add a run to the run map for LLM start events. This must sometimes be done synchronously to avoid race conditions when callbacks are backgrounded, so we expose it as a separate method here.
Optional
parentRunId: stringOptional
extraParams: KVMapOptional
tags: string[]Optional
metadata: KVMapOptional
name: stringOptional
dotted_order?: stringThe dotted order for the run.
This is a string composed of {time}{run-uuid}.* so that a trace can be sorted in the order it was executed.
Example:
Optional
end_time?: numberThe epoch time at which the run ended, if applicable.
Events like 'start', 'end' linked to the run.
Optionally, a unique identifier for the run.
The epoch time at which the run started, if available.
Optional
trace_id?: stringUnique ID assigned to every run within this nested trace. *
Create and add a run to the run map for retriever start events. This must sometimes be done synchronously to avoid race conditions when callbacks are backgrounded, so we expose it as a separate method here.
Optional
parentRunId: stringOptional
tags: string[]Optional
metadata: KVMapOptional
name: stringOptional
dotted_order?: stringThe dotted order for the run.
This is a string composed of {time}{run-uuid}.* so that a trace can be sorted in the order it was executed.
Example:
Optional
end_time?: numberThe epoch time at which the run ended, if applicable.
Events like 'start', 'end' linked to the run.
Optionally, a unique identifier for the run.
The epoch time at which the run started, if available.
Optional
trace_id?: stringUnique ID assigned to every run within this nested trace. *
Create and add a run to the run map for tool start events. This must sometimes be done synchronously to avoid race conditions when callbacks are backgrounded, so we expose it as a separate method here.
Optional
parentRunId: stringOptional
tags: string[]Optional
metadata: KVMapOptional
name: stringOptional
dotted_order?: stringThe dotted order for the run.
This is a string composed of {time}{run-uuid}.* so that a trace can be sorted in the order it was executed.
Example:
Optional
end_time?: numberThe epoch time at which the run ended, if applicable.
Events like 'start', 'end' linked to the run.
Optionally, a unique identifier for the run.
The epoch time at which the run started, if available.
Optional
trace_id?: stringUnique ID assigned to every run within this nested trace. *
Protected
_Protected
_Protected
getOptional
runId: stringCalled when an agent is about to execute an action, with the action and the run ID.
Called when an agent finishes execution, before it exits. with the final output and the run ID.
Called at the end of a Chain run, with the outputs and the run ID.
Optional
_parentRunId: stringOptional
_tags: string[]Optional
kwargs: { inputs?: Record<string, unknown> }Called if a Chain run encounters an error
Optional
_parentRunId: stringOptional
_tags: string[]Optional
kwargs: { inputs?: Record<string, unknown> }Called at the start of a Chain run, with the chain name and inputs and the run ID.
Optional
parentRunId: stringOptional
tags: string[]Optional
metadata: KVMapOptional
runType: stringOptional
name: stringCalled at the start of a Chat Model run, with the prompt(s) and the run ID.
Optional
parentRunId: stringOptional
extraParams: KVMapOptional
tags: string[]Optional
metadata: KVMapOptional
name: stringOptional
handleCalled if an LLM/ChatModel run encounters an error
Optional
_parentRunId: stringOptional
_tags: string[]Optional
extraParams: Record<string, unknown>Called when an LLM/ChatModel in streaming
mode produces a new token
idx.prompt is the index of the prompt that produced the token (if there are multiple prompts) idx.completion is the index of the completion that produced the token (if multiple completions per prompt are requested)
Optional
_parentRunId: stringOptional
_tags: string[]Optional
fields: HandleLLMNewTokenCallbackFieldsCalled at the start of an LLM or Chat Model run, with the prompt(s) and the run ID.
Optional
parentRunId: stringOptional
extraParams: KVMapOptional
tags: string[]Optional
metadata: KVMapOptional
name: stringOptional
parentRunId: stringOptional
tags: string[]Optional
metadata: KVMapOptional
name: stringCalled at the end of a Tool run, with the tool output and the run ID.
Called at the start of a Tool run, with the tool name and input and the run ID.
Optional
parentRunId: stringOptional
tags: string[]Optional
metadata: KVMapOptional
name: stringOptional
onOptional
onOptional
onOptional
onOptional
onOptional
onOptional
onOptional
onOptional
kwargs: { chunk: any }Optional
onOptional
onOptional
onOptional
onOptional
onOptional
onOptional
onOptional
onProtected
persistProtected
stringifyStatic
fromStatic
getStatic
lc_The name of the serializable. Override to provide an alias or to preserve the serialized module name in minified environments.
Implemented as a static method to support loading logic.
Interface for the input parameters of the BaseCallbackHandler class. It allows to specify which types of events should be ignored by the callback handler.