Commit Graph

407 Commits

Author SHA1 Message Date
glide-the 038f2eb1ec 修复代理为空的问题
(cherry picked from commit 84a4141dec)
2023-10-04 14:05:00 +08:00
glide-the 48338207bd 修复代理为空的问题
(cherry picked from commit a655608d01)
2023-10-04 14:05:00 +08:00
glide-the 84a4141dec 修复代理为空的问题 2023-10-04 14:02:57 +08:00
glide-the a655608d01 修复代理为空的问题 2023-10-04 13:33:42 +08:00
zR fc6a3b07ed
Dev (#1652)
* 更新上agent提示词代码

* 更新部分文档,修复了issue中提到的bge匹配超过1 的bug

* 按需修改

* 解决了部分最新用户用依赖的bug,加了两个工具,移除google工具
2023-10-04 12:05:46 +08:00
liunux4odoo 332f8be401
fix: windows下bind_host设为0.0.0.0时,将fschat_xx_address指向127.0.0.1,避免请求错误 (#1651) 2023-10-03 23:40:05 +08:00
zR 77d38db00e
修改部分错误的文档,加长了历史记录(for 32k Models) (#1629)
* 更新上agent提示词代码

* 更新部分文档,修复了issue中提到的bge匹配超过1 的bug

* 按需修改
2023-09-29 20:17:29 +08:00
liunux4odoo eb6f5cf84b
fix: embedding_model_dict used for bge-* models (#1628)
change to use `get_model_path`
2023-09-29 18:57:15 +08:00
zR d9056a8df6
python3.8用户需要加上__future__ (#1624)
* 增加了仅限GPT4的agent功能,陆续补充,中文版readme已写

* issue提到的一个bug

* 温度最小改成0,但是不应该支持负数

* 修改了最小的温度

* 增加了部分Agent支持和修改了启动文件的部分bug

* 修改了GPU数量配置文件

* 1

1

* 修复配置文件错误

* 更新readme,稳定测试

* 更新readme

* python3.8用户需要加这两行
2023-09-29 16:04:44 +08:00
hzg0601 00745c99e2 update baichuan.py 2023-09-29 13:19:17 +08:00
hzg0601 0e20552083 1. 增加baichuan-api支持;2.增加批量复制configs下.example文件为.py文件的脚本copy_config_example.py;3. 更新model_config.py.example 2023-09-29 13:16:14 +08:00
zR efd8edda16
Dev (#1618)
* 增加了仅限GPT4的agent功能,陆续补充,中文版readme已写

* issue提到的一个bug

* 温度最小改成0,但是不应该支持负数

* 修改了最小的温度

* 增加了部分Agent支持和修改了启动文件的部分bug

* 修改了GPU数量配置文件

* 1

1

* 修复配置文件错误

* 更新readme,稳定测试
2023-09-28 20:19:26 +08:00
WilliamChen-luckbob 8fa99026c8
根据官方文档,添加对英文版的bge embedding的指示模板 (#1585)
Co-authored-by: zR <2448370773@qq.com>
2023-09-28 19:18:31 +08:00
liunux4odoo b3c7f8b072
修复webui中重建知识库以及对话界面UI错误 (#1615)
* 修复bug:webui点重建知识库时,如果存在不支持的文件会导致整个接口错误;migrate中没有导入CHUNK_SIZE

* 修复:webui对话界面的expander一直为running状态;简化历史消息获取方法
2023-09-28 15:12:03 +08:00
liunux4odoo 8d0f8a5d67 fix: langchain warnings for import from root 2023-09-27 21:55:02 +08:00
zR d39878ff35
Dev (#1613)
* 增加了仅限GPT4的agent功能,陆续补充,中文版readme已写

* issue提到的一个bug

* 温度最小改成0,但是不应该支持负数

* 修改了最小的温度
2023-09-27 21:17:50 +08:00
zR 5702554171
增加了仅限GPT4的agent功能,陆续补充,中文版readme已写 (#1611) 2023-09-27 19:19:25 +08:00
imClumsyPanda f3042a6a29 merge master 2023-09-22 12:36:45 +08:00
liunux4odoo e4a927c5d1
将所有httpx请求改为使用Client,提高效率,方便以后设置代理等。 (#1554)
将所有httpx请求改为使用Client,提高效率,方便以后设置代理等。

将本项目相关服务加入无代理列表,避免fastchat的服务器请求错误。(windows下无效)
2023-09-21 15:19:51 +08:00
peterz3g 3ff130ecc2
修复csv文件解析编码报错的问题。 (#1508) 2023-09-21 14:41:49 +08:00
liunux4odoo 818cb1a491 update kb_doc_api: use Form instead of Body when upload file 2023-09-21 09:57:36 +08:00
glide-the 0586f94c5a summary_chunk 文档分段总结业务实现
使用 MapReduceDocumentsChain 生成摘要
2023-09-20 23:55:56 +08:00
liunux4odoo 92359fb6b9 remove depends on volcengine 2023-09-20 23:02:43 +08:00
glide-the bd0164ea62 处理序列化至磁盘的逻辑 2023-09-20 21:35:23 +08:00
Leego 9bcce0a572
【功能新增】在线 LLM 模型支持阿里云通义千问 (#1534)
* feat: add qwen-api

* 使Qwen API支持temperature参数;添加测试用例

* 将online-api的sdk列为可选依赖

---------

Co-authored-by: liunux4odoo <liunux@qq.com>
2023-09-20 21:34:12 +08:00
Jim Zhang cb2b560a5b fix : Duplicate variable and function name (#1509)
Co-authored-by: Jim <zhangpengyi@taijihuabao.com>
2023-09-20 16:46:31 +08:00
lehug b6c390777a
fix argument name in help text (#1532) 2023-09-20 10:38:50 +08:00
liunux4odoo 46af5b7571
fix: llm_model_dict with `xxx/xxx` local_model_path was parsed as online-api (#1513) 2023-09-18 12:10:03 +08:00
Jim Zhang 59fb309ba4
fix : Duplicate variable and function name (#1509)
Co-authored-by: Jim <zhangpengyi@taijihuabao.com>
2023-09-18 11:00:04 +08:00
liunux4odoo 1bae930691
修复faiss_pool知识库缓存key错误 (#1507) 2023-09-17 16:31:44 +08:00
liunux4odoo ec85cd1954
move wrap_done & get_ChatOpenAI from server.chat.utils to server.utils (#1506) 2023-09-17 16:19:50 +08:00
liunux4odoo bb7ce601fc 1. 搜索引擎问答支持历史记录;
2. 修复知识库问答历史记录传参错误:用户输入被传入history,问题出在webui中重复获取历史消息,api知识库对话接口并无问题。
2023-09-17 13:58:57 +08:00
glide-the 902ba0c321 增加传入矢量名称加载 2023-09-17 13:56:18 +08:00
glide-the 175c90c362 增加其它模型的参数适配 2023-09-17 13:56:08 +08:00
liunux4odoo a65bc4a63c
添加configs/prompt_config.py,允许用户自定义prompt模板: (#1504)
1、 默认包含2个模板,分别用于LLM对话,知识库和搜索引擎对话
2、 server/utils.py提供函数get_prompt_template,获取指定的prompt模板内容(支持热加载)
3、 api.py中chat/knowledge_base_chat/search_engine_chat接口支持prompt_name参数
2023-09-17 13:27:11 +08:00
zR 598eb298df
第一版初步agent实现 (#1503)
* 第一版初步agent实现

* 增加steaming参数

* 修改了weather.py

---------

Co-authored-by: zR <zRzRzRzRzRzRzR>
2023-09-17 11:19:16 +08:00
qiankunli 13cca9cf81
feat: support volc fangzhou (#1501)
* feat: support volc fangzhou

---------

Co-authored-by: liunux4odoo <41217877+liunux4odoo@users.noreply.github.com>
Co-authored-by: liqiankun.1111 <liqiankun.1111@bytedance.com>
2023-09-17 00:53:12 +08:00
liunux4odoo 9a7beef270 使火山方舟正常工作,添加错误处理和测试用例 2023-09-17 00:21:13 +08:00
liunux4odoo 745a105bae feat: support volc fangzhou 2023-09-16 22:21:16 +08:00
liunux4odoo 3dde02be28
优化LLM模型列表获取、切换的逻辑: (#1497)
1、更准确的获取未运行的可用模型
2、优化WEBUI模型列表显示与切换的控制逻辑
2023-09-16 07:15:08 +08:00
liunux4odoo 955b0bc211
修复ChatGPT api_base_url错误;用户可以在model_config在线模型配置中覆盖默认的api_base_url (#1496) 2023-09-15 22:56:13 +08:00
liunux4odoo 80375e1ff3
fix merge conflict for #1474 (#1494) 2023-09-15 18:11:15 +08:00
liunux4odoo f7c73b842a
优化configs (#1474)
* remove llm_model_dict

* optimize configs

* fix get_model_path

* 更改一些默认参数,添加千帆的默认配置

* Update server_config.py.example
2023-09-15 17:52:22 +08:00
imClumsyPanda 20eef45a58 update README.md 2023-09-15 09:53:58 +08:00
liunux4odoo 30aeec1c45
修改智谱API默认名称,给WEBUI设置主题 (#1484)
* 給WEBUI设置主题

* chatglm-api更名为zhipu-api
2023-09-15 01:48:02 +08:00
liunux4odoo f0f1dc2537 补充更多千帆平台支持的模型;除了指定模型名称,支持直接指定模型APIURL,便于填写单独申请的模型地址 2023-09-15 00:30:18 +08:00
liunux4odoo 4cf2e5ea5e 修复文心一言,添加测试用例 2023-09-14 23:37:34 +08:00
imClumsyPanda 883445e5b2
增加 百度文心一言 API 接入支持 (#1477)
* add RapidOCRPDFLoader

* update mypdfloader.py and requirements.txt

* add myimgloader.py

* add test samples

* add TODO to mypdfloader

* add loaders to KnowledgeFile class

* add loaders to KnowledgeFile class

* add ChineseRecursiveTextSplitter

* add ChineseRecursiveTextSplitter

* add baidu ernie api
2023-09-14 15:30:06 +08:00
唐国梁 6ad8aee88c add ES function 2023-09-14 07:54:42 +08:00
zR 769d75d784
修复测试文件 (#1467)
Co-authored-by: zR <zRzRzRzRzRzRzR>
2023-09-13 17:12:05 +08:00
zR bfdbe69fa1
增加了自定义分词器适配 (#1462)
* 添加了自定义分词器适配和测试文件
---------

Co-authored-by: zR <zRzRzRzRzRzRzR>
2023-09-13 15:42:12 +08:00
liunux4odoo c4cb4e19e5
清理不必要的依赖,增加星火API需要的websockets (#1463) 2023-09-13 15:35:04 +08:00
liunux4odoo 99b862dfc8 fix SparkApi import error 2023-09-13 14:03:09 +08:00
liunux4odoo 512638a3b1
支持讯飞星火大模型在线API (#1460)
* 支持讯飞星火大模型在线API
2023-09-13 13:51:05 +08:00
liunux4odoo 16d8809c9a
api和webui知识库操作支持chunk_size/overlap_size/zh_title_enhance参数 (#1459) 2023-09-13 11:19:47 +08:00
liunux4odoo 9defa4332e fix minimax api history error 2023-09-13 10:12:31 +08:00
liunux4odoo 8b040620de
对话接口支持temperature参数 (#1455) 2023-09-13 10:00:54 +08:00
liunux4odoo a03b8d330d
升级到langchain==0.0.287,fschat==0.0.28;处理langchain.Milvus bug(#10492) (#1454)
* 修复milvus_kb_service中一些bug,添加文档后将数据同步到数据库
* 升级到langchain==0.0.287,fschat==0.0.28;处理langchain.Milvus bug(#10492)
* 修复切换模型BUG: 从在线API切换模型时出错
2023-09-13 08:43:11 +08:00
liunux4odoo efd6d4a251
修复milvus_kb_service中一些bug,添加文档后将数据同步到数据库 (#1452) 2023-09-12 22:34:03 +08:00
imClumsyPanda 2020f5bb88 merge master 2023-09-12 15:51:28 +08:00
liunux4odoo 03c021d50f
添加MiniMax在线API支持 (#1445) 2023-09-12 15:24:47 +08:00
imClumsyPanda 8064586374 delete .doc from supported formats 2023-09-12 15:22:18 +08:00
liunux4odoo 60f88ae92e
fix: 由于server.utils导入model_workers时,导入fastchat model_worker,导致startup启动延迟明显 (#1436) 2023-09-12 08:52:00 +08:00
liunux4odoo 6a03611750
fix api and webui: (#1435)
1. fix #1431: 优化知识库问答与搜索引擎问答的API接口,避免docs重复返回
2. startup.py根据configs.log_verbose控制log级别
3. 修复/llm_model/list_models的bug:
   只有一个参数时,fastapi未返回json导致视图函数出错
2023-09-12 08:31:17 +08:00
liunux4odoo 22ff073309
修改Embeddings和FAISS缓存加载方式,知识库相关API接口支持多线程并发 (#1434)
* 修改Embeddings和FAISS缓存加载方式,支持多线程,支持内存FAISS

* 知识库相关API接口支持多线程并发

* 根据新的API接口调整ApiRequest和测试用例

* 删除webui.py失效的启动说明
2023-09-11 20:41:41 +08:00
glide-the 5550e3c1a9 增加显示详细日志开关 2023-09-08 20:48:31 +08:00
liunux4odoo 775870a516
改变api视图函数的sync/async,提高api并发能力: (#1414)
1. 4个chat类接口改为async
2. 知识库操作,涉及向量库修改的使用async,避免FAISS写入错误;涉及向量库读取的改为sync,提高并发
2023-09-08 12:25:02 +08:00
liunux4odoo 1195eb75eb merge pr1413 2023-09-08 10:30:07 +08:00
liunux4odoo 661a0e9d72 新功能:
- 知识库管理中的add_docs/delete_docs/update_docs均支持批量操作,并利用多线程提高效率
- API的重建知识库接口支持多线程
- add_docs可提供参数控制上传文件后是否继续进行向量化
- add_docs/update_docs支持传入自定义docs(以json形式)。后续考虑区分完整或补充式自定义docs
- download_doc接口添加`preview`参数,支持下载或预览
- kb_service增加`save_vector_store`方法,便于保存向量库(仅FAISS,其它无操作)
- 将document_loader & text_splitter逻辑从KnowledgeFile中抽离出来,为后续对内存文件进行向量化做准备
- KowledgeFile支持docs & splitted_docs的缓存,方便在中间过程做一些自定义

其它:
- 将部分错误输出由print改为logger.error
2023-09-08 08:55:12 +08:00
glide-the 1027ab6c06 增加构建文档metadata检索的开关,移动到dev_metadata_search 2023-09-05 20:59:57 +08:00
glide-the 491c9605d9 增加构建文档metadata检索的开关 2023-09-05 18:35:11 +08:00
liunux4odoo 3e87530478 使zhipuai变为非必要依赖(close #1369) 2023-09-05 12:43:51 +08:00
liunux4odoo 464ccc6d53 Update migrate.py (#1371)
fix bug at line 85 : for kb_file in kb_file
2023-09-05 11:52:22 +08:00
liunux4odoo 015ce57691
Update migrate.py (#1371)
fix bug at line 85 : for kb_file in kb_file
2023-09-05 11:47:25 +08:00
liunux4odoo 93b133f9ac 将KnowledgeFile的file2text拆分成file2docs、docs2texts和file2text三个部分,在保持接口不变的情况下,实现:
1、支持chunk_size和chunk_overlap参数
2、支持自定义text_splitter
3、支持自定义docs
修复:csv文件不使用text_splitter
2023-09-04 21:00:16 +08:00
zqt e21ca447af milvus/pg kb_service需要实现get_doc_by_id方法 2023-09-04 16:40:05 +08:00
liunux4odoo 0bc9d5c8ee
Merge branch 'dev' into opt_add_doc 2023-09-03 21:38:45 +08:00
imClumsyPanda 8a73673d6b update model_config.py.example 2023-09-03 15:57:44 +08:00
imClumsyPanda 25880ebd52 fix bug when config["device"]="auto" 2023-09-02 22:11:54 +08:00
liunux4odoo 6cb1bdf623
添加切换模型功能,支持智谱AI在线模型 (#1342)
* 添加LLM模型切换功能,需要在server_config中设置可切换的模型
* add tests for api.py/llm_model/*
* - 支持模型切换
- 支持智普AI线上模型
- startup.py增加参数`--api-worker`,自动运行所有的线上API模型。使用`-a
  (--all-webui), --all-api`时默认开启该选项
* 修复被fastchat覆盖的标准输出
* 对fastchat日志进行更细致的控制,startup.py中增加-q(--quiet)开关,可以减少无用的fastchat日志输出
* 修正chatglm api的对话模板


Co-authored-by: liunux4odoo <liunu@qq.com>
2023-09-01 23:58:09 +08:00
liunux4odoo 55e417a263 升级注意
数据库表发生变化,需要重建知识库

 新功能
- 增加FileDocModel库表,存储知识文件与向量库Document ID对应关系以及元数据,便于检索向量库
- 增加FileDocModel对应的数据库操作函数(这些函数主要是给KBService调用,用户一般无需使用):
  - list_docs_from_db: 根据知识库名称、文件名称、元数据检索对应的Document IDs
  - delete_docs_from_db: 根据知识库名称、文件名称删除对应的file-doc映射
  - add_docs_to_db: 添加对应的file-doc映射
- KBService增加list_docs方法,可以根据文件名、元数据检索Document。当前仅支持FAISS,待milvus/pg实现get_doc_by_id方法后即自动支持。
- 去除server.utils对torch的依赖

 待完善
- milvus/pg kb_service需要实现get_doc_by_id方法
2023-09-01 22:54:57 +08:00
imClumsyPanda d6dce95682 bug fix 2023-09-01 14:15:13 +08:00
imClumsyPanda 6c4ef26e9a
add RapidOCRPDFLoader and RapidOCRLoader (#1275)
* add RapidOCRPDFLoader

* update mypdfloader.py and requirements.txt

* add myimgloader.py

* add test samples

* add TODO to mypdfloader

* add loaders to KnowledgeFile class

* add loaders to KnowledgeFile class
2023-09-01 10:23:57 +08:00
liunux4odoo b1201a5f23
优化LLM和Embedding模型运行设备配置,可设为auto自动检测;修复:重建知识库时FAISS未保存 (#1330)
* 避免configs对torch的依赖;
* webui自动从configs获取api地址(close #1319)
* bug fix: 重建知识库时FAISS未保存
* 优化LLM和Embedding模型运行设备配置,可设为auto自动检测
2023-08-31 17:44:48 +08:00
liunux4odoo 34a416b941
优化server_config配置项 (#1293)
* update server_config.py:
- 在model_config中增加HISTORY_LEN配置参数
- 将server_config中helper function移动到server.utils中
- 统一set_httpx_timeout的定义和调用

* update webui.py:
应用model_config中的配置项:HISTORY_LEN,VECTOR_SEARCH_TOP_K,SEARCH_ENGINE_TOP_K

---------

Co-authored-by: liunux4odoo <liunu@qq.com>
2023-08-29 10:06:09 +08:00
liunux4odoo ca0ae29fef
运行startup.py时,如果不加参数直接显示配置和帮助信息后退出 (#1284)
* 统一XX_kb_service.add_doc/do_add_doc接口,不再需要embeddings参数

* 运行startup.py时,如果不加参数直接显示配置和帮助信息后退出

---------

Co-authored-by: liunux4odoo <liunu@qq.com>
2023-08-28 16:03:53 +08:00
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
imClumsyPanda 8faafa6a32 update format 2023-08-27 20:23:07 +08:00
zqt 1fa4e906c7 适配score_threshold 2023-08-27 11:21:10 +08:00
liunux4odoo 96f69edf7b
修复重建知识库界面无反应的问题,添加一些log信息 (#1258)
* close #1172: 给webui_page/utils添加一些log信息,方便定位错误

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

---------

Co-authored-by: liunux4odoo <liunu@qq.com>
2023-08-26 18:26:38 +08:00
liunux4odoo 9ca53fa3ad
fix #1224: failed to load json and pdf files (#1252)
Co-authored-by: liunux4odoo <liunu@qq.com>
2023-08-26 14:21:59 +08:00
imClumsyPanda f95d41ef47 [BUG] 修复csv文件读取后,单行数据被分成多段。 2023-08-26 11:45:01 +08:00
imClumsyPanda 4dafca2376 Merge branch 'master' into pre-release 2023-08-25 16:25:35 +08:00
liunux4odoo 447b370416 在search_engine_chat中检查Bing KEY,并更新tests 2023-08-25 10:58:40 +08:00
Pickupppp 0c63839ff6 修正 milvus 更改错误 2023-08-24 22:53:13 +08:00
zqt 2604341e9e 调整KBService 接口函数do_search 并适配pg 2023-08-24 22:35:30 +08:00
zqt 24e7351d32 Merge branch 'master' into dev 2023-08-24 22:31:37 +08:00
zqt996 67ac53242d
Merge pull request #1233 from Pickupppp/master
修复 milvus 作为默认数据库初始化异常和调用search方法异常
2023-08-24 22:28:38 +08:00
Meiracle bc3dbb443e
修复搜索引擎聊天接口 (#1228)
* 修复搜索引擎聊天接口

* 修复知识库聊天接口

* 恢复
2023-08-24 22:18:33 +08:00
Pickupppp 050a585a9d 修复 milvus 作为默认数据库初始化异常和调用search方法异常 2023-08-24 21:31:02 +08:00
zqt 2a2b95d214 search_engine_chat bug 2023-08-24 17:25:54 +08:00
liunux4odoo 63ca393731 参照chat,给knowledge_base_chat/search_engine_chat添加chatgpt代理设置 2023-08-24 15:10:51 +08:00
zqt ea4b5ebd16 Merge branch 'master' into dev 2023-08-24 14:16:21 +08:00
zqt 37454db3ec 添加chatgpt 调用代理设置 2023-08-24 13:51:17 +08:00
zR 7291e77978
support for bge-large-zh-noinstruct and openai text-embedding-ada-002 (#1119)
* support for bge-large-zh-noinstruct and openai text-embedding-ada-002

* 完善了readme,修改了BGE模型的载入方式

* 补充了readme中bge-large-zh-noinstruct的信息

* Update faiss_kb_service.py

* Update utils.py

---------

Co-authored-by: zR <zRzRzRzRzRzRzR>
Co-authored-by: imClumsyPanda <littlepanda0716@gmail.com>
2023-08-23 22:55:53 +08:00
liunux4odoo 351b62f7a7 fix part of #1206: add/delete/update_doc() get unexpected keyword argument 'not_refresh_vs_cache` 2023-08-23 15:26:52 +08:00
liunux4odoo 44edce6bcf fix #1142: 在History中使用jinja2模板代替f-string,避免消息中含有{ }时出错 2023-08-23 08:35:26 +08:00
zqt 16542f20b4 修复pg和milvus kbservice代码 2023-08-22 16:52:04 +08:00
zqt996 11856cc542
Merge pull request #1160 from shutter-cp/master
fix bug 1159
2023-08-22 16:38:06 +08:00
liunux4odoo c571585ffd optimize recreate vector store: save vector store once after all docs parsed for FAISS 2023-08-21 08:50:15 +08:00
liunux4odoo f40bb69224 优化FAISS向量库多文件操作;修复recreate_vector_store,大量文件时不再超时。 2023-08-20 19:10:29 +08:00
liunux4odoo 150a78bfd9 update kb_doc_api:make faiss cache working; delete vector store docs before add duplicate docs 2023-08-20 16:52:49 +08:00
imClumsyPanda 62aa97bb32 Merge branch 'master' into dev 2023-08-20 10:39:30 +08:00
imClumsyPanda cdea240c31 update README.md and llm_api_stale.py 2023-08-20 10:38:41 +08:00
liunux4odoo 69627a2fa3 update chat and knowledge base api: unify exception processing and return types 2023-08-19 15:14:45 +08:00
陈鹏 95d9fb0ee9
fix bug 1159
修复使用使用pg存储向量时,向量检索错误 {TypeError}TypeError("'Document' object is not subscriptable")
2023-08-18 14:41:11 +08:00
imClumsyPanda 4fb2e2198b merge dev_allinone 2023-08-17 22:29:26 +08:00
imClumsyPanda 52837429d2 update configs.__init__, webui.py and api.py 2023-08-17 22:19:37 +08:00
xain 6d1ea9bc99 Update utils.py (#1128)
不区分文件扩展名的大小写。
2023-08-17 21:09:05 +08:00
hzg0601 44d4bacf1c 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
liunux4odoo f92b002342 add startup.py: start specified servers with one command. see python startup.py --help 2023-08-17 13:24:53 +08:00
imClumsyPanda 8396b57101 update format of api_allinone.py and llm_api_launch.py 2023-08-16 22:24:29 +08:00
liunux4odoo 6c00c03faa llm_api can be terminated by Ctrl+c. success on windows 2023-08-16 17:48:55 +08:00
liunux4odoo e7d07a7923 Merge remote-tracking branch 'refs/remotes/origin/dev' into dev 2023-08-16 16:16:56 +08:00
liunux4odoo 8ed1f8efca update fastchat to 0.2.24 2023-08-16 16:15:45 +08:00
hzg0601 84b491b8b2 Merge branch 'dev' of github.com:chatchat-space/Langchain-Chatchat into dev 2023-08-16 16:00:40 +08:00
hzg0601 5f1471232d update llm_api_launch.py:修复本地加载问题 2023-08-16 16:00:24 +08:00
liunux4odoo f64affc930 update llm_api and api server:
1. fastchat's controller/model_worker/api_server use swagger UI offline.
2. add custom title and icon.
3. remove fastapi-offline dependence
2023-08-16 14:20:09 +08:00
liunux4odoo 67b8ebef52 update api and webui:
1. 增加search_docs接口,返回原始知识库检索文档,close #1103
2. 为FAISS检索增加score_threshold参数。milvus和PG暂不支持
2023-08-16 13:18:58 +08:00
hzg0601 b97358ea33 Merge branch 'dev' of github.com:chatchat-space/Langchain-Chatchat into dev 2023-08-16 11:15:31 +08:00
hzg0601 8e00f8305b 1. 更新allinone脚本提示,增加中文提示;2. 新增服务一键停止脚本shutdown_all.sh;3. 更新readme说明;3. 修复命令行bug 2023-08-16 11:15:10 +08:00
liunux4odoo a47240e871 fix KnowledgeFile: set text_splitter_name in database to SpacyTextSplitter if it is not set 2023-08-16 10:14:47 +08:00
hzg0601 348edb9a0d 更新提示 2023-08-16 10:13:51 +08:00
liunux4odoo 7c0e9c46db fix api & webui: 1.add logs, 2. check json response, 3. set timeout=False in recreate_vector_stoore 2023-08-15 14:24:54 +08:00
hzg0601 80f44ba24e git pull dev 2023-08-15 11:22:19 +08:00
hzg0601 5c0274efce 1. 增加api的一键启动脚本;2. 增加webui的一键启动脚本;3. 更新readme;4. 调整llm_api_launch 2023-08-15 11:02:32 +08:00
liunux4odoo 8477adfa33 update api and webui:
1. add download_doc to api
2. return local path or http url in kowledge_base_chat depends on
   no_remote_api
3. change assistant avater in webui
2023-08-14 19:32:28 +08:00
liunux4odoo 087bb37e08 fix chat and knowledge_base_chat 2023-08-14 19:32:28 +08:00
liunux4odoo ec984205ae fix knowledge base management:
1. docs in database were note deleted when clear vector store
2. diable buttons when local doc file not exist.
2023-08-14 19:09:02 +08:00
hzg0601 8b18cf2a5e git rebase and pull 2023-08-14 16:48:35 +08:00
liunux4odoo 0704eabe23 fix chat and knowledge_base_chat 2023-08-14 16:46:26 +08:00
hzg0601 90c92f8c93 解决多卡启动问题 2023-08-14 16:43:01 +08:00
liunux4odoo cc08e2cb96 update api and webui:
1. add download_doc to api
2. return local path or http url in kowledge_base_chat depends on
   no_remote_api
3. change assistant avater in webui
2023-08-14 11:46:36 +08:00
hzg0601 0d6a9cf8f3 Merge branch 'master' into dev 2023-08-14 11:39:12 +08:00
hzg0601 6590ca32db 更新多卡部署 2023-08-14 11:24:52 +08:00
liunux4odoo 126bd51232 fix chat and knowledge_base_chat 2023-08-14 10:35:47 +08:00
imClumsyPanda afc6aa968d update webui layout 2023-08-11 23:40:41 +08:00
liunux4odoo 2a57f49d80 update knowledge base management ui.
remove numpy/pandas from requirements, move them to webui requirements
2023-08-11 13:53:20 +08:00
liunux4odoo a08fe994c2 更新API与ApiReuest:
1. 重新整理webui_pages/utils与server/knowledge_base间的工具依赖
2.
将delete_knowledge_base与delete_doc接口从delete改为post.delete不支持body参数
3. 修复update_doc
4. 修复部分bug
2023-08-11 08:45:26 +08:00
liunux4odoo a261fda20b add tools to migrate knowledge base 2023-08-11 08:33:05 +08:00
imClumsyPanda ef098111dc update webui and utils 2023-08-10 23:04:05 +08:00
imClumsyPanda 8a4d9168fa update import pkgs and format 2023-08-10 21:26:05 +08:00
liunux4odoo 18e7e7307b patch fastapi-offline to use local swagger-ui assests 2023-08-10 17:00:39 +08:00
liunux4odoo 0364215987 Merge branch 'pr1037_pg_vs' into dev_fastchat 2023-08-10 15:07:58 +08:00
liunux4odoo 17ddee38a4 fix conflict between def_fastchat and pr1037 2023-08-10 15:02:41 +08:00
hzg0601 9525915a85 update llm_api_launch,llm_api_shutdown 2023-08-10 14:43:18 +08:00
liunux4odoo fd247f4657 Merge branch 'dev_fastchat' into pr1037_pg_vs 2023-08-10 14:21:37 +08:00
liunux4odoo 9ed91f0e8a automatically init vector store info to database when run api.py & webui.py 2023-08-10 14:12:02 +08:00
liunux4odoo f5024245a7 make api.py and webui.py working offline 2023-08-10 13:33:40 +08:00
zqt d4f728dfa2 添加向量数据库pg支持,和向量库docker-compose.ym环境文件 2023-08-10 11:16:52 +08:00
hzg0601 6c2b2b7ba2 测试llm_api_shutdown.py,通过 2023-08-10 09:38:45 +08:00
imClumsyPanda 8df00d0b04 add SCORE_THRESHOLD to faiss and milvus kb service 2023-08-10 00:36:59 +08:00
liunux4odoo 1a112c6908 update fastch_chat: disable streaming in swagger besides streaming in ApiRequest 2023-08-09 23:48:41 +08:00
imClumsyPanda 02b9d57072 update textsplitter and pdfloader 2023-08-09 23:36:43 +08:00
liunux4odoo 222689ed5b update kb and search chat: disable streaming in swagger besides streaming in ApiRequest 2023-08-09 23:35:36 +08:00
hzg0601 66ff913bb4 Merge branch 'dev_fastchat' of https://github.com/chatchat-space/langchain-ChatGLM into dev_fastchat 2023-08-09 23:18:54 +08:00
hzg0601 3e9d088cd9 update server 2023-08-09 23:18:44 +08:00
hzg0601 34bb681db1 删除shell脚本 2023-08-09 23:17:51 +08:00
hzg0601 8a34c3f163 增加停止服务的python脚本 2023-08-09 23:16:02 +08:00
imClumsyPanda 24a280ce8c re-add zh_title_enhance.py 2023-08-09 23:09:24 +08:00
imClumsyPanda 1b70fb5f9b update faiss_kb_service.py 2023-08-09 22:57:36 +08:00
liunux4odoo db29a2fea7 update knowledge_base_chat and search_engine_chat: yield chinese correctly 2023-08-09 22:54:37 +08:00
liunux4odoo ba3335efb8 update llm_api: move fastchat logs to LOG_PATH 2023-08-09 22:43:45 +08:00
liunux4odoo 997f8b2e3f update knowledge base api:
1. list_kbs_from_db return all kbs by default instead of return kbs with
   file_count > 0 only.
2. KBServiceFactory.get_service_by_name could return a FaissKBService
   that not in the db
2023-08-09 21:57:40 +08:00
liunux4odoo 323fc13d4c make parameter examples available in openapi docs 2023-08-09 18:15:14 +08:00
liunux4odoo c7b91bfaf1 update api/kb_doc_api and knowledge base management ui:
1. add update_doc to api which can udpate vector store from existed
   content file
2. add parameter `delete_content` to delete_doc api. user can decide
   whether delete local content file when delete doc.
3. fix bug in ApiReqeust.upload_doc
4. support listing docs existed in local folder bu not in db
2023-08-09 16:52:04 +08:00
liunux4odoo 4da7c04859 fix: parse history parameter to correct type 2023-08-09 12:09:45 +08:00
liunux4odoo 9883341924 update server.chat.*: set default value [] to history parameter. 2023-08-09 10:48:37 +08:00
liunux4odoo b98f5fd0b9 update knowledge base kbservice and api:
1. make huggingfaceembeddings hashable
2. unify embeddings' loading method for all kbservie
3. make ApiRequest skip empty content when streaming json to avoid dict
   KeyError
2023-08-09 10:46:01 +08:00
liunux4odoo 532ed81ecf add functions to get kb and doc details from db 2023-08-08 23:57:39 +08:00
imClumsyPanda 717ddf4d10 add history to chat apis 2023-08-08 23:56:27 +08:00
imClumsyPanda c17572b6a6 add history to chat apis 2023-08-08 23:55:27 +08:00
imClumsyPanda 2d49746a8d add history to chat apis 2023-08-08 23:54:51 +08:00
imClumsyPanda c8b6d53ede add llmchain_with_history.py as example 2023-08-08 22:15:16 +08:00
liunux4odoo 135af5f3ff update knowledge base db orm:
1. set default values for file_count, file_version, create_time.
2. fix bug: add_doc_to_db
3. make add_kb_to_db more flexiable with existing kb
2023-08-08 21:47:20 +08:00
liunux4odoo 2b0f8caa62 improve recreate_vector_store:
1. allow empty knowledge base
2. skip unspported files instead of exception
2023-08-08 17:59:41 +08:00
liunux4odoo e918244159 move KBServiceFactory to server.knowledge_base.kb_service.base 2023-08-08 17:41:58 +08:00
liunux4odoo 444e1afad5 remove server/knowledge_base/knowledge_file.py 2023-08-08 16:51:37 +08:00
liunux4odoo c4a3995310 move commonto tools from kbservice.base to server.knowledge_base.utils 2023-08-08 16:40:18 +08:00
liunux4odoo 584e3a9234 remove server/knowledge_base/knowledge_base_factory.py 2023-08-08 16:21:00 +08:00
liunux4odoo 7e07f0bbf4 move configs to configs.model_config 2023-08-08 15:56:32 +08:00
zqt b61e0772c9 使用orm操作数据库 2023-08-08 14:25:55 +08:00
zqt 41fd1acc9c Merge remote-tracking branch 'origin/dev_fastchat' into dev_fastchat
# Conflicts:
#	server/knowledge_base/kb_service/default_kb_service.py
#	server/knowledge_base/kb_service/milvus_kb_service.py
#	server/knowledge_base/knowledge_base_factory.py
2023-08-08 14:06:13 +08:00
hzg0601 82494aec00 Merge branch 'dev_fastchat' of github.com:chatchat-space/langchain-ChatGLM into dev_fastchat 2023-08-08 13:39:31 +08:00
hzg0601 360bd0a559 update llm_api_sh.py 2023-08-08 13:39:19 +08:00
liunux4odoo 0746272525 remove server/knowledge_base/knowledge_base.py 2023-08-08 13:36:20 +08:00
glide-the de8db40f4b BaseChatOpenAIChain,支持基础的ChatOpenAI对话的Chain接入 2023-08-07 23:05:54 +08:00
glide-the 823eb06c5d BaseChatOpenAIChain,支持基础的ChatOpenAI对话的Chain接入 2023-08-07 22:57:13 +08:00
liunux4odoo 08493bffbb add a basic knowledge base management ui. 2023-08-07 21:00:55 +08:00
imClumsyPanda 035a199c32 update kb_server.base 2023-08-07 20:48:06 +08:00