mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 10:17:00 +00:00
fix(openai): handle content blocks without type key in responses api conversion (#36725)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user