- Added `interpret` flag to `AnalystChatRequest` for optional immediate interpretation of queries. - Implemented new `POST /api/analyst/interpret` endpoint for on-demand data interpretation based on the latest query snapshot. - Updated `AnalystAgent` to handle interpretation logic, including error handling and response formatting. - Enhanced `AnalystQueryPage` to include a button for triggering interpretations, improving user interaction. - Updated frontend API calls to support the new interpret functionality, ensuring seamless integration with existing workflows. This update significantly enhances the analytical capabilities of the application, allowing users to request interpretations of their queries directly.
34 lines
1.0 KiB
Markdown
34 lines
1.0 KiB
Markdown
# 问数 / 解读拆分 Implementation Plan
|
|
|
|
> **For agentic workers:** REQUIRED SUB-SKILL: TDD per task.
|
|
|
|
**Goal:** 问数默认只返回表;各角色问数页按钮触发 `/api/analyst/interpret`,上下文仅最近一次问数。
|
|
|
|
**Architecture:** `AnalystAgent.run(interpret=False)` 跳过 `_generate_verified_answer`;新方法 `interpret()` 复用护栏;FastAPI 两路由;前端双请求。
|
|
|
|
**Tech Stack:** FastAPI · Pydantic · React · Ant Design
|
|
|
|
## Global Constraints
|
|
|
|
- 问数鉴权不变;客户 self 域尾注仍在解读成功路径追加。
|
|
- 不 commit 除非用户要求。
|
|
|
|
---
|
|
|
|
### Task 1: Schema + agent.run flag
|
|
|
|
- [ ] `ChatRequest.interpret: bool = False`
|
|
- [ ] `InterpretRequest` model
|
|
- [ ] `run(..., interpret=False)` 分支 + 测试
|
|
|
|
### Task 2: agent.interpret + route
|
|
|
|
- [ ] `interpret()` 方法 + `POST /api/analyst/interpret`
|
|
- [ ] 测试 deny echo + success
|
|
|
|
### Task 3: Frontend + memory
|
|
|
|
- [ ] `analyst.ts` + `AnalystQueryPage` 按钮与解读区
|
|
- [ ] MEMORY / TODO / REQUIREMENTS 更新
|
|
- [ ] `pytest` + `npm run test`
|