pub struct MessagesClient<'a> { /* private fields */ }Expand description
Domain client for Anthropic-compatible Messages API.
Implementations§
Source§impl<'a> MessagesClient<'a>
impl<'a> MessagesClient<'a>
Sourcepub async fn create(
&self,
request: &AnthropicMessagesRequest,
) -> Result<AnthropicMessagesResponse, OpenRouterError>
pub async fn create( &self, request: &AnthropicMessagesRequest, ) -> Result<AnthropicMessagesResponse, OpenRouterError>
Create a non-streaming message (POST /messages).
Sourcepub async fn stream(
&self,
request: &AnthropicMessagesRequest,
) -> Result<BoxStream<'static, Result<AnthropicMessagesSseEvent, OpenRouterError>>, OpenRouterError>
pub async fn stream( &self, request: &AnthropicMessagesRequest, ) -> Result<BoxStream<'static, Result<AnthropicMessagesSseEvent, OpenRouterError>>, OpenRouterError>
Stream SSE events from /messages.
Sourcepub async fn stream_unified(
&self,
request: &AnthropicMessagesRequest,
) -> Result<UnifiedStream, OpenRouterError>
pub async fn stream_unified( &self, request: &AnthropicMessagesRequest, ) -> Result<UnifiedStream, OpenRouterError>
Stream messages events using the unified stream abstraction.
Trait Implementations§
Source§impl<'a> Clone for MessagesClient<'a>
impl<'a> Clone for MessagesClient<'a>
Source§fn clone(&self) -> MessagesClient<'a>
fn clone(&self) -> MessagesClient<'a>
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 moreimpl<'a> Copy for MessagesClient<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for MessagesClient<'a>
impl<'a> !UnwindSafe for MessagesClient<'a>
impl<'a> Freeze for MessagesClient<'a>
impl<'a> Send for MessagesClient<'a>
impl<'a> Sync for MessagesClient<'a>
impl<'a> Unpin for MessagesClient<'a>
impl<'a> UnsafeUnpin for MessagesClient<'a>
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