1
- # Langchain -Chatchat 源代码部署/开发部署指南
1
+ # LangGraph -Chatchat 源代码部署/开发部署指南
2
2
3
3
## 0. 拉取项目代码
4
4
5
5
如果您是想要使用源码启动的用户,请直接拉取 master 分支代码
6
6
7
7
``` shell
8
- git clone https://github.com/chatchat-space/Langchain -Chatchat.git
8
+ git clone https://github.com/chatchat-space/LangGraph -Chatchat.git
9
9
```
10
10
11
11
## 1. 初始化开发环境
12
12
13
- Langchain-Chatchat 自 0.3.0 版本起,为方便支持用户使用 pip 方式安装部署,以及为避免环境中依赖包版本冲突等问题,
14
- 在源代码/开发部署中不再继续使用 requirements.txt 管理项目依赖库,转为使用 Poetry 进行环境管理。
13
+ LangGraph-Chatchat 使用 Poetry 进行环境管理。
15
14
16
15
### 1.1 安装 Poetry
17
16
18
- > 在安装 Poetry 之前,如果您使用 Conda,请创建并激活一个新的 Conda 环境,例如使用 ` conda create -n chatchat python=3.9 ` 创建一个新的 Conda 环境。
17
+ > 在安装 Poetry 之前,如果您使用 Conda,请创建并激活一个新的 Conda 环境,例如使用 ` conda create -n chatchat python=3.12 ` 创建一个新的 Conda 环境。
19
18
20
19
安装 Poetry: [ Poetry 安装文档] ( https://python-poetry.org/docs/#installing-with-pipx )
21
20
@@ -28,50 +27,37 @@ Langchain-Chatchat 自 0.3.0 版本起,为方便支持用户使用 pip 方式
28
27
29
28
### 1.2 安装源代码/开发部署所需依赖库
30
29
31
- 进入主项目目录,并安装 Langchain -Chatchat 依赖
30
+ 进入主项目目录,并安装 LangGraph -Chatchat 依赖
32
31
33
32
``` shell
34
- cd Langchain -Chatchat/libs/chatchat-server/
33
+ cd LangGraph -Chatchat/libs/chatchat-server
35
34
poetry install --with lint,test -E xinference
36
-
37
- # or use pip to install in editing mode:
38
- pip install -e .
39
35
```
40
36
41
37
> [ !Note]
42
38
> Poetry install 后会在你的虚拟环境中 site-packages 路径下生成一个 chatchat-` <version> ` .dist-info 文件夹带有 direct_url.json 文件,这个文件指向你的开发环境
43
39
44
40
### 1.3 更新开发部署环境依赖库
45
41
46
- 当开发环境中所需的依赖库发生变化时,一般按照更新主项目目录(` Langchain-Chatchat/libs/chatchat-server/ ` )下的 pyproject.toml 再进行 poetry update 的顺序执行。
47
-
48
- ### 1.4 将更新后的代码打包测试
49
-
50
- 如果需要对开发环境中代码打包成 Python 库并进行测试,可在主项目目录执行以下命令:
51
-
52
- ``` shell
53
- poetry build
54
- ```
55
-
56
- 命令执行完成后,在主项目目录下会新增 ` dist ` 路径,其中存储了打包后的 Python 库。
42
+ 当开发环境中所需的依赖库发生变化时,一般按照更新主项目目录(` LangGraph-Chatchat/libs/chatchat-server/ ` )下的 pyproject.toml 再进行 poetry update 的顺序执行。
57
43
58
44
## 2. 设置源代码根目录
59
45
60
- 如果您在开发时所使用的 IDE 需要指定项目源代码根目录,请将主项目目录(` Langchain -Chatchat/libs/chatchat-server/` )设置为源代码根目录。
46
+ 如果您在开发时所使用的 IDE 需要指定项目源代码根目录,请将主项目目录(` LangGraph -Chatchat/libs/chatchat-server/` )设置为源代码根目录。
61
47
62
48
执行以下命令之前,请先设置当前目录和项目数据目录:
63
49
``` shell
64
- cd Langchain -Chatchat/libs/chatchat-server/chatchat
50
+ cd LangGraph -Chatchat/libs/chatchat-server/chatchat
65
51
export CHATCHAT_ROOT=/parth/to/chatchat_data
66
52
```
67
53
68
54
## 3. 关于 chatchat 配置项
69
55
70
- 从 ` 0.3.1 ` 版本开始,所有配置项改为 ` yaml ` 文件,具体参考 [ Settings] ( settings.md ) 。
56
+ 配置项均为 ` yaml ` 文件,具体参考 [ Settings] ( settings.md ) 。
71
57
72
58
执行以下命令初始化项目配置文件和数据目录:
73
59
``` shell
74
- cd libs/chatchat-server
60
+ cd LangGraph-Chatchat/ libs/chatchat-server
75
61
python chatchat/cli.py init
76
62
```
77
63
@@ -81,15 +67,15 @@ python chatchat/cli.py init
81
67
> 这个命令会清空数据库、删除已有的配置文件,如果您有重要数据,请备份。
82
68
83
69
``` shell
84
- cd libs/chatchat-server
70
+ cd LangGraph-Chatchat/ libs/chatchat-server
85
71
python chatchat/cli.py kb --recreate-vs
86
72
```
87
73
如需使用其它 Embedding 模型,或者重建特定的知识库,请查看 ` python chatchat/cli.py kb --help ` 了解更多的参数。
88
74
89
75
## 5. 启动服务
90
76
91
77
``` shell
92
- cd libs/chatchat-server
78
+ cd LangGraph-Chatchat/ libs/chatchat-server
93
79
python chatchat/cli.py start -a
94
80
```
95
81
0 commit comments