pub struct Pipeline<'stream, STRATEGY: SearchStrategy = SimilaritySingleEmbedding, STATE: QueryState = Pending> { /* private fields */ }
Expand description
The starting point of a query pipeline
Implementations§
Source§impl<'a, STRATEGY: SearchStrategy> Pipeline<'a, STRATEGY>
impl<'a, STRATEGY: SearchStrategy> Pipeline<'a, STRATEGY>
Sourcepub fn from_search_strategy(strategy: STRATEGY) -> Pipeline<'a, STRATEGY>
pub fn from_search_strategy(strategy: STRATEGY) -> Pipeline<'a, STRATEGY>
Source§impl<'stream: 'static, STRATEGY> Pipeline<'stream, STRATEGY, Pending>where
STRATEGY: SearchStrategy,
impl<'stream: 'static, STRATEGY> Pipeline<'stream, STRATEGY, Pending>where
STRATEGY: SearchStrategy,
Sourcepub fn evaluate_with<T: EvaluateQuery + 'stream>(self, evaluator: T) -> Self
pub fn evaluate_with<T: EvaluateQuery + 'stream>(self, evaluator: T) -> Self
Evaluate queries with an evaluator
Sourcepub fn then_transform_query<T: TransformQuery + 'stream>(
self,
transformer: T,
) -> Pipeline<'stream, STRATEGY, Pending>
pub fn then_transform_query<T: TransformQuery + 'stream>( self, transformer: T, ) -> Pipeline<'stream, STRATEGY, Pending>
Transform a query into something else, see crate::query_transformers
Source§impl<'stream: 'static, STRATEGY: SearchStrategy + 'stream> Pipeline<'stream, STRATEGY, Pending>
impl<'stream: 'static, STRATEGY: SearchStrategy + 'stream> Pipeline<'stream, STRATEGY, Pending>
Source§impl<'stream: 'static, STRATEGY: SearchStrategy> Pipeline<'stream, STRATEGY, Retrieved>
impl<'stream: 'static, STRATEGY: SearchStrategy> Pipeline<'stream, STRATEGY, Retrieved>
Sourcepub fn then_transform_response<T: TransformResponse + 'stream>(
self,
transformer: T,
) -> Pipeline<'stream, STRATEGY, Retrieved>
pub fn then_transform_response<T: TransformResponse + 'stream>( self, transformer: T, ) -> Pipeline<'stream, STRATEGY, Retrieved>
Transforms a retrieved query into something else
Source§impl<'stream: 'static, STRATEGY: SearchStrategy> Pipeline<'stream, STRATEGY, Retrieved>
impl<'stream: 'static, STRATEGY: SearchStrategy> Pipeline<'stream, STRATEGY, Retrieved>
Sourcepub fn then_answer<T: Answer + 'stream>(
self,
answerer: T,
) -> Pipeline<'stream, STRATEGY, Answered>
pub fn then_answer<T: Answer + 'stream>( self, answerer: T, ) -> Pipeline<'stream, STRATEGY, Answered>
Generates an answer based on previous transformations
Source§impl<STRATEGY: SearchStrategy> Pipeline<'_, STRATEGY, Answered>
impl<STRATEGY: SearchStrategy> Pipeline<'_, STRATEGY, Answered>
Sourcepub async fn query(
self,
query: impl Into<Query<Pending>>,
) -> Result<Query<Answered>>
pub async fn query( self, query: impl Into<Query<Pending>>, ) -> Result<Query<Answered>>
Runs the pipeline with a user query, accepts &str
as well.
§Errors
Errors if any of the transformations failed or no response was found
Sourcepub async fn query_mut(
&mut self,
query: impl Into<Query<Pending>>,
) -> Result<Query<Answered>>
pub async fn query_mut( &mut self, query: impl Into<Query<Pending>>, ) -> Result<Query<Answered>>
Runs the pipeline with a user query, accepts &str
as well.
Does not consume the pipeline and requires a mutable reference. This allows the pipeline to be reused.
§Errors
Errors if any of the transformations failed or no response was found
Trait Implementations§
Source§impl Default for Pipeline<'_, SimilaritySingleEmbedding>
By default the SearchStrategy
is SimilaritySingleEmbedding
, which embed the current
query and returns a collection of documents.
impl Default for Pipeline<'_, SimilaritySingleEmbedding>
By default the SearchStrategy
is SimilaritySingleEmbedding
, which embed the current
query and returns a collection of documents.
Auto Trait Implementations§
impl<'stream, STRATEGY, STATE> Freeze for Pipeline<'stream, STRATEGY, STATE>where
STRATEGY: Freeze,
impl<'stream, STRATEGY = SimilaritySingleEmbedding, STATE = Pending> !RefUnwindSafe for Pipeline<'stream, STRATEGY, STATE>
impl<'stream, STRATEGY, STATE> Send for Pipeline<'stream, STRATEGY, STATE>
impl<'stream, STRATEGY = SimilaritySingleEmbedding, STATE = Pending> !Sync for Pipeline<'stream, STRATEGY, STATE>
impl<'stream, STRATEGY, STATE> Unpin for Pipeline<'stream, STRATEGY, STATE>where
STRATEGY: Unpin,
impl<'stream, STRATEGY = SimilaritySingleEmbedding, STATE = Pending> !UnwindSafe for Pipeline<'stream, STRATEGY, STATE>
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> 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