feat(routes): use coalescing operator

This commit is contained in:
ItzCrazyKns 2024-05-22 10:45:16 +05:30
parent 7853c18b6f
commit d04ba91c85
No known key found for this signature in database
GPG Key ID: 8162927C7CCE3065
3 changed files with 6 additions and 6 deletions

View File

@ -20,8 +20,8 @@ router.post('/', async (req, res) => {
});
const chatModels = await getAvailableChatModelProviders();
const provider = chat_model_provider || Object.keys(chatModels)[0];
const chatModel = chat_model || Object.keys(chatModels[provider])[0];
const provider = chat_model_provider ?? Object.keys(chatModels)[0];
const chatModel = chat_model ?? Object.keys(chatModels[provider])[0];
let llm: BaseChatModel | undefined;

View File

@ -20,8 +20,8 @@ router.post('/', async (req, res) => {
});
const chatModels = await getAvailableChatModelProviders();
const provider = chat_model_provider || Object.keys(chatModels)[0];
const chatModel = chat_model || Object.keys(chatModels[provider])[0];
const provider = chat_model_provider ?? Object.keys(chatModels)[0];
const chatModel = chat_model ?? Object.keys(chatModels[provider])[0];
let llm: BaseChatModel | undefined;

View File

@ -20,8 +20,8 @@ router.post('/', async (req, res) => {
});
const chatModels = await getAvailableChatModelProviders();
const provider = chat_model_provider || Object.keys(chatModels)[0];
const chatModel = chat_model || Object.keys(chatModels[provider])[0];
const provider = chat_model_provider ?? Object.keys(chatModels)[0];
const chatModel = chat_model ?? Object.keys(chatModels[provider])[0];
let llm: BaseChatModel | undefined;