Prechádzať zdrojové kódy

Fix OpenAI chat completions compatibility (#559)

ummmm u cant index a python dict w/ dot notation, sillyhead
Drake 7 mesiacov pred
rodič
commit
e1a142c179

+ 1 - 1
aphrodite/endpoints/openai/serving_chat.py

@@ -58,7 +58,7 @@ class OpenAIServingChat(OpenAIServing):
         # Deal with list in messages.content
         # Just replace the content list with the very first text message
         for message in request.messages:
-            if message.role == "user" and isinstance(message["content"], list):
+            if message["role"] == "user" and isinstance(message["content"], list):
                 message["content"] = next((content["text"]
                                            for content in message["content"]
                                            if content["type"] == "text"), "")