pub struct MetadataSummary { /* private fields */ }
Expand description
This module defines the MetadataSummary
struct and its associated methods,
which are used for generating metadata in the form of a summary
for a given text. It interacts with a client (e.g., OpenAI
) to generate
the summary based on the text chunk in an Node
.
MetadataSummary
is responsible for generating a summary
for a given text chunk. It uses a templated prompt to interact with a client
that implements the SimplePrompt
trait.
Implementations§
source§impl MetadataSummary
impl MetadataSummary
pub fn builder() -> MetadataSummaryBuilder
pub fn from_client( client: impl SimplePrompt + 'static, ) -> MetadataSummaryBuilder
sourcepub fn new(client: impl SimplePrompt + 'static) -> Self
pub fn new(client: impl SimplePrompt + 'static) -> Self
pub fn with_concurrency(self, concurrency: usize) -> Self
Trait Implementations§
source§impl Clone for MetadataSummary
impl Clone for MetadataSummary
source§fn clone(&self) -> MetadataSummary
fn clone(&self) -> MetadataSummary
Returns a copy 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 MetadataSummary
impl Debug for MetadataSummary
source§impl Transformer for MetadataSummary
impl Transformer for MetadataSummary
source§fn transform_node<'life0, 'async_trait>(
&'life0 self,
node: Node,
) -> Pin<Box<dyn Future<Output = Result<Node>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn transform_node<'life0, 'async_trait>(
&'life0 self,
node: Node,
) -> Pin<Box<dyn Future<Output = Result<Node>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Transforms an Node
by extracting a summary
based on the text chunk within the node.
§Arguments
node
- TheNode
containing the text chunk to process.
§Returns
A Result
containing the transformed Node
with added metadata,
or an error if the transformation fails.
§Errors
This function will return an error if the client fails to generate a summary from the provided prompt.
source§fn concurrency(&self) -> Option<usize>
fn concurrency(&self) -> Option<usize>
Overrides the default concurrency of the pipeline
Auto Trait Implementations§
impl Freeze for MetadataSummary
impl !RefUnwindSafe for MetadataSummary
impl Send for MetadataSummary
impl Sync for MetadataSummary
impl Unpin for MetadataSummary
impl !UnwindSafe for MetadataSummary
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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