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
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: B5690EEEBB952194

View file

@ -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 = ""