ai_interpreter¶
Optional OpenAI-powered plain-language interpretation of any module's
AnalysisOutput.
interpreter ¶
AI result interpretation using OpenAI GPT-4o. User supplies their own OPENAI_API_KEY — ARIN stores nothing.
AIInterpreter ¶
Stateless GPT-4o interpreter. Instantiated per request with user's API key. The key is never logged or stored beyond the request lifecycle.
Source code in ai_interpreter/interpreter.py
interpret ¶
Generate a one-shot interpretation of the analysis results.
Source code in ai_interpreter/interpreter.py
chat ¶
Follow-up questions after initial interpretation.
Source code in ai_interpreter/interpreter.py
build_interpretation_prompt ¶
Build the module-agnostic base LLM prompt: registry description, country/
period/model context, and a raw dump of output.stats, followed by a
fixed 4-section instruction (SUMMARY/KEY DRIVERS/RECOMMENDATIONS/CAVEATS).
Module-specific builders (e.g. build_drought_prompt) call this first and
append chart/stat detail particular to that module; build_prompt()
dispatches to the right one automatically.
Source code in ai_interpreter/interpreter.py
build_prompt ¶
Return the richest prompt available for the given module.