pub trait Provider: Send + Sync {
// Required method
fn stream<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
model: &'life1 str,
system_prompt: &'life2 str,
messages: &'life3 [AgentMessage],
tools: &'life4 [ToolDef],
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = StreamEvent> + Send>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait;
// Provided method
fn set_reasoning_effort(&self, _level: Option<&str>) { ... }
}Expand description
The one thing the agent loop needs from a provider.
Required Methods§
fn stream<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
model: &'life1 str,
system_prompt: &'life2 str,
messages: &'life3 [AgentMessage],
tools: &'life4 [ToolDef],
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = StreamEvent> + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Provided Methods§
Sourcefn set_reasoning_effort(&self, _level: Option<&str>)
fn set_reasoning_effort(&self, _level: Option<&str>)
Update reasoning effort (thinking level) at runtime. Default implementation is a no-op for providers that don’t support this.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".