Skip to content

Commit dfd1b9d

Browse files
vendor bool handling
1 parent 56f68eb commit dfd1b9d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

sentry_sdk/integrations/openai.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,9 @@ def _new_chat_completion_common(f: "Any", *args: "Any", **kwargs: "Any") -> "Any
614614
span.__enter__()
615615

616616
span.set_data(SPANDATA.GEN_AI_SYSTEM, "openai")
617-
is_streaming_response = bool(kwargs.get("stream", False))
617+
618+
# Same bool handling as in https://github.com/openai/openai-python/blob/acd0c54d8a68efeedde0e5b4e6c310eef1ce7867/src/openai/resources/completions.py#L585
619+
is_streaming_response = kwargs.get("stream", False) or False
618620
span.set_data(SPANDATA.GEN_AI_RESPONSE_STREAMING, is_streaming_response)
619621

620622
_set_completions_api_input_data(span, kwargs, integration)

0 commit comments

Comments
 (0)