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§
Sourcefn respond<'a>(
&'a self,
request: ModelRequest<'a>,
events: ModelEventSink,
) -> BoxFuture<'a, Result<ModelOutput>>
fn respond<'a>( &'a self, request: ModelRequest<'a>, events: ModelEventSink, ) -> BoxFuture<'a, Result<ModelOutput>>
Produces one streamed response.
Provided Methods§
Sourcefn supports_image_input(&self) -> bool
fn supports_image_input(&self) -> bool
Reports whether this provider accepts native image input.
Sourcefn compaction_endpoint(&self) -> bool
fn compaction_endpoint(&self) -> bool
Reports whether this provider exposes a native compaction endpoint.
Sourcefn compact<'a>(
&'a self,
_request: CompactRequest<'a>,
) -> BoxFuture<'a, Result<CompactOutput>>
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".