pub struct LlmClientAdapter { /* private fields */ }Expand description
Bridges an LlmClient to the StreamClient trait.
Wraps an Arc<dyn LlmClient> so existing provider implementations
can be used with the new StreamClient-based engine.
Implementations§
Trait Implementations§
Source§impl StreamClient for LlmClientAdapter
impl StreamClient for LlmClientAdapter
Source§fn chat<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
messages: &'life1 [ChatMessage],
tools: &'life2 [Value],
reasoning: Option<&'life3 ReasoningConfig>,
response_format: Option<&'life4 ResponseFormat>,
) -> Pin<Box<dyn Future<Output = AgentResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn chat<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
messages: &'life1 [ChatMessage],
tools: &'life2 [Value],
reasoning: Option<&'life3 ReasoningConfig>,
response_format: Option<&'life4 ResponseFormat>,
) -> Pin<Box<dyn Future<Output = AgentResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Delegate to the inner client’s chat() for efficiency — avoids
streaming when only the final text is needed.
Source§fn stream<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
messages: &'life1 [ChatMessage],
tools: &'life2 [Value],
reasoning: Option<&'life3 ReasoningConfig>,
response_format: Option<&'life4 ResponseFormat>,
) -> Pin<Box<dyn Future<Output = AgentResult<Pin<Box<dyn Stream<Item = AgentResult<StreamChunk>> + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn stream<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
messages: &'life1 [ChatMessage],
tools: &'life2 [Value],
reasoning: Option<&'life3 ReasoningConfig>,
response_format: Option<&'life4 ResponseFormat>,
) -> Pin<Box<dyn Future<Output = AgentResult<Pin<Box<dyn Stream<Item = AgentResult<StreamChunk>> + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Stream LLM response chunks from the provider. Read more
Source§fn capabilities(&self) -> LlmCapabilities
fn capabilities(&self) -> LlmCapabilities
Return the provider’s capabilities.
Source§fn model_name(&self) -> &str
fn model_name(&self) -> &str
The model name used by this client (e.g. “claude-sonnet”, “gpt-4o”).
Default: “unknown”.
Auto Trait Implementations§
impl !RefUnwindSafe for LlmClientAdapter
impl !UnwindSafe for LlmClientAdapter
impl Freeze for LlmClientAdapter
impl Send for LlmClientAdapter
impl Sync for LlmClientAdapter
impl Unpin for LlmClientAdapter
impl UnsafeUnpin for LlmClientAdapter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more