pub struct MetadataQACode { /* private fields */ }
Expand description
MetadataQACode
is responsible for generating questions and answers based on code chunks.
This struct integrates with the indexing pipeline to enhance the metadata of each code chunk
by adding relevant questions and answers.
Implementations§
source§impl MetadataQACode
impl MetadataQACode
pub fn builder() -> MetadataQACodeBuilder
pub fn from_client(client: impl SimplePrompt + 'static) -> MetadataQACodeBuilder
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 MetadataQACode
impl Clone for MetadataQACode
source§fn clone(&self) -> MetadataQACode
fn clone(&self) -> MetadataQACode
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 MetadataQACode
impl Debug for MetadataQACode
source§impl Transformer for MetadataQACode
impl Transformer for MetadataQACode
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,
Asynchronously transforms an Node
by generating questions and answers for its code chunk.
This method uses the SimplePrompt
client to generate questions and answers based on the code chunk
and adds this information to the node’s metadata.
§Arguments
node
- TheNode
to be transformed.
§Returns
A result containing the transformed Node
or an error if the transformation fails.
§Errors
This function will return an error if the SimplePrompt
client fails to generate a response.
source§fn concurrency(&self) -> Option<usize>
fn concurrency(&self) -> Option<usize>
Overrides the default concurrency of the pipeline
Auto Trait Implementations§
impl Freeze for MetadataQACode
impl !RefUnwindSafe for MetadataQACode
impl Send for MetadataQACode
impl Sync for MetadataQACode
impl Unpin for MetadataQACode
impl !UnwindSafe for MetadataQACode
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