From 9a9dff135aa5fde45016c45ac3c392d769477a6c Mon Sep 17 00:00:00 2001 From: Chill Date: Wed, 29 Mar 2023 16:05:02 +0800 Subject: [PATCH] =?UTF-8?q?update=20app=5Fchatgpt=20=E8=81=8A=E5=A4=A9?= =?UTF-8?q?=E5=B1=8F=E8=94=BD=E6=95=8F=E6=84=9F=E8=AF=8D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app_chatgpt/models/ai_robot.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app_chatgpt/models/ai_robot.py b/app_chatgpt/models/ai_robot.py index 65333906..979f1095 100644 --- a/app_chatgpt/models/ai_robot.py +++ b/app_chatgpt/models/ai_robot.py @@ -96,6 +96,7 @@ GPT-3 A set of models that can understand and generate natural language # for rec in res: # res = rec['message']['content'] res = '\n'.join([x['message']['content'] for x in res['choices']]) + res = self.filter_sensitive_words(res) return res else: pdata = { @@ -113,6 +114,7 @@ GPT-3 A set of models that can understand and generate natural language res = response.json() if 'choices' in res: res = '\n'.join([x['text'] for x in res['choices']]) + res = self.filter_sensitive_words(res) return res return "获取结果超时,请重新跟我聊聊。"