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 {
onToolCall = { stage, tool, toolArgs ->
println("Tool called: ${tool.name} with args $toolArgs")
}
onAgentFinished = { strategyName, result ->
println("Agent finished with result: $result")
}
}
Properties
Handler called after a response is received from the language model.
Handler called after a response with tool calls is received from the language model.
Handler called after a node in the agent's execution graph has been processed.
Handler called when an agent finishes execution.
Handler called when an error occurs during agent execution.
Handler called when an agent is created.
Handler called before a call is made to the language model.
Handler called before a call is made to the language model with tools.
Handler called before a node in the agent's execution graph is processed.
Handler called when a strategy finishes execution.
Handler called when a strategy starts execution.
Handler called when a tool is about to be called.
Handler called when a tool call fails with an exception.
Handler called when a tool call completes successfully.
Handler called when a validation error occurs during a tool call.