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
Parameters
galileoLogger?
GalileoLogger
startNewTrace?
boolean
= true
flushOnChainEnd?
boolean
= true
Returns
GalileoCallback
Overrides
Properties
_flushOnChainEnd
_galileoLogger
_nodes
_startNewTrace
awaitHandlers
Inherited from
ignoreAgent
Inherited from
ignoreChain
Inherited from
ignoreCustomEvent
Inherited from
ignoreLLM
Inherited from
ignoreRetriever
Inherited from
lc_kwargs
Inherited from
lc_serializable
Inherited from
name
Overrides
raiseError
Inherited from
Accessors
lc_aliases
Get Signature
Returns
|undefined
| {
[key
: string
]: string
;
}
Inherited from
lc_attributes
Get Signature
Returns
|undefined
| {
[key
: string
]: string
;
}
Inherited from
lc_id
Get Signature
Returns
string
[]
Inherited from
lc_namespace
Get Signature
Returns
["langchain_core"
, "callbacks"
, string
]
Inherited from
lc_secrets
Get Signature
Returns
|undefined
| {
[key
: string
]: string
;
}
Inherited from
Methods
copy()
Returns
BaseCallbackHandler
Inherited from
handleAgentAction()?
Parameters
action
AgentAction
runId
string
parentRunId?
string
tags?
string
[]
Returns
void
| Promise
<void
>
Implementation of
Inherited from
handleAgentEnd()
Parameters
finish
AgentFinish
runId
string
Returns
Promise
<void
>
Implementation of
Overrides
handleChainEnd()
Parameters
outputs
ChainValues
runId
string
parentRunId?
string
tags?
string
[]
kwargs?
inputs?
Record
<string
, unknown
>
Returns
Promise
<void
>
Implementation of
Overrides
handleChainError()
Parameters
err
AxiosError
runId
string
Returns
Promise
<void
>
Implementation of
Overrides
handleChainStart()
Parameters
chain
undefined
| Serialized
inputs
ChainValues
runId
string
parentRunId?
string
tags?
string
[]
metadata?
Record
<string
, any
>
Returns
Promise
<void
>
Implementation of
Overrides
handleChatModelStart()
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()?
Parameters
eventName
string
data
any
runId
string
tags?
string
[]
metadata?
Record
<string
, any
>
Returns
any
Implementation of
Inherited from
handleLLMEnd()
Parameters
output
LLMResult
runId
string
Returns
Promise
<void
>
Implementation of
Overrides
handleLLMError()
Parameters
err
AxiosError
runId
string
Returns
Promise
<void
>
Implementation of
Overrides
handleLLMNewToken()
streaming
mode produces a new token
Parameters
token
string
idx
NewTokenIndices
runId
string
Returns
Promise
<void
>
Implementation of
Overrides
handleLLMStart()
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()
Parameters
documents
DocumentInterface
<Record
<string
, unknown
>>[]
runId
string
Returns
Promise
<void
>
Implementation of
Overrides
handleRetrieverError()
Parameters
err
AxiosError
runId
string
Returns
Promise
<void
>
Implementation of
Overrides
handleRetrieverStart()
Parameters
retriever
undefined
| Serialized
query
string
runId
string
parentRunId?
string
tags?
string
[]
metadata?
Record
<string
, any
>
Returns
Promise
<void
>
Implementation of
Overrides
handleText()?
Parameters
text
string
runId
string
parentRunId?
string
tags?
string
[]
Returns
void
| Promise
<void
>
Implementation of
Inherited from
handleToolEnd()
Parameters
output
any
runId
string
Returns
Promise
<void
>
Implementation of
Overrides
handleToolError()
Parameters
err
AxiosError
runId
string
Returns
Promise
<void
>
Implementation of
Overrides
handleToolStart()
Parameters
tool
undefined
| Serialized
input
string
runId
string
parentRunId?
string
tags?
string
[]
metadata?
Record
<string
, any
>
Returns
Promise
<void
>
Implementation of
Overrides
toJSON()
Returns
Serialized
Inherited from
toJSONNotImplemented()
Returns
SerializedNotImplemented
Inherited from
fromMethods()
Parameters
methods
BaseCallbackHandlerMethodsClass
Returns
awaitHandlers
ignoreAgent
ignoreChain
ignoreCustomEvent
ignoreLLM
ignoreRetriever
lc_aliases
lc_attributes
lc_id
lc_kwargs
lc_namespace
lc_secrets
lc_serializable
name
raiseError
copy()
Returns
BaseCallbackHandler
handleAgentAction()?
Parameters
action
AgentAction
runId
string
parentRunId?
string
tags?
string
[]
Returns
void
| Promise
<void
>
handleAgentEnd()?
Parameters
action
AgentFinish
runId
string
parentRunId?
string
tags?
string
[]
Returns
void
| Promise
<void
>
handleChainEnd()?
Parameters
outputs
ChainValues
runId
string
parentRunId?
string
tags?
string
[]
kwargs?
inputs?
Record
<string
, unknown
>
Returns
any
handleChainError()?
Parameters
err
any
runId
string
parentRunId?
string
tags?
string
[]
kwargs?
inputs?
Record
<string
, unknown
>
Returns
any
handleChainStart()?
Parameters
chain
Serialized
inputs
ChainValues
runId
string
parentRunId?
string
tags?
string
[]
metadata?
Record
<string
, unknown
>
runType?
string
runName?
string
Returns
any
handleChatModelStart()?
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()?
Parameters
output
LLMResult
runId
string
parentRunId?
string
tags?
string
[]
Returns
any
handleLLMError()?
Parameters
err
any
runId
string
parentRunId?
string
tags?
string
[]
Returns
any
handleLLMNewToken()?
streaming
mode produces a new token
Parameters
token
string
idx
NewTokenIndices
runId
string
parentRunId?
string
tags?
string
[]
fields?
HandleLLMNewTokenCallbackFields
Returns
any
handleLLMStart()?
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()?
Parameters
output
any
runId
string
parentRunId?
string
tags?
string
[]
Returns
any
handleToolError()?
Parameters
err
any
runId
string
parentRunId?
string
tags?
string
[]
Returns
any
handleToolStart()?
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()
Returns
string