Langchain-Chatchat/server
liunux4odoo 3acbf4d5d1
增加数据库字段,重建知识库使用多线程 (#1280)
* close #1172: 给webui_page/utils添加一些log信息,方便定位错误

* 修复:重建知识库时页面未实时显示进度

* skip model_worker running when using online model api such as chatgpt

* 修改知识库管理相关内容:
1.KnowledgeFileModel增加3个字段:file_mtime(文件修改时间),file_size(文件大小),custom_docs(是否使用自定义docs)。为后面比对上传文件做准备。
2.给所有String字段加上长度,防止mysql建表错误(pr#1177)
3.统一[faiss/milvus/pgvector]_kb_service.add_doc接口,使其支持自定义docs
4.为faiss_kb_service增加一些方法,便于调用
5.为KnowledgeFile增加一些方法,便于获取文件信息,缓存file2text的结果。

* 修复/chat/fastchat无法流式输出的问题

* 新增功能:
1、KnowledgeFileModel增加"docs_count"字段,代表该文件加载到向量库中的Document数量,并在WEBUI中进行展示。
2、重建知识库`python init_database.py --recreate-vs`支持多线程。

其它:
统一代码中知识库相关函数用词:file代表一个文件名称或路径,doc代表langchain加载后的Document。部分与API接口有关或含义重叠的函数暂未修改。

---------

Co-authored-by: liunux4odoo <liunux@qq.com>, hongkong9771
2023-08-28 13:50:35 +08:00
..
chat 增加数据库字段,重建知识库使用多线程 (#1280) 2023-08-28 13:50:35 +08:00
db 增加数据库字段,重建知识库使用多线程 (#1280) 2023-08-28 13:50:35 +08:00
knowledge_base 增加数据库字段,重建知识库使用多线程 (#1280) 2023-08-28 13:50:35 +08:00
static update api and webui: 2023-08-16 13:18:58 +08:00
api.py 增加数据库字段,重建知识库使用多线程 (#1280) 2023-08-28 13:50:35 +08:00
api_allinone_stale.py update llm_api_launch,api_allinone,webui_allinone,readme:1.llm_api_launch,api_allinone_webui_allinone更名;2. 更新readme关于startup的说明 2023-08-17 16:59:16 +08:00
llm_api.py llm_api can be terminated by Ctrl+c. success on windows 2023-08-16 17:48:55 +08:00
llm_api_shutdown.py update import pkgs and format 2023-08-10 21:26:05 +08:00
llm_api_stale.py update README.md and llm_api_stale.py 2023-08-20 10:38:41 +08:00
utils.py update chat and knowledge base api: unify exception processing and return types 2023-08-19 15:14:45 +08:00
webui_allinone_stale.py update llm_api_launch,api_allinone,webui_allinone,readme:1.llm_api_launch,api_allinone_webui_allinone更名;2. 更新readme关于startup的说明 2023-08-17 16:59:16 +08:00