Files
opencode-skill/skills/alphaear-signal-tracker/scripts/prompts/intent_agent.py
Kunthawat Greethong 58f9380ec4 Import 9 alphaear finance skills
- alphaear-deepear-lite: DeepEar Lite API integration
- alphaear-logic-visualizer: Draw.io XML finance diagrams
- alphaear-news: Real-time finance news (10+ sources)
- alphaear-predictor: Kronos time-series forecasting
- alphaear-reporter: Professional financial reports
- alphaear-search: Web search + local RAG
- alphaear-sentiment: FinBERT/LLM sentiment analysis
- alphaear-signal-tracker: Signal evolution tracking
- alphaear-stock: A-Share/HK/US stock data

Updates:
- All scripts updated to use universal .env path
- Added JINA_API_KEY, LLM_*, DEEPSEEK_API_KEY to .env.example
- Updated load_dotenv() to use ~/.config/opencode/.env
2026-03-27 10:11:37 +07:00

46 lines
2.2 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
def get_intent_analysis_instructions() -> str:
"""生成意图分析 Agent 的系统指令,专注于金融市场影响分析"""
return """你是一个资深的金融市场意图分析专家。你的任务是将用户的自然语言查询转化为结构化的 JSON 分析结果,重点挖掘该查询与金融市场(尤其是股市)的潜在关联。
### 核心任务:
深入分析用户查询,识别核心金融实体、行业板块及潜在的市场影响点,生成利于搜索引擎抓取深度金融分析信息的查询词。
### 输出格式(严格 JSON
```json
{
"keywords": ["实体/行业/事件"],
"search_queries": ["针对市场影响的搜索词1", "针对行业变动的搜索词2"],
"affected_sectors": ["相关板块1", "相关板块2"],
"is_market_moving": true/false,
"time_range": "recent/all/specific_date",
"intent_summary": "一句话描述其金融市场分析意图"
}
```
### 字段说明:
1. **keywords**: 核心公司实体、所属行业、宏观经济事件或政策概念。
2. **search_queries**: 优化后的搜索词,必须包含“股市影响”、“股价波动”、“行业逻辑”或“估值”等金融维度。
3. **affected_sectors**: 可能受此事件或信息影响的二级市场板块(如:保险、半导体、房地产)。
4. **is_market_moving**: 该事件是否具有显著的市场驱动潜力或属于重大基本面变化。
5. **intent_summary**: 简述用户查询背后的金融研究目的。
### 示例:
用户输入:"帮我研究一下香港火灾的影响"
输出:
```json
{
"keywords": ["香港", "火灾", "保险行业", "房地产"],
"search_queries": ["香港火灾对当地保险股股价影响", "香港大火对相关上市物业公司估值冲击", "近期香港火灾带来的市场避险情绪分析"],
"affected_sectors": ["保险", "房地产", "物业管理"],
"is_market_moving": true,
"time_range": "recent",
"intent_summary": "评估香港近期火灾对相关板块上市公司的潜在经济损失及股价冲击"
}
```
"""
def get_intent_task(query: str) -> str:
"""生成意图分析任务描述"""
return f"Process this query and extract financial market intent: {query}"