pub struct Model { /* private fields */ }Expand description
A handle to a loaded model that implements Rig’s CompletionModel trait.
Obtained via CompletionClient::agent on a Client.
Trait Implementations§
Source§impl CompletionModel for Model
impl CompletionModel for Model
Source§type Response = RawResponse
type Response = RawResponse
The raw response type returned by the underlying completion model.
Source§type StreamingResponse = StreamChunk
type StreamingResponse = StreamChunk
The raw response type returned by the underlying completion model when streaming.
type Client = Client
fn make(client: &Client, model: impl Into<String>) -> Self
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 Freeze for Model
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnsafeUnpin for Model
impl UnwindSafe for Model
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