Skip to content

Commit

Permalink
fix legacy langchain class bug
Browse files Browse the repository at this point in the history
  • Loading branch information
pieroit committed Oct 17, 2023
1 parent 07f194e commit 80a68f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/cat/looking_glass/cheshire_cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 80a68f1

Please sign in to comment.