From 52b066524f67c90fd8ba74a36e4a43ce9ac12700 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Mon, 13 Feb 2023 23:06:35 +0800 Subject: [PATCH] fix bug --- openai/chatgpt.go | 2 ++ 1 file changed, 2 insertions(+) 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)