From 4ec2f73990b8e53d1dcd385528f583b29ee9682c Mon Sep 17 00:00:00 2001 From: sihyeong671 Date: Tue, 20 Aug 2024 22:11:57 +0900 Subject: [PATCH] fix: refactor by github review --- backend/src/langchain/langchain.module.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/langchain/langchain.module.ts b/backend/src/langchain/langchain.module.ts index 6b1bece1..1a9e49b0 100644 --- a/backend/src/langchain/langchain.module.ts +++ b/backend/src/langchain/langchain.module.ts @@ -29,7 +29,7 @@ const chatModelFactory = { const [provider, model] = modelType.split(":", 2); let chatModel: BaseChatModel | ChatOllama; - if (modelList[provider] && modelList[provider].includes(model)) { + if (modelList[provider]?.includes(model)) { if (provider === "ollama") { chatModel = new ChatOllama({ model: model,