Skip to main content

process_query

Function process_query 

Source
pub async fn process_query(query: &str) -> Result<Vec<CommandSuggestion>>
Expand description

Processes a user query and returns command suggestions.

Orchestrates the full query pipeline:

  1. Search for relevant tools via vector similarity
  2. Load manpage content for top match
  3. Scan current directory context
  4. Build LLM prompt
  5. Generate response via Ollama
  6. Parse JSON response

§Arguments

  • query - Natural language query describing desired functionality

§Errors

Returns an error if:

  • No matching tools found in index
  • Ollama API call fails
  • Response parsing fails