GalileoCallback
Class: GalileoCallback
Defined in: src/handlers/langchain.ts:62
Langchain callback handler for logging traces to the Galileo platform.
Extends
BaseCallbackHandler
Implements
CallbackHandlerMethods
Constructors
Constructor
Defined in: src/handlers/langchain.ts:73
Parameters
galileoLogger?
startNewTrace?
boolean
= true
flushOnChainEnd?
boolean
= true
Returns
GalileoCallback
Overrides
Properties
_flushOnChainEnd
Defined in: src/handlers/langchain.ts:68
_galileoLogger
Defined in: src/handlers/langchain.ts:66
_nodes
Defined in: src/handlers/langchain.ts:69
_startNewTrace
Defined in: src/handlers/langchain.ts:67
awaitHandlers
Defined in: node_modules/@langchain/core/dist/callbacks/base.d.ts:177
Inherited from
ignoreAgent
Defined in: node_modules/@langchain/core/dist/callbacks/base.d.ts:173
Inherited from
ignoreChain
Defined in: node_modules/@langchain/core/dist/callbacks/base.d.ts:172
Inherited from
ignoreCustomEvent
Defined in: node_modules/@langchain/core/dist/callbacks/base.d.ts:175
Inherited from
ignoreLLM
Defined in: node_modules/@langchain/core/dist/callbacks/base.d.ts:171
Inherited from
ignoreRetriever
Defined in: node_modules/@langchain/core/dist/callbacks/base.d.ts:174
Inherited from
lc_kwargs
Defined in: node_modules/@langchain/core/dist/callbacks/base.d.ts:169
Inherited from
lc_serializable
Defined in: node_modules/@langchain/core/dist/callbacks/base.d.ts:147
Inherited from
name
Defined in: src/handlers/langchain.ts:71
Overrides
raiseError
Defined in: node_modules/@langchain/core/dist/callbacks/base.d.ts:176
Inherited from
Accessors
lc_aliases
Get Signature
Defined in: node_modules/@langchain/core/dist/callbacks/base.d.ts:155
A 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.
Returns
| undefined
| {
[key
: string
]: string
;
}
Inherited from
lc_attributes
Get Signature
Defined in: node_modules/@langchain/core/dist/callbacks/base.d.ts:152
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.
Returns
| undefined
| {
[key
: string
]: string
;
}
Inherited from
lc_id
Get Signature
Defined in: node_modules/@langchain/core/dist/callbacks/base.d.ts:168
The final serialized identifier for the module.
Returns
string
[]
Inherited from
lc_namespace
Get Signature
Defined in: node_modules/@langchain/core/dist/callbacks/base.d.ts:148
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.
Returns
["langchain_core"
, "callbacks"
, string
]
Inherited from
lc_secrets
Get Signature
Defined in: node_modules/@langchain/core/dist/callbacks/base.d.ts:149
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.
Returns
| undefined
| {
[key
: string
]: string
;
}
Inherited from
Methods
copy()
Defined in: node_modules/@langchain/core/dist/callbacks/base.d.ts:179
Returns
BaseCallbackHandler
Inherited from
handleAgentAction()?
Defined in: node_modules/@langchain/core/dist/callbacks/base.d.ts:115
Called when an agent is about to execute an action, with the action and the run ID.
Parameters
action
AgentAction
runId
string
parentRunId?
string
tags?
string
[]
Returns
void
| Promise
<void
>
Implementation of
Inherited from
handleAgentEnd()
Defined in: src/handlers/langchain.ts:371
Called when an agent finishes execution, before it exits. with the final output and the run ID.
Parameters
finish
AgentFinish
runId
string
Returns
Promise
<void
>
Implementation of
Overrides
handleChainEnd()
Defined in: src/handlers/langchain.ts:352
Called at the end of a Chain run, with the outputs and the run ID.
Parameters
outputs
ChainValues
runId
string
parentRunId?
string
tags?
string
[]
kwargs?
inputs?
Record
<string
, unknown
>
Returns
Promise
<void
>
Implementation of
Overrides
handleChainError()
Defined in: src/handlers/langchain.ts:345
Called if a Chain run encounters an error
Parameters
err
AxiosError
runId
string
Returns
Promise
<void
>
Implementation of
Overrides
handleChainStart()
Defined in: src/handlers/langchain.ts:292
Called at the start of a Chain run, with the chain name and inputs and the run ID.
Parameters
chain
undefined
| Serialized
inputs
ChainValues
runId
string
parentRunId?
string
tags?
string
[]
metadata?
Record
<string
, any
>
Returns
Promise
<void
>
Implementation of
Overrides
handleChatModelStart()
Defined in: src/handlers/langchain.ts:436
Called at the start of a Chat Model run, with the prompt(s) and the run ID.
Parameters
llm
undefined
| Serialized
messages
BaseMessage
[][]
runId
string
parentRunId?
string
extraParams?
Record
<string
, unknown
>
tags?
string
[]
metadata?
Record
<string
, any
>
Returns
Promise
<void
>
Implementation of
Overrides
handleCustomEvent()?
Defined in: node_modules/@langchain/core/dist/callbacks/base.d.ts:127
Parameters
eventName
string
data
any
runId
string
tags?
string
[]
metadata?
Record
<string
, any
>
Returns
any
Implementation of
Inherited from
handleLLMEnd()
Defined in: src/handlers/langchain.ts:485
Called at the end of an LLM/ChatModel run, with the output and the run ID.
Parameters
output
LLMResult
runId
string
Returns
Promise
<void
>
Implementation of
Overrides
handleLLMError()
Defined in: src/handlers/langchain.ts:410
Called if an LLM/ChatModel run encounters an error
Parameters
err
AxiosError
runId
string
Returns
Promise
<void
>
Implementation of
Overrides
handleLLMNewToken()
Defined in: src/handlers/langchain.ts:417
Called when an LLM/ChatModel in streaming
mode produces a new token
Parameters
token
string
idx
NewTokenIndices
runId
string
Returns
Promise
<void
>
Implementation of
Overrides
handleLLMStart()
Defined in: src/handlers/langchain.ts:378
Called at the start of an LLM or Chat Model run, with the prompt(s) and the run ID.
Parameters
llm
undefined
| Serialized
prompts
string
[]
runId
string
parentRunId?
string
extraParams?
Record
<string
, unknown
>
tags?
string
[]
metadata?
Record
<string
, any
>
Returns
Promise
<void
>
Implementation of
Overrides
handleRetrieverEnd()
Defined in: src/handlers/langchain.ts:573
Parameters
documents
DocumentInterface
<Record
<string
, unknown
>>[]
runId
string
Returns
Promise
<void
>
Implementation of
Overrides
handleRetrieverError()
Defined in: src/handlers/langchain.ts:563
Parameters
err
AxiosError
runId
string
Returns
Promise
<void
>
Implementation of
Overrides
handleRetrieverStart()
Defined in: src/handlers/langchain.ts:547
Parameters
retriever
undefined
| Serialized
query
string
runId
string
parentRunId?
string
tags?
string
[]
metadata?
Record
<string
, any
>
Returns
Promise
<void
>
Implementation of
Overrides
handleText()?
Defined in: node_modules/@langchain/core/dist/callbacks/base.d.ts:110
Parameters
text
string
runId
string
parentRunId?
string
tags?
string
[]
Returns
void
| Promise
<void
>
Implementation of
Inherited from
handleToolEnd()
Defined in: src/handlers/langchain.ts:536
Called at the end of a Tool run, with the tool output and the run ID.
Parameters
output
any
runId
string
Returns
Promise
<void
>
Implementation of
Overrides
handleToolError()
Defined in: src/handlers/langchain.ts:529
Called if a Tool run encounters an error
Parameters
err
AxiosError
runId
string
Returns
Promise
<void
>
Implementation of
Overrides
handleToolStart()
Defined in: src/handlers/langchain.ts:508
Called at the start of a Tool run, with the tool name and input and the run ID.
Parameters
tool
undefined
| Serialized
input
string
runId
string
parentRunId?
string
tags?
string
[]
metadata?
Record
<string
, any
>
Returns
Promise
<void
>
Implementation of
Overrides
toJSON()
Defined in: node_modules/@langchain/core/dist/callbacks/base.d.ts:180
Returns
Serialized
Inherited from
toJSONNotImplemented()
Defined in: node_modules/@langchain/core/dist/callbacks/base.d.ts:181
Returns
SerializedNotImplemented
Inherited from
fromMethods()
Defined in: node_modules/@langchain/core/dist/callbacks/base.d.ts:182
Parameters
methods
BaseCallbackHandlerMethodsClass
Returns
awaitHandlers
ignoreAgent
ignoreChain
ignoreCustomEvent
ignoreLLM
ignoreRetriever
lc_aliases
lc_attributes
lc_id
The final serialized identifier for the module.
lc_kwargs
lc_namespace
lc_secrets
lc_serializable
name
raiseError
copy()
Returns
BaseCallbackHandler
handleAgentAction()?
Called when an agent is about to execute an action, with the action and the run ID.
Parameters
action
AgentAction
runId
string
parentRunId?
string
tags?
string
[]
Returns
void
| Promise
<void
>
handleAgentEnd()?
Called when an agent finishes execution, before it exits. with the final output and the run ID.
Parameters
action
AgentFinish
runId
string
parentRunId?
string
tags?
string
[]
Returns
void
| Promise
<void
>
handleChainEnd()?
Called at the end of a Chain run, with the outputs and the run ID.
Parameters
outputs
ChainValues
runId
string
parentRunId?
string
tags?
string
[]
kwargs?
inputs?
Record
<string
, unknown
>
Returns
any
handleChainError()?
Called if a Chain run encounters an error
Parameters
err
any
runId
string
parentRunId?
string
tags?
string
[]
kwargs?
inputs?
Record
<string
, unknown
>
Returns
any
handleChainStart()?
Called at the start of a Chain run, with the chain name and inputs and the run ID.
Parameters
chain
Serialized
inputs
ChainValues
runId
string
parentRunId?
string
tags?
string
[]
metadata?
Record
<string
, unknown
>
runType?
string
runName?
string
Returns
any
handleChatModelStart()?
Called at the start of a Chat Model run, with the prompt(s) and the run ID.
Parameters
llm
Serialized
messages
BaseMessage
[][]
runId
string
parentRunId?
string
extraParams?
Record
<string
, unknown
>
tags?
string
[]
metadata?
Record
<string
, unknown
>
runName?
string
Returns
any
handleCustomEvent()?
Parameters
eventName
string
data
any
runId
string
tags?
string
[]
metadata?
Record
<string
, any
>
Returns
any
handleLLMEnd()?
Called at the end of an LLM/ChatModel run, with the output and the run ID.
Parameters
output
LLMResult
runId
string
parentRunId?
string
tags?
string
[]
Returns
any
handleLLMError()?
Called if an LLM/ChatModel run encounters an error
Parameters
err
any
runId
string
parentRunId?
string
tags?
string
[]
Returns
any
handleLLMNewToken()?
Called when an LLM/ChatModel in streaming
mode produces a new token
Parameters
token
string
idx
NewTokenIndices
runId
string
parentRunId?
string
tags?
string
[]
fields?
HandleLLMNewTokenCallbackFields
Returns
any
handleLLMStart()?
Called at the start of an LLM or Chat Model run, with the prompt(s) and the run ID.
Parameters
llm
Serialized
prompts
string
[]
runId
string
parentRunId?
string
extraParams?
Record
<string
, unknown
>
tags?
string
[]
metadata?
Record
<string
, unknown
>
runName?
string
Returns
any
handleRetrieverEnd()?
Parameters
documents
DocumentInterface
<Record
<string
, any
>>[]
runId
string
parentRunId?
string
tags?
string
[]
Returns
any
handleRetrieverError()?
Parameters
err
any
runId
string
parentRunId?
string
tags?
string
[]
Returns
any
handleRetrieverStart()?
Parameters
retriever
Serialized
query
string
runId
string
parentRunId?
string
tags?
string
[]
metadata?
Record
<string
, unknown
>
name?
string
Returns
any
handleText()?
Parameters
text
string
runId
string
parentRunId?
string
tags?
string
[]
Returns
void
| Promise
<void
>
handleToolEnd()?
Called at the end of a Tool run, with the tool output and the run ID.
Parameters
output
any
runId
string
parentRunId?
string
tags?
string
[]
Returns
any
handleToolError()?
Called if a Tool run encounters an error
Parameters
err
any
runId
string
parentRunId?
string
tags?
string
[]
Returns
any
handleToolStart()?
Called at the start of a Tool run, with the tool name and input and the run ID.
Parameters
tool
Serialized
input
string
runId
string
parentRunId?
string
tags?
string
[]
metadata?
Record
<string
, unknown
>
runName?
string
Returns
any
toJSON()
Returns
Serialized
toJSONNotImplemented()
Returns
SerializedNotImplemented
Inherited from
lc_name()
Defined in: node_modules/@langchain/core/dist/callbacks/base.d.ts:164
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.
Returns
string