pub struct LlmClient { /* private fields */ }Expand description
Client for communicating with an LLM API.
Implementations§
Source§impl LlmClient
impl LlmClient
pub fn new(base_url: &str, api_key: &str, model: &str) -> Self
Sourcepub async fn stream_completion(
&self,
request: CompletionRequest<'_>,
) -> Result<Receiver<StreamEvent>, LlmError>
pub async fn stream_completion( &self, request: CompletionRequest<'_>, ) -> Result<Receiver<StreamEvent>, LlmError>
Stream a completion request, yielding StreamEvent values.
Auto Trait Implementations§
impl Freeze for LlmClient
impl !RefUnwindSafe for LlmClient
impl Send for LlmClient
impl Sync for LlmClient
impl Unpin for LlmClient
impl UnsafeUnpin 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