pub struct LlmQueryService { /* private fields */ }Expand description
Service for LLM-based query analysis and summarization
Implementations§
Source§impl LlmQueryService
impl LlmQueryService
Sourcepub fn new(config: IngestionConfig) -> Result<Self, String>
pub fn new(config: IngestionConfig) -> Result<Self, String>
Create a new LLM query service
Sourcepub async fn analyze_query(
&self,
user_query: &str,
schemas: &[SchemaWithState],
) -> Result<QueryPlan, String>
pub async fn analyze_query( &self, user_query: &str, schemas: &[SchemaWithState], ) -> Result<QueryPlan, String>
Analyze a natural language query and create an execution plan
Sourcepub async fn summarize_results(
&self,
original_query: &str,
results: &[Value],
) -> Result<String, String>
pub async fn summarize_results( &self, original_query: &str, results: &[Value], ) -> Result<String, String>
Summarize query results
Sourcepub async fn answer_question(
&self,
original_query: &str,
results: &[Value],
conversation_history: &[Message],
question: &str,
) -> Result<String, String>
pub async fn answer_question( &self, original_query: &str, results: &[Value], conversation_history: &[Message], question: &str, ) -> Result<String, String>
Answer a follow-up question based on context
Sourcepub async fn analyze_followup_question(
&self,
original_query: &str,
results: &[Value],
question: &str,
schemas: &[SchemaWithState],
) -> Result<FollowupAnalysis, String>
pub async fn analyze_followup_question( &self, original_query: &str, results: &[Value], question: &str, schemas: &[SchemaWithState], ) -> Result<FollowupAnalysis, String>
Analyze if a follow-up question needs a new query or can be answered from existing results
Sourcepub async fn generate_native_index_query_terms(
&self,
user_query: &str,
schemas: &[SchemaWithState],
) -> Result<Vec<String>, String>
pub async fn generate_native_index_query_terms( &self, user_query: &str, schemas: &[SchemaWithState], ) -> Result<Vec<String>, String>
Generate query terms for native index search based on a natural language query
Sourcepub async fn execute_ai_native_index_query(
&self,
user_query: &str,
schemas: &[SchemaWithState],
db_ops: &DbOperations,
) -> Result<String, String>
pub async fn execute_ai_native_index_query( &self, user_query: &str, schemas: &[SchemaWithState], db_ops: &DbOperations, ) -> Result<String, String>
Execute a complete AI-native index query workflow
Sourcepub async fn execute_ai_native_index_query_with_results(
&self,
user_query: &str,
schemas: &[SchemaWithState],
db_ops: &DbOperationsV2,
) -> Result<(String, Vec<IndexResult>), String>
pub async fn execute_ai_native_index_query_with_results( &self, user_query: &str, schemas: &[SchemaWithState], db_ops: &DbOperationsV2, ) -> Result<(String, Vec<IndexResult>), String>
Execute a complete AI-native index query workflow and return both AI interpretation and raw results
Sourcepub async fn suggest_alternative_query(
&self,
original_user_query: &str,
failed_query: &Query,
schemas: &[SchemaWithState],
previous_attempts: &[String],
) -> Result<Option<QueryPlan>, String>
pub async fn suggest_alternative_query( &self, original_user_query: &str, failed_query: &Query, schemas: &[SchemaWithState], previous_attempts: &[String], ) -> Result<Option<QueryPlan>, String>
Suggest alternative query strategies when results are empty
Auto Trait Implementations§
impl Freeze for LlmQueryService
impl !RefUnwindSafe for LlmQueryService
impl Send for LlmQueryService
impl Sync for LlmQueryService
impl Unpin for LlmQueryService
impl !UnwindSafe for LlmQueryService
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 moreCreates a shared type from an unshared type.