Skip to main content

AgentProvider

Trait AgentProvider 

Source
pub trait AgentProvider:
    Send
    + Sync
    + 'static {
Show 19 methods // Provided methods fn configure<'life0, 'life1, 'async_trait>( &'life0 self, _name: &'life1 str, _config: Map<String, Value>, ) -> Pin<Box<dyn Future<Output = ProviderResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn metadata(&self) -> Option<RuntimeMetadata> { ... } fn warnings(&self) -> Vec<String> { ... } fn health_check<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ProviderResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn start<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ProviderResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn close<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ProviderResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn create_session<'life0, 'async_trait>( &'life0 self, _request: CreateAgentProviderSessionRequest, ) -> Pin<Box<dyn Future<Output = ProviderResult<AgentSession>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn get_session<'life0, 'async_trait>( &'life0 self, _request: GetAgentProviderSessionRequest, ) -> Pin<Box<dyn Future<Output = ProviderResult<AgentSession>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn list_sessions<'life0, 'async_trait>( &'life0 self, _request: ListAgentProviderSessionsRequest, ) -> Pin<Box<dyn Future<Output = ProviderResult<ListAgentProviderSessionsResponse>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn update_session<'life0, 'async_trait>( &'life0 self, _request: UpdateAgentProviderSessionRequest, ) -> Pin<Box<dyn Future<Output = ProviderResult<AgentSession>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn create_turn<'life0, 'async_trait>( &'life0 self, _request: CreateAgentProviderTurnRequest, ) -> Pin<Box<dyn Future<Output = ProviderResult<AgentTurn>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn get_turn<'life0, 'async_trait>( &'life0 self, _request: GetAgentProviderTurnRequest, ) -> Pin<Box<dyn Future<Output = ProviderResult<AgentTurn>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn list_turns<'life0, 'async_trait>( &'life0 self, _request: ListAgentProviderTurnsRequest, ) -> Pin<Box<dyn Future<Output = ProviderResult<ListAgentProviderTurnsResponse>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn cancel_turn<'life0, 'async_trait>( &'life0 self, _request: CancelAgentProviderTurnRequest, ) -> Pin<Box<dyn Future<Output = ProviderResult<AgentTurn>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn list_turn_events<'life0, 'async_trait>( &'life0 self, _request: ListAgentProviderTurnEventsRequest, ) -> Pin<Box<dyn Future<Output = ProviderResult<ListAgentProviderTurnEventsResponse>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn get_interaction<'life0, 'async_trait>( &'life0 self, _request: GetAgentProviderInteractionRequest, ) -> Pin<Box<dyn Future<Output = ProviderResult<AgentInteraction>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn list_interactions<'life0, 'async_trait>( &'life0 self, _request: ListAgentProviderInteractionsRequest, ) -> Pin<Box<dyn Future<Output = ProviderResult<ListAgentProviderInteractionsResponse>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn resolve_interaction<'life0, 'async_trait>( &'life0 self, _request: ResolveAgentProviderInteractionRequest, ) -> Pin<Box<dyn Future<Output = ProviderResult<AgentInteraction>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn get_capabilities<'life0, 'async_trait>( &'life0 self, _request: GetAgentProviderCapabilitiesRequest, ) -> Pin<Box<dyn Future<Output = ProviderResult<AgentProviderCapabilities>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... }
}
Expand description

Provider trait for serving the Gestalt agent-provider protocol.

Provided Methods§

Source

fn configure<'life0, 'life1, 'async_trait>( &'life0 self, _name: &'life1 str, _config: Map<String, Value>, ) -> Pin<Box<dyn Future<Output = ProviderResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Configures the provider before it starts serving requests.

Source

fn metadata(&self) -> Option<RuntimeMetadata>

Returns runtime metadata that should augment the static manifest.

Source

fn warnings(&self) -> Vec<String>

Returns non-fatal warnings the host should surface to users.

Source

fn health_check<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ProviderResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Performs an optional health check.

Source

fn start<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ProviderResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Starts provider-owned background work after configuration.

Source

fn close<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ProviderResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Shuts the provider down before the runtime exits.

Source

fn create_session<'life0, 'async_trait>( &'life0 self, _request: CreateAgentProviderSessionRequest, ) -> Pin<Box<dyn Future<Output = ProviderResult<AgentSession>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Creates or idempotently returns an agent session.

Mints the session id returned on the AgentSession. Must be idempotent on idempotency_key scoped per subject (context.subject.id); an empty key always creates.

Source

fn get_session<'life0, 'async_trait>( &'life0 self, _request: GetAgentProviderSessionRequest, ) -> Pin<Box<dyn Future<Output = ProviderResult<AgentSession>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns one agent session by ID.

Source

fn list_sessions<'life0, 'async_trait>( &'life0 self, _request: ListAgentProviderSessionsRequest, ) -> Pin<Box<dyn Future<Output = ProviderResult<ListAgentProviderSessionsResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Lists agent sessions visible to the request subject.

Source

fn update_session<'life0, 'async_trait>( &'life0 self, _request: UpdateAgentProviderSessionRequest, ) -> Pin<Box<dyn Future<Output = ProviderResult<AgentSession>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Updates mutable agent session metadata or state.

Source

fn create_turn<'life0, 'async_trait>( &'life0 self, _request: CreateAgentProviderTurnRequest, ) -> Pin<Box<dyn Future<Output = ProviderResult<AgentTurn>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Starts or idempotently returns an agent turn.

Source

fn get_turn<'life0, 'async_trait>( &'life0 self, _request: GetAgentProviderTurnRequest, ) -> Pin<Box<dyn Future<Output = ProviderResult<AgentTurn>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns one agent turn by ID.

Source

fn list_turns<'life0, 'async_trait>( &'life0 self, _request: ListAgentProviderTurnsRequest, ) -> Pin<Box<dyn Future<Output = ProviderResult<ListAgentProviderTurnsResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Lists turns for a session or query.

Source

fn cancel_turn<'life0, 'async_trait>( &'life0 self, _request: CancelAgentProviderTurnRequest, ) -> Pin<Box<dyn Future<Output = ProviderResult<AgentTurn>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Requests cancellation of a running or pending turn.

Source

fn list_turn_events<'life0, 'async_trait>( &'life0 self, _request: ListAgentProviderTurnEventsRequest, ) -> Pin<Box<dyn Future<Output = ProviderResult<ListAgentProviderTurnEventsResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Lists ordered events emitted by a turn.

Source

fn get_interaction<'life0, 'async_trait>( &'life0 self, _request: GetAgentProviderInteractionRequest, ) -> Pin<Box<dyn Future<Output = ProviderResult<AgentInteraction>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns one pending or resolved interaction.

Source

fn list_interactions<'life0, 'async_trait>( &'life0 self, _request: ListAgentProviderInteractionsRequest, ) -> Pin<Box<dyn Future<Output = ProviderResult<ListAgentProviderInteractionsResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Lists interactions associated with a turn.

Source

fn resolve_interaction<'life0, 'async_trait>( &'life0 self, _request: ResolveAgentProviderInteractionRequest, ) -> Pin<Box<dyn Future<Output = ProviderResult<AgentInteraction>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Records a response to a pending interaction.

Source

fn get_capabilities<'life0, 'async_trait>( &'life0 self, _request: GetAgentProviderCapabilitiesRequest, ) -> Pin<Box<dyn Future<Output = ProviderResult<AgentProviderCapabilities>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the provider’s supported agent features.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§