Overview
Based on East Money's authoritative financial database, it builds an intelligent question-answering service covering the entire chain of "data-information-knowledge-analysis-decision-making." Through natural language interaction, it provides users with comprehensive solutions ranging from basic financial knowledge popularization to professional investment research support, delivering an efficient financial information acquisition experience of "instant answers." Conversational interaction lowers the threshold for obtaining financial data, making professional investment research capabilities readily accessible.
Supports standard mode and deep thinking mode, returning summarized answer content (including stock selection-related data results) and source references (news, announcements, data, etc.). This interface is an interface form that returns answer results in one go.
Core Capabilities
1. Financial Market Analysis
Supports natural language acquisition of multidimensional market analysis, covering market trend assessment, technical analysis, fundamental evaluation, capital flow monitoring, and quantitative market sentiment analysis, etc., covering major global market indices and sector performance such as A-shares, Hong Kong stocks, and U.S. stocks.
Applicable Scenarios: daily review, trend tracking, strategy formulation, risk warning, and market sentiment assessment, etc., assisting investment decisions.
2. Interpretation of Major Financial Events
Supports natural language tracking and in-depth interpretation of major capital market events, sudden policies, industry changes, and company announcements, etc., providing event logic organization, impact path analysis, industry chain transmission effects, and investment opportunity and risk assessment.
Applicable Scenarios: event-driven strategies, policy impact assessment, market sentiment tracking, and investment opportunity discovery, etc.
3. Financial Data Query
Supports natural language querying of financial data, covering multiple assets such as A-shares, Hong Kong stocks, U.S. stocks, funds, and bonds, including real-time quotes, company information, valuation, and financial statements, etc.
Applicable Scenarios: investment research, trading review, market monitoring, industry analysis, credit research, financial statement auditing, asset allocation, etc., adapting to the diverse needs of institutions and individuals.
4. Financial Information Search
Supports natural language search of the latest announcements, research reports, financial news, exchange developments, and official policies across the internet, covering global market targets.
Applicable Scenarios: hotspot capture, public opinion monitoring, research report quick review, announcement close reading, and investment decision-making, etc.
5. Macroeconomic Data Query
Supports natural language querying of global macroeconomic data, covering multiple fields such as national economic accounting, price indices, monetary finance, fiscal revenue and expenditure, foreign trade, employment and livelihood, and industrial operation.
Applicable Scenarios: macroeconomic research, market analysis, policy interpretation, and other diverse professional scenarios.
6. Stock Selection / Sector Selection / Fund Selection
Supports natural language input to screen multiple assets such as A-shares, Hong Kong stocks, U.S. stocks, funds, and bonds, and supports screening by multiple indicators, including technical, news-related, fundamental, and market sentiment factors, etc.
Applicable Scenarios: global asset quick screening, cross-market monitoring, investment portfolio construction, strategy backtesting, etc.
7. Financial Encyclopedia Knowledge Q&A
Supports querying basic knowledge such as financial terminology, investment theory, trading rules, market mechanisms, and product details in the form of natural language Q&A, covering multiple knowledge domains including stocks, funds, bonds, derivatives, and macroeconomics.
Applicable scenarios: Introductory investment learning, quick lookup of professional concepts, understanding business processes, popularization of financial knowledge and investor education, etc., lowering the threshold for acquiring professional financial knowledge.
Processing flow
Takes the user's natural-language input question as the input parameter, calls the scripts/generate_answer.py financial Q&A script, and returns the result as summary content in pure Markdown:
python3 {baseDir}/scripts/generate_answer.py --query "用户原始问题"
If you need to enable deep thinking mode:
python3 {baseDir}/scripts/generate_answer.py --query "用户原始问题" --deep-think
Mode selection rules:
- Use standard mode by default
- When the user explicitly requests expressions such as "in-depth analysis", "deep thinking", "detailed analysis", "think carefully", etc., enable deep thinking mode
Script output structure
The script returns JSON, with core fields:
| Field | Type | Description |
|---|---|---|
ok |
Boolean | Whether successful |
answer |
String | Model answer (Markdown format, i.e., the interface data.displayData) |
references |
Array | Traceability reference list (i.e., the interface data.refIndexList) |
references element description
| Field | Type | Description |
|---|---|---|
refId |
Number | Reference number (e.g., 1) |
type |
String | Data type:查数 公告 研报 资讯 选股/基 |
referenceType |
String | CITED_REFERENCE(direct reference) / OTHER_REFERENCE(extended reference) |
markdown |
String | Exists when type=data query or stock/fund selection, structured data table (Markdown format) |
title |
String | Exists when type=news, news title |
jumpUrl |
String | May exist when type=news, original document link (some have no jump link) |
source |
String | Source site name for news/public opinion, etc.; the script extracts from the top-level of the interface item source or nested data.source extract (e.g., "Yingjia Wealth Network") |
Output format specification
After the interface returns, organize the response content in the following format:
Answer body
Directly display the answer field content (already in Markdown format).
Traceability reference
Based on references each item's type display by category.Do not add the [refId] number prefix before the item(such as [1]、[2] etc.), directly display the content in list form:
### 溯源参考
**查数/选股数据:**
{对 type=查数 或 type=选股/基 的引用,直接展示其 markdown 字段的表格内容,不加 [refId] 编号}
**资讯引用:**
- [{title}]({jumpUrl})(来源:{source}) // 有 jumpUrl 且有 source 时
- [{title}]({jumpUrl}) // 有 jumpUrl、无 source
- {title}(来源:{source}) // 无 jumpUrl 但有 source
- {title} // jumpUrl、source 均无或为空时仅展示标题
**公告引用:**
- [{title}]({jumpUrl})(来源:{source}) // 有 jumpUrl 且有 source 时
- [{title}]({jumpUrl}) // 有 jumpUrl、无 source
- {title}(来源:{source}) // 无 jumpUrl 但有 source
- {title} // jumpUrl、source 均无或为空时仅展示标题
**研报引用:**
- [{title}]({jumpUrl})(来源:{source}) // 有 jumpUrl 且有 source 时
- [{title}]({jumpUrl}) // 有 jumpUrl、无 source
- {title}(来源:{source}) // 无 jumpUrl 但有 source
- {title} // jumpUrl、source 均无或为空时仅展示标题
注意:
- **禁止**在溯源条目前添加 `[1]`、`[2]` 等 refId 编号前缀,refId 仅用于内部数据关联,不对外展示
- 仅展示 `referenceType` 为 `CITED_REFERENCE`(直接引用)的条目为主要参考
- `OTHER_REFERENCE`(扩展引用)可作为补充阅读展示
- 如 `references` 为空,则省略溯源参考部分
---
## 公式格式要求
严格遵照以下格式:
- 行内公式:使用 `\(...\)` 格式(不使用 `$...$`)
- 行间公式:使用 `\[...\]` 格式
- 行间公式块内部内容保持不变
---
## 语言要求
始终使用中文进行交互和输出。如用户使用其他语言,仍以中文生成回答内容,但交互提示可跟随用户语言。
---
## 错误处理
| 错误码 | 含义 | 用户侧话术 |
|---|---|---|
| `BAD_REQUEST` | 缺少问题参数 | "请输入您想问的问题。" |
| `API_ERROR` | 接口返回非 200 状态码 | "金融问答服务暂时不可用,请稍后重试。" |
| `HTTP_ERROR` | HTTP 请求失败 | "金融问答服务暂时不可用,请稍后重试。" |
| `TIMEOUT` | 请求超时 | "请求超时,请稍后重试。" |
| `NETWORK_ERROR` | 网络错误 | "网络连接异常,请检查网络后重试。" |
| `EMPTY_RESPONSE` | 回答内容为空 | "未获取到有效回答,请稍后重试。" |
| 其他异常 | 未知异常 | "金融问答服务暂时不可用,请稍后重试。" |
---
## 脚本/文件说明
| 脚本/文件 | 功能 |
| --- | --- |
| `scripts/generate_answer.py` | 调用金融问答接口,传入用户问题及模式参数,返回回答结果和溯源参考 |