pub struct RetryClient<C: LlmClient> { /* private fields */ }Expand description
LLM client wrapper with automatic retry on transient errors.
Implementations§
Source§impl<C: LlmClient> RetryClient<C>
impl<C: LlmClient> RetryClient<C>
pub fn new(inner: C) -> Self
pub fn with_config(self, config: RetryConfig) -> Self
Trait Implementations§
Source§impl<C: LlmClient> LlmClient for RetryClient<C>
impl<C: LlmClient> LlmClient for RetryClient<C>
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.
Auto Trait Implementations§
impl<C> Freeze for RetryClient<C>where
C: Freeze,
impl<C> RefUnwindSafe for RetryClient<C>where
C: RefUnwindSafe,
impl<C> Send for RetryClient<C>
impl<C> Sync for RetryClient<C>
impl<C> Unpin for RetryClient<C>where
C: Unpin,
impl<C> UnsafeUnpin for RetryClient<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for RetryClient<C>where
C: UnwindSafe,
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