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

部署后没有openAI内容返回 #1

Closed
1 task done
torans opened this issue May 12, 2023 · 1 comment
Closed
1 task done

部署后没有openAI内容返回 #1

torans opened this issue May 12, 2023 · 1 comment

Comments

@torans
Copy link

torans commented May 12, 2023

⚠️ 确认 issue 是否已存在 ⚠️

  • 我已经搜索了现有的问题,没有找到跟我问题相关的问题。

GPT-3 or GPT-4

GPT-3.5

操作系统

Linux

Bug 描述 📝

按照安装教程部署在海外节点(韩国)后,页面能正常显示,能获取到角色及收到"本项目已开放全部源代码:https://github.com/yangjian102621/chatgpt-plus..."等信息,但是发送消息却无法收到返回信息。
1,排查了Key没问题;
2,对比了Toml配置文件没看出异常。

重现步骤 🕹

运行日志:
2023-05-12T05:09:05.440Z INFO src/main.go:20 Loading config file: config.toml
2023-05-12T05:09:05.442Z INFO server/server.go:152 http://0.0.0.0:5678
2023-05-12T05:09:14.748Z INFO server/handler_chat.go:40 New websocket connected, IP: 127.0.0.1:39862, Username: Jran
2023-05-12T05:09:19.170Z INFO server/handler_chat.go:67 Receive a message: 1111
2023-05-12T05:09:19.170Z INFO server/handler_chat.go:132 会话上下文:[]
2023-05-12T05:09:19.170Z INFO server/handler_chat.go:179 Use API KEY: sk-Kxxx, PROXY:
2023-05-12T05:09:19.369Z ERROR server/handler_chat.go:213 EOF
chatplus/server.(*Server).sendMessage
/Users/ran/Developer/codes/chatgpt-plus/src/server/handler_chat.go:213
chatplus/server.(*Server).ChatHandle.func2
/Users/ran/Developer/codes/chatgpt-plus/src/server/handler_chat.go:73
2023-05-12T05:09:19.369Z INFO server/handler_chat.go:78 回答完毕: 1111

你的应用配置信息

Title = "Chat-Plus AI 助手"
ConsoleTitle = "Chat-Plus 控制台"
Listen = "0.0.0.0:5678"
ProxyURL = [""]
AccessKey = "test"

[Session]
  SecretKey = "test001"
  Name = "CHAT_SESSION_ID"
  Path = "/"
  Domain = "chat.xxx.com"
  MaxAge = 86400
  Secure = false
  HttpOnly = false
  SameSite = 2

[ImgURL]
  WechatCard = ""
  WechatGroup = ""

[Manager]
  Username = "admin"
  Password = "admin123"

[Chat]
  ApiURL = "https://api.openai.com/v1/chat/completions"
  Model = "gpt-3.5-turbo"
  Temperature = 1.0
  MaxTokens = 1024
  EnableContext = true
  ChatContextExpireTime = 3600

  [[Chat.ApiKeys]]
    Value = "sk-xxxxxxx"
    LastUsed = 1683867437
@yangjian102621
Copy link
Owner

@torans EOF 是 OpenAI 返回流异常终止了。先确保你的服务器能正常访问 OpenAI 的API。运行下面的脚本,看能否正常返回消息(把 OPENAI_API_KEY 换成你的 API KEY)。

curl https://api.openai.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
    "model": "gpt-3.5-turbo",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants