feat: 接入 AnalysisContextPack 低敏 Prompt 摘要 P3 (#1491)

* feat: inject AnalysisContextPack prompt summary

* fix: align agent pack summary with prefetched news
This commit is contained in:
Alfred
2026-05-28 19:04:17 +08:00
committed by GitHub
parent f1fdaaba1b
commit 8aa214acc2
18 changed files with 770 additions and 20 deletions

View File

@@ -932,15 +932,19 @@ class TestBuildUserMessage(unittest.TestCase):
"effective_daily_bar_date": "2026-03-26",
"is_partial_bar": True,
},
"analysis_context_pack_summary": "\n## 分析上下文包摘要\n- 数据块状态:行情 available\n",
"realtime_quote": {"price": 1880.0},
},
)
self.assertIn("股票代码: 600519", msg)
self.assertIn("市场阶段上下文", msg)
self.assertIn("分析上下文包摘要", msg)
self.assertIn("盘中", msg)
self.assertIn("不得当作完整日线复盘", msg)
self.assertLess(msg.index("市场阶段上下文"), msg.index("[系统已获取的实时行情]"))
self.assertLess(msg.index("市场阶段上下文"), msg.index("分析上下文包摘要"))
self.assertLess(msg.index("分析上下文包摘要"), msg.index("[系统已获取的实时行情]"))
self.assertNotIn("market_phase_context", msg)
self.assertNotIn("analysis_context_pack_summary", msg)
self.assertNotIn("is_partial_bar", msg)
self.assertNotIn("is_market_open_now", msg)