pub struct AnthropicDriver { /* private fields */ }Expand description
Anthropic Messages API driver.
Implementations§
Source§impl AnthropicDriver
impl AnthropicDriver
pub fn new( provider_id: impl Into<String>, capabilities: Vec<Capability>, ) -> AnthropicDriver
Trait Implementations§
Source§impl Debug for AnthropicDriver
impl Debug for AnthropicDriver
Source§impl ProviderDriver for AnthropicDriver
impl ProviderDriver for AnthropicDriver
Source§fn provider_id(&self) -> &str
fn provider_id(&self) -> &str
Unique provider identifier (matches manifest
id).Source§fn build_request(
&self,
messages: &[Message],
model: &str,
temperature: Option<f64>,
max_tokens: Option<u32>,
stream: bool,
extra: Option<&Value>,
) -> Result<DriverRequest, Error>
fn build_request( &self, messages: &[Message], model: &str, temperature: Option<f64>, max_tokens: Option<u32>, stream: bool, extra: Option<&Value>, ) -> Result<DriverRequest, Error>
Build a provider-specific HTTP request from unified parameters.
Source§fn parse_response(&self, body: &Value) -> Result<DriverResponse, Error>
fn parse_response(&self, body: &Value) -> Result<DriverResponse, Error>
Parse a non-streaming response into unified format.
Source§fn parse_stream_event(
&self,
data: &str,
) -> Result<Option<StreamingEvent>, Error>
fn parse_stream_event( &self, data: &str, ) -> Result<Option<StreamingEvent>, Error>
Parse a single streaming event from raw SSE/NDJSON data.
Source§fn supported_capabilities(&self) -> &[Capability]
fn supported_capabilities(&self) -> &[Capability]
Get the list of capabilities this driver supports.
Source§fn is_stream_done(&self, _data: &str) -> bool
fn is_stream_done(&self, _data: &str) -> bool
Check if the done signal has been received in streaming.
Auto Trait Implementations§
impl Freeze for AnthropicDriver
impl RefUnwindSafe for AnthropicDriver
impl Send for AnthropicDriver
impl Sync for AnthropicDriver
impl Unpin for AnthropicDriver
impl UnsafeUnpin for AnthropicDriver
impl UnwindSafe for AnthropicDriver
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