fix(openai): handle content blocks without type key in responses api conversion (#36725)

This commit is contained in:
William FH
2026-04-14 12:13:40 -07:00
committed by GitHub
parent 01a324af0e
commit 885f2c2c2d
4 changed files with 54 additions and 6 deletions

View File

@@ -407,6 +407,8 @@ def _convert_from_v1_to_responses(
) -> list[dict[str, Any]]:
new_content: list = []
for block in content:
if "type" not in block:
continue
if block["type"] == "text" and "annotations" in block:
# Need a copy because we're changing the annotations list
new_block = dict(block)