mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-20 06:20:55 +00:00
25 lines
587 B
TypeScript
25 lines
587 B
TypeScript
export function isModelNotFoundErrorMessage(raw: string): boolean {
|
|
const msg = raw.trim();
|
|
if (!msg) {
|
|
return false;
|
|
}
|
|
if (/\b404\b/.test(msg) && /not(?:[_\-\s])?found/i.test(msg)) {
|
|
return true;
|
|
}
|
|
if (/not_found_error/i.test(msg)) {
|
|
return true;
|
|
}
|
|
if (/model:\s*[a-z0-9._-]+/i.test(msg) && /not(?:[_\-\s])?found/i.test(msg)) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
export function isMiniMaxModelNotFoundErrorMessage(raw: string): boolean {
|
|
const msg = raw.trim();
|
|
if (!msg) {
|
|
return false;
|
|
}
|
|
return /\b404\b.*\bpage not found\b/i.test(msg);
|
|
}
|