Skip to content

Commit

Permalink
fix: remove langchain mandatory dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
gventuri committed Feb 29, 2024
1 parent 00929a1 commit 53e3de6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pandasai/llm/langchain.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
from typing import Union
try:
from langchain_core.language_models.chat_models import BaseChatModel
from langchain_core.language_models.llms import BaseLLM

LANGCHAIN_AVAILABLE = True
except ImportError:
# Fallback definitions if langchain_core is not installed
BaseLLM = BaseChatModel = object
LANGCHAIN_AVAILABLE = False

from langchain_core.language_models.chat_models import BaseChatModel
from langchain_core.language_models.llms import BaseLLM
from typing import Union

from pandasai.prompts.base import AbstractPrompt

Expand Down

0 comments on commit 53e3de6

Please sign in to comment.