修复:DSH 自主查询、图片直显与报告稳定性
允许 Agent 在循环中查目录、修正查询和提问,保留实时权限检查及模型原始回答。 统一相同查询证据与图表资源;排名补齐阶段指标,修正 OR 重量筛选,并限制模型明细输入。 增加运行恢复、图表自适应坐标轴与两位小数,修复报告主图选择、重复图及边缘标签。 验证:独立副本通过 162 项 Python、73 项前端及 21 项后端测试,前端构建通过。 线上已用原 8 题复测,并追加两轮双期对比;TOP100 与组合筛选分别核对 100 行和 20 行。
This commit is contained in:
@@ -10,6 +10,17 @@ from nao_weight_ranking import rank_response
|
||||
|
||||
|
||||
class DshModelInputTests(unittest.TestCase):
|
||||
def test_history_image_projection_preserves_stored_answers_and_user_questions(self):
|
||||
from dsh_model_input import presentation_context
|
||||
source = {'_serverHistory': [{'answer': '结论。',
|
||||
'question': '解释 '}]}
|
||||
before = copy.deepcopy(source)
|
||||
result = presentation_context(source)
|
||||
self.assertEqual(source, before)
|
||||
self.assertEqual(result['_serverHistory'][0]['answer'], '结论。真实标题')
|
||||
self.assertEqual(result['_serverHistory'][0]['question'], source['_serverHistory'][0]['question'])
|
||||
self.assertEqual(result['presentation']['imageResources'], [])
|
||||
|
||||
def test_recent_monthly_trend_binds_published_months_instead_of_one_month(self):
|
||||
context = {'_businessCatalog': {'periods': [f'2026-{month:02d}' for month in range(1, 11)],
|
||||
'latestDataPeriod': {'year': 2026, 'month': 10}}}
|
||||
|
||||
Reference in New Issue
Block a user