Files
group_xinghuo_jinrong/docs/superpowers/plans/2026-09-12-analyst-query-visualization.md
T
zhanghongyu_0626 a0f550646e feat(analyst): Add analyze endpoint and chart specification validation
- Introduced a new `/analyze` endpoint in the analyst API to process analysis requests, allowing users to receive textual interpretations and chart specifications based on provided prompts.
- Enhanced `analyst_schemas.py` with `AnalyzeRequest` and `ChartSpec` models to structure analysis requests and validate chart specifications.
- Implemented chart validation logic in a new `analyst_chart.py` service, ensuring that chart types and fields are correctly specified and conform to allowed values.
- Updated `AnalystAgent` to handle analysis requests, integrating the new logic for generating responses based on user prompts and data availability.
- Added unit tests to verify the functionality of the new endpoint and validation mechanisms, ensuring robustness and reliability.

This update significantly enhances the analytical capabilities of the application, providing users with improved tools for data interpretation and visualization.
2026-09-12 12:33:37 +08:00

968 B
Raw Blame History

问数分析助手(文字 + 图表)Implementation Plan

For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (- [ ]) syntax for tracking.

Goal: 问数快照 + 对话框提示词 → LLM 选图型/文字 → 校验 ChartSpec → 前端 @ant-design/charts 渲染。

Architecture: NL2SQL 不动;新增 analyst_chart.py 校验 + POST /analyze;问数页 Modal 替代原 interpret 按钮。

Tech Stack: FastAPI · Pydantic · DeepSeek LLM · pytest · React · @ant-design/charts · Vitest

Global Constraints

  • analyst_chart_max_rows 默认 500(settings)
  • LLM 样本行 30 行 TSV
  • chart_type ∈ line|bar|column|pie|none
  • 不做 D-09 Redis 会话

Spec: docs/superpowers/specs/2026-09-12-analyst-query-visualization-design.md

Tasks executed inline in session 2026-09-12.