pub struct AnthropicProvider { /* private fields */ }Expand description
Anthropic Messages provider.
Implementations§
Source§impl AnthropicProvider
impl AnthropicProvider
Sourcepub fn new(
base_url: impl Into<String>,
api_key: impl Into<String>,
max_concurrency: usize,
) -> Result<Self, ProviderError>
pub fn new( base_url: impl Into<String>, api_key: impl Into<String>, max_concurrency: usize, ) -> Result<Self, ProviderError>
Build a provider for base_url (e.g. https://api.anthropic.com),
authenticating with api_key and issuing at most max_concurrency
concurrent requests per batch.
§Errors
Returns ProviderError::Transport if the HTTP client cannot be built.
Trait Implementations§
Source§impl InferenceProvider for AnthropicProvider
impl InferenceProvider for AnthropicProvider
Source§fn infer_batch<'life0, 'async_trait>(
&'life0 self,
request: InferenceRequest,
) -> Pin<Box<dyn Future<Output = Result<InferenceResponse, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn infer_batch<'life0, 'async_trait>(
&'life0 self,
request: InferenceRequest,
) -> Pin<Box<dyn Future<Output = Result<InferenceResponse, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Run one batch of inputs through the model. Read more
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
Stable backend-kind identity for logging and the
laminar.ai_calls
log (e.g. anthropic, openai, local). Constant per implementor.Source§fn intrinsic_labels(&self, _model: &str) -> Option<Vec<String>>
fn intrinsic_labels(&self, _model: &str) -> Option<Vec<String>>
Classifier labels intrinsic to a model, discovered from its own metadata.
Returns
None for backends that have none (remote providers, embedding
models). A local classifier returns its config.json id2label once the
model is on disk — the seam that lets a lazily downloaded classifier score
without the labels having been known at startup. The default is None.Auto Trait Implementations§
impl Freeze for AnthropicProvider
impl !RefUnwindSafe for AnthropicProvider
impl Send for AnthropicProvider
impl Sync for AnthropicProvider
impl Unpin for AnthropicProvider
impl UnsafeUnpin for AnthropicProvider
impl !UnwindSafe for AnthropicProvider
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more