liunux4odoo
|
aae4144476
|
数据库和向量库中文档 metadata["source"] 改为相对路径,便于向量库迁移 (#2153)
修复:
- 上传知识库文件名称包括子目录时,自动创建子目录
|
2023-11-23 19:54:00 +08:00 |
liunux4odoo
|
b51ba11f45
|
支持通过配置项同时启动多个模型,将Wiki纳入samples知识库 (#2002)
新功能:
- 将 LLM_MODEL 配置项改为 LLM_MODELS 列表,同时启动多个模型
- 将 wiki 纳入 samples 知识库
依赖变化:
- 指定 streamlit~=1.27.0。1.26.0会报rerun错误,1.28.0会有无限刷新错误
修复优化:
- 优化 get_default_llm_model 逻辑
- 适配 Qwen 在线 API 做 Embeddings 时最大 25 行的限制
- 列出知识库磁盘文件时跳过 . 开头的文件
|
2023-11-09 22:15:52 +08:00 |
zR
|
57612d5232
|
修复一些bug (#1965)
* 修改一些bug
* 更新掉了一部分之前的bug
|
2023-11-03 18:56:27 +08:00 |
liunux4odoo
|
d8e15b57ba
|
知识库支持子目录(不包括temp和tmp开头的目录),文件相对路径总长度不可超过255 (#1928)
|
2023-10-31 16:59:40 +08:00 |
liunux4odoo
|
65592a45c3
|
支持在线 Embeddings, Lite 模式支持所有知识库相关功能 (#1924)
新功能:
- 支持在线 Embeddings:zhipu-api, qwen-api, minimax-api, qianfan-api
- API 增加 /other/embed_texts 接口
- init_database.py 增加 --embed-model 参数,可以指定使用的嵌入模型(本地或在线均可)
- 对于 FAISS 知识库,支持多向量库,默认位置:{KB_PATH}/vector_store/{embed_model}
- Lite 模式支持所有知识库相关功能。此模式下最主要的限制是:
- 不能使用本地 LLM 和 Embeddings 模型
- 知识库不支持 PDF 文件
- init_database.py 重建知识库时不再默认情况数据库表,增加 clear-tables 参数手动控制。
- API 和 WEBUI 中 score_threshold 参数范围改为 [0, 2],以更好的适应在线嵌入模型
问题修复:
- API 中 list_config_models 会删除 ONLINE_LLM_MODEL 中的敏感信息,导致第二轮API请求错误
开发者:
- 统一向量库的识别:以(kb_name,embed_model)为判断向量库唯一性的依据,避免 FAISS 知识库缓存加载逻辑错误
- KBServiceFactory.get_service_by_name 中添加 default_embed_model 参数,用于在构建新知识库时设置 embed_model
- 优化 kb_service 中 Embeddings 操作:
- 统一加载接口: server.utils.load_embeddings,利用全局缓存避免各处 Embeddings 传参
- 统一文本嵌入接口:server.knowledge_base.kb_service.base.[embed_texts, embed_documents]
- 重写 normalize 函数,去除对 scikit-learn/scipy 的依赖
|
2023-10-31 14:26:50 +08:00 |
zR
|
24d1e28a07
|
一些细节优化 (#1891)
Co-authored-by: zR <zRzRzRzRzRzRzR>
|
2023-10-27 11:52:44 +08:00 |
liunux4odoo
|
b4c68ddd05
|
优化在线 API ,支持 completion 和 embedding,简化在线 API 开发方式 (#1886)
* 优化在线 API ,支持 completion 和 embedding,简化在线 API 开发方式
新功能
- 智谱AI、Minimax、千帆、千问 4 个在线模型支持 embeddings(不通过Fastchat,后续会单独提供相关api接口)
- 在线模型自动检测传入参数,在传入非 messages 格式的 prompt 时,自动转换为 completion 形式,以支持 completion 接口
开发者:
- 重构ApiModelWorker:
- 所有在线 API 请求封装到 do_chat 方法:自动传入参数 ApiChatParams,简化参数与配置项的获取;自动处理与fastchat的接口
- 加强 API 请求错误处理,返回更有意义的信息
- 改用 qianfan sdk 重写 qianfan-api
- 将所有在线模型的测试用例统一在一起,简化测试用例编写
* Delete requirements_langflow.txt
|
2023-10-26 22:44:48 +08:00 |
liunux4odoo
|
d053950aee
|
新功能: (#1801)
- 更新langchain/fastchat依赖,添加xformers依赖
- 默认max_tokens=None, 生成tokens自动为模型支持的最大值
修复:
- history_len=0 时会带入1条不完整的历史消息,导致LLM错误
- 当对话轮数 达到history_len时,传入的历史消息为空
|
2023-10-19 22:09:15 +08:00 |
zR
|
69e5da4e7a
|
北京黑客松更新 (#1785)
* 北京黑客松更新
知识库支持:
支持zilliz数据库
Agent支持:
支持以下工具调用
1. 支持互联网Agent调用
2. 支持知识库Agent调用
3. 支持旅游助手工具(未上传)
知识库更新
1. 支持知识库简介,用于Agent选择
2. UI对应知识库简介
提示词选择
1. UI 和模板支持提示词模板更换选择
|
2023-10-18 15:19:02 +08:00 |
liunux4odoo
|
9ce328fea9
|
实现Api和WEBUI的前后端分离 (#1772)
* update ApiRequest: 删除no_remote_api本地调用模式;支持同步/异步调用
* 实现API和WEBUI的分离:
- API运行服务器上的配置通过/llm_model/get_model_config、/server/configs接口提供,WEBUI运行机器上的配置项仅作为代码内部默认值使用
- 服务器可用的搜索引擎通过/server/list_search_engines提供
- WEBUI可选LLM列表中只列出在FSCHAT_MODEL_WORKERS中配置的模型
- 修改WEBUI中默认LLM_MODEL获取方式,改为从api端读取
- 删除knowledge_base_chat中`local_doc_url`参数
其它修改:
- 删除多余的kb_config.py.exmaple(名称错误)
- server_config中默认关闭vllm
- server_config中默认注释除智谱AI之外的在线模型
- 修改requests从系统获取的代理,避免model worker注册错误
* 修正:
- api.list_config_models返回模型原始配置
- api.list_config_models和api.get_model_config中过滤online api模型的敏感信息
- 将GPT等直接访问的模型列入WEBUI可选模型列表
其它:
- 指定langchain==0.3.313, fschat==0.2.30, langchain-experimental==0.0.30
|
2023-10-17 16:52:07 +08:00 |
liunux4odoo
|
cd748128c3
|
add paramter `max_tokens` to 4 chat api with default value 1024 (#1744)
|
2023-10-12 16:18:56 +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 |
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 |
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 |
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
|
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 |
zR
|
bfdbe69fa1
|
增加了自定义分词器适配 (#1462)
* 添加了自定义分词器适配和测试文件
---------
Co-authored-by: zR <zRzRzRzRzRzRzR>
|
2023-09-13 15:42:12 +08:00 |
liunux4odoo
|
8b040620de
|
对话接口支持temperature参数 (#1455)
|
2023-09-13 10:00:54 +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
|
775870a516
|
改变api视图函数的sync/async,提高api并发能力: (#1414)
1. 4个chat类接口改为async
2. 知识库操作,涉及向量库修改的使用async,避免FAISS写入错误;涉及向量库读取的改为sync,提高并发
|
2023-09-08 12:25:02 +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
|
63ca393731
|
参照chat,给knowledge_base_chat/search_engine_chat添加chatgpt代理设置
|
2023-08-24 15:10:51 +08:00 |
liunux4odoo
|
44edce6bcf
|
fix #1142: 在History中使用jinja2模板代替f-string,避免消息中含有{ }时出错
|
2023-08-23 08:35:26 +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
|
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 |
liunux4odoo
|
126bd51232
|
fix chat and knowledge_base_chat
|
2023-08-14 10:35:47 +08:00 |
imClumsyPanda
|
8a4d9168fa
|
update import pkgs and format
|
2023-08-10 21:26:05 +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 |
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
|
323fc13d4c
|
make parameter examples available in openapi docs
|
2023-08-09 18:15:14 +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 |
imClumsyPanda
|
2d49746a8d
|
add history to chat apis
|
2023-08-08 23:54:51 +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
|
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 |
imClumsyPanda
|
b91d96ab0c
|
update kb_doc_api.py
|
2023-08-06 18:32:10 +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
|
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 |
imClumsyPanda
|
b62ea6bd2a
|
add top-k to search_chat apis and add top-k params in model_config
|
2023-08-03 17:06:43 +08:00 |
liunux4odoo
|
5c804aac75
|
make api and webui support top_k paramter
|
2023-08-03 15:47:53 +08:00 |
liunux4odoo
|
df61f31c8e
|
修改knowledge_base_chat实现:利用缓存避免每次请求重新加载向量库;增加top_k参数。
|
2023-08-03 15:22:46 +08:00 |
imClumsyPanda
|
dcf49a59ef
|
v0.2.0 first commit
|
2023-07-27 23:22:07 +08:00 |