Skip to main content

HeadlessTurnProvider

Trait HeadlessTurnProvider 

Source
pub trait HeadlessTurnProvider: LlmProvider {
    // Required methods
    fn converse<'life0, 'life1, 'async_trait>(
        &'life0 self,
        request: &'life1 ChatRequest,
    ) -> Pin<Box<dyn Future<Output = Result<HeadlessToolResponse, RunnerError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn converse_stream<'life0, 'life1, 'async_trait>(
        &'life0 self,
        request: &'life1 ChatRequest,
    ) -> Pin<Box<dyn Future<Output = Result<HeadlessEventStream, RunnerError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A provider whose runtime executes tools itself during a turn.

LlmProvider::complete hides the tool activity inside a plain response; these two methods expose it, so a host that hands the runtime an MCP surface on each ChatRequest can observe what was called.

Required Methods§

Source

fn converse<'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 ChatRequest, ) -> Pin<Box<dyn Future<Output = Result<HeadlessToolResponse, RunnerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Run a conversation turn and return detailed results including tool call metadata.

Source

fn converse_stream<'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 ChatRequest, ) -> Pin<Box<dyn Future<Output = Result<HeadlessEventStream, RunnerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Run a conversation turn, streaming text deltas and tool-call observations as they happen, ending with HeadlessStreamEvent::Done.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§