AIAgentGraphPipeline

expect open class AIAgentGraphPipeline(agentConfig: AIAgentConfig, clock: Clock = Clock.System, basePipelineDelegate: AIAgentPipelineImpl = AIAgentPipelineImpl(agentConfig, clock)) : AIAgentPipeline, AIAgentGraphPipelineAPI(source)

Represents a pipeline for AI agent graph execution, extending the functionality of AIAgentPipeline. This class manages the execution of specific nodes in the pipeline using registered handlers.

actual open class AIAgentGraphPipeline(agentConfig: AIAgentConfig, clock: Clock, basePipelineDelegate: AIAgentPipelineImpl) : AIAgentPipeline, AIAgentGraphPipelineAPI(source)
actual open class AIAgentGraphPipeline(agentConfig: AIAgentConfig, clock: Clock, basePipelineDelegate: AIAgentPipelineImpl) : AIAgentPipeline, AIAgentGraphPipelineAPI(source)

Constructors

Link copied to clipboard
expect constructor(agentConfig: AIAgentConfig, clock: Clock = Clock.System, basePipelineDelegate: AIAgentPipelineImpl = AIAgentPipelineImpl(agentConfig, clock))
actual constructor(agentConfig: AIAgentConfig, clock: Clock, basePipelineDelegate: AIAgentPipelineImpl)
actual constructor(agentConfig: AIAgentConfig, clock: Clock, basePipelineDelegate: AIAgentPipelineImpl)

Properties

Link copied to clipboard
expect open override val clock: Clock

Provides access to a Clock instance representing the current system time. The Clock can be used to retrieve the current time, create date-time instances, or perform operations based on a specific moment in time.

open override val clock: Clock
open override val clock: Clock
Link copied to clipboard
expect open override val config: AIAgentConfig

Represents the configuration settings for the AI agent.

open override val config: AIAgentConfig
open override val config: AIAgentConfig

Functions

Link copied to clipboard
expect open suspend override fun closeAllFeaturesMessageProcessors()
open suspend override fun closeAllFeaturesMessageProcessors()
open suspend override fun closeAllFeaturesMessageProcessors()
Link copied to clipboard
expect open override fun <TFeature : Any> feature(featureClass: KClass<TFeature>, feature: AIAgentFeature<*, TFeature>): TFeature?

Retrieves a feature implementation from the current pipeline using the specified feature, if it is registered.

open override fun <TFeature : Any> feature(featureClass: KClass<TFeature>, feature: AIAgentFeature<*, TFeature>): TFeature?
open override fun <TFeature : Any> feature(featureClass: KClass<TFeature>, feature: AIAgentFeature<*, TFeature>): TFeature?
Link copied to clipboard

Installs a feature into the pipeline with the provided configuration.

expect open override fun <TConfig : FeatureConfig, TFeatureImpl : Any> install(featureKey: AIAgentStorageKey<TFeatureImpl>, featureConfig: TConfig, featureImpl: TFeatureImpl)

Installs a feature into the AI agent storage using the provided feature key, configuration, and implementation.

open override fun <TConfig : FeatureConfig, TFeatureImpl : Any> install(featureKey: AIAgentStorageKey<TFeatureImpl>, featureConfig: TConfig, featureImpl: TFeatureImpl)
open override fun <TConfig : FeatureConfig, TFeatureImpl : Any> install(featureKey: AIAgentStorageKey<TFeatureImpl>, featureConfig: TConfig, featureImpl: TFeatureImpl)
Link copied to clipboard
expect open override fun interceptAfterLLMCall(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMCallCompletedContext) -> Unit)

Intercepts LLM calls after they are made to process or log the response.

open override fun interceptAfterLLMCall(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMCallCompletedContext) -> Unit)
open override fun interceptAfterLLMCall(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMCallCompletedContext) -> Unit)
Link copied to clipboard
expect open override fun interceptAgentBeforeClose(feature: AIAgentFeature<*, *>, handle: suspend (AgentClosingContext) -> Unit)

Intercepts and sets a handler to be invoked before an agent is closed.

open override fun interceptAgentBeforeClose(feature: AIAgentFeature<*, *>, handle: suspend (AgentClosingContext) -> Unit)
open override fun interceptAgentBeforeClose(feature: AIAgentFeature<*, *>, handle: suspend (AgentClosingContext) -> Unit)
Link copied to clipboard
expect open override fun interceptAgentClosing(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: AgentClosingContext) -> Unit)

Intercepts and sets a handler to be invoked before an agent is closed.

open override fun interceptAgentClosing(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: AgentClosingContext) -> Unit)
open override fun interceptAgentClosing(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: AgentClosingContext) -> Unit)
Link copied to clipboard
expect open override fun interceptAgentCompleted(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: AgentCompletedContext) -> Unit)

Intercepts the completion of an agent's operation and assigns a custom handler to process the result.

open override fun interceptAgentCompleted(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: AgentCompletedContext) -> Unit)
open override fun interceptAgentCompleted(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: AgentCompletedContext) -> Unit)
Link copied to clipboard
expect open override fun interceptAgentExecutionFailed(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: AgentExecutionFailedContext) -> Unit)

Intercepts and handles errors occurring during the execution of an AI agent's strategy.

open override fun interceptAgentExecutionFailed(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: AgentExecutionFailedContext) -> Unit)
open override fun interceptAgentExecutionFailed(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: AgentExecutionFailedContext) -> Unit)
Link copied to clipboard
expect open override fun interceptAgentFinished(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: AgentCompletedContext) -> Unit)

Intercepts the completion of an agent's operation and assigns a custom handler to process the result.

open override fun interceptAgentFinished(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: AgentCompletedContext) -> Unit)
open override fun interceptAgentFinished(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: AgentCompletedContext) -> Unit)
Link copied to clipboard
expect open override fun interceptAgentRunError(feature: AIAgentFeature<*, *>, handle: suspend (AgentExecutionFailedContext) -> Unit)

Intercepts and handles errors occurring during the execution of an AI agent's strategy.

open override fun interceptAgentRunError(feature: AIAgentFeature<*, *>, handle: suspend (AgentExecutionFailedContext) -> Unit)
open override fun interceptAgentRunError(feature: AIAgentFeature<*, *>, handle: suspend (AgentExecutionFailedContext) -> Unit)
Link copied to clipboard
expect open override fun interceptAgentStarting(feature: AIAgentFeature<*, *>, handle: suspend (AgentStartingContext) -> Unit)

Intercepts on before an agent started to modify or enhance the agent.

open override fun interceptAgentStarting(feature: AIAgentFeature<*, *>, handle: suspend (AgentStartingContext) -> Unit)
open override fun interceptAgentStarting(feature: AIAgentFeature<*, *>, handle: suspend (AgentStartingContext) -> Unit)
Link copied to clipboard
expect open override fun interceptBeforeAgentStarted(feature: AIAgentFeature<*, *>, handle: suspend (AgentStartingContext) -> Unit)

Intercepts on before an agent started to modify or enhance the agent.

open override fun interceptBeforeAgentStarted(feature: AIAgentFeature<*, *>, handle: suspend (AgentStartingContext) -> Unit)
open override fun interceptBeforeAgentStarted(feature: AIAgentFeature<*, *>, handle: suspend (AgentStartingContext) -> Unit)
Link copied to clipboard
expect open override fun interceptBeforeLLMCall(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMCallStartingContext) -> Unit)

Intercepts LLM calls before they are made (deprecated name).

open override fun interceptBeforeLLMCall(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMCallStartingContext) -> Unit)
open override fun interceptBeforeLLMCall(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMCallStartingContext) -> Unit)
Link copied to clipboard

Intercepts environment creation to allow features to modify or enhance the agent environment.

open override fun interceptEnvironmentCreated(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: AgentEnvironmentTransformingContext, environment: AIAgentEnvironment) -> AIAgentEnvironment)
open override fun interceptEnvironmentCreated(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: AgentEnvironmentTransformingContext, environment: AIAgentEnvironment) -> AIAgentEnvironment)
Link copied to clipboard
expect open override fun interceptLLMCallCompleted(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMCallCompletedContext) -> Unit)

Intercepts LLM calls after they are made to process or log the response.

open override fun interceptLLMCallCompleted(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMCallCompletedContext) -> Unit)
open override fun interceptLLMCallCompleted(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMCallCompletedContext) -> Unit)
Link copied to clipboard
expect open override fun interceptLLMCallStarting(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMCallStartingContext) -> Unit)

Intercepts LLM calls before they are made to modify or log the prompt.

open override fun interceptLLMCallStarting(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMCallStartingContext) -> Unit)
open override fun interceptLLMCallStarting(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMCallStartingContext) -> Unit)
Link copied to clipboard
expect open override fun interceptLLMStreamingCompleted(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMStreamingCompletedContext) -> Unit)

Intercepts streaming operations after they complete to perform post-processing or cleanup.

open override fun interceptLLMStreamingCompleted(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMStreamingCompletedContext) -> Unit)
open override fun interceptLLMStreamingCompleted(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMStreamingCompletedContext) -> Unit)
Link copied to clipboard
expect open override fun interceptLLMStreamingFailed(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMStreamingFailedContext) -> Unit)

Intercepts errors during the streaming process.

open override fun interceptLLMStreamingFailed(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMStreamingFailedContext) -> Unit)
open override fun interceptLLMStreamingFailed(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMStreamingFailedContext) -> Unit)
Link copied to clipboard
expect open override fun interceptLLMStreamingFrameReceived(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMStreamingFrameReceivedContext) -> Unit)

Intercepts stream frames as they are received during the streaming process.

open override fun interceptLLMStreamingFrameReceived(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMStreamingFrameReceivedContext) -> Unit)
open override fun interceptLLMStreamingFrameReceived(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMStreamingFrameReceivedContext) -> Unit)
Link copied to clipboard
expect open override fun interceptLLMStreamingStarting(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMStreamingStartingContext) -> Unit)

Intercepts streaming operations before they begin to modify or log the streaming request.

open override fun interceptLLMStreamingStarting(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMStreamingStartingContext) -> Unit)
open override fun interceptLLMStreamingStarting(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMStreamingStartingContext) -> Unit)
Link copied to clipboard
expect open override fun interceptNodeExecutionCompleted(feature: AIAgentGraphFeature<*, *>, handle: suspend (eventContext: NodeExecutionCompletedContext) -> Unit)

Intercepts node execution after it completes.

open override fun interceptNodeExecutionCompleted(feature: AIAgentGraphFeature<*, *>, handle: suspend (eventContext: NodeExecutionCompletedContext) -> Unit)
open override fun interceptNodeExecutionCompleted(feature: AIAgentGraphFeature<*, *>, handle: suspend (eventContext: NodeExecutionCompletedContext) -> Unit)
Link copied to clipboard
expect open override fun interceptNodeExecutionFailed(feature: AIAgentGraphFeature<*, *>, handle: suspend (eventContext: NodeExecutionFailedContext) -> Unit)

Intercepts and handles node execution errors for a given feature.

open override fun interceptNodeExecutionFailed(feature: AIAgentGraphFeature<*, *>, handle: suspend (eventContext: NodeExecutionFailedContext) -> Unit)
open override fun interceptNodeExecutionFailed(feature: AIAgentGraphFeature<*, *>, handle: suspend (eventContext: NodeExecutionFailedContext) -> Unit)
Link copied to clipboard
expect open override fun interceptNodeExecutionStarting(feature: AIAgentGraphFeature<*, *>, handle: suspend (eventContext: NodeExecutionStartingContext) -> Unit)

Intercepts node execution before it starts.

open override fun interceptNodeExecutionStarting(feature: AIAgentGraphFeature<*, *>, handle: suspend (eventContext: NodeExecutionStartingContext) -> Unit)
open override fun interceptNodeExecutionStarting(feature: AIAgentGraphFeature<*, *>, handle: suspend (eventContext: NodeExecutionStartingContext) -> Unit)
Link copied to clipboard
expect open override fun interceptStrategyCompleted(feature: AIAgentFeature<*, *>, handle: suspend (StrategyCompletedContext) -> Unit)

Sets up an interceptor to handle the completion of a strategy for the given feature.

open override fun interceptStrategyCompleted(feature: AIAgentFeature<*, *>, handle: suspend (StrategyCompletedContext) -> Unit)
open override fun interceptStrategyCompleted(feature: AIAgentFeature<*, *>, handle: suspend (StrategyCompletedContext) -> Unit)
Link copied to clipboard
expect open override fun interceptStrategyFinished(feature: AIAgentFeature<*, *>, handle: suspend (StrategyCompletedContext) -> Unit)

Sets up an interceptor to handle the completion of a strategy for the given feature.

open override fun interceptStrategyFinished(feature: AIAgentFeature<*, *>, handle: suspend (StrategyCompletedContext) -> Unit)
open override fun interceptStrategyFinished(feature: AIAgentFeature<*, *>, handle: suspend (StrategyCompletedContext) -> Unit)
Link copied to clipboard
expect open override fun interceptStrategyStart(feature: AIAgentFeature<*, *>, handle: suspend (StrategyStartingContext) -> Unit)

Intercepts strategy started event to perform actions when an agent strategy begins execution.

open override fun interceptStrategyStart(feature: AIAgentFeature<*, *>, handle: suspend (StrategyStartingContext) -> Unit)
open override fun interceptStrategyStart(feature: AIAgentFeature<*, *>, handle: suspend (StrategyStartingContext) -> Unit)
Link copied to clipboard
expect open override fun interceptStrategyStarting(feature: AIAgentFeature<*, *>, handle: suspend (StrategyStartingContext) -> Unit)

Intercepts strategy started event to perform actions when an agent strategy begins execution.

open override fun interceptStrategyStarting(feature: AIAgentFeature<*, *>, handle: suspend (StrategyStartingContext) -> Unit)
open override fun interceptStrategyStarting(feature: AIAgentFeature<*, *>, handle: suspend (StrategyStartingContext) -> Unit)
Link copied to clipboard
expect open override fun interceptSubgraphExecutionCompleted(feature: AIAgentGraphFeature<*, *>, handle: suspend (eventContext: SubgraphExecutionCompletedContext) -> Unit)

Intercepts the completion of a subgraph execution and allows handling of the event.

open override fun interceptSubgraphExecutionCompleted(feature: AIAgentGraphFeature<*, *>, handle: suspend (eventContext: SubgraphExecutionCompletedContext) -> Unit)
open override fun interceptSubgraphExecutionCompleted(feature: AIAgentGraphFeature<*, *>, handle: suspend (eventContext: SubgraphExecutionCompletedContext) -> Unit)
Link copied to clipboard
expect open override fun interceptSubgraphExecutionFailed(feature: AIAgentGraphFeature<*, *>, handle: suspend (eventContext: SubgraphExecutionFailedContext) -> Unit)

Intercepts and handles subgraph execution failures for a given feature.

open override fun interceptSubgraphExecutionFailed(feature: AIAgentGraphFeature<*, *>, handle: suspend (eventContext: SubgraphExecutionFailedContext) -> Unit)
open override fun interceptSubgraphExecutionFailed(feature: AIAgentGraphFeature<*, *>, handle: suspend (eventContext: SubgraphExecutionFailedContext) -> Unit)
Link copied to clipboard
expect open override fun interceptSubgraphExecutionStarting(feature: AIAgentGraphFeature<*, *>, handle: suspend (eventContext: SubgraphExecutionStartingContext) -> Unit)

Intercepts the execution of a subgraph when it starts.

open override fun interceptSubgraphExecutionStarting(feature: AIAgentGraphFeature<*, *>, handle: suspend (eventContext: SubgraphExecutionStartingContext) -> Unit)
open override fun interceptSubgraphExecutionStarting(feature: AIAgentGraphFeature<*, *>, handle: suspend (eventContext: SubgraphExecutionStartingContext) -> Unit)
Link copied to clipboard
expect open override fun interceptToolCall(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolCallStartingContext) -> Unit)

Intercepts and handles tool calls for the specified feature and its implementation. Updates the tool call handler for the given feature key with a custom handler.

open override fun interceptToolCall(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolCallStartingContext) -> Unit)
open override fun interceptToolCall(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolCallStartingContext) -> Unit)
Link copied to clipboard
expect open override fun interceptToolCallCompleted(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolCallCompletedContext) -> Unit)

Intercepts the result of a tool call with a custom handler for a specific feature.

open override fun interceptToolCallCompleted(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolCallCompletedContext) -> Unit)
open override fun interceptToolCallCompleted(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolCallCompletedContext) -> Unit)
Link copied to clipboard
expect open override fun interceptToolCallFailed(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolCallFailedContext) -> Unit)

Sets up an interception mechanism to handle tool call failures for a specific feature.

open override fun interceptToolCallFailed(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolCallFailedContext) -> Unit)
open override fun interceptToolCallFailed(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolCallFailedContext) -> Unit)
Link copied to clipboard
expect open override fun interceptToolCallFailure(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolCallFailedContext) -> Unit)

Sets up an interception mechanism to handle tool call failures for a specific feature.

open override fun interceptToolCallFailure(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolCallFailedContext) -> Unit)
open override fun interceptToolCallFailure(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolCallFailedContext) -> Unit)
Link copied to clipboard
expect open override fun interceptToolCallResult(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolCallCompletedContext) -> Unit)

Intercepts the result of a tool call with a custom handler for a specific feature.

open override fun interceptToolCallResult(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolCallCompletedContext) -> Unit)
open override fun interceptToolCallResult(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolCallCompletedContext) -> Unit)
Link copied to clipboard
expect open override fun interceptToolCallStarting(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolCallStartingContext) -> Unit)

Intercepts and handles tool calls for the specified feature.

open override fun interceptToolCallStarting(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolCallStartingContext) -> Unit)
open override fun interceptToolCallStarting(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolCallStartingContext) -> Unit)
Link copied to clipboard
expect open override fun interceptToolValidationError(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolValidationFailedContext) -> Unit)

Intercepts validation errors encountered during the execution of tools associated with the specified feature.

open override fun interceptToolValidationError(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolValidationFailedContext) -> Unit)
open override fun interceptToolValidationError(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolValidationFailedContext) -> Unit)
Link copied to clipboard
expect open override fun interceptToolValidationFailed(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolValidationFailedContext) -> Unit)

Intercepts validation errors encountered during the execution of tools associated with the specified feature.

open override fun interceptToolValidationFailed(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolValidationFailedContext) -> Unit)
open override fun interceptToolValidationFailed(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolValidationFailedContext) -> Unit)
Link copied to clipboard

Intercepts and sets a handler to be invoked before an agent is closed.

Link copied to clipboard

Intercepts the completion of an agent's operation and assigns a custom handler to process the result.

Link copied to clipboard

Intercepts and handles errors occurring during the execution of an AI agent's strategy.

Link copied to clipboard

Intercepts on before an agent started to modify or enhance the agent.

Link copied to clipboard

Intercepts environment creation to allow features to modify or enhance the agent environment.

Link copied to clipboard

Intercepts LLM calls after they are made to process or log the response.

Link copied to clipboard

Intercepts LLM calls before they are made to modify or log the prompt.

Link copied to clipboard

Intercepts streaming operations after they complete to perform post-processing or cleanup.

Link copied to clipboard

Intercepts errors during the streaming process.

Intercepts stream frames as they are received during the streaming process.

Link copied to clipboard

Intercepts streaming operations before they begin to modify or log the streaming request.

Link copied to clipboard

Intercepts node execution after it is successfully completed.

Link copied to clipboard

Intercepts node execution when it fails.

Link copied to clipboard

Intercepts node execution before it starts.

Link copied to clipboard

Sets up an interceptor to handle the completion of a strategy for the given feature.

Link copied to clipboard

Intercepts strategy started event to perform actions when an agent strategy begins execution.

Intercepts subgraph execution after it is successfully completed.

Link copied to clipboard

Intercepts subgraph execution when it fails.

Intercepts subgraph execution before it starts.

Link copied to clipboard

Intercepts the result of a tool call with a custom handler for a specific feature.

Link copied to clipboard

Sets up an interception mechanism to handle tool call failures for a specific feature.

Link copied to clipboard

Intercepts and handles tool calls for the specified feature.

Link copied to clipboard

Intercepts validation errors encountered during the execution of tools associated with the specified feature.

Link copied to clipboard
expect open suspend override fun onAgentClosing(eventId: String, executionInfo: AgentExecutionInfo, agentId: String)

Invoked before an agent is closed to perform necessary pre-closure operations.

open suspend override fun onAgentClosing(eventId: String, executionInfo: AgentExecutionInfo, agentId: String)
open suspend override fun onAgentClosing(eventId: String, executionInfo: AgentExecutionInfo, agentId: String)
Link copied to clipboard
expect open suspend override fun onAgentCompleted(eventId: String, executionInfo: AgentExecutionInfo, agentId: String, runId: String, result: Any?, context: AIAgentContext)

Notifies all registered handlers that an agent has finished execution.

open suspend override fun onAgentCompleted(eventId: String, executionInfo: AgentExecutionInfo, agentId: String, runId: String, result: Any?, context: AIAgentContext)
open suspend override fun onAgentCompleted(eventId: String, executionInfo: AgentExecutionInfo, agentId: String, runId: String, result: Any?, context: AIAgentContext)
Link copied to clipboard
expect open suspend override fun onAgentEnvironmentTransforming(eventId: String, executionInfo: AgentExecutionInfo, agent: GraphAIAgent<*, *>, baseEnvironment: AIAgentEnvironment): AIAgentEnvironment

Transforms the agent environment by applying all registered environment transformers.

open suspend override fun onAgentEnvironmentTransforming(eventId: String, executionInfo: AgentExecutionInfo, agent: GraphAIAgent<*, *>, baseEnvironment: AIAgentEnvironment): AIAgentEnvironment
open suspend override fun onAgentEnvironmentTransforming(eventId: String, executionInfo: AgentExecutionInfo, agent: GraphAIAgent<*, *>, baseEnvironment: AIAgentEnvironment): AIAgentEnvironment
Link copied to clipboard
expect open suspend override fun onAgentExecutionFailed(eventId: String, executionInfo: AgentExecutionInfo, agentId: String, runId: String, throwable: Throwable, context: AIAgentContext)

Notifies all registered handlers about an error that occurred during agent execution.

open suspend override fun onAgentExecutionFailed(eventId: String, executionInfo: AgentExecutionInfo, agentId: String, runId: String, throwable: Throwable, context: AIAgentContext)
open suspend override fun onAgentExecutionFailed(eventId: String, executionInfo: AgentExecutionInfo, agentId: String, runId: String, throwable: Throwable, context: AIAgentContext)
Link copied to clipboard
expect open suspend override fun <TInput, TOutput> onAgentStarting(eventId: String, executionInfo: AgentExecutionInfo, runId: String, agent: AIAgent<*, *>, context: AIAgentContext)

Notifies all registered handlers that an agent has started execution.

open suspend override fun <TInput, TOutput> onAgentStarting(eventId: String, executionInfo: AgentExecutionInfo, runId: String, agent: AIAgent<*, *>, context: AIAgentContext)
open suspend override fun <TInput, TOutput> onAgentStarting(eventId: String, executionInfo: AgentExecutionInfo, runId: String, agent: AIAgent<*, *>, context: AIAgentContext)
Link copied to clipboard
expect open suspend override fun onLLMCallCompleted(eventId: String, executionInfo: AgentExecutionInfo, runId: String, prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>, responses: List<Message.Response>, moderationResponse: ModerationResult?, context: AIAgentContext)

Notifies all registered LLM handlers after a language model call has completed.

open suspend override fun onLLMCallCompleted(eventId: String, executionInfo: AgentExecutionInfo, runId: String, prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>, responses: List<Message.Response>, moderationResponse: ModerationResult?, context: AIAgentContext)
open suspend override fun onLLMCallCompleted(eventId: String, executionInfo: AgentExecutionInfo, runId: String, prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>, responses: List<Message.Response>, moderationResponse: ModerationResult?, context: AIAgentContext)
Link copied to clipboard
expect open suspend override fun onLLMCallStarting(eventId: String, executionInfo: AgentExecutionInfo, runId: String, prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>, context: AIAgentContext)

Notifies all registered LLM handlers before a language model call is made.

open suspend override fun onLLMCallStarting(eventId: String, executionInfo: AgentExecutionInfo, runId: String, prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>, context: AIAgentContext)
open suspend override fun onLLMCallStarting(eventId: String, executionInfo: AgentExecutionInfo, runId: String, prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>, context: AIAgentContext)
Link copied to clipboard
expect open suspend override fun onLLMStreamingCompleted(eventId: String, executionInfo: AgentExecutionInfo, runId: String, prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>, context: AIAgentContext)

Invoked after streaming from a language model completes.

open suspend override fun onLLMStreamingCompleted(eventId: String, executionInfo: AgentExecutionInfo, runId: String, prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>, context: AIAgentContext)
open suspend override fun onLLMStreamingCompleted(eventId: String, executionInfo: AgentExecutionInfo, runId: String, prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>, context: AIAgentContext)
Link copied to clipboard
expect open suspend override fun onLLMStreamingFailed(eventId: String, executionInfo: AgentExecutionInfo, runId: String, prompt: Prompt, model: LLModel, throwable: Throwable, context: AIAgentContext)

Invoked if an error occurs during the streaming process.

open suspend override fun onLLMStreamingFailed(eventId: String, executionInfo: AgentExecutionInfo, runId: String, prompt: Prompt, model: LLModel, throwable: Throwable, context: AIAgentContext)
open suspend override fun onLLMStreamingFailed(eventId: String, executionInfo: AgentExecutionInfo, runId: String, prompt: Prompt, model: LLModel, throwable: Throwable, context: AIAgentContext)
Link copied to clipboard
expect open suspend override fun onLLMStreamingFrameReceived(eventId: String, executionInfo: AgentExecutionInfo, runId: String, prompt: Prompt, model: LLModel, streamFrame: StreamFrame, context: AIAgentContext)

Invoked when a stream frame is received during the streaming process.

open suspend override fun onLLMStreamingFrameReceived(eventId: String, executionInfo: AgentExecutionInfo, runId: String, prompt: Prompt, model: LLModel, streamFrame: StreamFrame, context: AIAgentContext)
open suspend override fun onLLMStreamingFrameReceived(eventId: String, executionInfo: AgentExecutionInfo, runId: String, prompt: Prompt, model: LLModel, streamFrame: StreamFrame, context: AIAgentContext)
Link copied to clipboard
expect open suspend override fun onLLMStreamingStarting(eventId: String, executionInfo: AgentExecutionInfo, runId: String, prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>, context: AIAgentContext)

Invoked before streaming from a language model begins.

open suspend override fun onLLMStreamingStarting(eventId: String, executionInfo: AgentExecutionInfo, runId: String, prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>, context: AIAgentContext)
open suspend override fun onLLMStreamingStarting(eventId: String, executionInfo: AgentExecutionInfo, runId: String, prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>, context: AIAgentContext)
Link copied to clipboard
expect open suspend override fun onNodeExecutionCompleted(eventId: String, executionInfo: AgentExecutionInfo, node: AIAgentNodeBase<*, *>, context: AIAgentGraphContextBase, input: Any?, inputType: TypeToken, output: Any?, outputType: TypeToken)

Notifies all registered node handlers after a node has been executed.

open suspend override fun onNodeExecutionCompleted(eventId: String, executionInfo: AgentExecutionInfo, node: AIAgentNodeBase<*, *>, context: AIAgentGraphContextBase, input: Any?, inputType: TypeToken, output: Any?, outputType: TypeToken)
open suspend override fun onNodeExecutionCompleted(eventId: String, executionInfo: AgentExecutionInfo, node: AIAgentNodeBase<*, *>, context: AIAgentGraphContextBase, input: Any?, inputType: TypeToken, output: Any?, outputType: TypeToken)
Link copied to clipboard
expect open suspend override fun onNodeExecutionFailed(eventId: String, executionInfo: AgentExecutionInfo, node: AIAgentNodeBase<*, *>, context: AIAgentGraphContextBase, input: Any?, inputType: TypeToken, throwable: Throwable)

Handles errors occurring during the execution of a node by invoking all registered node execution error handlers.

open suspend override fun onNodeExecutionFailed(eventId: String, executionInfo: AgentExecutionInfo, node: AIAgentNodeBase<*, *>, context: AIAgentGraphContextBase, input: Any?, inputType: TypeToken, throwable: Throwable)
open suspend override fun onNodeExecutionFailed(eventId: String, executionInfo: AgentExecutionInfo, node: AIAgentNodeBase<*, *>, context: AIAgentGraphContextBase, input: Any?, inputType: TypeToken, throwable: Throwable)
Link copied to clipboard
expect open suspend override fun onNodeExecutionStarting(eventId: String, executionInfo: AgentExecutionInfo, node: AIAgentNodeBase<*, *>, context: AIAgentGraphContextBase, input: Any?, inputType: TypeToken)

Notifies all registered node handlers before a node is executed.

open suspend override fun onNodeExecutionStarting(eventId: String, executionInfo: AgentExecutionInfo, node: AIAgentNodeBase<*, *>, context: AIAgentGraphContextBase, input: Any?, inputType: TypeToken)
open suspend override fun onNodeExecutionStarting(eventId: String, executionInfo: AgentExecutionInfo, node: AIAgentNodeBase<*, *>, context: AIAgentGraphContextBase, input: Any?, inputType: TypeToken)
Link copied to clipboard
expect open suspend override fun onStrategyCompleted(eventId: String, executionInfo: AgentExecutionInfo, strategy: AIAgentStrategy<*, *, *>, context: AIAgentContext, result: Any?, resultType: TypeToken)

Notifies all registered strategy handlers that a strategy has finished execution.

open suspend override fun onStrategyCompleted(eventId: String, executionInfo: AgentExecutionInfo, strategy: AIAgentStrategy<*, *, *>, context: AIAgentContext, result: Any?, resultType: TypeToken)
open suspend override fun onStrategyCompleted(eventId: String, executionInfo: AgentExecutionInfo, strategy: AIAgentStrategy<*, *, *>, context: AIAgentContext, result: Any?, resultType: TypeToken)
Link copied to clipboard
expect open suspend override fun onStrategyStarting(eventId: String, executionInfo: AgentExecutionInfo, strategy: AIAgentStrategy<*, *, *>, context: AIAgentContext)

Notifies all registered strategy handlers that a strategy has started execution.

open suspend override fun onStrategyStarting(eventId: String, executionInfo: AgentExecutionInfo, strategy: AIAgentStrategy<*, *, *>, context: AIAgentContext)
open suspend override fun onStrategyStarting(eventId: String, executionInfo: AgentExecutionInfo, strategy: AIAgentStrategy<*, *, *>, context: AIAgentContext)
Link copied to clipboard
expect open suspend override fun onSubgraphExecutionCompleted(eventId: String, executionInfo: AgentExecutionInfo, subgraph: AIAgentSubgraphBase<*, *>, context: AIAgentGraphContextBase, input: Any?, inputType: TypeToken, output: Any?, outputType: TypeToken)

Notifies all registered subgraph handlers after a subgraph has been executed.

open suspend override fun onSubgraphExecutionCompleted(eventId: String, executionInfo: AgentExecutionInfo, subgraph: AIAgentSubgraphBase<*, *>, context: AIAgentGraphContextBase, input: Any?, inputType: TypeToken, output: Any?, outputType: TypeToken)
open suspend override fun onSubgraphExecutionCompleted(eventId: String, executionInfo: AgentExecutionInfo, subgraph: AIAgentSubgraphBase<*, *>, context: AIAgentGraphContextBase, input: Any?, inputType: TypeToken, output: Any?, outputType: TypeToken)
Link copied to clipboard
expect open suspend override fun onSubgraphExecutionFailed(eventId: String, executionInfo: AgentExecutionInfo, subgraph: AIAgentSubgraphBase<*, *>, context: AIAgentGraphContextBase, input: Any?, inputType: TypeToken, throwable: Throwable)

Notifies all registered subgraph handlers when a subgraph execution fails.

open suspend override fun onSubgraphExecutionFailed(eventId: String, executionInfo: AgentExecutionInfo, subgraph: AIAgentSubgraphBase<*, *>, context: AIAgentGraphContextBase, input: Any?, inputType: TypeToken, throwable: Throwable)
open suspend override fun onSubgraphExecutionFailed(eventId: String, executionInfo: AgentExecutionInfo, subgraph: AIAgentSubgraphBase<*, *>, context: AIAgentGraphContextBase, input: Any?, inputType: TypeToken, throwable: Throwable)
Link copied to clipboard
expect open suspend override fun onSubgraphExecutionStarting(eventId: String, executionInfo: AgentExecutionInfo, subgraph: AIAgentSubgraphBase<*, *>, context: AIAgentGraphContextBase, input: Any?, inputType: TypeToken)

Notifies all registered subgraph handlers before a subgraph is executed.

open suspend override fun onSubgraphExecutionStarting(eventId: String, executionInfo: AgentExecutionInfo, subgraph: AIAgentSubgraphBase<*, *>, context: AIAgentGraphContextBase, input: Any?, inputType: TypeToken)
open suspend override fun onSubgraphExecutionStarting(eventId: String, executionInfo: AgentExecutionInfo, subgraph: AIAgentSubgraphBase<*, *>, context: AIAgentGraphContextBase, input: Any?, inputType: TypeToken)
Link copied to clipboard
expect open suspend override fun onToolCallCompleted(eventId: String, executionInfo: AgentExecutionInfo, runId: String, toolCallId: String?, toolName: String, toolDescription: String?, toolArgs: JSONObject, toolResult: JSONElement?, context: AIAgentContext)

Notifies all registered tool handlers about the result of a tool call.

open suspend override fun onToolCallCompleted(eventId: String, executionInfo: AgentExecutionInfo, runId: String, toolCallId: String?, toolName: String, toolDescription: String?, toolArgs: JSONObject, toolResult: JSONElement?, context: AIAgentContext)
open suspend override fun onToolCallCompleted(eventId: String, executionInfo: AgentExecutionInfo, runId: String, toolCallId: String?, toolName: String, toolDescription: String?, toolArgs: JSONObject, toolResult: JSONElement?, context: AIAgentContext)
Link copied to clipboard
expect open suspend override fun onToolCallFailed(eventId: String, executionInfo: AgentExecutionInfo, runId: String, toolCallId: String?, toolName: String, toolDescription: String?, toolArgs: JSONObject, message: String, error: AIAgentError?, context: AIAgentContext)

Notifies all registered tool handlers when a tool call fails with an exception.

open suspend override fun onToolCallFailed(eventId: String, executionInfo: AgentExecutionInfo, runId: String, toolCallId: String?, toolName: String, toolDescription: String?, toolArgs: JSONObject, message: String, error: AIAgentError?, context: AIAgentContext)
open suspend override fun onToolCallFailed(eventId: String, executionInfo: AgentExecutionInfo, runId: String, toolCallId: String?, toolName: String, toolDescription: String?, toolArgs: JSONObject, message: String, error: AIAgentError?, context: AIAgentContext)
Link copied to clipboard
expect open suspend override fun onToolCallStarting(eventId: String, executionInfo: AgentExecutionInfo, runId: String, toolCallId: String?, toolName: String, toolDescription: String?, toolArgs: JSONObject, context: AIAgentContext)

Notifies all registered tool handlers when a tool is called.

open suspend override fun onToolCallStarting(eventId: String, executionInfo: AgentExecutionInfo, runId: String, toolCallId: String?, toolName: String, toolDescription: String?, toolArgs: JSONObject, context: AIAgentContext)
open suspend override fun onToolCallStarting(eventId: String, executionInfo: AgentExecutionInfo, runId: String, toolCallId: String?, toolName: String, toolDescription: String?, toolArgs: JSONObject, context: AIAgentContext)
Link copied to clipboard
expect open suspend override fun onToolValidationFailed(eventId: String, executionInfo: AgentExecutionInfo, runId: String, toolCallId: String?, toolName: String, toolDescription: String?, toolArgs: JSONObject, message: String, error: AIAgentError, context: AIAgentContext)

Notifies all registered tool handlers when a validation error occurs during a tool call.

open suspend override fun onToolValidationFailed(eventId: String, executionInfo: AgentExecutionInfo, runId: String, toolCallId: String?, toolName: String, toolDescription: String?, toolArgs: JSONObject, message: String, error: AIAgentError, context: AIAgentContext)
open suspend override fun onToolValidationFailed(eventId: String, executionInfo: AgentExecutionInfo, runId: String, toolCallId: String?, toolName: String, toolDescription: String?, toolArgs: JSONObject, message: String, error: AIAgentError, context: AIAgentContext)
Link copied to clipboard
expect open suspend override fun prepareFeatures()
open suspend override fun prepareFeatures()
open suspend override fun prepareFeatures()
Link copied to clipboard
expect open suspend override fun uninstall(featureKey: AIAgentStorageKey<*>)

Uninstalls the specified feature associated with the given key from storage.

open suspend override fun uninstall(featureKey: AIAgentStorageKey<*>)
open suspend override fun uninstall(featureKey: AIAgentStorageKey<*>)