EventHandlerConfig
Configuration class for the EventHandler feature.
This class provides a way to configure handlers for various events that occur during the execution of an agent. These events include agent lifecycle events, strategy events, node events, LLM call events, and tool call events.
Each handler is a property that can be assigned a lambda function to be executed when the corresponding event occurs.
Example usage:
handleEvents {
onToolCallStarting { eventContext ->
println("Tool called: ${eventContext.tool.name} with args ${eventContext.toolArgs}")
}
onAgentCompleted { eventContext ->
println("Agent finished with result: ${eventContext.result}")
}
}
Functions
Append handler called after a response is received from the language model.
Append handler called after a node in the agent's execution graph has been processed.
Appends a handler called before an agent is closed. This allows for additional behavior to be executed prior to the agent being closed.
Appends a handler called before an agent is closed. This allows for additional behavior to be executed prior to the agent being closed.
Append handler called when an agent finishes execution.
Append handler called when an error occurs during agent execution.
Append handler called when an agent finishes execution.
Append handler called when an error occurs during agent execution.
Append handler called when an agent is started.
Append handler called when an agent is started.
Append handler called before a call is made to the language model.
Append handler called before a node in the agent's execution graph is processed.
Append handler called after a response is received from the language model.
Append handler called before a call is made to the language model.
Registers a handler to be invoked after streaming from a language model completes.
Registers a handler to be invoked when an error occurs during streaming.
Registers a handler to be invoked when stream frames are received during streaming.
Registers a handler to be invoked before streaming from a language model begins.
Append handler called after a node in the agent's execution graph has been processed.
Append handler called when an error occurs during the execution of a node.
Append handler called when an error occurs during the execution of a node.
Append handler called before a node in the agent's execution graph is processed.
Append handler called when a strategy finishes execution.
Append handler called when a strategy finishes execution.
Append handler called when a strategy starts execution.
Append handler called when a strategy starts execution.
Append handler called when a tool is about to be called.
Append handler called when a tool call completes successfully.
Append handler called when a tool call fails with an exception.
Append handler called when a tool call fails with an exception.
Append handler called when a tool call completes successfully.
Append handler called when a tool is about to be called.
Append handler called when a validation error occurs during a tool call.
Append handler called when a validation error occurs during a tool call.