pub struct Simple { /* private fields */ }
Expand description
Generate an answer based on the current query
For most general purposes, this transformer should provide a sensible default. It takes either
a transformation that has already been applied to the documents (in Query::current
), or the
documents themselves, and will then feed them as context with the original question to an llm
to generate an answer.
Optionally, a custom document template can be provided to render the documents in a specific way.
Implementations§
Source§impl Simple
impl Simple
pub fn builder() -> SimpleBuilder
Sourcepub fn from_client(client: impl SimplePrompt + 'static) -> Simple
pub fn from_client(client: impl SimplePrompt + 'static) -> Simple
Builds a new simple answer generator from a client that implements SimplePrompt
.
§Panics
Panics if the build failed
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Simple
impl !RefUnwindSafe for Simple
impl Send for Simple
impl Sync for Simple
impl Unpin for Simple
impl !UnwindSafe for Simple
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,
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 more