Privoce / vocechat-web

VoceChat Web App
https://privoce.voce.chat/
GNU General Public License v3.0
1.75k stars 180 forks source link

[BUG]使用ChatGPT机器人BUG #159

Open Miykah opened 11 months ago

Miykah commented 11 months ago

描述问题

部署好 vocechat-chatbot-vercel 后(本地node部署),可以正常使用。但是将webhook填入vocechat机器人以后,从vocechat发消息,一直收不到回复,查看vocechat-chatbot-vercel日志发现消息发送成功,GPT也调用成功,但是回复到vocechat失败。

vocechat-chatbot-vercel输出信息:

bot: from webhook push POST 0 http://vocechat.xxx.top 6227d
bot: handler POST {
  created_at: 1703059951872,
  detail: {
  content: '你好',
  content_type: 'text/plain',
  expires_in: null,
  properties: { local_id: 1703059952671, mentions: [] },
  type: 'normal'
},
  domain: null,
  from_uid: 1,
  mid: 34,
  target: { uid: 18 },
  type: 'chat'
}
bot: start req ChatGPT
bot: end req ChatGPT {
  id: 'chatcmpl-lTiFbkVBFnqXqpbEaCmkoUXSXWFYA',
  object: 'chat.completion',
  created: 1703059953,
  model: 'gpt-3.5-turbo',
  choices: [
  {
  index: 0,
  message: { role: 'assistant', content: '你好!有什么我可以帮助你的吗?' },
  finish_reason: 'stop'
}
],
  usage: { prompt_tokens: 45, completion_tokens: 18, total_tokens: 63 },
  system_fingerprint: ''
} 你好!有什么我可以帮助你的吗? http://vocechat.xxx.top/api/bot/reply/34
bot: send failed http://vocechat.xxx.top/api/bot/reply/34 [SyntaxError: Unexpected token m in JSON at position 0]

vocechat-chatbot-vercel的.env.local如下: image

额外信息

chatgpt的访问地址为 : bot.xxx.top,我填入机器人的webhook为:https://bot.xxx.top/api/bot 参考文档设置的。

JohminStudio commented 4 months ago

老哥,解决没

MasterKe2003 commented 1 month ago

一样问题