diff --git a/openai/chatgpt.go b/openai/chatgpt.go index 84f4219..34f7fdb 100644 --- a/openai/chatgpt.go +++ b/openai/chatgpt.go @@ -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)