Skip to main content

SessionHost

Trait SessionHost 

Source
pub trait SessionHost: Send {
    // Required methods
    fn prepare_round<'a>(
        &'a mut self,
        round: u64,
    ) -> HostFuture<'a, RoundPreparation>;
    fn record<'a>(&'a mut self, event: SessionEvent) -> HostFuture<'a, ()>;
    fn execute_tool<'a>(
        &'a mut self,
        call: Result<ToolCall>,
        provider_operation_id: Uuid,
    ) -> HostFuture<'a, SessionToolOutcome>;
    fn complete_capture<'a>(
        &'a mut self,
        capture: Value,
        contents: String,
    ) -> HostFuture<'a, SessionControl>;
    fn complete_round<'a>(
        &'a mut self,
        completion: RoundCompletion,
    ) -> HostFuture<'a, SessionControl>;
}
Expand description

Application-owned semantics invoked by the primary agent runtime.

Required Methods§

Source

fn prepare_round<'a>( &'a mut self, round: u64, ) -> HostFuture<'a, RoundPreparation>

Prepares the complete context and runtime selection for one provider round.

Source

fn record<'a>(&'a mut self, event: SessionEvent) -> HostFuture<'a, ()>

Records one provider-protocol fact and durably checkpoints its effects.

Source

fn execute_tool<'a>( &'a mut self, call: Result<ToolCall>, provider_operation_id: Uuid, ) -> HostFuture<'a, SessionToolOutcome>

Executes and durably projects one parsed or invalid application tool call.

Source

fn complete_capture<'a>( &'a mut self, capture: Value, contents: String, ) -> HostFuture<'a, SessionControl>

Completes an opaque freeform capture requested by a prior tool result.

Source

fn complete_round<'a>( &'a mut self, completion: RoundCompletion, ) -> HostFuture<'a, SessionControl>

Applies the terminal provider answer and decides whether another round is needed.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§