mocode-ai 1.9.5 → 1.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/llm/index.js +3 -0
- package/package.json +1 -1
package/dist/llm/index.js
CHANGED
|
@@ -329,8 +329,11 @@ export function isContextLengthError(err) {
|
|
|
329
329
|
const msg = typeof e.message === 'string' ? e.message.toLowerCase() : '';
|
|
330
330
|
if (!msg)
|
|
331
331
|
return false;
|
|
332
|
+
const requestPayloadLimit = /(?:request|payload|body|history|conversation|input|prompt).{0,48}(?:exceed(?:s|ed|ing)?|too (?:large|long)|(?:is )?(?:over|above)|(?:size|length) limit|limit exceeded|larger than|maximum|max(?:imum)?)/.test(msg) ||
|
|
333
|
+
/(?:exceed(?:s|ed|ing)?|too (?:large|long)|(?:is )?(?:over|above)|limit exceeded|maximum|max(?:imum)?).{0,48}(?:request|payload|body|history|conversation|input|prompt)/.test(msg);
|
|
332
334
|
return (/context[_ ]length|context window|maximum context|too many tokens|string_above_max_length/.test(msg) ||
|
|
333
335
|
/(input|prompt|context|request).{0,20}too (long|large)|exceeds? the (model|maximum|context)/.test(msg) ||
|
|
336
|
+
requestPayloadLimit ||
|
|
334
337
|
/reduce the length|上下文(长度)?(超|过)|超出.*上下文|请求过长|长度超过|token 数?超过/.test(msg));
|
|
335
338
|
}
|
|
336
339
|
export function classifyChatError(msg) {
|