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

09f2b2f731f79a1df6a8382db2a2b447bbc9e433

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +2 -1Showing whitespace changes
public/scripts/openai.js+2 -1
@@ -1661,7 +1661,8 @@ export function getChatCompletionModel(source = null) {
1661 case chat_completion_sources.XAI:1661 case chat_completion_sources.XAI:
1662 return oai_settings.xai_model;1662 return oai_settings.xai_model;
1663 default:1663 default:
1664 throw new Error(`Unknown chat completion source: ${activeSource}`);1664 console.error(`Unknown chat completion source: ${activeSource}`);
1665 return '';
1665 }1666 }
1666}1667}
16671668