Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/gsk 1819 set a minimum on langchains version #1507

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/build-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,28 +57,39 @@ jobs:
os: [ubuntu-latest]
pydantic_v1: [false]
pandas_v1: [false]
langchain_minimal: [false]
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
include:
- python-version: "3.10"
os: windows-2019
pydantic_v1: false
pandas_v1: false
langchain_minimal: false
- python-version: "3.10"
os: windows-2022
pydantic_v1: false
pandas_v1: false
langchain_minimal: false
- python-version: "3.10"
os: macos-latest
pydantic_v1: false
pandas_v1: false
langchain_minimal: false
- python-version: "3.10"
os: ubuntu-latest
pydantic_v1: true
pandas_v1: false
langchain_minimal: false
- python-version: "3.10"
os: ubuntu-latest
pydantic_v1: false
pandas_v1: true
langchain_minimal: false
- python-version: "3.10"
os: ubuntu-latest
pydantic_v1: false
pandas_v1: false
langchain_minimal: true
continue-on-error: false # https://ncorti.com/blog/howto-github-actions-build-matrix
steps:
- name: Checkout code
Expand Down Expand Up @@ -115,6 +126,18 @@ jobs:
pdm run pip uninstall pydantic pydantic_core -y
pdm run pip install "pydantic>=1,<2"

- name: Install langchain minimal version
if: ${{ matrix.langchain_minimal }}
run: |
pdm run pip uninstall langchain -y
pdm run pip install "langchain==0.0.275"

- name: Check Pydantic installed version
if: ${{ matrix.langchain_minimal }}
run: |
pdm run pip freeze | grep '^langchain'
pdm run pip freeze | grep -q '^langchain==0.0.275'

- name: Check Pydantic installed version
run: |
pdm run pip freeze | grep '^pydantic'
Expand Down
6 changes: 5 additions & 1 deletion pdm.lock

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

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ dev = [
"pydantic>=2",
]
ml_runtime = [
"langchain>=0.0.187",
"langchain>=0.0.275",
"nltk>=3.8.1",
"xgboost>=1.7.5",
"lightgbm>=3.3.5",
Expand Down
17 changes: 17 additions & 0 deletions tests/llm/test_talk.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,28 @@
import pytest
from langchain.agents import AgentExecutor
from langchain.llms import FakeListLLM
from langchain.prompts.chat import ChatPromptTemplate

from giskard import llm_config
from giskard.llm.talk.talk import ModelSpec


def test_create_prompt_langchain():
ChatPromptTemplate.from_messages(
[
(
"system",
"""
Your task is to critisize an article based on its summary.
Please remember to always give unbiased and respectful critisize.
You should always starts with: "I believe this article is really ..."
""",
),
("user", "Article: {article_summary}"),
]
)


def test_predict(german_credit_test_data, german_credit_model):
model_spec = ModelSpec(model=german_credit_model)

Expand Down