Skip to content

Commit 32ff14f

Browse files
committed
feat(mx): 集成东方财富妙想API并新增AI选股功能
- 新增MiaoXiangSearchProvider实现东方财富妙想资讯搜索支持 - 配置文件增加MX_APIKEY环境变量支持多个妙想API Key - 新增AI选股API端点,支持自然语言条件智能选股 - WebUI添加AI选股页面及相关路由和侧边栏入口 - 实现前端调用AI选股API并展示选股结果和提交深度分析功能 - 调整核心配置管理以支持妙想API Key的加载和校验 - 更新.gitignore和配置示例以支持妙想API相关文件和文档 - 日志、错误处理和消息提示完善AI选股功能用户体验
1 parent f09942f commit 32ff14f

17 files changed

Lines changed: 1028 additions & 12 deletions

File tree

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,9 @@ BRAVE_API_KEYS=
260260
# 留空时默认自动从 searx.space 拉取公共实例;若不希望访问公共实例,可将下方开关设为 false
261261
SEARXNG_BASE_URLS=
262262
SEARXNG_PUBLIC_INSTANCES_ENABLED=true
263+
# 东方财富妙想 API Key(金融新闻搜索 + 智能选股,支持多个,逗号分隔)
264+
# 获取: https://mkapi2.dfcfs.com/
265+
# MX_APIKEY=your_miaoxiang_key_here
263266

264267
# ===================================
265268
# Social Sentiment Intelligence (US stocks only)

.gitignore

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,192 @@ static/
8080
/apps/dsa-desktop/node_modules/
8181

8282
.codex
83+
.qoder/repowiki/zh/content/快速开始.md
84+
.qoder/repowiki/zh/content/项目概述.md
85+
.qoder/repowiki/zh/content/API参考文档/分析报告API.md
86+
.qoder/repowiki/zh/content/API参考文档/股票数据API.md
87+
.qoder/repowiki/zh/content/API参考文档/回测引擎API.md
88+
.qoder/repowiki/zh/content/API参考文档/历史数据管理API.md
89+
.qoder/repowiki/zh/content/API参考文档/系统配置API.md
90+
.qoder/repowiki/zh/content/API参考文档/用户认证API.md
91+
.qoder/repowiki/zh/content/API参考文档/用量监控API.md
92+
.qoder/repowiki/zh/content/API参考文档/组合管理API.md
93+
.qoder/repowiki/zh/content/API参考文档/AI代理系统API.md
94+
.qoder/repowiki/zh/content/API参考文档/API参考文档.md
95+
.qoder/repowiki/zh/content/开发指南/版本控制与协作.md
96+
.qoder/repowiki/zh/content/开发指南/测试策略与实施.md
97+
.qoder/repowiki/zh/content/开发指南/持续集成与部署.md
98+
.qoder/repowiki/zh/content/开发指南/代码规范与最佳实践.md
99+
.qoder/repowiki/zh/content/开发指南/调试工具与技巧.md
100+
.qoder/repowiki/zh/content/开发指南/开发环境搭建.md
101+
.qoder/repowiki/zh/content/开发指南/开发指南.md
102+
.qoder/repowiki/zh/content/扩展开发/第三方集成.md
103+
.qoder/repowiki/zh/content/扩展开发/分析策略扩展.md
104+
.qoder/repowiki/zh/content/扩展开发/扩展开发.md
105+
.qoder/repowiki/zh/content/扩展开发/数据提供者扩展.md
106+
.qoder/repowiki/zh/content/扩展开发/通知发送器扩展.md
107+
.qoder/repowiki/zh/content/扩展开发/AI代理扩展.md
108+
.qoder/repowiki/zh/content/故障排除/常见问题诊断.md
109+
.qoder/repowiki/zh/content/故障排除/故障排除.md
110+
.qoder/repowiki/zh/content/故障排除/配置问题排查.md
111+
.qoder/repowiki/zh/content/故障排除/日志分析与调试.md
112+
.qoder/repowiki/zh/content/故障排除/网络问题诊断.md
113+
.qoder/repowiki/zh/content/故障排除/系统监控与告警.md
114+
.qoder/repowiki/zh/content/故障排除/性能调优与优化.md
115+
.qoder/repowiki/zh/content/最佳实践/安全考虑.md
116+
.qoder/repowiki/zh/content/最佳实践/成本优化.md
117+
.qoder/repowiki/zh/content/最佳实践/使用建议.md
118+
.qoder/repowiki/zh/content/最佳实践/团队协作.md
119+
.qoder/repowiki/zh/content/最佳实践/维护指南.md
120+
.qoder/repowiki/zh/content/最佳实践/性能优化.md
121+
.qoder/repowiki/zh/content/最佳实践/最佳实践.md
122+
.qoder/repowiki/zh/content/核心功能模块/核心功能模块.md
123+
.qoder/repowiki/zh/content/核心功能模块/AI智能分析引擎/代理系统架构.md
124+
.qoder/repowiki/zh/content/核心功能模块/AI智能分析引擎/代理协作机制.md
125+
.qoder/repowiki/zh/content/核心功能模块/AI智能分析引擎/风险分析代理.md
126+
.qoder/repowiki/zh/content/核心功能模块/AI智能分析引擎/技术分析代理.md
127+
.qoder/repowiki/zh/content/核心功能模块/AI智能分析引擎/决策代理.md
128+
.qoder/repowiki/zh/content/核心功能模块/AI智能分析引擎/AI智能分析引擎.md
129+
.qoder/repowiki/zh/content/核心功能模块/回测引擎/服务集成与API.md
130+
.qoder/repowiki/zh/content/核心功能模块/回测引擎/回测引擎.md
131+
.qoder/repowiki/zh/content/核心功能模块/回测引擎/回测引擎核心架构.md
132+
.qoder/repowiki/zh/content/核心功能模块/回测引擎/量化策略配置.md
133+
.qoder/repowiki/zh/content/核心功能模块/回测引擎/性能指标与分析.md
134+
.qoder/repowiki/zh/content/核心功能模块/数据提供者系统/基本面数据适配器.md
135+
.qoder/repowiki/zh/content/核心功能模块/数据提供者系统/数据提供者系统.md
136+
.qoder/repowiki/zh/content/核心功能模块/数据提供者系统/数据源策略与切换机制.md
137+
.qoder/repowiki/zh/content/核心功能模块/数据提供者系统/数据源基类与接口.md
138+
.qoder/repowiki/zh/content/核心功能模块/数据提供者系统/AkShare数据源.md
139+
.qoder/repowiki/zh/content/核心功能模块/数据提供者系统/Tushare数据源.md
140+
.qoder/repowiki/zh/content/核心功能模块/数据提供者系统/YFinance数据源.md
141+
.qoder/repowiki/zh/content/核心功能模块/股票数据分析系统/股票数据分析系统.md
142+
.qoder/repowiki/zh/content/核心功能模块/股票数据分析系统/基本面分析.md
143+
.qoder/repowiki/zh/content/核心功能模块/股票数据分析系统/技术分析工具.md
144+
.qoder/repowiki/zh/content/核心功能模块/股票数据分析系统/数据标准化流程.md
145+
.qoder/repowiki/zh/content/核心功能模块/股票数据分析系统/新闻情感分析.md
146+
.qoder/repowiki/zh/content/核心功能模块/通知系统/多渠道路由机制.md
147+
.qoder/repowiki/zh/content/核心功能模块/通知系统/通知规则设置.md
148+
.qoder/repowiki/zh/content/核心功能模块/通知系统/通知渠道配置.md
149+
.qoder/repowiki/zh/content/核心功能模块/通知系统/通知系统.md
150+
.qoder/repowiki/zh/content/核心功能模块/通知系统/消息模板设计.md
151+
.qoder/repowiki/zh/content/用户界面/移动端适配.md
152+
.qoder/repowiki/zh/content/用户界面/用户界面.md
153+
.qoder/repowiki/zh/content/用户界面/主题系统.md
154+
.qoder/repowiki/zh/content/用户界面/桌面应用.md
155+
.qoder/repowiki/zh/content/用户界面/UI组件库/布局组件.md
156+
.qoder/repowiki/zh/content/用户界面/UI组件库/基础组件.md
157+
.qoder/repowiki/zh/content/用户界面/UI组件库/数据展示组件.md
158+
.qoder/repowiki/zh/content/用户界面/UI组件库/专用组件.md
159+
.qoder/repowiki/zh/content/用户界面/UI组件库/UI组件库.md
160+
.qoder/repowiki/zh/content/用户界面/Web界面/布局系统.md
161+
.qoder/repowiki/zh/content/用户界面/Web界面/回测工具.md
162+
.qoder/repowiki/zh/content/用户界面/Web界面/聊天分析界面.md
163+
.qoder/repowiki/zh/content/用户界面/Web界面/路由系统.md
164+
.qoder/repowiki/zh/content/用户界面/Web界面/设置配置.md
165+
.qoder/repowiki/zh/content/用户界面/Web界面/通用组件库.md
166+
.qoder/repowiki/zh/content/用户界面/Web界面/投资组合管理.md
167+
.qoder/repowiki/zh/content/用户界面/Web界面/仪表板页面.md
168+
.qoder/repowiki/zh/content/用户界面/Web界面/Web界面.md
169+
.qoder/repowiki/zh/content/系统架构/系统架构.md
170+
.qoder/repowiki/zh/content/系统架构/组件交互.md
171+
.qoder/repowiki/zh/content/系统架构/AI代理架构/代理编排器.md
172+
.qoder/repowiki/zh/content/系统架构/AI代理架构/代理工厂模式.md
173+
.qoder/repowiki/zh/content/系统架构/AI代理架构/AI代理架构.md
174+
.qoder/repowiki/zh/content/系统架构/AI代理架构/代理工具系统/代理工具系统.md
175+
.qoder/repowiki/zh/content/系统架构/AI代理架构/代理工具系统/分析工具.md
176+
.qoder/repowiki/zh/content/系统架构/AI代理架构/代理工具系统/工具注册表核心.md
177+
.qoder/repowiki/zh/content/系统架构/AI代理架构/代理工具系统/回测工具.md
178+
.qoder/repowiki/zh/content/系统架构/AI代理架构/代理工具系统/市场工具.md
179+
.qoder/repowiki/zh/content/系统架构/AI代理架构/代理工具系统/数据工具.md
180+
.qoder/repowiki/zh/content/系统架构/AI代理架构/代理工具系统/搜索工具.md
181+
.qoder/repowiki/zh/content/系统架构/AI代理架构/代理技能系统/代理技能系统.md
182+
.qoder/repowiki/zh/content/系统架构/AI代理架构/代理技能系统/技能代理执行.md
183+
.qoder/repowiki/zh/content/系统架构/AI代理架构/代理技能系统/技能管理器.md
184+
.qoder/repowiki/zh/content/系统架构/AI代理架构/代理技能系统/技能加载系统.md
185+
.qoder/repowiki/zh/content/系统架构/AI代理架构/代理技能系统/技能聚合系统.md
186+
.qoder/repowiki/zh/content/系统架构/AI代理架构/代理技能系统/技能路由系统.md
187+
.qoder/repowiki/zh/content/系统架构/AI代理架构/代理技能系统/技能数据模型.md
188+
.qoder/repowiki/zh/content/系统架构/AI代理架构/代理技能系统/默认技能配置.md
189+
.qoder/repowiki/zh/content/系统架构/AI代理架构/代理类型系统/代理类型系统.md
190+
.qoder/repowiki/zh/content/系统架构/AI代理架构/代理类型系统/风险代理.md
191+
.qoder/repowiki/zh/content/系统架构/AI代理架构/代理类型系统/基础代理类.md
192+
.qoder/repowiki/zh/content/系统架构/AI代理架构/代理类型系统/技术分析代理.md
193+
.qoder/repowiki/zh/content/系统架构/AI代理架构/代理类型系统/决策代理.md
194+
.qoder/repowiki/zh/content/系统架构/AI代理架构/代理类型系统/投资组合代理.md
195+
.qoder/repowiki/zh/content/系统架构/AI代理架构/代理类型系统/智能代理.md
196+
.qoder/repowiki/zh/content/系统架构/API架构/路由系统.md
197+
.qoder/repowiki/zh/content/系统架构/API架构/请求响应流程.md
198+
.qoder/repowiki/zh/content/系统架构/API架构/中间件栈.md
199+
.qoder/repowiki/zh/content/系统架构/API架构/API版本控制.md
200+
.qoder/repowiki/zh/content/系统架构/API架构/API架构.md
201+
.qoder/repowiki/zh/content/系统架构/数据架构/数据存储系统.md
202+
.qoder/repowiki/zh/content/系统架构/数据架构/数据缓存系统.md
203+
.qoder/repowiki/zh/content/系统架构/数据架构/数据架构.md
204+
.qoder/repowiki/zh/content/系统架构/数据架构/数据提供者系统/东方财富数据源.md
205+
.qoder/repowiki/zh/content/系统架构/数据架构/数据提供者系统/数据提供者系统.md
206+
.qoder/repowiki/zh/content/系统架构/数据架构/数据提供者系统/数据源管理器.md
207+
.qoder/repowiki/zh/content/系统架构/数据架构/数据提供者系统/数据源基类.md
208+
.qoder/repowiki/zh/content/系统架构/数据架构/数据提供者系统/长桥数据源.md
209+
.qoder/repowiki/zh/content/系统架构/数据架构/数据提供者系统/AkShare数据源.md
210+
.qoder/repowiki/zh/content/系统架构/数据架构/数据提供者系统/Baostock数据源.md
211+
.qoder/repowiki/zh/content/系统架构/数据架构/数据提供者系统/PyTDX数据源.md
212+
.qoder/repowiki/zh/content/系统架构/数据架构/数据提供者系统/TickFlow数据源.md
213+
.qoder/repowiki/zh/content/系统架构/数据架构/数据提供者系统/Tushare数据源.md
214+
.qoder/repowiki/zh/content/系统架构/数据架构/数据提供者系统/Yahoo Finance数据源.md
215+
.qoder/repowiki/zh/content/系统架构/数据架构/数据标准化系统/财务数据适配器.md
216+
.qoder/repowiki/zh/content/系统架构/数据架构/数据标准化系统/股票代码标准化.md
217+
.qoder/repowiki/zh/content/系统架构/数据架构/数据标准化系统/股票指数加载.md
218+
.qoder/repowiki/zh/content/系统架构/数据架构/数据标准化系统/数据标准化系统.md
219+
.qoder/repowiki/zh/content/系统架构/数据架构/数据标准化系统/数据质量控制.md
220+
.qoder/repowiki/zh/content/系统架构/通知架构/通知发送器.md
221+
.qoder/repowiki/zh/content/系统架构/通知架构/通知架构.md
222+
.qoder/repowiki/zh/content/系统架构/通知架构/通知路由机制.md
223+
.qoder/repowiki/zh/content/系统架构/通知架构/通知配置管理.md
224+
.qoder/repowiki/zh/content/系统架构/通知架构/消息模板系统.md
225+
.qoder/repowiki/zh/content/部署指南/备份与恢复.md
226+
.qoder/repowiki/zh/content/部署指南/部署指南.md
227+
.qoder/repowiki/zh/content/部署指南/监控告警系统.md
228+
.qoder/repowiki/zh/content/部署指南/生产环境部署.md
229+
.qoder/repowiki/zh/content/部署指南/性能优化策略.md
230+
.qoder/repowiki/zh/content/部署指南/Docker容器化部署.md
231+
.qoder/repowiki/zh/content/配置管理/配置管理.md
232+
.qoder/repowiki/zh/content/配置管理/系统配置.md
233+
.qoder/repowiki/zh/content/配置管理/性能配置.md
234+
.qoder/repowiki/zh/content/配置管理/AI模型配置/多键支持.md
235+
.qoder/repowiki/zh/content/配置管理/AI模型配置/多提供商集成.md
236+
.qoder/repowiki/zh/content/配置管理/AI模型配置/降级回退策略.md
237+
.qoder/repowiki/zh/content/配置管理/AI模型配置/提供商特定配置.md
238+
.qoder/repowiki/zh/content/配置管理/AI模型配置/通道路由系统.md
239+
.qoder/repowiki/zh/content/配置管理/AI模型配置/温度参数管理.md
240+
.qoder/repowiki/zh/content/配置管理/AI模型配置/AI模型配置.md
241+
.qoder/repowiki/zh/content/配置管理/数据源配置/数据缓存配置.md
242+
.qoder/repowiki/zh/content/配置管理/数据源配置/数据源架构设计.md
243+
.qoder/repowiki/zh/content/配置管理/数据源配置/数据源降级机制.md
244+
.qoder/repowiki/zh/content/配置管理/数据源配置/数据源配置.md
245+
.qoder/repowiki/zh/content/配置管理/数据源配置/AkShare数据源配置.md
246+
.qoder/repowiki/zh/content/配置管理/数据源配置/LongBridge数据源配置.md
247+
.qoder/repowiki/zh/content/配置管理/数据源配置/Tushare数据源配置.md
248+
.qoder/repowiki/zh/content/配置管理/数据源配置/Yahoo Finance数据源配置.md
249+
.qoder/repowiki/zh/content/配置管理/通知配置/飞书通知配置.md
250+
.qoder/repowiki/zh/content/配置管理/通知配置/通知路由规则.md
251+
.qoder/repowiki/zh/content/配置管理/通知配置/通知模板系统.md
252+
.qoder/repowiki/zh/content/配置管理/通知配置/通知配置.md
253+
.qoder/repowiki/zh/content/配置管理/通知配置/通知渠道总览.md
254+
.qoder/repowiki/zh/content/配置管理/通知配置/邮件通知配置.md
255+
.qoder/repowiki/zh/content/配置管理/通知配置/自定义Webhook配置.md
256+
.qoder/repowiki/zh/content/配置管理/通知配置/Discord和Slack配置.md
257+
.qoder/repowiki/zh/content/配置管理/通知配置/Pushover通知配置.md
258+
.qoder/repowiki/zh/content/配置管理/通知配置/Telegram通知配置.md
259+
.qoder/repowiki/zh/meta/repowiki-metadata.json
260+
wiki/index.md
261+
wiki/log.md
262+
wiki/SCHEMA.md
263+
.qoder/skills/mx-data/_meta.json
264+
.qoder/skills/mx-data/mx_data.py
265+
.qoder/skills/mx-data/SKILL.md
266+
.qoder/skills/mx-search/_meta.json
267+
.qoder/skills/mx-search/mx_search.py
268+
.qoder/skills/mx-search/SKILL.md
269+
.qoder/skills/mx-xuangu/_meta.json
270+
.qoder/skills/mx-xuangu/mx_xuangu.py
271+
.qoder/skills/mx-xuangu/SKILL.md

api/v1/endpoints/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
agent,
2020
usage,
2121
portfolio,
22+
screen,
2223
)
2324
__all__ = [
2425
"health",
@@ -31,4 +32,5 @@
3132
"agent",
3233
"usage",
3334
"portfolio",
35+
"screen",
3436
]

api/v1/endpoints/screen.py

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
===================================
4+
AI 选股 API 端点(基于东方财富妙想智能选股)
5+
===================================
6+
7+
职责:
8+
1. 接收自然语言选股条件
9+
2. 复用 miaoxiang_tools 中的 smart_stock_screen 实现
10+
3. 返回结构化选股结果
11+
"""
12+
13+
from __future__ import annotations
14+
15+
import logging
16+
from typing import Any, Dict, List, Optional
17+
18+
from fastapi import APIRouter, HTTPException
19+
from pydantic import BaseModel, Field
20+
21+
from src.agent.tools.miaoxiang_tools import _handle_smart_stock_screen
22+
23+
logger = logging.getLogger(__name__)
24+
25+
router = APIRouter()
26+
27+
28+
class ScreenQueryRequest(BaseModel):
29+
"""AI 选股请求"""
30+
query: str = Field(..., min_length=1, max_length=500, description="自然语言选股条件,如 '今天涨幅超过5%的A股'")
31+
32+
33+
class ScreenQueryResponse(BaseModel):
34+
"""AI 选股响应"""
35+
success: bool
36+
query: str
37+
results_count: int = 0
38+
returned_count: int = 0
39+
data_source: Optional[str] = None
40+
results: List[Dict[str, Any]] = Field(default_factory=list)
41+
message: Optional[str] = None
42+
error: Optional[str] = None
43+
44+
45+
@router.post(
46+
"/query",
47+
response_model=ScreenQueryResponse,
48+
summary="AI 智能选股",
49+
description="通过自然语言条件调用东方财富妙想 API 筛选股票。需配置 MX_APIKEY。",
50+
)
51+
def screen_query(payload: ScreenQueryRequest) -> ScreenQueryResponse:
52+
query = payload.query.strip()
53+
if not query:
54+
raise HTTPException(status_code=400, detail="选股条件不能为空")
55+
56+
logger.info("AI screen query: %s", query)
57+
result = _handle_smart_stock_screen(query)
58+
59+
# Error case: MX_APIKEY not configured or all keys failed
60+
if "error" in result:
61+
err_msg = result["error"]
62+
if "not configured" in err_msg or "MX_APIKEY" in err_msg:
63+
raise HTTPException(
64+
status_code=503,
65+
detail="AI 选股功能未启用:请在设置页配置 MX_APIKEY(东方财富妙想 API Key)。",
66+
)
67+
return ScreenQueryResponse(
68+
success=False,
69+
query=query,
70+
error=err_msg,
71+
)
72+
73+
return ScreenQueryResponse(
74+
success=bool(result.get("success", False)),
75+
query=result.get("query", query),
76+
results_count=int(result.get("results_count", 0) or 0),
77+
returned_count=int(result.get("returned_count", 0) or 0),
78+
data_source=result.get("data_source"),
79+
results=result.get("results", []) or [],
80+
message=result.get("message"),
81+
)

api/v1/router.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from fastapi import APIRouter
1313

14-
from api.v1.endpoints import analysis, auth, history, stocks, backtest, system_config, agent, usage, portfolio
14+
from api.v1.endpoints import analysis, auth, history, stocks, backtest, system_config, agent, usage, portfolio, screen
1515

1616
# 创建 v1 版本主路由
1717
router = APIRouter(prefix="/api/v1")
@@ -69,3 +69,9 @@
6969
prefix="/portfolio",
7070
tags=["Portfolio"]
7171
)
72+
73+
router.include_router(
74+
screen.router,
75+
prefix="/screen",
76+
tags=["Screen"]
77+
)

apps/dsa-web/src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import LoginPage from './pages/LoginPage';
88
import NotFoundPage from './pages/NotFoundPage';
99
import ChatPage from './pages/ChatPage';
1010
import PortfolioPage from './pages/PortfolioPage';
11+
import ScreenPage from './pages/ScreenPage';
1112
import { ApiErrorAlert, Shell } from './components/common';
1213
import { AuthProvider, useAuth } from './contexts/AuthContext';
1314
import { useAgentChatStore } from './stores/agentChatStore';
@@ -62,6 +63,7 @@ const AppContent: React.FC = () => {
6263
<Routes>
6364
<Route element={<Shell />}>
6465
<Route path="/" element={<HomePage />} />
66+
<Route path="/screen" element={<ScreenPage />} />
6567
<Route path="/chat" element={<ChatPage />} />
6668
<Route path="/portfolio" element={<PortfolioPage />} />
6769
<Route path="/backtest" element={<BacktestPage />} />

apps/dsa-web/src/api/screen.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import apiClient from './index';
2+
import { toCamelCase } from './utils';
3+
4+
// ============ Types ============
5+
6+
/** A single stock row returned by the AI screen endpoint. */
7+
export type ScreenResultRow = Record<string, string>;
8+
9+
export interface ScreenResponse {
10+
success: boolean;
11+
query: string;
12+
resultsCount: number;
13+
returnedCount: number;
14+
dataSource?: string;
15+
results: ScreenResultRow[];
16+
message?: string;
17+
error?: string;
18+
}
19+
20+
// ============ API ============
21+
22+
export const screenApi = {
23+
/**
24+
* Trigger an AI-powered stock screen using natural language conditions.
25+
* @param query Natural language screening query (e.g. "今天涨幅超过5%的A股")
26+
*/
27+
query: async (query: string): Promise<ScreenResponse> => {
28+
const response = await apiClient.post<Record<string, unknown>>(
29+
'/api/v1/screen/query',
30+
{ query },
31+
);
32+
return toCamelCase<ScreenResponse>(response.data);
33+
},
34+
};
35+
36+
export default screenApi;

apps/dsa-web/src/components/layout/ShellHeader.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ type ShellHeaderProps = {
1111

1212
const TITLES: Record<string, { title: string; description: string }> = {
1313
'/': { title: '首页', description: '股票分析与历史报告工作台' },
14+
'/screen': { title: 'AI选股', description: '自然语言智能选股' },
1415
'/chat': { title: '问股', description: '多轮策略问答与历史会话管理' },
1516
'/backtest': { title: '回测', description: '回测任务与结果浏览' },
1617
'/settings': { title: '设置', description: '系统配置、模型与认证管理' },

0 commit comments

Comments
 (0)