pub struct LlmClient { /* private fields */ }Implementations§
Source§impl LlmClient
impl LlmClient
Sourcepub fn from_config(
config: &RobitConfig,
profile_name: Option<&str>,
) -> Result<Self, LlmError>
pub fn from_config( config: &RobitConfig, profile_name: Option<&str>, ) -> Result<Self, LlmError>
Create a new LlmClient from loaded configuration.
profile_name: which profile to use. If None, uses the default profile.
Sourcepub async fn chat_stream(
&self,
messages: Vec<ChatCompletionRequestMessage>,
tools: Option<Vec<ChatCompletionTools>>,
) -> Result<ChatCompletionResponseStream, LlmError>
pub async fn chat_stream( &self, messages: Vec<ChatCompletionRequestMessage>, tools: Option<Vec<ChatCompletionTools>>, ) -> Result<ChatCompletionResponseStream, LlmError>
Streaming chat completion. Returns an async stream of response chunks.
Sourcepub async fn chat(
&self,
messages: Vec<ChatCompletionRequestMessage>,
tools: Option<Vec<ChatCompletionTools>>,
) -> Result<CreateChatCompletionResponse, LlmError>
pub async fn chat( &self, messages: Vec<ChatCompletionRequestMessage>, tools: Option<Vec<ChatCompletionTools>>, ) -> Result<CreateChatCompletionResponse, LlmError>
Non-streaming chat completion. Returns the full response.
Sourcepub fn resolved(&self) -> &ResolvedModel
pub fn resolved(&self) -> &ResolvedModel
Get the resolved model info.
Sourcepub fn supports_images(&self) -> bool
pub fn supports_images(&self) -> bool
Whether the current model supports image inputs.
Sourcepub fn supports_tools(&self) -> bool
pub fn supports_tools(&self) -> bool
Whether the current model supports tool calling.
Auto Trait Implementations§
impl !RefUnwindSafe for LlmClient
impl !UnwindSafe for LlmClient
impl Freeze for LlmClient
impl Send for LlmClient
impl Sync for LlmClient
impl Unpin for LlmClient
impl UnsafeUnpin 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