pub struct OxideChatClient { /* private fields */ }Expand description
LlmClient backed by openai-oxide Chat Completions API.
Implementations§
Source§impl OxideChatClient
impl OxideChatClient
Sourcepub fn from_config(config: &LlmConfig) -> Result<Self, SgrError>
pub fn from_config(config: &LlmConfig) -> Result<Self, SgrError>
Create from LlmConfig.
Trait Implementations§
Source§impl LlmClient for OxideChatClient
impl LlmClient for OxideChatClient
Source§fn structured_call<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
schema: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<(Option<Value>, Vec<ToolCall>, String), SgrError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn structured_call<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
schema: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<(Option<Value>, Vec<ToolCall>, String), SgrError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Structured call: send messages with schema injected into system prompt.
Returns (parsed_output, native_tool_calls, raw_text).
Source§fn tools_call<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
tools: &'life2 [ToolDef],
) -> Pin<Box<dyn Future<Output = Result<Vec<ToolCall>, SgrError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn tools_call<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
tools: &'life2 [ToolDef],
) -> Pin<Box<dyn Future<Output = Result<Vec<ToolCall>, SgrError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Native function calling: send messages + tool defs, get tool calls.
This is STATELESS — no side effects on shared state.
Source§fn complete<'life0, 'life1, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
) -> Pin<Box<dyn Future<Output = Result<String, SgrError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn complete<'life0, 'life1, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
) -> Pin<Box<dyn Future<Output = Result<String, SgrError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Plain text completion (no schema, no tools).
Source§fn tools_call_stateful<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
tools: &'life2 [ToolDef],
_previous_response_id: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<(Vec<ToolCall>, Option<String>), SgrError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn tools_call_stateful<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
tools: &'life2 [ToolDef],
_previous_response_id: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<(Vec<ToolCall>, Option<String>), SgrError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Stateful function calling with explicit response_id for chaining.
Returns (tool_calls, new_response_id).
When previous_response_id is Some, only delta messages are needed.
Auto Trait Implementations§
impl Freeze for OxideChatClient
impl !RefUnwindSafe for OxideChatClient
impl Send for OxideChatClient
impl Sync for OxideChatClient
impl Unpin for OxideChatClient
impl UnsafeUnpin for OxideChatClient
impl !UnwindSafe for OxideChatClient
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