pub trait Brain: Send + Sync {
// Required methods
fn id(&self) -> &str;
fn caps(&self) -> ModelCaps;
fn complete<'life0, 'async_trait>(
&'life0 self,
req: BrainRequest,
) -> Pin<Box<dyn Future<Output = Result<BrainStream>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Uniform interface over every model vendor. Normalizes messages, streaming, and tool-calling so the rest of the system is vendor-agnostic.
Required Methods§
Sourcefn complete<'life0, 'async_trait>(
&'life0 self,
req: BrainRequest,
) -> Pin<Box<dyn Future<Output = Result<BrainStream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn complete<'life0, 'async_trait>(
&'life0 self,
req: BrainRequest,
) -> Pin<Box<dyn Future<Output = Result<BrainStream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stream a completion
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".