33 lines
849 B
Python
33 lines
849 B
Python
"""Analysis registry — the planner reads this to know what's available."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
from api.analyses.base import Analysis
|
|
from api.analyses.compare_periods import ComparePeriods
|
|
from api.analyses.direct_answer import DirectAnswer
|
|
from api.analyses.drill_down import DrillDown
|
|
|
|
REGISTRY: dict[str, Analysis] = {
|
|
DirectAnswer.name: DirectAnswer(),
|
|
ComparePeriods.name: ComparePeriods(),
|
|
DrillDown.name: DrillDown(),
|
|
}
|
|
|
|
|
|
def get(name: str) -> Analysis | None:
|
|
return REGISTRY.get(name)
|
|
|
|
|
|
def catalog() -> list[dict[str, Any]]:
|
|
"""Plain-dict catalog for prompt injection into the planner."""
|
|
return [
|
|
{
|
|
"name": a.name,
|
|
"description": a.description,
|
|
"args_schema": a.args_schema,
|
|
}
|
|
for a in REGISTRY.values()
|
|
]
|