当chatGPT返回错误的时候把错误消息返回给IM

This commit is contained in:
Will 2023-02-13 23:03:47 +08:00
parent c80767c59f
commit 304093260e

View File

@ -115,6 +115,8 @@ func Completions(msg string) (*string, error) {
reply = v["text"].(string)
break
}
} else {
replay = v["error"]["message"].(string)
}
log.Printf("gpt response text: %s \n", reply)
result := strings.TrimSpace(reply)