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:
parent
2cda890deb
commit
fb903ecddf
1 changed files with 1 additions and 1 deletions
|
|
@ -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"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue