callbacks array of a
LangChain/LangGraph invocation, or automatically injected via
LangGraphInstrumentor.
Properties
name: string
Methods
constructor(client: FiddlerClient)
An initialized FiddlerClient used to create spans.
handleAgentAction(action: AgentAction, runId: string)
Called when an agent is about to execute an action,
with the action and the run ID.
The agent action containing tool name and input.
Run identifier to look up the span.
handleAgentEnd(action: AgentFinish, runId: string)
Called when an agent finishes execution, before it exits.
with the final output and the run ID.
The agent finish containing return values.
Run identifier to look up the span.
handleChainEnd(outputs: ChainValues, runId: string)
Called at the end of a Chain run, with the outputs and the run ID.
Output values produced by the chain.
Run identifier to look up the span.
handleChainError(error: Error, runId: string)
Called if a Chain run encounters an error
The error that occurred.
Run identifier to look up the span.
handleChainStart(serialized: Serialized, inputs: ChainValues, runId: string, parentRunId?: string, tags?: string[], metadata?: Record<string, unknown>)
Called at the start of a Chain run, with the chain name and inputs
and the run ID.
Serialized chain/runnable metadata.
Input values passed to the chain.
Unique run identifier.
Parent run ID for nesting.
LangChain tags (used for LangGraph node detection).
LangChain metadata (agent name, node name, etc.).
handleChatModelStart(serialized: Serialized, messages: BaseMessage[][], runId: string, parentRunId?: string, extraParams?: Record<string, unknown>, _tags?: string[], _metadata?: Record<string, unknown>, runName?: string)
Called at the start of a Chat Model run, with the prompt(s)
and the run ID.
Serialized chat model metadata.
2D array of chat messages (outer = batches).
Unique run identifier.
Parent run ID for nesting.
Additional invocation parameters.
Optional explicit run name.
handleLLMEnd(output: LLMResult, runId: string)
Called at the end of an LLM/ChatModel run, with the output and the run ID.
The LLMResult containing generations and usage.
Run identifier to look up the span.
handleLLMError(error: Error, runId: string)
Called if an LLM/ChatModel run encounters an error
The error that occurred.
Run identifier to look up the span.
handleLLMStart(serialized: Serialized, prompts: string[], runId: string, parentRunId?: string, _extraParams?: Record<string, unknown>, _tags?: string[], _metadata?: Record<string, unknown>, runName?: string)
Called at the start of an LLM or Chat Model run, with the prompt(s)
and the run ID.
Serialized LLM metadata.
Array of prompt strings.
Unique run identifier.
Parent run ID for nesting.
Optional explicit run name.
handleRetrieverEnd(documents: { metadata?: unknown; pageContent?: string }[], runId: string)
Called when a retriever returns documents.
Sets the concatenated page content as the tool output.
Array of retrieved documents with
pageContent.Run identifier to look up the span.
handleRetrieverError(error: Error, runId: string)
Called when a retriever throws an error.
The error that occurred.
Run identifier to look up the span.
handleRetrieverStart(serialized: Serialized, query: string, runId: string, parentRunId?: string)
Called when a retriever begins fetching documents.
Creates a tool-type span with the retriever name and query.
Serialized retriever metadata.
The search query string.
Unique run identifier.
Parent run ID for nesting.
handleToolEnd(output: string, runId: string)
Called at the end of a Tool run, with the tool output and the run ID.
Tool output (string or ToolMessage-like object).
Run identifier to look up the span.
handleToolError(error: Error, runId: string)
Called if a Tool run encounters an error
The error that occurred.
Run identifier to look up the span.
handleToolStart(serialized: Serialized, input: string, runId: string, parentRunId?: string, _tags?: string[], _metadata?: Record<string, unknown>, runName?: string)
Called at the start of a Tool run, with the tool name and input
and the run ID.
Serialized tool metadata.
The input string or structured input for the tool.
Unique run identifier.
Parent run ID for nesting.
Optional explicit run name.