Skip to content

Commit

Permalink
Updated deps for latest langchain version (#3092)
Browse files Browse the repository at this point in the history
* Updated deps and imports for latest langchain version
  • Loading branch information
antonpirker authored May 21, 2024
1 parent eed9d48 commit 69a3b29
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
9 changes: 8 additions & 1 deletion tests/integrations/langchain/test_langchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
from unittest.mock import Mock

import pytest
from langchain_community.chat_models import ChatOpenAI

try:
# Langchain >= 0.2
from langchain_openai import ChatOpenAI
except ImportError:
# Langchain < 0.2
from langchain_community.chat_models import ChatOpenAI

from langchain_core.callbacks import CallbackManagerForLLMRun
from langchain_core.messages import BaseMessage, AIMessageChunk
from langchain_core.outputs import ChatGenerationChunk
Expand Down
12 changes: 8 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ envlist =
{py3.9,py3.11,py3.12}-huggingface_hub-{v0.22,latest}

# Langchain
{py3.9,py3.11,py3.12}-langchain-0.1
{py3.9,py3.11,py3.12}-langchain-v0.1
{py3.9,py3.11,py3.12}-langchain-latest
{py3.9,py3.11,py3.12}-langchain-notiktoken

Expand Down Expand Up @@ -462,12 +462,16 @@ deps =
huggingface_hub-latest: huggingface_hub

# Langchain
langchain: openai~=1.0.0
langchain-0.1: langchain~=0.1.11
langchain-0.1: tiktoken~=0.6.0
langchain-v0.1: openai~=1.0.0
langchain-v0.1: langchain~=0.1.11
langchain-v0.1: tiktoken~=0.6.0
langchain-latest: langchain
langchain-latest: langchain-openai
langchain-latest: openai>=1.6.1
langchain-latest: tiktoken~=0.6.0
langchain-notiktoken: langchain
langchain-notiktoken: langchain-openai
langchain-notiktoken: openai>=1.6.1

# Loguru
loguru-v0.5: loguru~=0.5.0
Expand Down

0 comments on commit 69a3b29

Please sign in to comment.