Skip to main content

Module debug

Module debug 

Source
Expand description

Automatic LLM-assisted debugging for failed search requests.

When a search/ask/body command fails (transport error, JSON parse error, API error), the bot records what happened and asks the local Ollama instance (same host as FicHub, thinkcentre) to diagnose the root cause. The diagnosis is logged at warn! level and echoed to the user as a short hint so they know the failure is being looked at.

Config (all optional):

  • FANFIC_ARCHIVIST_OLLAMA_URL default http://localhost:11434
  • FANFIC_ARCHIVIST_LLM_MODEL default ornith:9b
  • FANFIC_ARCHIVIST_LLM_DEBUG set 0 to disable entirely

Structs§

DebugContext
Input describing a failed API call.

Functions§

diagnose_with_llm
Ask the local Ollama to diagnose a failed search. Best-effort: any failure returns Ok(None) so the caller can continue without the diagnosis.
short_hint
Build a short user-facing hint from a diagnosis (keep it under embed limits).