Skip to main content

AgentService

Trait AgentService 

Source
pub trait AgentService {
    // Required methods
    fn models(&self) -> Result<Value>;
    fn send(&self, conversation: &str, text: &str) -> Result<u64>;
    fn cancel(&self, stream: u64);
}
Expand description

Models and the agent (agent.use). Tools run in the host after a host-drawn approval; replies stream back as agent.stream chunks.

Required Methods§

Source

fn models(&self) -> Result<Value>

Source

fn send(&self, conversation: &str, text: &str) -> Result<u64>

Start a turn; returns a stream id.

Source

fn cancel(&self, stream: u64)

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§