pub struct RemoteLLMClient { /* private fields */ }Expand description
A client for interacting with a remote LLM.
Implementations§
Source§impl RemoteLLMClient
impl RemoteLLMClient
Sourcepub async fn chat(
&self,
messages: Vec<ChatMessage>,
tools: Option<Vec<ToolDefinition>>,
temperature: Option<f32>,
max_tokens: Option<u32>,
stop: Option<Vec<String>>,
) -> Result<ChatMessage>
pub async fn chat( &self, messages: Vec<ChatMessage>, tools: Option<Vec<ToolDefinition>>, temperature: Option<f32>, max_tokens: Option<u32>, stop: Option<Vec<String>>, ) -> Result<ChatMessage>
Sends a chat request to the remote LLM.
Sourcepub async fn chat_stream<F>(
&self,
messages: Vec<ChatMessage>,
tools: Option<Vec<ToolDefinition>>,
temperature: Option<f32>,
max_tokens: Option<u32>,
stop: Option<Vec<String>>,
on_chunk: F,
) -> Result<ChatMessage>
pub async fn chat_stream<F>( &self, messages: Vec<ChatMessage>, tools: Option<Vec<ToolDefinition>>, temperature: Option<f32>, max_tokens: Option<u32>, stop: Option<Vec<String>>, on_chunk: F, ) -> Result<ChatMessage>
Sends a streaming chat request to the remote LLM.
Trait Implementations§
Source§impl LLMProvider for RemoteLLMClient
impl LLMProvider for RemoteLLMClient
Source§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,
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,
Generates a response from the LLM.
Auto Trait Implementations§
impl Freeze for RemoteLLMClient
impl !RefUnwindSafe for RemoteLLMClient
impl Send for RemoteLLMClient
impl Sync for RemoteLLMClient
impl Unpin for RemoteLLMClient
impl !UnwindSafe for RemoteLLMClient
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