Skip to content

Commit

Permalink
feat(deps): bump supported LangChain versions to 0.3.20
Browse files Browse the repository at this point in the history
Add compatibility test script to verify functionality across different LangChain versions
  • Loading branch information
ari-noumena committed Mar 9, 2025
1 parent 6799a14 commit 5b4b9d4
Show file tree
Hide file tree
Showing 6 changed files with 252 additions and 52 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,34 @@ jobs:
- name: Test build
run: |
poetry build
backwards-compatibility:
runs-on: ubuntu-latest
name: Minimum versions compatibility test
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Cache poetry install
uses: actions/cache@v4
with:
path: ~/.local
key: poetry-compatibility

- uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Install dependencies
run: poetry install --no-interaction

- name: Test compatibility with minimum versions
env:
LAKERA_GUARD_API_KEY: ${{ secrets.LAKERA_GUARD_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: ./scripts/test_compatibility.sh
5 changes: 3 additions & 2 deletions lakera_chainguard/lakera_chainguard.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@

import requests
from langchain.agents import AgentExecutor
from langchain.schema import BaseMessage, PromptValue
from langchain_core.messages import BaseMessage
from langchain_core.prompt_values import PromptValue
from langchain.tools import BaseTool
from langchain_core.agents import AgentStep
from langchain.callbacks.manager import (
CallbackManagerForLLMRun,
CallbackManagerForChainRun,
)
from langchain.schema.agent import AgentFinish, AgentAction
from langchain_core.agents import AgentFinish, AgentAction
from langchain_core.language_models import BaseChatModel, BaseLLM
from langchain_core.messages import AIMessage, HumanMessage, SystemMessage
from langchain_core.outputs import ChatResult, LLMResult
Expand Down
148 changes: 103 additions & 45 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ keywords = ["llm", "langchain", "prompt-injection", "llm-security", "lakera-guar
[tool.poetry.dependencies]
python = "^3.10"
requests = "^2.31.0"
langchain = "^0.2.10"
langchain-core = "^0.2.22"
langchain = ">=0.2.10,<0.4.0"
langchain-core = ">=0.2.43,<0.4.0"
langchain-community = ">=0.2.5,<0.4.0"
types-requests = "^2.31.0.20240106"
griffe = "0.49.0"
langchain-community = "0.2.5"


[tool.poetry.group.dev.dependencies]
Expand All @@ -28,10 +28,10 @@ black = "^23.12.1"
pre-commit = "^3.6.0"
ipykernel = "^6.28.0"
openai = "^1.6.1"
langchain-openai = "0.1.25"
mkdocs = "^1.5.3"
mkdocstrings = {extras = ["python"], version = "^0.24.0"}
mkdocs-material = "^9.5.3"
langchain-openai = ">=0.1.25,<0.4.0"


[build-system]
Expand Down
Loading

0 comments on commit 5b4b9d4

Please sign in to comment.