Add custom_openai models only if custom_openai is configured
This commit is contained in:
parent
bcebdb5fd9
commit
70919ea228
1 changed files with 3 additions and 1 deletions
|
|
@ -104,7 +104,8 @@ export const getAvailableChatModelProviders = async () => {
|
|||
const customOpenAiApiUrl = getCustomOpenaiApiUrl();
|
||||
const customOpenAiModelName = getCustomOpenaiModelName();
|
||||
|
||||
models['custom_openai'] = {
|
||||
if (customOpenAiApiKey && customOpenAiApiUrl && customOpenAiModelName) {
|
||||
models['custom_openai'] = {
|
||||
...(customOpenAiApiKey && customOpenAiApiUrl && customOpenAiModelName
|
||||
? {
|
||||
[customOpenAiModelName]: {
|
||||
|
|
@ -120,6 +121,7 @@ export const getAvailableChatModelProviders = async () => {
|
|||
},
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
};
|
||||
|
||||
return models;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue