Skip to content

Commit

Permalink
Make LangChain dependency optional in pr-agent and update requirement…
Browse files Browse the repository at this point in the history
…s.txt
  • Loading branch information
mrT23 committed Dec 14, 2023
1 parent 246be61 commit 38ea914
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions pr_agent/algo/ai_handlers/langchain_ai_handler.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
from langchain.chat_models import ChatOpenAI
from langchain.schema import SystemMessage, HumanMessage
try:
from langchain.chat_models import ChatOpenAI
from langchain.schema import SystemMessage, HumanMessage
except: # we don't enforce langchain as a dependency, so if it's not installed, just move on
pass

from pr_agent.algo.ai_handlers.base_ai_handler import BaseAiHandler
from pr_agent.config_loader import get_settings
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ starlette-context==0.3.6
tiktoken==0.5.2
ujson==5.8.0
uvicorn==0.22.0
langchain==0.0.349
# langchain==0.0.349 # uncomment this to support language LangChainOpenAIHandler

0 comments on commit 38ea914

Please sign in to comment.