1888 Commits

Author SHA1 Message Date
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
liunux4odoo
1dc069fa9c model_config 中补充 oneapi 默认在线模型;/v1/models 接口支持 oneapi 平台,统一返回模型列表 2024-03-07 08:31:47 +08:00
liunux4odoo
82dfcd97e6 fix merge conflict 2024-03-06 14:02:30 +08:00
liunux4odoo
f0f31167e9 update xinference manager ui 2024-03-06 13:51:57 +08:00
liunux4odoo
49bc5b54a4 添加 xinference 本地模型和自定义模型配置 UI: streamlit run model_loaders/xinference_manager.py 2024-03-06 13:51:57 +08:00
xucailiang
76b796ea58 原因:windows下启动失败提示补充python-multipart包 (#3184)
改动:requirements添加python-multipart==0.0.9
版本:0.0.9  Requires: Python >=3.8

Co-authored-by: XuCai <liangxc@akulaku.com>
2024-03-06 13:51:57 +08:00
liunux4odoo
77c3fa65c2 移除 llama-index 依赖;修复 /v1/models 错误 2024-03-06 13:51:57 +08:00
liunux4odoo
d0846f88cc - pydantic 限定为 v1,并统一项目中所有 pydantic 导入路径,为以后升级 v2 做准备
- 重构 api.py:
    - 按模块划分为不同的 router
    - 添加 openai 兼容的转发接口,项目默认使用该接口以实现模型负载均衡
    - 添加 /tools 接口,可以获取/调用编写的 agent tools
    - 移除所有 EmbeddingFuncAdapter,统一改用 get_Embeddings
    - 待办:
        - /chat/chat 接口改为 openai 兼容
        - 添加 /chat/kb_chat 接口,openai 兼容
        - 改变 ntlk/knowledge_base/logs 等数据目录位置
2024-03-06 13:51:34 +08:00
liunux4odoo
65466007ae make torch & transformers optional
import pydantic Model & Field from langchain.pydantic_v1 instead of pydantic.v1
2024-03-06 13:50:06 +08:00
liunux4odoo
73eb5e2e32 move document_loaders & text_splitter under server 2024-03-06 13:49:39 +08:00