Skip to main content

Host

Trait Host 

Source
pub trait Host: Send {
    // Required methods
    fn render_tool_call(&mut self, call: &ToolCall) -> Result<String>;
    fn execute_tool<'a>(
        &'a mut self,
        call: ToolCall,
        operation_id: Uuid,
        budget: ContextBudget,
    ) -> HostFuture<'a, ToolOutcome>;
    fn complete_capture<'a>(
        &'a mut self,
        capture: Value,
        contents: String,
        budget: ContextBudget,
    ) -> HostFuture<'a, ToolOutcome>;
    fn record(&mut self, event: AuditEvent) -> Result<()>;
}
Expand description

Application-owned behavior invoked by the generic subagent loop.

Required Methods§

Source

fn render_tool_call(&mut self, call: &ToolCall) -> Result<String>

Renders the retained invocation text before execution.

Source

fn execute_tool<'a>( &'a mut self, call: ToolCall, operation_id: Uuid, budget: ContextBudget, ) -> HostFuture<'a, ToolOutcome>

Executes one application tool.

Source

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

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

Source

fn record(&mut self, event: AuditEvent) -> Result<()>

Records one durable audit event selected by the runtime.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§