Skip to main content

Module llm

Module llm 

Source
Expand description

LLM-based search intent classification.

This module provides high-accuracy intent classification using language models. Classification includes a 200ms timeout by default for responsive user experience.

Structsยง

LlmIntentResponse ๐Ÿ”’
LLM classification result structure.

Constantsยง

LLM_INTENT_PROMPT ๐Ÿ”’
Prompt template for LLM intent classification.

Functionsยง

classify_intent_with_llm
Classifies search intent using an LLM provider.
extract_json_from_response ๐Ÿ”’
Extracts JSON from LLM response, handling markdown code blocks.
parse_llm_response ๐Ÿ”’
Parses LLM response into a SearchIntent.