Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: OneBot阿里通义千问API报错 #748

Closed
KarlLee830 opened this issue Mar 29, 2024 · 1 comment
Closed

[Bug]: OneBot阿里通义千问API报错 #748

KarlLee830 opened this issue Mar 29, 2024 · 1 comment
Labels
bug? Bug或Bug修复相关

Comments

@KarlLee830
Copy link

部署方式

Docker部署

消息平台适配器

aiocqhttp(使用 OneBot 协议接入的)

系统环境

Unraid v6.12.6 中国大陆

Python环境

Docker内置Python环境

QChatGPT版本

v3.1.0.1

异常情况

尝试使用oneapi转换的通义千问API时报错
如需debug可提供搭建好的oneapi环境

日志信息

root@PowerServer:/mnt/user/appdata/qchatgptdocker# docker compose up
[+] Running 1/0
 ✔ Container qchatgptdocker-qchatgpt-1  Created                                                                                         0.0s 
Attaching to qchatgptdocker-qchatgpt-1
qchatgptdocker-qchatgpt-1  | 
qchatgptdocker-qchatgpt-1  |   ___   ___ _         _    ___ ___ _____ 
qchatgptdocker-qchatgpt-1  |  / _ \ / __| |_  __ _| |_ / __| _ \_   _|
qchatgptdocker-qchatgpt-1  | | (_) | (__| ' \/ _` |  _| (_ |  _/ | |  
qchatgptdocker-qchatgpt-1  |  \__\_\\___|_||_\__,_|\__|\___|_|   |_|  
qchatgptdocker-qchatgpt-1  | 
qchatgptdocker-qchatgpt-1  | ⭐️开源地址: https://github.com/RockChinQ/QChatGPT
qchatgptdocker-qchatgpt-1  | 📖文档地址: https://q.rkcn.top
qchatgptdocker-qchatgpt-1  | 
qchatgptdocker-qchatgpt-1  | [2024-03-29 19:52:56.426] /app/pkg/platform/manager.py (108) - [INFO] :
qchatgptdocker-qchatgpt-1  |     初始化平台适配器 0: aiocqhttp
qchatgptdocker-qchatgpt-1  | [2024-03-29 19:52:56 +0000] [1] [INFO] Running on http://0.0.0.0:5140 (CTRL + C to quit)
qchatgptdocker-qchatgpt-1  | [2024-03-29 19:52:58 +0000] [1] [INFO] 192.168.2.18:64909 GET /ws 1.1 101 - 510
qchatgptdocker-qchatgpt-1  | [2024-03-29 19:53:13.188] /app/pkg/pipeline/process/process.py (36) - [INFO] :
qchatgptdocker-qchatgpt-1  |     处理 person_13******37 的请求(0): 你好
qchatgptdocker-qchatgpt-1  | [2024-03-29 19:53:13.456] /app/pkg/pipeline/process/handlers/chat.py (97) - [ERROR] :
qchatgptdocker-qchatgpt-1  |     对话(0)请求失败: 模型请求失败: 请求参数错误: Error code: 400 - {'error': {'code': 'InvalidParameter', 'message': 'Provider API error: Role must be user or assistant and Content length must be greater than 0 (request id: 20240330035313198634539KHrrO4yq)', 'param': '07682f42-5cb6-9c46-ad1a-cc63e2d9cde2', 'type': 'InvalidParameter'}}
qchatgptdocker-qchatgpt-1  | [2024-03-29 19:53:13.978] /app/pkg/pipeline/controller.py (81) - [ERROR] :
qchatgptdocker-qchatgpt-1  |     模型请求失败: 请求参数错误: Error code: 400 - {'error': {'code': 'InvalidParameter', 'message': 'Provider API error: Role must be user or assistant and Content length must be greater than 0 (request id: 20240330035313198634539KHrrO4yq)', 'param': '07682f42-5cb6-9c46-ad1a-cc63e2d9cde2', 'type': 'InvalidParameter'}}

oneapi log内容

[ERR] 2024/03/30 - 03:53:13 | 20240330035313198634539KHrrO4yq | relay error happen, status code is 400, won't retry in this case 
[ERR] 2024/03/30 - 03:53:13 | 20240330035313198634539KHrrO4yq | relay error (channel #3(通义千问)): Provider API error: Role must be user or assistant and Content length must be greater than 0 
[GIN] 2024/03/30 - 03:53:13 | 20240330035313198634539KHrrO4yq | 400 |  256.296039ms |      172.17.0.1 |    POST /v1/chat/completions

启用的插件

[bot] 所有插件(1):

#1 Switcher
快捷切换使用的模型
v0.2.0
作者: RockChinQ

@KarlLee830 KarlLee830 added the bug? Bug或Bug修复相关 label Mar 29, 2024
@RockChinQ
Copy link
Owner

RockChinQ commented Mar 30, 2024

等 3.1.0.2 版本发布后,在 data/config/provider.json 里,把 prompt 的内容给删了,只剩下空字符串就可以了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug? Bug或Bug修复相关
Projects
None yet
Development

No branches or pull requests

2 participants