pub struct BoxedStructuredTextCompletionModel<T> { /* private fields */ }Expand description
A boxed BoxedStructuredTextCompletionModel.
Trait Implementations§
Source§impl<T> Clone for BoxedStructuredTextCompletionModel<T>where
T: Clone,
impl<T> Clone for BoxedStructuredTextCompletionModel<T>where
T: Clone,
Source§fn clone(&self) -> BoxedStructuredTextCompletionModel<T>
fn clone(&self) -> BoxedStructuredTextCompletionModel<T>
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<T> CreateTextCompletionSession for BoxedStructuredTextCompletionModel<T>
impl<T> CreateTextCompletionSession for BoxedStructuredTextCompletionModel<T>
Source§type Session = BoxedTextCompletionSession
type Session = BoxedTextCompletionSession
The type of the session that this model uses.
Source§type Error = Box<dyn Error + Sync + Send>
type Error = Box<dyn Error + Sync + Send>
The type of error this model may return during operations.
Source§fn new_session(
&self,
) -> Result<<BoxedStructuredTextCompletionModel<T> as CreateTextCompletionSession>::Session, <BoxedStructuredTextCompletionModel<T> as CreateTextCompletionSession>::Error>
fn new_session( &self, ) -> Result<<BoxedStructuredTextCompletionModel<T> as CreateTextCompletionSession>::Session, <BoxedStructuredTextCompletionModel<T> as CreateTextCompletionSession>::Error>
Create a new session for this model. Read more
Source§impl<T> StructuredTextCompletionModel<BoxedCompletionConstraintsForType<T>> for BoxedStructuredTextCompletionModel<T>
impl<T> StructuredTextCompletionModel<BoxedCompletionConstraintsForType<T>> for BoxedStructuredTextCompletionModel<T>
Source§fn stream_text_with_callback_and_parser<'a>(
&'a self,
session: &'a mut <BoxedStructuredTextCompletionModel<T> as CreateTextCompletionSession>::Session,
text: &str,
sampler: GenerationParameters,
parser: BoxedCompletionConstraintsForType<T>,
on_token: impl FnMut(String) -> Result<(), <BoxedStructuredTextCompletionModel<T> as CreateTextCompletionSession>::Error> + Send + Sync + 'static,
) -> impl Future<Output = Result<T, <BoxedStructuredTextCompletionModel<T> as CreateTextCompletionSession>::Error>> + Send + 'a
fn stream_text_with_callback_and_parser<'a>( &'a self, session: &'a mut <BoxedStructuredTextCompletionModel<T> as CreateTextCompletionSession>::Session, text: &str, sampler: GenerationParameters, parser: BoxedCompletionConstraintsForType<T>, on_token: impl FnMut(String) -> Result<(), <BoxedStructuredTextCompletionModel<T> as CreateTextCompletionSession>::Error> + Send + Sync + 'static, ) -> impl Future<Output = Result<T, <BoxedStructuredTextCompletionModel<T> as CreateTextCompletionSession>::Error>> + Send + 'a
Generate text with the given prompt and the given constraints. Read more
Source§impl<T> TextCompletionModel for BoxedStructuredTextCompletionModel<T>
impl<T> TextCompletionModel for BoxedStructuredTextCompletionModel<T>
Source§fn stream_text_with_callback<'a>(
&'a self,
session: &'a mut <BoxedStructuredTextCompletionModel<T> as CreateTextCompletionSession>::Session,
text: &str,
sampler: GenerationParameters,
on_token: impl FnMut(String) -> Result<(), <BoxedStructuredTextCompletionModel<T> as CreateTextCompletionSession>::Error> + Send + Sync + 'static,
) -> impl Future<Output = Result<(), <BoxedStructuredTextCompletionModel<T> as CreateTextCompletionSession>::Error>> + Send + 'a
fn stream_text_with_callback<'a>( &'a self, session: &'a mut <BoxedStructuredTextCompletionModel<T> as CreateTextCompletionSession>::Session, text: &str, sampler: GenerationParameters, on_token: impl FnMut(String) -> Result<(), <BoxedStructuredTextCompletionModel<T> as CreateTextCompletionSession>::Error> + Send + Sync + 'static, ) -> impl Future<Output = Result<(), <BoxedStructuredTextCompletionModel<T> as CreateTextCompletionSession>::Error>> + Send + 'a
Generate text with the given prompt. Read more
Auto Trait Implementations§
impl<T> !RefUnwindSafe for BoxedStructuredTextCompletionModel<T>
impl<T> !UnwindSafe for BoxedStructuredTextCompletionModel<T>
impl<T> Freeze for BoxedStructuredTextCompletionModel<T>
impl<T> Send for BoxedStructuredTextCompletionModel<T>
impl<T> Sync for BoxedStructuredTextCompletionModel<T>
impl<T> Unpin for BoxedStructuredTextCompletionModel<T>
impl<T> UnsafeUnpin for BoxedStructuredTextCompletionModel<T>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<M> TextCompletionModelExt for Mwhere
M: CreateTextCompletionSession,
impl<M> TextCompletionModelExt for Mwhere
M: CreateTextCompletionSession,
Source§fn complete(&self, text: impl ToString) -> TextCompletionBuilder<Self>where
Self: Clone,
fn complete(&self, text: impl ToString) -> TextCompletionBuilder<Self>where
Self: Clone,
Create a new text completion builder for this model. See
TextCompletionBuilder for more details.Source§fn boxed_completion_model(self) -> BoxedTextCompletionModel
fn boxed_completion_model(self) -> BoxedTextCompletionModel
Erase the type of the text completion model. This can be used to make multiple implementations of
TextCompletionModel compatible with the same type.Source§fn boxed_typed_completion_model<T>(
self,
) -> BoxedStructuredTextCompletionModel<T>where
Self: Sized + StructuredTextCompletionModel<Self::DefaultConstraints> + CreateDefaultCompletionConstraintsForType<T> + Send + Sync + 'static,
Self::Error: Send + Sync + Error + 'static,
Self::Session: TextCompletionSession + Clone + Send + Sync + 'static,
<Self::Session as TextCompletionSession>::Error: Error + Send + Sync + 'static,
T: 'static,
fn boxed_typed_completion_model<T>(
self,
) -> BoxedStructuredTextCompletionModel<T>where
Self: Sized + StructuredTextCompletionModel<Self::DefaultConstraints> + CreateDefaultCompletionConstraintsForType<T> + Send + Sync + 'static,
Self::Error: Send + Sync + Error + 'static,
Self::Session: TextCompletionSession + Clone + Send + Sync + 'static,
<Self::Session as TextCompletionSession>::Error: Error + Send + Sync + 'static,
T: 'static,
Erase the type of the structured text completion model. This can be used to make multiple implementations of
StructuredTextCompletionModel compatible with the same type.