mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-03-15 00:07:28 +00:00
OAI: Relax role requirement for chat completion message lists
Make it so any message role can be parsed from a list. Not really sure why this is the case because system and assistant shouldn't be sending data other than text, but it also doesn't make much sense to be extremely strict with roles either. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
@@ -217,7 +217,7 @@ async def format_prompt_with_template(
|
||||
# Deal with list in messages.content
|
||||
# Just replace the content list with the very first text message
|
||||
for message in data.messages:
|
||||
if message["role"] == "user" and isinstance(message["content"], list):
|
||||
if isinstance(message["content"], list):
|
||||
message["content"] = next(
|
||||
(
|
||||
content["text"]
|
||||
|
||||
Reference in New Issue
Block a user