Skip to main content

DirectCompletionHost

Trait DirectCompletionHost 

Source
pub trait DirectCompletionHost: Send + Sync {
    // Provided methods
    fn direct_completion<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _request: DirectRequest,
        _usage_source: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<DirectCompletion, PluginError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn direct_llm_completion<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _request: LlmRequest,
        _usage_source: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<DirectLlmCompletion, PluginError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}

Provided Methods§

Source

fn direct_completion<'life0, 'life1, 'async_trait>( &'life0 self, _request: DirectRequest, _usage_source: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<DirectCompletion, PluginError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Make a single LLM call without creating a full session. Used by plugins for structured extraction, summarization, observation, and other one-shot calls that don’t need tools, turn loops, or session state. The usage_source label tags the resulting token cost in the parent session’s ledger.

Source

fn direct_llm_completion<'life0, 'life1, 'async_trait>( &'life0 self, _request: LlmRequest, _usage_source: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<DirectLlmCompletion, PluginError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§