feat(settings): fix `undefined` model for custom OpenAI

This commit is contained in:
ItzCrazyKns 2024-07-25 20:34:49 +05:30
parent 27f8cfd212
commit cbce39a5dd
No known key found for this signature in database
GPG Key ID: 8162927C7CCE3065
1 changed files with 7 additions and 3 deletions

View File

@ -225,9 +225,13 @@ const SettingsDialog = ({
value={selectedChatModelProvider ?? undefined}
onChange={(e) => {
setSelectedChatModelProvider(e.target.value);
if (e.target.value === 'custom_openai') {
setSelectedChatModel('');
} else {
setSelectedChatModel(
config.chatModelProviders[e.target.value][0],
);
}
}}
options={Object.keys(config.chatModelProviders).map(
(provider) => ({