pub trait Model: Send + Sync {
// Required methods
fn config(&self) -> &ModelConfig;
fn update_config(&mut self, config: ModelConfig);
fn stream<'a>(
&'a self,
messages: &'a [Message],
tool_specs: Option<&'a [ToolSpec]>,
system_prompt: Option<&'a str>,
tool_choice: Option<ToolChoice>,
system_prompt_content: Option<&'a [SystemContentBlock]>,
) -> StreamEventStream<'a>;
}Expand description
Trait for model implementations.
Required Methods§
Sourcefn config(&self) -> &ModelConfig
fn config(&self) -> &ModelConfig
Returns the model configuration.
Sourcefn update_config(&mut self, config: ModelConfig)
fn update_config(&mut self, config: ModelConfig)
Updates the model configuration.
Sourcefn stream<'a>(
&'a self,
messages: &'a [Message],
tool_specs: Option<&'a [ToolSpec]>,
system_prompt: Option<&'a str>,
tool_choice: Option<ToolChoice>,
system_prompt_content: Option<&'a [SystemContentBlock]>,
) -> StreamEventStream<'a>
fn stream<'a>( &'a self, messages: &'a [Message], tool_specs: Option<&'a [ToolSpec]>, system_prompt: Option<&'a str>, tool_choice: Option<ToolChoice>, system_prompt_content: Option<&'a [SystemContentBlock]>, ) -> StreamEventStream<'a>
Streams a response from the model.