From c004ea5e8258381d94d1c16c58c3164c65ec176e Mon Sep 17 00:00:00 2001 From: Chill Date: Tue, 18 Apr 2023 13:50:23 +0800 Subject: [PATCH] =?UTF-8?q?fix=20#I6WMVK=20[app=5Fchatgpt]=20ChatGPT=20?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=83=85=E5=86=B5=EF=BC=8C=E5=AF=B9=E8=AF=9D?= =?UTF-8?q?=E6=9D=83=E9=99=90=E4=B8=BA=E6=89=80=E6=9C=89=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E4=B9=9F=E8=A6=81=E4=BF=9D=E5=AD=98=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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 421e6ba6..3586293e 100644 --- a/app_chatgpt/models/ai_robot.py +++ b/app_chatgpt/models/ai_robot.py @@ -141,7 +141,7 @@ GPT-3 A set of models that can understand and generate natural language content = json.loads(json.dumps(res['choices'][0]['message']['content'])) data = content.replace(' .', '.').strip() answer_user = answer_id.mapped('user_ids')[:1] - if answer_user.gpt_policy == 'limit' and usage: + if usage: prompt_tokens = usage['prompt_tokens'] completion_tokens = usage['completion_tokens'] total_tokens = usage['total_tokens'] @@ -151,6 +151,7 @@ GPT-3 A set of models that can understand and generate natural language if not ai_use: ai_use.create({ 'name': author_id.id, + 'ai_user_id': answer_user.id, 'human_prompt_tokens': prompt_tokens, 'ai_completion_tokens': completion_tokens, 'tokens_total': total_tokens,