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
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
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
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
f40bb69224
优化FAISS向量库多文件操作;修复recreate_vector_store,大量文件时不再超时。
2023-08-20 19:10:29 +08:00
liunux4odoo
69627a2fa3
update chat and knowledge base api: unify exception processing and return types
2023-08-19 15:14:45 +08:00
liunux4odoo
d4cf77170a
fix webui: correct error messages
2023-08-18 11:47:49 +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
f9d5038e59
fix webui utils: remove unneeded error check
2023-08-16 09:33:55 +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
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
353d9fc72b
update init_database.py
2023-08-13 10:25:02 +08:00
liunux4odoo
2bb9a7949f
fix: delete knowledge base error
2023-08-11 23:35:27 +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
b733a47902
split requirements to 2 parts: basic with api; webui
2023-08-10 15:51:22 +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
d89fcb3b2e
update knowledge base management page:
...
1. move get_kb_details & get_doc_details to utils.py
2. adjust aggrid columns width.
2023-08-10 11:37:14 +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
liunux4odoo
450b23c4f2
update knowledge base management api and ui
2023-08-09 22:00:33 +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
973d3097e7
fix webui_pages/utils.py: support history parameter for chat_chat
2023-08-09 11:00:22 +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
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
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
liunux4odoo
27d49be706
make apirequest support streaming dict
2023-08-04 12:49:39 +08:00
imClumsyPanda
329c24ee73
1. change bing_search_chat and duckduckgo_search_chat into search_engine_chat
...
2. add knowledge_base not found to knowledge_base_chat and add search_engine not found to search_engine_chat
2023-08-03 18:22:36 +08:00
liunux4odoo
5c804aac75
make api and webui support top_k paramter
2023-08-03 15:47:53 +08:00
liunux4odoo
dc74bdab41
将httpx.stream返回结果转化为普通生成器,使得httpx api请求与直接调用server.chat.xx返回相同的结果。
2023-08-03 12:52:49 +08:00
liunux4odoo
3c2b8a85d6
add knowledge base api methods
2023-08-03 10:49:57 +08:00
liunux4odoo
d36d801a58
add api request methods for all chat apis
2023-08-03 09:33:24 +08:00
imClumsyPanda
bcfd3f5af5
add webui_pages
2023-08-01 14:47:38 +08:00