Skip to content

Commit

Permalink
API: Relax multimodal format, fixes HuggingFace Chat UI (#6353)
Browse files Browse the repository at this point in the history
  • Loading branch information
Papierkorb authored Sep 3, 2024
1 parent 4c74c7a commit 9a150c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion extensions/openai/completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,9 @@ def convert_history(history):
elif item['type'] == 'text' and isinstance(item['text'], str):
content = item['text']

if image_url and content:
if image_url:
new_history.append({"image_url": image_url, "role": "user"})
if content:
new_history.append({"content": content, "role": "user"})
else:
new_history.append(entry)
Expand Down

0 comments on commit 9a150c3

Please sign in to comment.