Skip to main content

GoalCapability

Struct GoalCapability 

Source
pub struct GoalCapability { /* private fields */ }
Expand description

Runtime capability that keeps /goal inside the agent output retry loop.

Implementations§

Source§

impl GoalCapability

Source

pub fn new(options: GoalRunOptions) -> Self

Create a goal-mode capability.

Trait Implementations§

Source§

impl AgentCapability for GoalCapability

Source§

fn spec(&self) -> CapabilitySpec

Stable capability spec used for ordering and reconstruction evidence.
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 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 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 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. Read more
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. Read more
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. Read more
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 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.
Source§

impl Debug for GoalCapability

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more