pub struct LLMClient { /* private fields */ }Implementations§
Source§impl LLMClient
impl LLMClient
pub async fn new(provider_type: LLMProviderType) -> Result<Self>
pub fn provider_type(&self) -> &LLMProviderType
Source§impl LLMClient
impl LLMClient
pub async fn chat( &self, messages: Vec<ChatMessage>, tools: Option<Vec<ToolDefinition>>, ) -> Result<ChatMessage>
pub async fn chat_stream<F>( &self, messages: Vec<ChatMessage>, tools: Option<Vec<ToolDefinition>>, on_chunk: F, ) -> Result<ChatMessage>
Trait Implementations§
Source§impl LLMProvider for LLMClient
impl LLMProvider for LLMClient
fn generate<'life0, 'async_trait>(
&'life0 self,
request: LLMRequest,
) -> Pin<Box<dyn Future<Output = Result<LLMResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl Freeze for LLMClient
impl !RefUnwindSafe for LLMClient
impl Send for LLMClient
impl Sync for LLMClient
impl Unpin for LLMClient
impl !UnwindSafe for LLMClient
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