From 31a496fd24c934b319c085fb81d5791a1c6fbb77 Mon Sep 17 00:00:00 2001 From: Junyang Lin Date: Sun, 13 Aug 2023 12:58:42 +0800 Subject: [PATCH] Update openai_api.py --- openai_api.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openai_api.py b/openai_api.py index bae3e90..568984f 100644 --- a/openai_api.py +++ b/openai_api.py @@ -105,8 +105,9 @@ async def create_chat_completion(request: ChatCompletionRequest): query = request.messages[-1].content prev_messages = request.messages[:-1] - if len(prev_messages) > 0 and prev_messages[0].role == "system": - query = prev_messages.pop(0).content + query + # Temporarily, the system role does not work as expected. We advise that you write the setups for role-play in your query. + # if len(prev_messages) > 0 and prev_messages[0].role == "system": + # query = prev_messages.pop(0).content + query history = [] if len(prev_messages) % 2 == 0: