Skip to content

Commit

Permalink
Refactor callbackHandler function to reply with JSON data
Browse files Browse the repository at this point in the history
  • Loading branch information
kkdai committed Jan 24, 2024
1 parent 708c9ed commit 823a950
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,7 @@ func callbackHandler(w http.ResponseWriter, r *http.Request) {
log.Println("Error parsing JSON:", err)
}
log.Println("Got jsonData:", string(jsonData))

// send json string to gemini complete whole result.
ret := GeminiChatComplete("你幫忙使用者搜尋資料,根據找到的關鍵字,查詢到以下資料,請整理相關回覆:" + string(jsonData))
if err := replyText(e.ReplyToken, ret); err != nil {
if err := replyText(e.ReplyToken, string(jsonData)); err != nil {
log.Print(err)
}

Expand Down

0 comments on commit 823a950

Please sign in to comment.