deanxv / coze-discord-proxy

代理Discord对话Coze-Bot,实现以API形式请求GPT4模型,提供对话、文生图、图生文、知识库检索等功能。
GNU General Public License v3.0
3.61k stars 1.05k forks source link

执行画图命令时,返回的是文本会话信息 #133

Closed kingdocker closed 6 months ago

kingdocker commented 6 months ago

例行检查

  1. 机器人在coze里已经添加了DALLE画图插件。
  2. 机器人配置没问题,可以正常对话发送消息。
  3. CDP版本v4.4.0。

问题描述 执行画图命令时,返回的是会话信息。

复现步骤

  1. 在本地进行curl:

    $ curl http://127.0.0.1:7077/v1/images/generations   -H "Content-Type: application/json"   -H "Authorization: Bearer sk-xxx"   -d '{
    "model": "gpt-4",
    "messages": [
      {
        "role": "user",
        "content": "画一只猫 \\n"
      }
    ]
    }'
    {"error":{"message":"Failed to fetch image URL, please try again later.","type":"request_error","param":"","code":"500"}}
  2. 在discord里观察,只进行了文本会话。没有走画图接口。

image
  1. 查看容器日志,其实是发送了image的请求了的。 $ docker logs -f 523 [SYS] 2024/03/25 - 22:09:25 | COZE-DISCORD-PROXY v4.4.0 started [SYS] 2024/03/25 - 22:09:25 | Environment variable check passed. [SYS] 2024/03/25 - 22:09:25 | Bot is now running. Enjoy It. [GIN] 2024/03/25 - 22:10:10 | 20240325221010200938323xjhLGL58 | 200 | 377.825µs | 172.18.0.1 | GET /swagger/index.html [GIN] 2024/03/25 - 22:18:00 | 20240325221259545259103wSGWWJiQ | 200 | 5m0.963509432s | 172.18.0.1 | POST /v1/chat/completions [GIN] 2024/03/25 - 22:20:05 | 20240325221504654041982twbUwH0j | 200 | 5m0.850822989s | 172.18.0.1 | POST /v1/chat/completions [GIN] 2024/03/25 - 22:21:05 | 20240325221604630171937pxJmPh5F | 200 | 5m1.180918363s | 172.18.0.1 | POST /v1/chat/completions [GIN] 2024/03/25 - 22:21:31 | 20240325221630343439644oQi8kHCw | 200 | 5m0.974050547s | 172.18.0.1 | POST /v1/chat/completions [GIN] 2024/03/25 - 22:22:10 | 20240325221709751821426dFCaZCE1 | 200 | 5m0.920013863s | 172.18.0.1 | POST /v1/chat/completions [GIN] 2024/03/25 - 22:23:10 | 20240325221809736211908CwkSA8xu | 200 | 5m0.973306179s | 172.18.0.1 | POST /v1/chat/completions [GIN] 2024/03/25 - 22:25:15 | 202403252220148421707052yAGJniX | 200 | 5m0.949410682s | 172.18.0.1 | POST /v1/chat/completions [GIN] 2024/03/25 - 22:26:37 | 20240325222136660091335ufm0RRxb | 200 | 5m0.846746101s | 172.18.0.1 | POST /v1/chat/completions [GIN] 2024/03/25 - 22:27:02 | 20240325222201513661016LTnblNkI | 200 | 5m0.867051509s | 172.18.0.1 | POST /v1/chat/completions [GIN] 2024/03/25 - 22:27:27 | 2024032522222730950320aPn8vMZT | 200 | 5m0.871107416s | 54.238.1.1 | POST /v1/chat/completions [GIN] 2024/03/25 - 22:28:38 | 20240325222832936096332rUgdLsxL | 200 | 5.895301526s | 54.238.1.1 | POST /v1/chat/completions [GIN] 2024/03/25 - 22:30:48 | 20240325223037290820395dcik48HK | 200 | 11.421114662s | 172.18.0.1 | POST /v1/chat/completions [GIN] 2024/03/25 - 22:31:30 | 20240325223117972614157Y9SwgyLh | 200 | 12.868159152s | 172.18.0.1 | POST /v1/chat/completions [GIN] 2024/03/25 - 22:33:21 | 202403252233031121323480EDyp1lW | 200 | 18.106259687s | 172.18.0.1 | POST /v1/images/generations [GIN] 2024/03/25 - 22:35:18 | 20240325223504121855159eWt6ER0n | 200 | 13.981077931s | 172.18.0.1 | POST /v1/images/generations [GIN] 2024/03/25 - 22:37:58 | 20240325223751873828547Zc2cp5mV | 200 | 6.233401314s | 172.18.0.1 | POST /v1/chat/completions [GIN] 2024/03/25 - 22:38:17 | 20240325223806896006023eIuTuV7y | 200 | 11.094851607s | 172.18.0.1 | POST /v1/images/generations [GIN] 2024/03/25 - 22:50:31 | 202403252250231671119145ksxy4T9 | 200 | 8.179260038s | 172.18.0.1 | POST /v1/images/generations [GIN] 2024/03/25 - 22:51:44 | 20240325225137915467957XWSVpqsW | 200 | 6.684906237s | 172.18.0.1 | POST /v1/images/generations [GIN] 2024/03/25 - 22:52:06 | 20240325225159760582870uAVx1Efs | 200 | 6.700356769s | 172.18.0.1 | POST /v1/images/generations

预期结果 能够返回绘画结果。

deanxv commented 6 months ago
  1. v1/images/generations 接口的请求体格式和对话接口的请求体格式不一样,请查看官方api文档。

  2. 画图需要启用Dall-E-3插件。