pub struct ChatOpenAICompatible { /* private fields */ }Expand description
OpenAI-compatible Chat Model base implementation
Implementations§
Trait Implementations§
Source§impl BaseChatModel for ChatOpenAICompatible
impl BaseChatModel for ChatOpenAICompatible
Source§fn context_window(&self) -> Option<u64>
fn context_window(&self) -> Option<u64>
Get the context window size (max input tokens)
Source§fn invoke<'life0, 'async_trait>(
&'life0 self,
messages: Vec<Message>,
tools: Option<Vec<ToolDefinition>>,
tool_choice: Option<ToolChoice>,
) -> Pin<Box<dyn Future<Output = Result<ChatCompletion, LlmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn invoke<'life0, 'async_trait>(
&'life0 self,
messages: Vec<Message>,
tools: Option<Vec<ToolDefinition>>,
tool_choice: Option<ToolChoice>,
) -> Pin<Box<dyn Future<Output = Result<ChatCompletion, LlmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Invoke the model with messages
Source§fn invoke_stream<'life0, 'async_trait>(
&'life0 self,
messages: Vec<Message>,
tools: Option<Vec<ToolDefinition>>,
tool_choice: Option<ToolChoice>,
) -> Pin<Box<dyn Future<Output = Result<ChatStream, LlmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn invoke_stream<'life0, 'async_trait>(
&'life0 self,
messages: Vec<Message>,
tools: Option<Vec<ToolDefinition>>,
tool_choice: Option<ToolChoice>,
) -> Pin<Box<dyn Future<Output = Result<ChatStream, LlmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Invoke the model with streaming response
Source§fn supports_vision(&self) -> bool
fn supports_vision(&self) -> bool
Check if the model supports vision
Source§fn count_tokens<'life0, 'life1, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
) -> Pin<Box<dyn Future<Output = u64> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn count_tokens<'life0, 'life1, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
) -> Pin<Box<dyn Future<Output = u64> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Count tokens in messages (approximate)
Source§fn supports_tools(&self) -> bool
fn supports_tools(&self) -> bool
Check if the model supports tools
Source§fn supports_streaming(&self) -> bool
fn supports_streaming(&self) -> bool
Check if the model supports streaming
Source§impl Clone for ChatOpenAICompatible
impl Clone for ChatOpenAICompatible
Source§fn clone(&self) -> ChatOpenAICompatible
fn clone(&self) -> ChatOpenAICompatible
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ChatOpenAICompatible
impl !RefUnwindSafe for ChatOpenAICompatible
impl Send for ChatOpenAICompatible
impl Sync for ChatOpenAICompatible
impl Unpin for ChatOpenAICompatible
impl UnsafeUnpin for ChatOpenAICompatible
impl !UnwindSafe for ChatOpenAICompatible
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