fix: 捕捉 zAI 模型错误提示

This commit is contained in:
foxhui
2025-12-31 02:25:21 +08:00
Unverified
parent 5c6e452a8d
commit 47417065e6
+3
View File
@@ -287,6 +287,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) {
return { error: '解析对话响应失败' };
}
// 9. 等待 chat/completions 响应 (状态码 200 且 status: true)
let completionsResponse;
try {
@@ -294,6 +295,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) {
urlMatch: 'chat/completions',
method: 'POST',
timeout: 120000,
errorText: ['Model is unable to process your request'],
meta
});
} catch (e) {
@@ -329,6 +331,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) {
urlMatch: 'chat/completed',
method: 'POST',
timeout: 120000,
errorText: ['Model is unable to process your request'],
meta
});
} catch (e) {