Handle unknown chat completion sources gracefully by logging an error and returning an empty string

This commit is contained in:
Cohee
2025-05-11 11:09:15 +03:00
parent fc1020a8e4
commit 09f2b2f731

View File

@ -1661,7 +1661,8 @@ export function getChatCompletionModel(source = null) {
case chat_completion_sources.XAI: case chat_completion_sources.XAI:
return oai_settings.xai_model; return oai_settings.xai_model;
default: default:
throw new Error(`Unknown chat completion source: ${activeSource}`); console.error(`Unknown chat completion source: ${activeSource}`);
return '';
} }
} }