Skip to main content

detect_search_intent_hybrid

Function detect_search_intent_hybrid 

Source
pub fn detect_search_intent_hybrid(
    provider: Option<Arc<dyn LlmProviderTrait>>,
    prompt: &str,
    config: &SearchIntentConfig,
) -> SearchIntent
Expand description

Detects search intent using hybrid keyword + LLM detection.

Runs keyword detection immediately and LLM detection in parallel. Merges results with LLM taking precedence for intent type if confidence is high.

§Arguments

  • provider - Optional LLM provider.
  • prompt - The user prompt to analyze.
  • config - Configuration for intent detection.

§Returns

A merged SearchIntent from both detection methods.

§Panics

This function does not panic under normal operation.