pub struct RetryingModel<M> { /* private fields */ }Expand description
Wraps a CompletionModel, retrying transient failures on every call.
Implementations§
Source§impl<M> RetryingModel<M>
impl<M> RetryingModel<M>
Trait Implementations§
Source§impl<M: Clone> Clone for RetryingModel<M>
impl<M: Clone> Clone for RetryingModel<M>
Source§fn clone(&self) -> RetryingModel<M>
fn clone(&self) -> RetryingModel<M>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<M: CompletionModel> CompletionModel for RetryingModel<M>
impl<M: CompletionModel> CompletionModel for RetryingModel<M>
Source§type Response = <M as CompletionModel>::Response
type Response = <M as CompletionModel>::Response
The raw response type returned by the underlying completion model.
Source§type StreamingResponse = <M as CompletionModel>::StreamingResponse
type StreamingResponse = <M as CompletionModel>::StreamingResponse
The raw response type returned by the underlying completion model when streaming.
Source§type Client = <M as CompletionModel>::Client
type Client = <M as CompletionModel>::Client
Provider client type used to construct this model.
Source§fn make(client: &Self::Client, model: impl Into<String>) -> Self
fn make(client: &Self::Client, model: impl Into<String>) -> Self
Construct a model handle from a provider client and model identifier.
Source§async fn completion(
&self,
request: CompletionRequest,
) -> Result<CompletionResponse<Self::Response>, CompletionError>
async fn completion( &self, request: CompletionRequest, ) -> Result<CompletionResponse<Self::Response>, CompletionError>
Generates a completion response for the given completion request.
async fn stream( &self, request: CompletionRequest, ) -> Result<StreamingCompletionResponse<Self::StreamingResponse>, CompletionError>
Source§fn completion_request(
&self,
prompt: impl Into<Message>,
) -> CompletionRequestBuilder<Self>
fn completion_request( &self, prompt: impl Into<Message>, ) -> CompletionRequestBuilder<Self>
Generates a completion request builder for the given
prompt.Auto Trait Implementations§
impl<M> Freeze for RetryingModel<M>where
M: Freeze,
impl<M> RefUnwindSafe for RetryingModel<M>where
M: RefUnwindSafe,
impl<M> Send for RetryingModel<M>where
M: Send,
impl<M> Sync for RetryingModel<M>where
M: Sync,
impl<M> Unpin for RetryingModel<M>where
M: Unpin,
impl<M> UnsafeUnpin for RetryingModel<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for RetryingModel<M>where
M: 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