From 304093260e28ccee19d031215f8355a55925861b Mon Sep 17 00:00:00 2001 From: Will Date: Mon, 13 Feb 2023 23:03:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93chatGPT=E8=BF=94=E5=9B=9E=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E6=97=B6=E5=80=99=E6=8A=8A=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E8=BF=94=E5=9B=9E=E7=BB=99IM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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)