openai: fix allowed block types (#20636)

pull/17154/head^2
ccurme 6 months ago committed by GitHub
parent 764871f97d
commit 6d530481c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -154,7 +154,11 @@ def _format_message_content(content: Any) -> Any:
# Remove unexpected block types
formatted_content = []
for block in content:
if isinstance(block, dict) and "type" in block and block["type"] != "text":
if (
isinstance(block, dict)
and "type" in block
and block["type"] == "tool_use"
):
continue
else:
formatted_content.append(block)

Loading…
Cancel
Save