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.
This commit is contained in:
Kumi 2024-11-06 16:24:54 +01:00
parent 5fef1ab59c
commit 21edc48050
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -488,7 +488,7 @@ class OpenAI(BaseAI):
}
return (
system_message_dict
[system_message_dict]
+ [truncated_messages[0]]
+ list(reversed(truncated_messages[1:]))
)