Skip to content

Commit a0504d7

Browse files
authored
Merge pull request #466 from ansforge/hotfix/chatbot-downgrade-packages
Hotfix: librairie langchain utilisé dans le chatbot
2 parents f96f6f7 + 92a660f commit a0504d7

4 files changed

Lines changed: 20 additions & 230 deletions

File tree

tools/chatbot/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ This project uses [uv](https://docs.astral.sh/uv/) for dependency management.
1414
### Installation
1515

1616
1. Install uv if you haven't already:
17+
1718
```bash
1819
curl -LsSf https://astral.sh/uv/install.sh | sh
1920
```
2021

2122
2. Install dependencies:
23+
2224
```bash
2325
uv sync
2426
```
@@ -33,7 +35,7 @@ uv run python chatbot.py
3335

3436
Create a `.env` file with the following variables:
3537

36-
```
38+
```txt
3739
SLACK_APP_TOKEN=xapp-...
3840
SLACK_BOT_TOKEN=xoxb-...
3941
OPENAI_API_KEY=sk-...
@@ -58,13 +60,13 @@ uv run pytest
5860
Format code:
5961

6062
```bash
61-
uv run black .
63+
uv run ruff format .
6264
```
6365

6466
Lint code:
6567

6668
```bash
67-
uv run flake8 .
69+
uv run ruff check .
6870
```
6971

7072
### Docker
@@ -74,4 +76,4 @@ Build and run with Docker:
7476
```bash
7577
docker build -t samu-hub-chatbot .
7678
docker run -d --env-file .env samu-hub-chatbot
77-
```
79+
```

tools/chatbot/chatbot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
from langchain_community.document_loaders import PyPDFLoader
1010

11-
from langchain.chains import create_retrieval_chain
12-
from langchain.chains.combine_documents import create_stuff_documents_chain
11+
from langchain_classic.chains import create_retrieval_chain
12+
from langchain_classic.chains.combine_documents import create_stuff_documents_chain
1313
from langchain_core.prompts import ChatPromptTemplate
1414

1515
import os

tools/chatbot/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ description = "SAMU Hub Santé Slack chatbot"
55
requires-python = ">=3.11"
66
dependencies = [
77
"slack-bolt~=1.26.0",
8-
"langchain~=1.0.3",
98
"langchain-openai~=1.0.1",
109
"langchain-community~=0.4.1",
1110
"langchain-core~=1.0.2",
@@ -14,11 +13,12 @@ dependencies = [
1413
"openai~=2.6.1",
1514
"python-dotenv~=1.2.1",
1615
"pypdf~=6.1.3",
16+
"langchain-classic>=1.0.0",
1717
]
1818

1919
[dependency-groups]
2020
dev = [
2121
"pytest>=7.0.0",
2222
"ruff>=0.14.3",
2323
"pip-audit>=2.6.0",
24-
]
24+
]

0 commit comments

Comments
 (0)