pub struct MetadataQAText { /* private fields */ }
Expand description
MetadataQAText
is responsible for generating questions and answers
from a given text chunk. It uses a templated prompt to interact with a client
that implements the SimplePrompt
trait.
Implementations§
Source§impl MetadataQAText
impl MetadataQAText
Sourcepub fn builder() -> MetadataQATextBuilder
pub fn builder() -> MetadataQATextBuilder
Creates a new builder for the transformer
Sourcepub fn from_client(client: impl SimplePrompt + 'static) -> MetadataQATextBuilder
pub fn from_client(client: impl SimplePrompt + 'static) -> MetadataQATextBuilder
Build a new transformer from a client
Sourcepub fn new(client: impl SimplePrompt + 'static) -> Self
pub fn new(client: impl SimplePrompt + 'static) -> Self
Create a new transformer from a client
Sourcepub fn with_concurrency(self, concurrency: usize) -> Self
pub fn with_concurrency(self, concurrency: usize) -> Self
Set the concurrency level for the transformer
Trait Implementations§
Source§impl Clone for MetadataQAText
impl Clone for MetadataQAText
Source§fn clone(&self) -> MetadataQAText
fn clone(&self) -> MetadataQAText
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MetadataQAText
impl Debug for MetadataQAText
Source§impl Default for MetadataQAText
impl Default for MetadataQAText
Source§impl Transformer for MetadataQAText
impl Transformer for MetadataQAText
Source§fn transform_node<'life0, 'async_trait>(
&'life0 self,
node: TextNode,
) -> Pin<Box<dyn Future<Output = Result<TextNode>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn transform_node<'life0, 'async_trait>(
&'life0 self,
node: TextNode,
) -> Pin<Box<dyn Future<Output = Result<TextNode>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Transforms an TextNode
by generating questions and answers
based on the text chunk within the node.
§Arguments
node
- TheTextNode
containing the text chunk to process.
§Returns
A Result
containing the transformed TextNode
with added metadata,
or an error if the transformation fails.
§Errors
This function will return an error if the client fails to generate questions and answers from the provided prompt.
type Input = String
type Output = String
Source§fn concurrency(&self) -> Option<usize>
fn concurrency(&self) -> Option<usize>
Overrides the default concurrency of the pipeline
fn name(&self) -> &'static str
Source§impl WithIndexingDefaults for MetadataQAText
impl WithIndexingDefaults for MetadataQAText
fn with_indexing_defaults(&mut self, defaults: IndexingDefaults)
Auto Trait Implementations§
impl Freeze for MetadataQAText
impl !RefUnwindSafe for MetadataQAText
impl Send for MetadataQAText
impl Sync for MetadataQAText
impl Unpin for MetadataQAText
impl !UnwindSafe for MetadataQAText
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