pub struct QueryRefiner { /* private fields */ }Expand description
Query refiner with multi-turn conversation support
Implementations§
Source§impl QueryRefiner
impl QueryRefiner
Sourcepub fn new(config: RefinementConfig) -> Self
pub fn new(config: RefinementConfig) -> Self
Create a new query refiner with multi-turn support
Sourcepub fn add_turn(
&mut self,
query: String,
refined_query: Option<String>,
intent: Option<String>,
entities: Vec<String>,
)
pub fn add_turn( &mut self, query: String, refined_query: Option<String>, intent: Option<String>, entities: Vec<String>, )
Add a conversation turn for context
Sourcepub fn refine(&self, query: &str) -> Result<Vec<RefinementSuggestion>>
pub fn refine(&self, query: &str) -> Result<Vec<RefinementSuggestion>>
Analyze a query and suggest refinements with context awareness
Sourcepub fn apply_suggestion(
&self,
query: &str,
suggestion: &RefinementSuggestion,
) -> Result<String>
pub fn apply_suggestion( &self, query: &str, suggestion: &RefinementSuggestion, ) -> Result<String>
Apply a refinement suggestion
Sourcepub fn start_refinement_session(&self, initial_query: &str) -> RefinementSession
pub fn start_refinement_session(&self, initial_query: &str) -> RefinementSession
Get interactive refinement session
Sourcepub fn learn_from_feedback(
&mut self,
original: String,
refined: String,
accepted: bool,
)
pub fn learn_from_feedback( &mut self, original: String, refined: String, accepted: bool, )
Learn from user feedback on refinements
Sourcepub fn get_history(&self) -> &[ConversationTurn]
pub fn get_history(&self) -> &[ConversationTurn]
Get conversation history
Sourcepub fn clear_history(&mut self)
pub fn clear_history(&mut self)
Clear conversation history
Auto Trait Implementations§
impl Freeze for QueryRefiner
impl RefUnwindSafe for QueryRefiner
impl Send for QueryRefiner
impl Sync for QueryRefiner
impl Unpin for QueryRefiner
impl UnsafeUnpin for QueryRefiner
impl UnwindSafe for QueryRefiner
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 moreimpl<T> MaybeSend for Twhere
T: Send,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.