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

🐞 错误报告 私聊机器人不回复 #209

Closed
1178615156 opened this issue Apr 22, 2023 · 3 comments
Closed

🐞 错误报告 私聊机器人不回复 #209

1178615156 opened this issue Apr 22, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@1178615156
Copy link

错误报告 🐞

如果您在使用此项目时遇到了错误,请在此报告,我们会尽快解决此问题。

错误描述 🤔

1682155291611

附加信息 📝

  • 运行方式docker runleizhenpeng/feishu-chatgpt
  • log
[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.

[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:	export GIN_MODE=release
 - using code:	gin.SetMode(gin.ReleaseMode)

[GIN-debug] GET    /ping                     --> main.main.func2 (3 handlers)
[GIN-debug] POST   /webhook/event            --> github.com/larksuite/oapi-sdk-gin.NewEventHandlerFunc.func1 (3 handlers)
[GIN-debug] POST   /webhook/card             --> github.com/larksuite/oapi-sdk-gin.NewCardActionHandlerFunc.func1 (3 handlers)
[GIN-debug] [WARNING] You trusted all proxies, this is NOT safe. We recommend you to set a value.
Please check https://pkg.go.dev/github.com/gin-gonic/gin#readme-don-t-trust-all-proxies for details.
[GIN-debug] Listening and serving HTTP on :9000
2023/04/22 09:19:22 http server started: http://localhost:9000/webhook/event
2023/04/22 09:19:40 [Error] [handle event,path:/webhook/event,error:event type: message, not found handler]
[GIN] 2023/04/22 - 09:19:40 | 200 |     310.534µs |  192.168.248.80 | POST     "/webhook/event"
No available API, revive one randomly
2023/04/22 09:19:41 [Error] [handle event,path:/webhook/event, error:invalid argument to Intn]
[GIN] 2023/04/22 - 09:19:41 | 500 |     830.523µs |  192.168.248.80 | POST     "/webhook/event"

  • 输出日志,包括错误信息和堆栈跟踪
  • 相关的代码片段或文件
  • 您的操作系统、软件版本等环境信息

感谢您的反馈!🙏

@1178615156 1178615156 added the bug Something isn't working label Apr 22, 2023
@1178615156
Copy link
Author

应该是这里的原因:
用的是中转代理,不是sk开头

//OPENAI_KEY: sk-xxx,sk-xxx,sk-xxx
//result:[sk-xxx sk-xxx sk-xxx]
func getViperStringArray(key string, defaultValue []string) []string {
	value := viper.GetString(key)
	if value == "" {
		return defaultValue
	}
	raw := strings.Split(value, ",")
	return filterFormatKey(raw)
}


// 过滤出 "sk-" 开头的 key
func filterFormatKey(keys []string) []string {
	var result []string
	for _, key := range keys {
		if strings.HasPrefix(key, "sk-") || strings.HasPrefix(key,
			"fk") {
			result = append(result, key)
		}
	}
	return result

}

@FrankFang
Copy link

这是因为你的服务器无法访问 api.openai.com

@1178615156
Copy link
Author

这是因为你的服务器无法访问 api.openai.com

测试了,是因为key被过滤了,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants