Skip to content

Commit 88edfcd

Browse files
.
1 parent e25afa7 commit 88edfcd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sentry_sdk/integrations/openai.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,7 +1102,7 @@ def _new_responses_create_common(f: "Any", *args: "Any", **kwargs: "Any") -> "An
11021102
response = yield f, args, kwargs
11031103

11041104
# Attribute check to fail gracefully if the attribute is not present in future `openai` versions.
1105-
if isinstance(response, Stream):
1105+
if isinstance(response, Stream) and hasattr(response, "_iterator"):
11061106
input = kwargs.get("input")
11071107

11081108
if input is not None and isinstance(input, str):
@@ -1119,7 +1119,7 @@ def _new_responses_create_common(f: "Any", *args: "Any", **kwargs: "Any") -> "An
11191119
)
11201120

11211121
# Attribute check to fail gracefully if the attribute is not present in future `openai` versions.
1122-
elif isinstance(response, AsyncStream):
1122+
elif isinstance(response, AsyncStream) and hasattr(response, "_iterator"):
11231123
input = kwargs.get("input")
11241124

11251125
if input is not None and isinstance(input, str):

0 commit comments

Comments
 (0)