Skip to main content

Model

Trait Model 

Source
pub trait Model: Send + Sync {
    // Required method
    fn respond<'a>(
        &'a self,
        request: ModelRequest<'a>,
        events: ModelEventSink,
    ) -> BoxFuture<'a, Result<ModelOutput>>;

    // Provided methods
    fn info(&self) -> ModelInfo { ... }
    fn supports_image_input(&self) -> bool { ... }
    fn compaction_endpoint(&self) -> bool { ... }
    fn compact<'a>(
        &'a self,
        _request: CompactRequest<'a>,
    ) -> BoxFuture<'a, Result<CompactOutput>> { ... }
}
Expand description

A model provider Adapter used by the agent loop.

Required Methods§

Source

fn respond<'a>( &'a self, request: ModelRequest<'a>, events: ModelEventSink, ) -> BoxFuture<'a, Result<ModelOutput>>

Produces one streamed response.

Provided Methods§

Source

fn info(&self) -> ModelInfo

Returns stable display metadata without exposing credentials.

Source

fn supports_image_input(&self) -> bool

Reports whether this provider accepts native image input.

Source

fn compaction_endpoint(&self) -> bool

Reports whether this provider exposes a native compaction endpoint.

Source

fn compact<'a>( &'a self, _request: CompactRequest<'a>, ) -> BoxFuture<'a, Result<CompactOutput>>

Calls the native compaction endpoint when advertised.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§