From 80a68f1d386315f4b81f9aa85b94847c4821f7fb Mon Sep 17 00:00:00 2001 From: Piero Savastano Date: Tue, 17 Oct 2023 18:10:41 +0200 Subject: [PATCH] fix legacy langchain class bug --- core/cat/looking_glass/cheshire_cat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/cat/looking_glass/cheshire_cat.py b/core/cat/looking_glass/cheshire_cat.py index c29975c8..36610e71 100644 --- a/core/cat/looking_glass/cheshire_cat.py +++ b/core/cat/looking_glass/cheshire_cat.py @@ -5,7 +5,7 @@ import os import asyncio import langchain -from langchain.llms import Cohere, OpenAI, OpenAIChat, AzureOpenAI, HuggingFaceTextGenInference, HuggingFaceHub +from langchain.llms import Cohere, OpenAI, AzureOpenAI, HuggingFaceTextGenInference, HuggingFaceHub from langchain.chat_models import ChatOpenAI, AzureChatOpenAI from langchain.base_language import BaseLanguageModel @@ -163,7 +163,7 @@ def get_language_embedder(self) -> embedders.EmbedderSettings: return embedder # OpenAI embedder - if type(self._llm) in [OpenAI, OpenAIChat]: + if type(self._llm) in [OpenAI, ChatOpenAI]: embedder = embedders.EmbedderOpenAIConfig.get_embedder_from_config( { "openai_api_key": self._llm.openai_api_key,