src.llm_interpreter.render.citations

Citation system for AMMM reports.

This module maps evidence to source CSV/PNG files, ensuring all claims are traceable back to their source data.

Author: AMMM Team Created: 2025-04-10 Last Modified: 2025-04-10

Module Contents

class src.llm_interpreter.render.citations.Citation

Represents a citation to a source file.

to_markdown() str

Format citation as markdown reference.

class src.llm_interpreter.render.citations.CitationManager

Manages citations for evidence-backed reports.

Automatically generates citation IDs and tracks all evidence sources.

add_citation(source_file: str, description: str, evidence_type: str = 'metric') str

Add a citation and return its ID.

Parameters:
  • source_file – Name of source file (e.g., “vif_summary.csv”)

  • description – Description of what this citation references

  • evidence_type – Type of evidence (metric, diagnostic, visualization)

Returns:

Citation ID that can be used in text

cite_vif(variable: str, vif_value: float) str

Cite VIF summary for a specific variable.

cite_stationarity(variable: str) str

Cite stationarity summary.

cite_model_summary(parameter: str) str

Cite model summary for parameter.

cite_elpd(metric: str) str

Cite ELPD diagnostics.

cite_media_performance(channel: str) str

Cite media performance metrics.

cite_budget_scenario(scenario: str) str

Cite budget scenario results.

cite_waterfall() str

Cite waterfall decomposition.

cite_figure(figure_name: str, description: str) str

Cite a figure/visualization.

get_citation_text(citation_id: str) str

Get inline citation text.

generate_references_section() str

Generate markdown references section.

src.llm_interpreter.render.citations.create_citation_manager() CitationManager

Create a new citation manager.