pub struct Model<M: CompletionModel> { /* private fields */ }
Expand description
A model that can be used to prompt completions from a completion model. This is the simplest building block for creating an LLM powered application.
Trait Implementations§
source§impl<M: CompletionModel> Chat for Model<M>
impl<M: CompletionModel> Chat for Model<M>
source§impl<M: CompletionModel> Completion<M> for Model<M>
impl<M: CompletionModel> Completion<M> for Model<M>
source§async fn completion(
&self,
prompt: &str,
chat_history: Vec<Message>,
) -> Result<CompletionRequestBuilder<M>, CompletionError>
async fn completion( &self, prompt: &str, chat_history: Vec<Message>, ) -> Result<CompletionRequestBuilder<M>, CompletionError>
Generates a completion request builder for the given
prompt
and chat_history
.
This function is meant to be called by the user to further customize the
request at prompt time before sending it. Read moreAuto Trait Implementations§
impl<M> Freeze for Model<M>where
M: Freeze,
impl<M> RefUnwindSafe for Model<M>where
M: RefUnwindSafe,
impl<M> Send for Model<M>
impl<M> Sync for Model<M>
impl<M> Unpin for Model<M>where
M: Unpin,
impl<M> UnwindSafe for Model<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