pub struct AnthropicModelClient { /* private fields */ }Implementations§
Source§impl AnthropicModelClient
impl AnthropicModelClient
pub fn new(config: AnthropicConfig) -> Self
Trait Implementations§
Source§impl Clone for AnthropicModelClient
impl Clone for AnthropicModelClient
Source§fn clone(&self) -> AnthropicModelClient
fn clone(&self) -> AnthropicModelClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AnthropicModelClient
impl Debug for AnthropicModelClient
Source§impl ModelClient for AnthropicModelClient
impl ModelClient for AnthropicModelClient
Source§fn stream<'life0, 'async_trait>(
&'life0 self,
input: ModelTurnInput,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'static, Result<ModelChunk, ModelClientError>>, ModelClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stream<'life0, 'async_trait>(
&'life0 self,
input: ModelTurnInput,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'static, Result<ModelChunk, ModelClientError>>, ModelClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stream the model’s response as a sequence of
ModelChunks. Production
ScriptedModelClient / OpenAiCompatibleModelClient implement this;
next() is provided as a folding convenience for callers that don’t
need token-level events.Source§fn next<'life0, 'async_trait>(
&'life0 self,
input: ModelTurnInput,
) -> Pin<Box<dyn Future<Output = Result<ModelResponse, ModelClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn next<'life0, 'async_trait>(
&'life0 self,
input: ModelTurnInput,
) -> Pin<Box<dyn Future<Output = Result<ModelResponse, ModelClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Buffer the stream into a single
ModelResponse. Default impl
awaits every chunk and then runs collect_model_response. Override
only if a provider has a cheaper non-streaming path (none today —
even OpenAI’s non-stream call still goes through the same SSE-or-not
branch on our side).Auto Trait Implementations§
impl !RefUnwindSafe for AnthropicModelClient
impl !UnwindSafe for AnthropicModelClient
impl Freeze for AnthropicModelClient
impl Send for AnthropicModelClient
impl Sync for AnthropicModelClient
impl Unpin for AnthropicModelClient
impl UnsafeUnpin for AnthropicModelClient
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