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.
This commit is contained in:
Koesn 2024-06-02 20:22:36 +07:00 committed by GitHub
parent abe5ddc883
commit abaca1e0a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -207,6 +207,9 @@ def convert_history(history):
elif role == "system": elif role == "system":
system_message = content 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: if not user_input_last:
user_input = "" user_input = ""