feat(routes): use coalescing operator
This commit is contained in:
parent
7853c18b6f
commit
d04ba91c85
|
@ -20,8 +20,8 @@ router.post('/', async (req, res) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const chatModels = await getAvailableChatModelProviders();
|
const chatModels = await getAvailableChatModelProviders();
|
||||||
const provider = chat_model_provider || Object.keys(chatModels)[0];
|
const provider = chat_model_provider ?? Object.keys(chatModels)[0];
|
||||||
const chatModel = chat_model || Object.keys(chatModels[provider])[0];
|
const chatModel = chat_model ?? Object.keys(chatModels[provider])[0];
|
||||||
|
|
||||||
let llm: BaseChatModel | undefined;
|
let llm: BaseChatModel | undefined;
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,8 @@ router.post('/', async (req, res) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const chatModels = await getAvailableChatModelProviders();
|
const chatModels = await getAvailableChatModelProviders();
|
||||||
const provider = chat_model_provider || Object.keys(chatModels)[0];
|
const provider = chat_model_provider ?? Object.keys(chatModels)[0];
|
||||||
const chatModel = chat_model || Object.keys(chatModels[provider])[0];
|
const chatModel = chat_model ?? Object.keys(chatModels[provider])[0];
|
||||||
|
|
||||||
let llm: BaseChatModel | undefined;
|
let llm: BaseChatModel | undefined;
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,8 @@ router.post('/', async (req, res) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const chatModels = await getAvailableChatModelProviders();
|
const chatModels = await getAvailableChatModelProviders();
|
||||||
const provider = chat_model_provider || Object.keys(chatModels)[0];
|
const provider = chat_model_provider ?? Object.keys(chatModels)[0];
|
||||||
const chatModel = chat_model || Object.keys(chatModels[provider])[0];
|
const chatModel = chat_model ?? Object.keys(chatModels[provider])[0];
|
||||||
|
|
||||||
let llm: BaseChatModel | undefined;
|
let llm: BaseChatModel | undefined;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue