From abaca1e0a92b80da8176e5aefaf44a69d31edebb Mon Sep 17 00:00:00 2001 From: Koesn <148289202+Koesn@users.noreply.github.com> Date: Sun, 2 Jun 2024 20:22:36 +0700 Subject: [PATCH] Update extensions/openai/completions.py This will ensure the last message is added. It also enable system prompt to be processed. Now OAI API compatible can user their system prompt. --- extensions/openai/completions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extensions/openai/completions.py b/extensions/openai/completions.py index 44c1df86..24f87904 100644 --- a/extensions/openai/completions.py +++ b/extensions/openai/completions.py @@ -207,6 +207,9 @@ def convert_history(history): elif role == "system": system_message = content + if current_message: + chat_dialogue.append([current_message, current_reply]) # Ensure the last message is added. System prompt is now enabled. Tested. + if not user_input_last: user_input = ""