feat(shipping, admin, workspace, docs): 迭代货代模块、补充文档并处理合并冲突问题
This commit is contained in:
1 parent
4587b56900
commit
3c0e08377c
94 files changed
+29222
-1218
No files matched your search
@@ -521,7 +521,10 @@ export function useChat() {
|
||||
* 说明:
|
||||
* - Dify Chatflow 失败时常以 `workflow_finished + data.status=failed` 返回,HTTP 仍是 200;
|
||||
* - 若这里只按“终态成功”处理,页面会出现“没有任何响应”;
|
||||
* - 因此需要优先从 top-level / nested data / error 对象里抽取失败文案。
|
||||
* - 因此需要优先从 top-level / nested data / error 对象里抽取失败文案;
|
||||
* - 上下文过长与缺省失败文案走 chat.streamError.contextTooLong / workflowFailed。
|
||||
* @param data - SSE 事件 JSON
|
||||
* @returns 用户可读错误;非失败终态返回空串
|
||||
*/
|
||||
const extractWorkflowFailureMessage = (data: Record<string, unknown>) => {
|
||||
if (String(data.event || '') !== 'workflow_finished') return '';
|
||||
@@ -543,11 +546,11 @@ export function useChat() {
|
||||
const normalized = formatStreamError(candidate).trim();
|
||||
if (!normalized || normalized === 'Unknown error') continue;
|
||||
if (/maximum context length|input_tokens/i.test(normalized)) {
|
||||
return '当前会话上下文过长,模型无法继续回答。请新建对话后重新查询该资产编号。';
|
||||
return t('chat.streamError.contextTooLong');
|
||||
}
|
||||
return normalized;
|
||||
}
|
||||
return '工作流执行失败,请稍后重试';
|
||||
return t('chat.streamError.workflowFailed');
|
||||
};
|
||||
|
||||
const streamErrorLabels = (): StreamErrorLabels => ({
|
||||
|
||||
Reference in new issue
Block a user