From 80c098f7eb9d1cf67399e9fa036e18005810f4c5 Mon Sep 17 00:00:00 2001 From: anpigon Date: Sun, 7 Jul 2024 20:13:39 +0900 Subject: [PATCH] feat(createChatModelInstance.ts): add support for ChatAnthropic model to enhance AI model options --- src/libs/ai/createChatModelInstance.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libs/ai/createChatModelInstance.ts b/src/libs/ai/createChatModelInstance.ts index 1b55479..69e5c1b 100644 --- a/src/libs/ai/createChatModelInstance.ts +++ b/src/libs/ai/createChatModelInstance.ts @@ -1,5 +1,6 @@ import {ChatOllama} from '@langchain/community/chat_models/ollama'; import {ChatGoogleGenerativeAI} from '@langchain/google-genai'; +import {ChatAnthropic} from '@langchain/anthropic'; import {ChatOpenAI} from '@langchain/openai'; import {ChatGroq} from '@langchain/groq'; @@ -20,6 +21,8 @@ export default function createChatModelInstance(provider: LLM_PROVIDERS, model: return new ChatGoogleGenerativeAI(options); case LLM_PROVIDERS.GROQ: return new ChatGroq(options); + case LLM_PROVIDERS.ANTHROPIC: + return new ChatAnthropic(options); default: return new ChatOpenAI({ ...options,