EventHandlerConfigAPI

Functions

Link copied to clipboard
abstract suspend fun invokeOnAgentClosing(eventContext: AgentClosingContext)

Invokes the handler associated with the event that occurs before an agent is closed.

Link copied to clipboard
abstract suspend fun invokeOnAgentCompleted(eventContext: AgentCompletedContext)

Invoke handlers for after a node in the agent's execution graph has been processed event.

Link copied to clipboard
abstract suspend fun invokeOnAgentExecutionFailed(eventContext: AgentExecutionFailedContext)

Invoke handlers for an event when an error occurs during agent execution.

Link copied to clipboard
abstract suspend fun invokeOnAgentStarting(eventContext: AgentStartingContext)

Invoke handlers for an event when an agent is started.

Link copied to clipboard
abstract suspend fun invokeOnLLMCallCompleted(eventContext: LLMCallCompletedContext)

Invoke handlers for after a response is received from the language model event.

Link copied to clipboard
abstract suspend fun invokeOnLLMCallStarting(eventContext: LLMCallStartingContext)

Invoke handlers for before a call is made to the language model event.

Link copied to clipboard

Invokes the handler associated with the event that occurs after streaming completes.

Link copied to clipboard
abstract suspend fun invokeOnLLMStreamingFailed(eventContext: LLMStreamingFailedContext)

Invokes the handler associated with the event that occurs when an error occurs during streaming.

Link copied to clipboard

Invokes the handler associated with stream frame events during streaming.

Link copied to clipboard
abstract suspend fun invokeOnLLMStreamingStarting(eventContext: LLMStreamingStartingContext)

Invokes the handler associated with the event that occurs before streaming starts.

Link copied to clipboard

Invoke handlers for after a node in the agent's execution graph has been processed event.

Link copied to clipboard
abstract suspend fun invokeOnNodeExecutionFailed(interceptContext: NodeExecutionFailedContext)

Invokes the error handling logic for a node execution error event.

Link copied to clipboard

Invoke handlers for before a node in the agent's execution graph is processed event.

Link copied to clipboard
abstract suspend fun invokeOnStrategyCompleted(eventContext: StrategyCompletedContext)

Invoke handlers for an event when a strategy finishes execution.

Link copied to clipboard
abstract suspend fun invokeOnStrategyStarting(eventContext: StrategyStartingContext)

Invoke handlers for an event when strategy starts execution.

Link copied to clipboard

Invoke handlers for after a subgraph in the agent's execution graph has been processed event.

Link copied to clipboard
abstract suspend fun invokeOnSubgraphExecutionFailed(interceptContext: SubgraphExecutionFailedContext)

Invokes the error handling logic for a subgraph execution error event.

Link copied to clipboard

Invoked when the execution of a subgraph is starting. This method allows you to perform actions or initialize resources necessary for the subgraph execution process.

Link copied to clipboard
abstract suspend fun invokeOnToolCallCompleted(eventContext: ToolCallCompletedContext)

Invoke handlers for an event when a tool call is completed successfully.

Link copied to clipboard
abstract suspend fun invokeOnToolCallFailed(eventContext: ToolCallFailedContext)

Invoke handlers for a tool call failure with an exception event.

Link copied to clipboard
abstract suspend fun invokeOnToolCallStarting(eventContext: ToolCallStartingContext)

Invoke handlers for the tool call event.

Link copied to clipboard
abstract suspend fun invokeOnToolValidationFailed(eventContext: ToolValidationFailedContext)

Invoke handlers for a validation error during a tool call event.

Link copied to clipboard
abstract fun onAfterLLMCall(handler: suspend (AfterLLMCallContext) -> Unit)

Append handler called after a response is received from the language model.

Link copied to clipboard
abstract fun onAfterNode(handler: suspend (NodeAfterExecuteContext) -> Unit)

Append handler called after a node in the agent's execution graph has been processed.

Link copied to clipboard
abstract fun onAgentBeforeClose(handler: suspend (AgentBeforeCloseContext) -> Unit)

Appends a handler called before an agent is closed. This allows for additional behavior to be executed prior to the agent being closed.

Link copied to clipboard
abstract fun onAgentClosing(handler: suspend (eventContext: AgentClosingContext) -> Unit)

Appends a handler called before an agent is closed. This allows for additional behavior to be executed prior to the agent being closed.

Link copied to clipboard
abstract fun onAgentCompleted(handler: suspend (eventContext: AgentCompletedContext) -> Unit)

Append handler called when an agent finishes execution.

Link copied to clipboard
abstract fun onAgentExecutionFailed(handler: suspend (eventContext: AgentExecutionFailedContext) -> Unit)

Append handler called when an error occurs during agent execution.

Link copied to clipboard
abstract fun onAgentFinished(handler: suspend (AgentFinishedContext) -> Unit)

Append handler called when an agent finishes execution.

Link copied to clipboard
abstract fun onAgentRunError(handler: suspend (AgentRunErrorContext) -> Unit)

Append handler called when an error occurs during agent execution.

Link copied to clipboard
abstract fun onAgentStarting(handler: suspend (eventContext: AgentStartingContext) -> Unit)

Append handler called when an agent is started.

Link copied to clipboard
abstract fun onBeforeAgentStarted(handler: suspend (AgentStartContext) -> Unit)

Append handler called when an agent is started.

Link copied to clipboard
abstract fun onBeforeLLMCall(handler: suspend (BeforeLLMCallContext) -> Unit)

Append handler called before a call is made to the language model.

Link copied to clipboard
abstract fun onBeforeNode(handler: suspend (NodeBeforeExecuteContext) -> Unit)

Append handler called before a node in the agent's execution graph is processed.

Link copied to clipboard
abstract fun onLLMCallCompleted(handler: suspend (eventContext: LLMCallCompletedContext) -> Unit)

Append handler called after a response is received from the language model.

Link copied to clipboard
abstract fun onLLMCallStarting(handler: suspend (eventContext: LLMCallStartingContext) -> Unit)

Append handler called before a call is made to the language model.

Link copied to clipboard
abstract fun onLLMStreamingCompleted(handler: suspend (eventContext: LLMStreamingCompletedContext) -> Unit)

Registers a handler to be invoked after streaming from a language model completes.

Link copied to clipboard
abstract fun onLLMStreamingFailed(handler: suspend (eventContext: LLMStreamingFailedContext) -> Unit)

Registers a handler to be invoked when an error occurs during streaming.

Link copied to clipboard
abstract fun onLLMStreamingFrameReceived(handler: suspend (eventContext: LLMStreamingFrameReceivedContext) -> Unit)

Registers a handler to be invoked when stream frames are received during streaming.

Link copied to clipboard
abstract fun onLLMStreamingStarting(handler: suspend (eventContext: LLMStreamingStartingContext) -> Unit)

Registers a handler to be invoked before streaming from a language model begins.

Link copied to clipboard
abstract fun onNodeExecutionCompleted(handler: suspend (eventContext: NodeExecutionCompletedContext) -> Unit)

Append handler called after a node in the agent's execution graph has been processed.

Link copied to clipboard
abstract fun onNodeExecutionError(handler: suspend (NodeExecutionErrorContext) -> Unit)

Append handler called when an error occurs during the execution of a node.

Link copied to clipboard
abstract fun onNodeExecutionFailed(handler: suspend (eventContext: NodeExecutionFailedContext) -> Unit)

Append handler called when an error occurs during the execution of a node.

Link copied to clipboard
abstract fun onNodeExecutionStarting(handler: suspend (eventContext: NodeExecutionStartingContext) -> Unit)

Append handler called before a node in the agent's execution graph is processed.

Link copied to clipboard
abstract fun onStrategyCompleted(handler: suspend (eventContext: StrategyCompletedContext) -> Unit)

Append handler called when a strategy finishes execution.

Link copied to clipboard
abstract fun onStrategyFinished(handler: suspend (StrategyFinishedContext) -> Unit)

Append handler called when a strategy finishes execution.

Link copied to clipboard
abstract fun onStrategyStarted(handler: suspend (StrategyStartContext) -> Unit)

Append handler called when a strategy starts execution.

Link copied to clipboard
abstract fun onStrategyStarting(handler: suspend (eventContext: StrategyStartingContext) -> Unit)

Append handler called when a strategy starts execution.

Link copied to clipboard
abstract fun onSubgraphExecutionCompleted(handler: suspend (eventContext: SubgraphExecutionCompletedContext) -> Unit)

Append handler called after a subgraph in the agent's execution graph has been processed.

Link copied to clipboard
abstract fun onSubgraphExecutionFailed(handler: suspend (eventContext: SubgraphExecutionFailedContext) -> Unit)

Append handler called when an error occurs during the execution of a subgraph.

Link copied to clipboard
abstract fun onSubgraphExecutionStarting(handler: suspend (eventContext: SubgraphExecutionStartingContext) -> Unit)

Append handler called before a subgraph in the agent's execution graph is processed.

Link copied to clipboard
abstract fun onToolCall(handler: suspend (ToolCallContext) -> Unit)

Append handler called when a tool is about to be called.

Link copied to clipboard
abstract fun onToolCallCompleted(handler: suspend (eventContext: ToolCallCompletedContext) -> Unit)

Append handler called when a tool call completes successfully.

Link copied to clipboard
abstract fun onToolCallFailed(handler: suspend (eventContext: ToolCallFailedContext) -> Unit)

Append handler called when a tool call fails with an exception.

Link copied to clipboard
abstract fun onToolCallFailure(handler: suspend (ToolCallFailureContext) -> Unit)

Append handler called when a tool call fails with an exception.

Link copied to clipboard
abstract fun onToolCallResult(handler: suspend (ToolCallResultContext) -> Unit)

Append handler called when a tool call completes successfully.

Link copied to clipboard
abstract fun onToolCallStarting(handler: suspend (eventContext: ToolCallStartingContext) -> Unit)

Append handler called when a tool is about to be called.

Link copied to clipboard
abstract fun onToolValidationError(handler: suspend (ToolValidationErrorContext) -> Unit)

Append handler called when a validation error occurs during a tool call.

Link copied to clipboard
abstract fun onToolValidationFailed(handler: suspend (eventContext: ToolValidationFailedContext) -> Unit)

Append handler called when a validation error occurs during a tool call.