AIAgentPlannerPipelineAPI

Platform-agnostic API for planner agent pipelines, extending the base pipeline API with planner-specific functionality.

Inheritors

Properties

Link copied to clipboard
abstract val clock: KoogClock
Link copied to clipboard
abstract val config: AIAgentConfig

Functions

Link copied to clipboard
abstract suspend fun closeAllFeaturesMessageProcessors()
Link copied to clipboard
abstract suspend fun collectToolCallMetadata(eventId: String, executionInfo: AgentExecutionInfo, runId: String, toolCallId: String?, toolName: String, toolDescription: String?, toolArgs: JSONObject, context: AIAgentContext): ToolCallMetadata

Collects metadata contributions from every feature that registered a handler via provideToolCallMetadata and returns the combined map.

Link copied to clipboard
abstract fun <TFeature : Any> feature(featureClass: KClass<TFeature>, feature: AIAgentFeature<*, TFeature>): TFeature?
Link copied to clipboard
abstract fun <TConfig : FeatureConfig, TFeatureImpl : Any> install(featureKey: AIAgentStorageKey<TFeatureImpl>, featureConfig: TConfig, featureImpl: TFeatureImpl)
Link copied to clipboard
abstract fun interceptAgentClosing(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: AgentClosingContext) -> Unit)
Link copied to clipboard
abstract fun interceptAgentCompleted(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: AgentCompletedContext) -> Unit)
Link copied to clipboard
abstract fun interceptAgentExecutionFailed(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: AgentExecutionFailedContext) -> Unit)
Link copied to clipboard
abstract fun interceptAgentStarting(feature: AIAgentFeature<*, *>, handle: suspend (AgentStartingContext) -> Unit)
Link copied to clipboard
abstract fun interceptEnvironmentCreated(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: AgentEnvironmentTransformingContext, environment: AIAgentEnvironment) -> AIAgentEnvironment)
Link copied to clipboard
abstract fun interceptLLMCallCompleted(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMCallCompletedContext) -> Unit)
Link copied to clipboard
abstract fun interceptLLMCallFailed(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMCallFailedContext) -> Unit)
Link copied to clipboard
abstract fun interceptLLMCallStarting(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMCallStartingContext) -> Unit)
Link copied to clipboard
abstract fun interceptLLMStreamingCompleted(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMStreamingCompletedContext) -> Unit)
Link copied to clipboard
abstract fun interceptLLMStreamingFailed(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMStreamingFailedContext) -> Unit)
Link copied to clipboard
abstract fun interceptLLMStreamingFrameReceived(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMStreamingFrameReceivedContext) -> Unit)
Link copied to clipboard
abstract fun interceptLLMStreamingStarting(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: LLMStreamingStartingContext) -> Unit)

Intercepts plan completion evaluation completed event to perform actions when a plan is evaluated for completion.

Intercepts plan completion evaluation starting event to perform actions when a plan is about to be evaluated for completion.

Link copied to clipboard
abstract fun interceptPlanCreationCompleted(feature: AIAgentFeature<*, *>, handle: suspend (PlanCreationCompletedContext) -> Unit)

Intercepts plan creation completed event to perform actions when a plan completes creation.

Link copied to clipboard
abstract fun interceptPlanCreationStarting(feature: AIAgentFeature<*, *>, handle: suspend (PlanCreationStartingContext) -> Unit)

Intercepts plan creation starting event to perform actions when a plan begins creation.

Link copied to clipboard
abstract fun interceptStepExecutionCompleted(feature: AIAgentFeature<*, *>, handle: suspend (StepExecutionCompletedContext) -> Unit)

Intercepts step execution completed event to perform actions when a plan step completes execution.

Link copied to clipboard
abstract fun interceptStepExecutionStarting(feature: AIAgentFeature<*, *>, handle: suspend (StepExecutionStartingContext) -> Unit)

Intercepts step execution starting event to perform actions when a plan step begins execution.

Link copied to clipboard
abstract fun interceptStrategyCompleted(feature: AIAgentFeature<*, *>, handle: suspend (StrategyCompletedContext) -> Unit)
Link copied to clipboard
abstract fun interceptStrategyStarting(feature: AIAgentFeature<*, *>, handle: suspend (StrategyStartingContext) -> Unit)
Link copied to clipboard
abstract fun interceptToolCallCompleted(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolCallCompletedContext) -> Unit)
Link copied to clipboard
abstract fun interceptToolCallFailed(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolCallFailedContext) -> Unit)
Link copied to clipboard
abstract fun interceptToolCallStarting(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolCallStartingContext) -> Unit)
Link copied to clipboard
abstract fun interceptToolValidationFailed(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolValidationFailedContext) -> Unit)
Link copied to clipboard
abstract suspend fun onAgentClosing(eventId: String, executionInfo: AgentExecutionInfo, agent: AIAgent<*, *>)
Link copied to clipboard
abstract suspend fun onAgentCompleted(eventId: String, executionInfo: AgentExecutionInfo, agent: AIAgent<*, *>, context: AIAgentContext, runId: String, result: Any?)
Link copied to clipboard
abstract suspend fun onAgentEnvironmentTransforming(eventId: String, executionInfo: AgentExecutionInfo, agent: AIAgent<*, *>, baseEnvironment: AIAgentEnvironment): AIAgentEnvironment
Link copied to clipboard
abstract suspend fun onAgentExecutionFailed(eventId: String, executionInfo: AgentExecutionInfo, agent: AIAgent<*, *>, context: AIAgentContext, runId: String, error: Throwable)
Link copied to clipboard
abstract suspend fun <TInput, TOutput> onAgentStarting(eventId: String, executionInfo: AgentExecutionInfo, agent: AIAgent<*, *>, context: AIAgentContext, runId: String)
Link copied to clipboard
abstract suspend fun onLLMCallCompleted(eventId: String, executionInfo: AgentExecutionInfo, context: AIAgentContext, runId: String, prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>, response: Message.Assistant?, moderationResponse: ModerationResult? = null)
Link copied to clipboard
abstract suspend fun onLLMCallFailed(eventId: String, executionInfo: AgentExecutionInfo, context: AIAgentContext, runId: String, prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>, error: Throwable)
Link copied to clipboard
abstract suspend fun onLLMCallStarting(eventId: String, executionInfo: AgentExecutionInfo, context: AIAgentContext, runId: String, prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>)
Link copied to clipboard
abstract suspend fun onLLMStreamingCompleted(eventId: String, executionInfo: AgentExecutionInfo, context: AIAgentContext, runId: String, prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>)
Link copied to clipboard
abstract suspend fun onLLMStreamingFailed(eventId: String, executionInfo: AgentExecutionInfo, context: AIAgentContext, runId: String, prompt: Prompt, model: LLModel, error: Throwable)
Link copied to clipboard
abstract suspend fun onLLMStreamingFrameReceived(eventId: String, executionInfo: AgentExecutionInfo, context: AIAgentContext, runId: String, prompt: Prompt, model: LLModel, streamFrame: StreamFrame)
Link copied to clipboard
abstract suspend fun onLLMStreamingStarting(eventId: String, executionInfo: AgentExecutionInfo, context: AIAgentContext, runId: String, prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>)
Link copied to clipboard
abstract suspend fun onPlanCompletionEvaluationCompleted(eventId: String, executionInfo: AgentExecutionInfo, context: AIAgentContext, state: Any, stateType: TypeToken?, plan: Any, planType: TypeToken?, stepIndex: Int, isCompleted: Boolean)

Notifies all registered planner handlers when evaluating whether a plan is completed.

Link copied to clipboard
abstract suspend fun onPlanCompletionEvaluationStarting(eventId: String, executionInfo: AgentExecutionInfo, context: AIAgentContext, state: Any, stateType: TypeToken?, plan: Any, planType: TypeToken?, stepIndex: Int)

Notifies all registered planner handlers when evaluating whether a plan is completed.

Link copied to clipboard
abstract suspend fun onPlanCreationCompleted(eventId: String, executionInfo: AgentExecutionInfo, context: AIAgentContext, state: Any, stateType: TypeToken?, plan: Any?, planType: TypeToken?, stepIndex: Int, updatedPlan: Any)

Notifies all registered planner handlers that a plan creation has completed.

Link copied to clipboard
abstract suspend fun onPlanCreationStarting(eventId: String, executionInfo: AgentExecutionInfo, context: AIAgentContext, state: Any, stateType: TypeToken?, plan: Any?, planType: TypeToken?, stepIndex: Int)

Notifies all registered planner handlers that a plan creation has started.

Link copied to clipboard
abstract suspend fun onStepExecutionCompleted(eventId: String, executionInfo: AgentExecutionInfo, context: AIAgentContext, state: Any, stateType: TypeToken?, plan: Any, planType: TypeToken?, stepIndex: Int)

Notifies all registered planner handlers that a plan step execution has completed.

Link copied to clipboard
abstract suspend fun onStepExecutionStarting(eventId: String, executionInfo: AgentExecutionInfo, context: AIAgentContext, state: Any, stateType: TypeToken?, plan: Any, planType: TypeToken?, stepIndex: Int)

Notifies all registered planner handlers that a plan step execution has started.

Link copied to clipboard
abstract suspend fun onStrategyCompleted(eventId: String, executionInfo: AgentExecutionInfo, context: AIAgentContext, strategy: AIAgentStrategy<*, *, *>, result: Any?, resultType: TypeToken)
Link copied to clipboard
abstract suspend fun onStrategyStarting(eventId: String, executionInfo: AgentExecutionInfo, context: AIAgentContext, strategy: AIAgentStrategy<*, *, *>)
Link copied to clipboard
abstract suspend fun onToolCallCompleted(eventId: String, executionInfo: AgentExecutionInfo, context: AIAgentContext, runId: String, toolCallId: String?, toolName: String, toolDescription: String?, toolArgs: JSONObject, toolResult: JSONElement?)
Link copied to clipboard
abstract suspend fun onToolCallFailed(eventId: String, executionInfo: AgentExecutionInfo, context: AIAgentContext, runId: String, toolCallId: String?, toolName: String, toolDescription: String?, toolArgs: JSONObject, message: String, error: Throwable?)
Link copied to clipboard
abstract suspend fun onToolCallStarting(eventId: String, executionInfo: AgentExecutionInfo, context: AIAgentContext, runId: String, toolCallId: String?, toolName: String, toolDescription: String?, toolArgs: JSONObject)
Link copied to clipboard
abstract suspend fun onToolValidationFailed(eventId: String, executionInfo: AgentExecutionInfo, context: AIAgentContext, runId: String, toolCallId: String?, toolName: String, toolDescription: String?, toolArgs: JSONObject, message: String, error: Throwable)
Link copied to clipboard
abstract suspend fun prepareFeatures()
Link copied to clipboard
abstract fun provideToolCallMetadata(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: ToolCallStartingContext) -> Map<String, Any?>)

Registers a handler that contributes metadata for every tool call.

Link copied to clipboard
abstract suspend fun uninstall(featureKey: AIAgentStorageKey<*>)