28 lines
1.1 KiB
Python
28 lines
1.1 KiB
Python
"""cf analyze — AI-анализ финансовой модели (заглушка)."""
|
|
|
|
import typer
|
|
|
|
from infrastructure.cli.services import build_services, console, load_model, resolve_currency
|
|
from infrastructure.i18n import t
|
|
|
|
CURRENCY_OPTION = typer.Option(None, "--currency", "-c", help=t("cmd.forecast.opt.currency"))
|
|
|
|
|
|
def analyze(
|
|
months: int = typer.Option(12, "--months", "-m", help=t("cmd.analyze.opt.months")),
|
|
currency: str | None = CURRENCY_OPTION,
|
|
) -> None:
|
|
"""AI-анализ финансовой модели"""
|
|
model = load_model()
|
|
target_curr, _ = resolve_currency(model, currency)
|
|
_, _, assistant, _ = build_services(model)
|
|
assistant.display_currency = target_curr
|
|
result = assistant.analyze(months)
|
|
|
|
console.print(f"[bold]{t('cmd.analyze.title.prompt')}:[/bold]")
|
|
console.print(result["prompt"][:500] + "...\n")
|
|
|
|
console.print(f"[bold]{t('cmd.analyze.title.summary')}:[/bold]")
|
|
console.print(t("cmd.analyze.base_currency", currency=model.base_currency))
|
|
console.print(f"\n[yellow]{t('cmd.analyze.stub')}[/yellow]")
|