LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangChain
  • Browser
  • Universal
  • Hub
  • Node
  • Load
  • Serializable
  • Encoder Backed
  • File System
  • In Memory
  • Tools
LangChain Core
  • Agents
  • Caches
  • Base
  • Dispatch
  • Web
  • Manager
  • Promises
  • Chat History
  • Context
  • Base
  • Langsmith
  • Documents
  • Embeddings
  • Errors
  • Example Selectors
  • Indexing
  • Base
  • Chat Models
  • Compat
  • Event
  • Llms
  • Openai Completions Stream
  • Profile
  • Stream
  • Structured Output
  • Load
  • Serializable
  • Memory
  • Messages
  • Tool
  • Output Parsers
  • Openai Functions
  • Openai Tools
  • Outputs
  • Prompt Values
  • Prompts
  • Retrievers
  • Document Compressors
  • Runnables
  • Graph
  • Singletons
  • Stores
  • Structured Query
  • Testing
  • Tools
  • Base
  • Console
  • Log Stream
  • Run Collector
  • Tracer Langchain
  • Stream
  • Async Caller
  • Chunk Array
  • Context
  • Env
  • Event Source Parse
  • Format
  • Function Calling
  • Hash
  • Json Patch
  • Json Schema
  • Math
  • Ssrf
  • Standard Schema
  • Stream
  • Testing
  • Tiktoken
  • Types
  • Uuid
  • Vectorstores
Text Splitters
MCP Adapters
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangChain
BrowserUniversalHubNodeLoadSerializableEncoder BackedFile SystemIn MemoryTools
LangChain Core
AgentsCachesBaseDispatchWebManagerPromisesChat HistoryContextBaseLangsmithDocumentsEmbeddingsErrorsExample SelectorsIndexingBaseChat ModelsCompatEventLlmsOpenai Completions StreamProfileStreamStructured OutputLoadSerializableMemoryMessagesToolOutput ParsersOpenai FunctionsOpenai ToolsOutputsPrompt ValuesPromptsRetrieversDocument CompressorsRunnablesGraphSingletonsStoresStructured QueryTestingToolsBaseConsoleLog StreamRun CollectorTracer LangchainStreamAsync CallerChunk ArrayContextEnvEvent Source ParseFormatFunction CallingHashJson PatchJson SchemaMathSsrfStandard SchemaStreamTestingTiktokenTypesUuidVectorstores
Text Splitters
MCP Adapters
Language
Theme
JavaScript@langchain/coretracersrun_collectorRunCollectorCallbackHandler
Class●Since v1.0

RunCollectorCallbackHandler

A callback handler that collects traced runs and makes it easy to fetch the traced run object from calls through any langchain object. For instance, it makes it easy to fetch the run ID and then do things with that, such as log feedback.

Copy
class RunCollectorCallbackHandler

Bases

BaseTracer

Used in Docs

  • Trace LangChain applications (Python and JS/TS)

Constructors

constructor
constructor

Properties

property
awaitHandlers: boolean
property
exampleId: string
property
ignoreAgent: boolean
property
ignoreChain: boolean
property
ignoreCustomEvent: boolean
property
ignoreLLM: boolean
property
ignoreRetriever: boolean
property
lc_kwargs: SerializedFields
property
lc_serializable: boolean
property
name: string
property
raiseError: boolean
property
runMap: Map<string, Run>
property
runTreeMap: Map<string, RunTree>
property
tracedRuns: Run[]
property
usesRunTreeMap: boolean
property
lc_aliases
property
lc_attributes
property
lc_id
property
lc_namespace
property
lc_secrets
property
lc_serializable_keys

Methods

method
_addChildRun
method
_addRunToRunMap
method
_createRunForChainStart
method
_createRunForChatModelStart
method
_createRunForLLMStart
method
_createRunForRetrieverStart
method
_createRunForToolStart
method
_endTrace
method
_getExecutionOrder
method
copy
method
getRunById
method
handleAgentAction
method
handleAgentEnd
method
handleChainEnd
method
handleChainError
method
handleChainStart
method
handleChatModelStart
method
handleChatModelStreamEvent
method
handleCustomEvent
method
handleLLMEnd
method
handleLLMError
method
handleLLMNewToken
method
handleLLMStart
method
handleRetrieverEnd
method
handleRetrieverError
method
handleRetrieverStart
method
handleText
method
handleToolEnd
method
handleToolError
method
handleToolEvent
method
handleToolStart
method
onAgentAction
method
onAgentEnd
method
onChainEnd
method
onChainError
method
onChainStart
method
onLLMEnd
method
onLLMError
method
onLLMNewToken
method
onLLMStart
method
onRetrieverEnd
method
onRetrieverError
method
onRetrieverStart
method
onRunCreate
method
onRunUpdate
method
onText
method
onToolEnd
method
onToolError
method
onToolStart
method
persistRun
method
stringifyError
method
toJSON
method
toJSONNotImplemented
method
fromMethods
method
lc_name

Inherited fromBaseTracer

Properties

PawaitHandlersPignoreAgentPignoreChainPignoreCustomEventPignoreLLMPignoreRetrieverPlc_kwargsPlc_serializablePnamePraiseErrorPrunMapPrunTreeMapPusesRunTreeMapPlc_aliasesPlc_attributesPlc_idPlc_namespacePlc_secretsPlc_serializable_keys

Methods

M_addChildRunM_addRunToRunMapM_createRunForChainStartM_createRunForChatModelStartM_createRunForLLMStartM_createRunForRetrieverStartM_createRunForToolStartM_endTraceM_getExecutionOrderMcopyMgetRunByIdMhandleAgentActionMhandleAgentEndMhandleChainEndMhandleChainErrorMhandleChainStartMhandleChatModelStartMhandleChatModelStreamEventMhandleCustomEventMhandleLLMEndMhandleLLMErrorMhandleLLMNewTokenMhandleLLMStartMhandleRetrieverEndMhandleRetrieverErrorMhandleRetrieverStartMhandleTextMhandleToolEndMhandleToolErrorMhandleToolEventMhandleToolStartMonAgentActionMonAgentEndMonChainEndMonChainErrorMonChainStartMonLLMEndMonLLMErrorMonLLMNewTokenMonLLMStartMonRetrieverEndMonRetrieverErrorMonRetrieverStartMonRunCreateMonRunUpdateMonTextMonToolEndMonToolErrorMonToolStartMpersistRunMstringifyErrorMtoJSONMtoJSONNotImplementedMfromMethodsMlc_name

Inherited fromBaseCallbackHandler

Properties

PawaitHandlersPignoreAgentPignoreChainPignoreCustomEventPignoreLLMPignoreRetrieverPlc_kwargsPlc_serializablePnamePraiseErrorPlc_aliasesPlc_attributesPlc_idPlc_namespacePlc_secretsPlc_serializable_keys

Methods

McopyMhandleAgentActionMhandleAgentEndMhandleChainEndMhandleChainErrorMhandleChainStart
View source on GitHub
MhandleChatModelStart
MhandleChatModelStreamEvent
MhandleCustomEvent
MhandleLLMEnd
MhandleLLMError
MhandleLLMNewToken
MhandleLLMStart
MhandleRetrieverEnd
MhandleRetrieverError
MhandleRetrieverStart
MhandleText
MhandleToolEnd
MhandleToolError
MhandleToolEvent
MhandleToolStart
MtoJSON
MtoJSONNotImplemented
MfromMethods
Mlc_name