pub struct OxideClient { /* private fields */ }Expand description
LlmClient backed by openai-oxide (Responses API).
With oxide-ws feature: call connect_ws() to upgrade to WebSocket mode.
All subsequent calls go over persistent wss:// connection (-20-25% latency).
Implementations§
Source§impl OxideClient
impl OxideClient
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 OxideClient
impl LlmClient for OxideClient
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 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 OxideClient
impl !RefUnwindSafe for OxideClient
impl Send for OxideClient
impl Sync for OxideClient
impl Unpin for OxideClient
impl UnsafeUnpin for OxideClient
impl !UnwindSafe for OxideClient
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