Skip to main content

PolicyLlmClient

Trait PolicyLlmClient 

Source
pub trait PolicyLlmClient: Send + Sync {
    // Required method
    fn chat<'a>(
        &'a self,
        messages: &'a [PolicyMessage],
    ) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'a>>;
}
Expand description

Trait for sending chat messages to the policy LLM.

Implemented externally (e.g. in runner.rs on a newtype wrapping Arc<AnyProvider>). zeph-tools defines the usage; zeph-common defines the contract, keeping both crates decoupled from zeph-llm.

Required Methods§

Source

fn chat<'a>( &'a self, messages: &'a [PolicyMessage], ) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'a>>

Send a sequence of messages and return the assistant’s text response.

§Errors

Returns Err(String) if the LLM call fails (network error, timeout, etc.).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§