Commit Graph

121 Commits

Author SHA1 Message Date
zqt 24e7351d32 Merge branch 'master' into dev 2023-08-24 22:31:37 +08:00
Pickupppp 050a585a9d 修复 milvus 作为默认数据库初始化异常和调用search方法异常 2023-08-24 21:31:02 +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
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
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
xain 6d1ea9bc99 Update utils.py (#1128)
不区分文件扩展名的大小写。
2023-08-17 21:09:05 +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
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
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
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
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 17ddee38a4 fix conflict between def_fastchat and pr1037 2023-08-10 15:02:41 +08:00
zqt d4f728dfa2 添加向量数据库pg支持,和向量库docker-compose.ym环境文件 2023-08-10 11:16:52 +08:00
imClumsyPanda 8df00d0b04 add SCORE_THRESHOLD to faiss and milvus kb service 2023-08-10 00:36:59 +08:00
imClumsyPanda 02b9d57072 update textsplitter and pdfloader 2023-08-09 23:36:43 +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 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 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 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
liunux4odoo 0746272525 remove server/knowledge_base/knowledge_base.py 2023-08-08 13:36:20 +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
liunux4odoo 44c713ef98 use KBServiceFactory to replace all the KnowledgeBase.
make KBServiceFactory support embed_model parameter.
rewrite api: recreate_vector_store.
fix some bugs.
2023-08-07 20:37:16 +08:00
zqt996 0f46185cfb
添加Milvus库 (#1011) 2023-08-07 16:56:57 +08:00
zqt 72951d95fb 添加milvus库支持 2023-08-07 16:32:34 +08:00
imClumsyPanda 18d31f5116 add KBService and KBServiceFactory class 2023-08-06 23:44:02 +08:00
imClumsyPanda b91d96ab0c update kb_doc_api.py 2023-08-06 18:32:10 +08:00
imClumsyPanda a447529c2e update kb_doc_api.py 2023-08-05 23:35:20 +08:00
imClumsyPanda 7f89efee4b fix kb_doc_api.py 2023-08-05 23:01:56 +08:00
imClumsyPanda 3f045cedb9 1. add add_doc and list_docs to KnowledgeBase class
2. add DB_ROOT_PATH to model_config.py.example
2023-08-05 22:57:19 +08:00
imClumsyPanda 313e590961 update DocumentLoader in knowledge_file.py 2023-08-05 21:51:07 +08:00
imClumsyPanda f68e432570 update table_name and column_name in SQL 2023-08-05 21:02:14 +08:00
imClumsyPanda cd0f2a2c41 update class method of KnowledgeBase and KnowledgeFile 2023-08-05 20:52:14 +08:00
imClumsyPanda 14a5de6a29 update class method of KnowledgeBase and KnowledgeFile 2023-08-05 13:51:05 +08:00
imClumsyPanda 7beeaacea6 update class method of KnowledgeBase and KnowledgeFile 2023-08-05 13:48:55 +08:00
imClumsyPanda e8a88f174d update class method of KnowledgeBase and KnowledgeFile 2023-08-05 13:48:30 +08:00
imClumsyPanda 206261cd0c update class method of KnowledgeBase and KnowledgeFile 2023-08-05 13:46:00 +08:00
imClumsyPanda 6c7adfbaeb change kb_api functions with KnowledgeBase class method 2023-08-05 03:15:41 +08:00
imClumsyPanda 7e1472a95b add KnowledgeBase class 2023-08-05 00:10:10 +08:00
imClumsyPanda 590367a5b5 add KnowledgeFile class 2023-08-04 23:54:26 +08:00
imClumsyPanda 775d46fecf format update in knowledge_base/utils.py 2023-08-04 23:14:43 +08:00
imClumsyPanda bc3ee83910 update kb_doc_api.py 2023-08-04 22:22:48 +08:00
liunux4odoo 5d1a0ec15d add recreate_vector_store to kb_doc_api, and the router in api.py. 2023-08-04 20:26:14 +08:00
liunux4odoo 46c7d8d169 allow kb_doc_api.upload_doc to override existed file by parameter.
update_doc is not needed.
2023-08-04 15:53:44 +08:00
imClumsyPanda b4f80ca370 update server.knowledge_base.utils 2023-08-04 15:32:42 +08:00
imClumsyPanda 7bfbe18011 update requirements.txt and kb_doc_api.py 2023-08-04 15:12:14 +08:00
liunux4odoo c4994e85df fix: knowledge_base_chat and search_engine_chat should stream json text
instead of dict. client should use json.loads.
2023-08-04 12:12:13 +08:00
liunux4odoo 88682c87ff 优化server下知识库相关模块的结构:将知识库相关操作从knowledge_base_chat移动到knowledge_base.utils;优化kb_doc_api中embeddings加载。 2023-08-04 10:16:30 +08:00
imClumsyPanda dcf49a59ef v0.2.0 first commit 2023-07-27 23:22:07 +08:00