修复:普通对话沿用模型原文并保留业务前态
This commit is contained in:
@@ -1480,6 +1480,11 @@ kind=members仅用于列出有哪些委托单/批号/规格等唯一成员,不
|
||||
value = candidate
|
||||
recovery_repairs.extend(changes)
|
||||
protocol_context = (context or {}).get('_protocol') if isinstance(context, dict) else None
|
||||
if (isinstance(protocol_context, dict) and protocol_context.get('version') == 1
|
||||
and task['kind'] in ('explain', 'restate') and not task.get('directResponse')
|
||||
and not task['needsClarification']):
|
||||
raise TaskUnavailable('当前协议的普通对话须提供directResponse;业务解释须选择正式分析或历史报告任务。',
|
||||
field='kind.protocol', expected='supported business task or reviewed directResponse')
|
||||
if autonomous_session:
|
||||
from nao_native_planning import history_only_requested
|
||||
if (history_only_requested(question) and not task['needsClarification']
|
||||
@@ -1572,7 +1577,7 @@ kind=members仅用于列出有哪些委托单/批号/规格等唯一成员,不
|
||||
or _source_column_intent(question, (context or {}).get('_businessCatalog', {}))))
|
||||
member_list_review_required = task['kind'] == 'members'
|
||||
if ((task.get('directResponse') or (semantic_review and payload['previousUserQuestions']) or review_read_requirements)
|
||||
and not autonomous_session
|
||||
and (not autonomous_session or task.get('directResponse'))
|
||||
and (task['kind'] in ('analysis','metrics','members','explain','restate','source_verify','details')
|
||||
or review_read_requirements and task['kind'] == 'report')):
|
||||
review_system = ('你是只读任务计划的语义核对员。依据前序用户问题与最新问题核对计划是否真正回答最新意图,'
|
||||
@@ -1585,6 +1590,7 @@ kind=members仅用于列出有哪些委托单/批号/规格等唯一成员,不
|
||||
'若用户要求报废率的分子分母或计算基数,实际fields须同时包含scrapRate、scrapWeight、totalWeight,不能只有goal提及;缺少任一应aligned=false。'
|
||||
'前序未完成的问题只提供语义,不是已核实结果;truncated的问题不完整,不推断省略内容。'
|
||||
'directResponse仅用于一般问候、能力介绍或致谢;业务趋势、比较和原因判断即使没有数字也不能直答。'
|
||||
'同时核对directResponse.answer正文;即使用户仅问候,只要回复夹带未查询业务事实或因果,必须判aligned=false或requiresEvidence=true。'
|
||||
'历史报告kind=report与复述不同:报告来源由服务端在任务确认后冻结和导入,规划上下文不会包含历史来源正文;'
|
||||
'previousVerifiedTurns为空、缺失或没有来源摘要不能据此判断历史数据不存在,也不能把用户明确的报告意图改成explain/restate或要求用户证明历史来源存在。'
|
||||
'应按用户范围保留kind=report、historyMode=first/last/all、freshQuery=false及空root指标条件;来源可用性/缺口交由服务端导入结果决定。'
|
||||
@@ -1992,8 +1998,12 @@ kind=members仅用于列出有哪些委托单/批号/规格等唯一成员,不
|
||||
if error.field:
|
||||
payload['validationFeedback'] = error.field + ': ' + str(error)
|
||||
payload['repairInstructions'] = '根据错误和上一份计划修正协议格式,保留原业务目标、期间及范围,返回完整JSON计划,不输出解释。'
|
||||
if error.field == 'directResponse.business':
|
||||
payload['repairInstructions'] = '当前问题涉及业务事实,禁止directResponse;保留用户最新问题及前文目标,返回完整业务分析或指标计划。'
|
||||
if error.field == 'kind.protocol':
|
||||
payload['repairInstructions'] = ('重新核对最新意图:一般问候、能力介绍或致谢必须返回kind=explain及directResponse的模型回复;'
|
||||
'涉及业务事实则选择现有analysis/metrics/report等正式任务,不能用普通explain/restate绕过查询。记忆或操作要求不得伪装普通对话。')
|
||||
elif error.field == 'directResponse.business':
|
||||
payload['repairInstructions'] = ('上次回复夹带未经查询的业务判断,请重新核对最新用户意图:问候或能力介绍仍使用directResponse,仅介绍能做什么,不断言实际业务结果;'
|
||||
'只有用户确实要求业务事实、比较或原因解释时,才改为完整业务分析或指标计划。保留原问题,不因上次错误回复改写用户目标。')
|
||||
elif error.field and error.field.startswith('directResponse'):
|
||||
payload['repairInstructions'] = '保持最小一般对话JSON,仅修复错误字段,保留kind、goal、directResponse;无需补全业务计划字段。answer只写一般回复,列表用项目符号,不写业务数值。'
|
||||
elif error.field and (error.field == 'queryPlan' or error.field.startswith('queryPlan.')):
|
||||
|
||||
Reference in New Issue
Block a user