From c450331ffdac7b4dc655ce7c6a395a00dee9db96 Mon Sep 17 00:00:00 2001 From: Chill Date: Thu, 25 May 2023 14:47:48 +0800 Subject: [PATCH] fix --- app_chatgpt/models/ai_robot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app_chatgpt/models/ai_robot.py b/app_chatgpt/models/ai_robot.py index 17d3155a..6ba0bca5 100644 --- a/app_chatgpt/models/ai_robot.py +++ b/app_chatgpt/models/ai_robot.py @@ -155,7 +155,8 @@ GPT-3 A set of models that can understand and generate natural language def get_ai_post(self, res, author_id=False, answer_id=False, param={}): if res and author_id and isinstance(res, openai.openai_object.OpenAIObject) or isinstance(res, list) or isinstance(res, dict): # 返回是个对象,那么就是ai - if isinstance(res, dict): + # if isinstance(res, dict): + if self.provider == 'openai': # openai 格式处理 usage = res['usage'] content = res['choices'][0]['message']['content']