mirror of
https://github.com/foxhui/WebAI2API.git
synced 2026-06-16 21:03:59 +08:00
fix: 捕捉 zAI 模型错误提示
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user