Skip to main content

AgentCapability

Trait AgentCapability 

Source
pub trait AgentCapability: Send + Sync {
Show 33 methods // Provided methods fn spec(&self) -> CapabilitySpec { ... } fn on_run_start<'life0, 'life1, 'async_trait>( &'life0 self, _state: &'life1 mut AgentRunState, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn on_run_start_with_context<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, state: &'life1 mut AgentRunState, _context: &'life2 mut AgentContext, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn prepare_run_input<'life0, 'life1, 'async_trait>( &'life0 self, _state: &'life1 mut AgentRunState, input: AgentInput, ) -> Pin<Box<dyn Future<Output = CapabilityResult<AgentInput>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn prepare_run_input_with_context<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, state: &'life1 mut AgentRunState, _context: &'life2 mut AgentContext, input: AgentInput, ) -> Pin<Box<dyn Future<Output = CapabilityResult<AgentInput>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn prepare_model_messages<'life0, 'life1, 'async_trait>( &'life0 self, _state: &'life1 mut AgentRunState, messages: Vec<ModelMessage>, ) -> Pin<Box<dyn Future<Output = CapabilityResult<Vec<ModelMessage>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn prepare_model_messages_with_context<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, state: &'life1 mut AgentRunState, _context: &'life2 mut AgentContext, messages: Vec<ModelMessage>, ) -> Pin<Box<dyn Future<Output = CapabilityResult<Vec<ModelMessage>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn prepare_provider_messages<'life0, 'life1, 'async_trait>( &'life0 self, _state: &'life1 mut AgentRunState, messages: Vec<ModelMessage>, ) -> Pin<Box<dyn Future<Output = CapabilityResult<Vec<ModelMessage>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn prepare_provider_messages_with_context<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, state: &'life1 mut AgentRunState, _context: &'life2 mut AgentContext, messages: Vec<ModelMessage>, ) -> Pin<Box<dyn Future<Output = CapabilityResult<Vec<ModelMessage>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn prepare_tools<'life0, 'life1, 'async_trait>( &'life0 self, _state: &'life1 AgentRunState, tools: Vec<ToolDefinition>, ) -> Pin<Box<dyn Future<Output = CapabilityResult<Vec<ToolDefinition>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn prepare_tools_with_context<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, state: &'life1 AgentRunState, _context: &'life2 AgentContext, tools: Vec<ToolDefinition>, ) -> Pin<Box<dyn Future<Output = CapabilityResult<Vec<ToolDefinition>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn before_model_request<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _state: &'life1 mut AgentRunState, _request: &'life2 mut ModelRequest, _settings: &'life3 mut Option<ModelSettings>, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn before_model_request_with_context<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, state: &'life1 mut AgentRunState, context: &'life2 mut AgentContext, request: &'life3 mut ModelRequest, settings: &'life4 mut Option<ModelSettings>, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait { ... } fn after_model_response<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _state: &'life1 mut AgentRunState, _response: &'life2 mut ModelResponse, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn before_tool_execution<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _state: &'life1 mut AgentRunState, _tool_context: &'life2 mut ToolContext, _call: &'life3 ToolCallPart, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn before_tool_execution_with_context<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, state: &'life1 mut AgentRunState, _context: &'life2 mut AgentContext, tool_context: &'life3 mut ToolContext, call: &'life4 ToolCallPart, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait { ... } fn after_tool_result<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _state: &'life1 mut AgentRunState, _call: &'life2 ToolCallPart, _tool_return: &'life3 mut ToolReturnPart, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn after_tool_result_with_context<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, state: &'life1 mut AgentRunState, _context: &'life2 mut AgentContext, call: &'life3 ToolCallPart, tool_return: &'life4 mut ToolReturnPart, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait { ... } fn after_model_response_with_context<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, state: &'life1 mut AgentRunState, context: &'life2 mut AgentContext, response: &'life3 mut ModelResponse, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn before_output_validation<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _state: &'life1 mut AgentRunState, _output: &'life2 str, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn before_output_validation_with_context<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, state: &'life1 mut AgentRunState, _context: &'life2 mut AgentContext, output: &'life3 str, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn validate_output<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _state: &'life1 mut AgentRunState, _output: &'life2 str, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn validate_output_with_context<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, state: &'life1 mut AgentRunState, context: &'life2 mut AgentContext, output: &'life3 str, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn after_output_validation<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _state: &'life1 mut AgentRunState, _output: &'life2 str, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn after_output_validation_with_context<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, state: &'life1 mut AgentRunState, _context: &'life2 mut AgentContext, output: &'life3 str, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn on_checkpoint<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _state: &'life1 AgentRunState, _checkpoint: &'life2 AgentCheckpoint, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn on_checkpoint_with_context<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, state: &'life1 AgentRunState, _context: &'life2 AgentContext, checkpoint: &'life3 AgentCheckpoint, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn on_retry<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _state: &'life1 mut AgentRunState, _kind: RetryEventKind, _retries: usize, _message: &'life2 str, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn on_stream_event<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _state: &'life1 AgentRunState, _event: &'life2 AgentStreamRecord, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn on_stream_event_with_context<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, state: &'life1 AgentRunState, _context: &'life2 AgentContext, event: &'life3 AgentStreamRecord, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn on_retry_with_context<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, state: &'life1 mut AgentRunState, _context: &'life2 mut AgentContext, kind: RetryEventKind, retries: usize, message: &'life3 str, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn on_run_complete<'life0, 'life1, 'async_trait>( &'life0 self, _state: &'life1 mut AgentRunState, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn on_run_complete_with_context<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, state: &'life1 mut AgentRunState, context: &'life2 mut AgentContext, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... }
}
Expand description

Hook interface for runtime extension points.

Provided Methods§

Source

fn spec(&self) -> CapabilitySpec

Stable capability spec used for ordering and reconstruction evidence.

Source

fn on_run_start<'life0, 'life1, 'async_trait>( &'life0 self, _state: &'life1 mut AgentRunState, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Called after a run state is created and before the first request is prepared.

Source

fn on_run_start_with_context<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, state: &'life1 mut AgentRunState, _context: &'life2 mut AgentContext, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Context-aware run-start hook.

Source

fn prepare_run_input<'life0, 'life1, 'async_trait>( &'life0 self, _state: &'life1 mut AgentRunState, input: AgentInput, ) -> Pin<Box<dyn Future<Output = CapabilityResult<AgentInput>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Called after run state is initialized and before the first model request is built.

Source

fn prepare_run_input_with_context<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, state: &'life1 mut AgentRunState, _context: &'life2 mut AgentContext, input: AgentInput, ) -> Pin<Box<dyn Future<Output = CapabilityResult<AgentInput>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Context-aware run-input preparation hook.

Source

fn prepare_model_messages<'life0, 'life1, 'async_trait>( &'life0 self, _state: &'life1 mut AgentRunState, messages: Vec<ModelMessage>, ) -> Pin<Box<dyn Future<Output = CapabilityResult<Vec<ModelMessage>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Called after message history is assembled and before provider-bound preparation/model call.

Mutations from this hook are captured in canonical session history. Use this hook for model-visible context that must remain part of future request prefixes; use prepare_provider_messages for provider-only transient rewrites. The runtime context injector is implemented as a built-in capability in this canonical pipeline.

Source

fn prepare_model_messages_with_context<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, state: &'life1 mut AgentRunState, _context: &'life2 mut AgentContext, messages: Vec<ModelMessage>, ) -> Pin<Box<dyn Future<Output = CapabilityResult<Vec<ModelMessage>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Context-aware model-message preparation hook.

Mutations from this hook are captured in canonical session history. Use this hook for model-visible context that must remain part of future request prefixes; use prepare_provider_messages_with_context for provider-only transient rewrites.

Source

fn prepare_provider_messages<'life0, 'life1, 'async_trait>( &'life0 self, _state: &'life1 mut AgentRunState, messages: Vec<ModelMessage>, ) -> Pin<Box<dyn Future<Output = CapabilityResult<Vec<ModelMessage>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Called after canonical model-message capabilities and durable history capture, before the model call.

Mutations from this hook are provider-bound only and are not copied back into the session message history.

Source

fn prepare_provider_messages_with_context<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, state: &'life1 mut AgentRunState, _context: &'life2 mut AgentContext, messages: Vec<ModelMessage>, ) -> Pin<Box<dyn Future<Output = CapabilityResult<Vec<ModelMessage>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Context-aware provider-bound message preparation hook.

Source

fn prepare_tools<'life0, 'life1, 'async_trait>( &'life0 self, _state: &'life1 AgentRunState, tools: Vec<ToolDefinition>, ) -> Pin<Box<dyn Future<Output = CapabilityResult<Vec<ToolDefinition>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Called after tool definitions are collected and before request parameters are finalized.

Source

fn prepare_tools_with_context<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, state: &'life1 AgentRunState, _context: &'life2 AgentContext, tools: Vec<ToolDefinition>, ) -> Pin<Box<dyn Future<Output = CapabilityResult<Vec<ToolDefinition>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Context-aware prepare-tools hook.

Source

fn before_model_request<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _state: &'life1 mut AgentRunState, _request: &'life2 mut ModelRequest, _settings: &'life3 mut Option<ModelSettings>, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Called after a request is prepared and before the model call.

Source

fn before_model_request_with_context<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, state: &'life1 mut AgentRunState, context: &'life2 mut AgentContext, request: &'life3 mut ModelRequest, settings: &'life4 mut Option<ModelSettings>, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Context-aware before-model-request hook.

Source

fn after_model_response<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _state: &'life1 mut AgentRunState, _response: &'life2 mut ModelResponse, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Called after a model response is received.

Source

fn before_tool_execution<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _state: &'life1 mut AgentRunState, _tool_context: &'life2 mut ToolContext, _call: &'life3 ToolCallPart, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Called before a tool call is executed.

Source

fn before_tool_execution_with_context<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, state: &'life1 mut AgentRunState, _context: &'life2 mut AgentContext, tool_context: &'life3 mut ToolContext, call: &'life4 ToolCallPart, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Context-aware before-tool-execution hook.

Source

fn after_tool_result<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _state: &'life1 mut AgentRunState, _call: &'life2 ToolCallPart, _tool_return: &'life3 mut ToolReturnPart, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Called after a tool result is produced and before it is applied to run state.

Source

fn after_tool_result_with_context<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, state: &'life1 mut AgentRunState, _context: &'life2 mut AgentContext, call: &'life3 ToolCallPart, tool_return: &'life4 mut ToolReturnPart, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Context-aware after-tool-result hook.

Source

fn after_model_response_with_context<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, state: &'life1 mut AgentRunState, context: &'life2 mut AgentContext, response: &'life3 mut ModelResponse, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Context-aware after-model-response hook.

Source

fn before_output_validation<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _state: &'life1 mut AgentRunState, _output: &'life2 str, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Called before final output validation begins.

Source

fn before_output_validation_with_context<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, state: &'life1 mut AgentRunState, _context: &'life2 mut AgentContext, output: &'life3 str, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Context-aware before-output-validation hook.

Source

fn validate_output<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _state: &'life1 mut AgentRunState, _output: &'life2 str, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Called after output text is selected and before finalization.

Source

fn validate_output_with_context<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, state: &'life1 mut AgentRunState, context: &'life2 mut AgentContext, output: &'life3 str, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Context-aware output validation hook.

Source

fn after_output_validation<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _state: &'life1 mut AgentRunState, _output: &'life2 str, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Called after output validation accepts the output.

Source

fn after_output_validation_with_context<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, state: &'life1 mut AgentRunState, _context: &'life2 mut AgentContext, output: &'life3 str, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Context-aware after-output-validation hook.

Source

fn on_checkpoint<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _state: &'life1 AgentRunState, _checkpoint: &'life2 AgentCheckpoint, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Called after an executor checkpoint is emitted.

Source

fn on_checkpoint_with_context<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, state: &'life1 AgentRunState, _context: &'life2 AgentContext, checkpoint: &'life3 AgentCheckpoint, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Context-aware checkpoint hook.

Source

fn on_retry<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _state: &'life1 mut AgentRunState, _kind: RetryEventKind, _retries: usize, _message: &'life2 str, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Called when semantic retry is scheduled.

Source

fn on_stream_event<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _state: &'life1 AgentRunState, _event: &'life2 AgentStreamRecord, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Called after a stream event is recorded.

Source

fn on_stream_event_with_context<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, state: &'life1 AgentRunState, _context: &'life2 AgentContext, event: &'life3 AgentStreamRecord, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Context-aware stream observer hook.

Source

fn on_retry_with_context<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, state: &'life1 mut AgentRunState, _context: &'life2 mut AgentContext, kind: RetryEventKind, retries: usize, message: &'life3 str, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Context-aware retry hook.

Source

fn on_run_complete<'life0, 'life1, 'async_trait>( &'life0 self, _state: &'life1 mut AgentRunState, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Called when a run completes.

Source

fn on_run_complete_with_context<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, state: &'life1 mut AgentRunState, context: &'life2 mut AgentContext, ) -> Pin<Box<dyn Future<Output = CapabilityResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Context-aware run-complete hook.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§