pub struct CohereProvider { /* private fields */ }Expand description
Cohere API provider.
Supports Cohere’s chat API with tool calling capabilities.
Implementations§
Trait Implementations§
Source§impl LlmProvider for CohereProvider
impl LlmProvider for CohereProvider
Source§fn send_msg(
&self,
client: &HttpClient,
messages: &[Message],
options: &MessageOptions,
) -> Pin<Box<dyn Future<Output = Result<Message, LlmError>> + Send>>
fn send_msg( &self, client: &HttpClient, messages: &[Message], options: &MessageOptions, ) -> Pin<Box<dyn Future<Output = Result<Message, LlmError>> + Send>>
Send a message to the LLM.
Returns the assistant’s response message or an error.
Source§fn send_msg_stream(
&self,
client: &HttpClient,
messages: &[Message],
options: &MessageOptions,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<StreamEvent, LlmError>> + Send>>, LlmError>> + Send>>
fn send_msg_stream( &self, client: &HttpClient, messages: &[Message], options: &MessageOptions, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<StreamEvent, LlmError>> + Send>>, LlmError>> + Send>>
Send a streaming message to the LLM.
Returns a stream of events as they arrive from the API.
Auto Trait Implementations§
impl Freeze for CohereProvider
impl RefUnwindSafe for CohereProvider
impl Send for CohereProvider
impl Sync for CohereProvider
impl Unpin for CohereProvider
impl UnwindSafe for CohereProvider
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