Skip to content

Commit 50c55d6

Browse files
committed
chore: debug info
1 parent 6d76e25 commit 50c55d6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

server.go

+9-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"github.com/go-zoox/chatbot-feishu"
99
"github.com/go-zoox/core-utils/regexp"
1010
"github.com/go-zoox/core-utils/strings"
11+
"github.com/go-zoox/debug"
1112
openaiclient "github.com/go-zoox/openai-client"
1213
"github.com/go-zoox/proxy"
1314
"github.com/go-zoox/proxy/utils/rewriter"
@@ -371,7 +372,10 @@ func ServeFeishuBot(cfg *FeishuBotConfig) (err error) {
371372
}
372373

373374
go func() {
374-
logger.Infof("%s 问 ChatGPT:%s", user.User.Name, question)
375+
if debug.IsDebugMode() {
376+
logger.Infof("%s 问 ChatGPT:%s", user.User.Name, question)
377+
}
378+
375379
var err error
376380

377381
conversation, err := client.GetOrCreateConversation(request.ChatID(), &chatgpt.ConversationConfig{
@@ -420,7 +424,10 @@ func ServeFeishuBot(cfg *FeishuBotConfig) (err error) {
420424
return
421425
}
422426

423-
logger.Infof("ChatGPT 答 %s:%s", user.User.Name, answer)
427+
if debug.IsDebugMode() {
428+
logger.Infof("ChatGPT 答 %s:%s", user.User.Name, answer)
429+
}
430+
424431
responseMessage := string(answer)
425432
// if request.IsGroupChat() {
426433
// responseMessage = fmt.Sprintf("%s\n-------------\n%s", question, answer)

0 commit comments

Comments
 (0)