16 lines
777 B
Python
16 lines
777 B
Python
"""Safe operational notices; model failures are not missing business information."""
|
|
|
|
|
|
def review_failure(exc):
|
|
if getattr(exc, 'reason', None) == 'model_account_unavailable':
|
|
return {
|
|
'code': 'model_account_unavailable',
|
|
'message': '模型服务账户暂不可用,请联系管理员检查账户余额及服务状态,恢复后重新分析。',
|
|
}
|
|
if isinstance(exc, TimeoutError) or getattr(exc, 'reason', None) in ('gateway_timeout', 'direct_timeout'):
|
|
return {'code': 'model_timeout', 'message': '模型核对超时,未生成完整建议。'}
|
|
return {
|
|
'code': 'analysis_incomplete',
|
|
'message': '本次分析未完成,请稍后重新分析;无需因此修改目标或任务描述。',
|
|
}
|