1897 Commits

Author SHA1 Message Date
imClumsyPanda
00869bd839 add BaseRetrieverService, VectorstoreRetrieverService, EnsembleRetrieverService 2024-03-30 00:17:48 +08:00
glide-the
6e9e31a32c 格式化和代码检查说明 2024-03-29 18:26:50 +08:00
liunux4odoo
27f0f512a3
添加 openai 兼容的 files 接口 (#3573) 2024-03-29 18:07:07 +08:00
liunux4odoo
a1429a350a
修复:search_local_knowledge_base 工具返回值错误;/tools 路由错误;webui 中“正在思考”一直显示 (#3571) 2024-03-29 14:30:16 +08:00
liunux4odoo
42aa900566
优化工具定义;添加 openai 兼容的统一 chat 接口 (#3570)
- 修复:
    - Qwen Agent 的 OutputParser 不再抛出异常,遇到非 COT 文本直接返回
    - CallbackHandler 正确处理工具调用信息

- 重写 tool 定义方式:
    - 添加 regist_tool 简化 tool 定义:
        - 可以指定一个用户友好的名称
        - 自动将函数的 __doc__ 作为 tool.description
	- 支持用 Field 定义参数,不再需要额外定义 ModelSchema
        - 添加 BaseToolOutput 封装 tool	返回结果,以便同时获取原始值、给LLM的字符串值
        - 支持工具热加载(有待测试)

- 增加 openai 兼容的统一 chat 接口,通过 tools/tool_choice/extra_body 不同参数组合支持:
    - Agent 对话
    - 指定工具调用(如知识库RAG)
    - LLM 对话

- 根据后端功能更新 webui
2024-03-29 11:55:32 +08:00
glide-the
5e70aff522 格式化 2024-03-29 10:23:28 +08:00
glide-the
4c040a49be 格式化代码 2024-03-29 10:22:15 +08:00
liunux4odoo
9818bd2a88
- 重写 tool 部分: (#3553)
- 简化 tool 的定义方式
    - 所有 tool 和 tool_config 支持热加载
    - 修复:json_schema_extra warning
2024-03-28 13:08:51 +08:00
glide-the
f9f9d4b9fb
Merge pull request #3546 from chatchat-space/dev_module
移动模块信息
2024-03-28 09:14:35 +08:00
glide-the
32974f8e2f 封装ModelManager 2024-03-28 09:11:08 +08:00
liunux4odoo
26b141a06e update .gitignore; fix model version error in api_schemas 2024-03-27 10:39:45 +08:00
glide-the
9260039672 移动项目模块 2024-03-27 10:12:28 +08:00
glide-the
bc7f01925f 删除历史文件 2024-03-26 21:06:34 +08:00
glide-the
9aeeec586b
Merge pull request #3528 from chatchat-space/dev_model_providers
模型默认参数从配置文件加载
2024-03-26 17:44:30 +08:00
glide-the
1e96d69945
Merge pull request #3523 from khazic/dev_model_providers
模型默认参数从配置文件加载
2024-03-26 16:15:34 +08:00
khazic
5b90286843 qqqq 2024-03-26 16:00:40 +08:00
khazic
43a19d9b66 20240326 2024-03-26 14:58:50 +08:00
khazic
8ebfb34a51 20240326 2024-03-26 14:49:26 +08:00
glide-the
596a0f5fa1
Merge pull request #3517 from chatchat-space/dev_module
Dev module
2024-03-26 13:32:05 +08:00
liunux4odoo
44f2fd5aa6 update wiki sub module 2024-03-26 12:38:03 +08:00
liunux4odoo
e21d2c572f update gitignore; remove unignored files 2024-03-26 12:35:21 +08:00
liunux4odoo
24ffa2f362 fix bugs; make poetry using tsinghua mirror of pypi 2024-03-26 12:27:02 +08:00
liunux4odoo
b9c08cbefd 对python的要求降级到py38 2024-03-26 10:37:36 +08:00
liunux4odoo
fad54822d0 Merge branch 'panda-dev' into temp 2024-03-26 09:48:40 +08:00
srszzw
9b62b1c72b
dev分支解决pydantic版本冲突问题,增加ollama配置,支持ollama会话和向量接口 (#3508)
* dev分支解决pydantic版本冲突问题,增加ollama配置,支持ollama会话和向量接口
1、因dev版本的pydantic升级到了v2版本,由于在class History(BaseModel)中使用了from server.pydantic_v1,而fastapi的引用已变为pydantic的v2版本,所以fastapi用v2版本去校验用v1版本定义的对象,当会话历史histtory不为空的时候,会报错:TypeError: BaseModel.validate() takes 2 positional arguments but 3 were given。经测试,解方法为在class History(BaseModel)中也使用v2版本即可;
2、配置文件参照其它平台配置,增加了ollama平台相关配置,会话模型用户可根据实际情况自行添加,向量模型目前支持nomic-embed-text(必须升级ollama到0.1.29以上)。
3、因ollama官方只在会话部分对openai api做了兼容,向量api暂未适配,好在langchain官方库支持OllamaEmbeddings,因而在get_Embeddings方法中添加了相关支持代码。

* 修复 pydantic 升级到 v2 后 DocumentWithVsID 和 /v1/embeddings 兼容性问题

---------

Co-authored-by: srszzw <srszzw@163.com>
Co-authored-by: liunux4odoo <liunux@qq.com>
2024-03-25 16:35:45 +08:00
glide-the
28cbf862ff 使用poetry管理项目 2024-03-25 15:32:04 +08:00
glide-the
6f5f22a17a 使用poetry管理项目 2024-03-25 15:31:49 +08:00
liunux4odoo
51691ee008
update to pydantic v2 (#3486) 2024-03-22 20:39:25 +08:00
glide-the
42dc6d18c9
Merge pull request #3466 from glide-the/dev_model_providers
model_providers bootstrap
2024-03-22 01:00:10 +08:00
glide-the
9d954b2b76 model_providers bootstrap 2024-03-22 00:57:14 +08:00
glide-the
4873d136b5 model_providers bootstrap 2024-03-22 00:43:09 +08:00
panhong
d63bf0bda5
添加 react 编写的新版 WEBUI (#3417)
* feat:提交前端代码

* feat:提交logo样式切换

* feat:替换avatar、部分位置icon、chatchat相关说明、git链接、Wiki链接、关于、设置、反馈与建议等功能,关闭lobehub自检更新功能

* fix:移除多余代码

---------

Co-authored-by: liunux4odoo <41217877+liunux4odoo@users.noreply.github.com>
2024-03-19 14:30:26 +08:00
liunux4odoo
16d9b60999 fix merge conflict: langchain Embeddings not imported in server.utils 2024-03-19 08:34:05 +08:00
glide-the
e977e2ff73 dify model_providers configuration
This module provides the interface for invoking and authenticating various models, and offers Dify a unified information and credentials form rule for model providers.
2024-03-18 01:19:14 +08:00
Sumkor
4bdb69baf3
fix markdown header split (#1825) (#3324) 2024-03-15 07:17:53 +08:00
glide-the
9b5367a23b
Merge pull request #3310 from chatchat-space/revert-3304-dev
Revert "xinference的代码"
2024-03-13 20:17:02 +08:00
glide-the
301c7c3d8c
Revert "xinference的代码" 2024-03-13 20:16:42 +08:00
glide-the
08f6fa53b4
Merge pull request #3304 from khazic/dev
后端服务接入功能工具包
2024-03-13 20:00:49 +08:00
Leb
980f321bec
diiii
diii
2024-03-13 19:51:36 +08:00
Leb
9208627138
Create khazic 2024-03-13 19:49:02 +08:00
Leb
4939e736e1
Delete server/xinference directory 2024-03-13 16:56:53 +08:00
Leb
eec8d51a91
xinference的代码
先传 我后面来改
2024-03-13 16:37:37 +08:00
dignfei
7b2b24c0bc
使用多进程提高导入知识库的速度 (#3276) 2024-03-13 10:36:14 +08:00
liunux4odoo
6310095a00 make xinference model manager support xinference 0.9.x 2024-03-12 20:37:17 +08:00
liunux4odoo
08c155949b
make qwen agent work with langchain>=0.1 (#3228) 2024-03-07 19:14:33 +08:00
glide-the
87c912087c 修复glm3 agent被注释的agent会话文本结构解析代码
看起来输出的文本占位符如下,目前解析代码是有问题的
Thought <|assistant|> Action\r
```python
tool_call(action_input)
```<|observation|>
2024-03-07 13:56:07 +08:00
liunux4odoo
51301dfe6a 优化 ES 知识库
- 开发者
    - get_OpenAIClient 的 local_wrap 默认值改为 False,避免 API 服务未启动导致其它功能受阻(如Embeddings)
    - 修改 ES 知识库服务:
	- 检索策略改为 ApproxRetrievalStrategy
	- 设置 timeout 为 60, 避免文档过多导致 ConnecitonTimeout Error
    - 修改 LocalAIEmbeddings,使用多线程进行  embed_texts,效果不明显,瓶颈可能主要在提供 Embedding 的服务器上
2024-03-07 11:58:27 +08:00
liunux4odoo
c839a1791a update kb_config.py.example 2024-03-07 09:22:35 +08:00
liunux4odoo
1118922387 调整根目录结构,kb/logs/media/nltk_data 移动到专用数据目录(可配置,默认 data)。注意知识库文件要做相应移动 2024-03-07 09:17:11 +08:00
liunux4odoo
e06d56b8bc 重写 calculate 工具 2024-03-07 09:01:50 +08:00