pub struct PromptRequest<'a, M: CompletionModel> { /* private fields */ }
Expand description
A builder for creating prompt requests with customizable options. Uses generics to track which options have been set during the build process.
Implementations§
Source§impl<'a, M: CompletionModel> PromptRequest<'a, M>
impl<'a, M: CompletionModel> PromptRequest<'a, M>
Source§impl<'a, M: CompletionModel> PromptRequest<'a, M>
impl<'a, M: CompletionModel> PromptRequest<'a, M>
Sourcepub fn multi_turn(self, depth: usize) -> PromptRequest<'a, M>
pub fn multi_turn(self, depth: usize) -> PromptRequest<'a, M>
Set the maximum depth for multi-turn conversations
Sourcepub fn with_history(self, history: &'a mut Vec<Message>) -> PromptRequest<'a, M>
pub fn with_history(self, history: &'a mut Vec<Message>) -> PromptRequest<'a, M>
Add chat history to the prompt request
Trait Implementations§
Source§impl<'a, M: CompletionModel> IntoFuture for PromptRequest<'a, M>
Due to: RFC 2515, we have to use a BoxFuture
for the IntoFuture
implementation. In the future, we should be able to use impl Future<...>
directly via the associated type.
impl<'a, M: CompletionModel> IntoFuture for PromptRequest<'a, M>
Due to: RFC 2515, we have to use a BoxFuture
for the IntoFuture
implementation. In the future, we should be able to use impl Future<...>
directly via the associated type.
Source§type Output = Result<String, PromptError>
type Output = Result<String, PromptError>
The output that the future will produce on completion.
Source§type IntoFuture = Pin<Box<dyn Future<Output = <PromptRequest<'a, M> as IntoFuture>::Output> + Send + 'a>>
type IntoFuture = Pin<Box<dyn Future<Output = <PromptRequest<'a, M> as IntoFuture>::Output> + Send + 'a>>
Which kind of future are we turning this into?
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
Auto Trait Implementations§
impl<'a, M> Freeze for PromptRequest<'a, M>
impl<'a, M> !RefUnwindSafe for PromptRequest<'a, M>
impl<'a, M> Send for PromptRequest<'a, M>
impl<'a, M> Sync for PromptRequest<'a, M>
impl<'a, M> Unpin for PromptRequest<'a, M>
impl<'a, M> !UnwindSafe for PromptRequest<'a, M>
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