From a9f0488e22ed328f7ae316b960fa69a685b9de93 Mon Sep 17 00:00:00 2001 From: Kaya <95276965+kytpbs@users.noreply.github.com> Date: Thu, 19 Oct 2023 01:21:37 +0300 Subject: [PATCH] fix error --- src/GPT.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/GPT.py b/src/GPT.py index 7a96b4b..ea956ca 100644 --- a/src/GPT.py +++ b/src/GPT.py @@ -54,11 +54,17 @@ def chat(main_message: str, message_history: dict[discord.User, str]): }, ] for user, message in message_history.items(): - messages.append({ - "role": "assistant" if user.bot else "user", - "name": user.name, - "content": message, - }) + if user.bot: + messages.append({ + "role": "assistant", + "content": message, + }) + else: + messages.append({ + "role": "user", + "name": user.name, + "content": message, + }) messages.append({ "role": "user",