Skip to content

Commit fe0d756

Browse files
authored
Update test_responses_stream.py
1 parent c7ff63a commit fe0d756

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

libs/partners/openai/tests/unit_tests/chat_models/test_responses_stream.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,8 @@ def mock_create(*args: Any, **kwargs: Any) -> MockSyncContextManager:
678678
for idx, item in enumerate(response.output):
679679
dumped = _strip_none(item.model_dump())
680680
_ = dumped.pop("status", None)
681-
if dumped["type"] == "output_text":
682-
dumped["type"] = "input_text"
681+
if "content" in dumped and isinstance(dumped["content"], list):
682+
for content in dumped["content"]:
683+
if "type" in content and content["type"] == "output_text":
684+
content["type"] == "input_text"
683685
assert dumped == payload["input"][idx]

0 commit comments

Comments
 (0)