From 21edc480501b62d7efed093d482467b3b596b821 Mon Sep 17 00:00:00 2001 From: Kumi Date: Wed, 6 Nov 2024 16:24:54 +0100 Subject: [PATCH] fix: correct message concatenation logic Wraps `system_message_dict` in a list to address a logic error in message concatenation. This ensures that the message list is correctly formatted, preventing potential runtime issues when processing the message sequence. --- src/gptbot/classes/ai/openai.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gptbot/classes/ai/openai.py b/src/gptbot/classes/ai/openai.py index 777d399..e6d2e94 100644 --- a/src/gptbot/classes/ai/openai.py +++ b/src/gptbot/classes/ai/openai.py @@ -488,7 +488,7 @@ class OpenAI(BaseAI): } return ( - system_message_dict + [system_message_dict] + [truncated_messages[0]] + list(reversed(truncated_messages[1:])) )