-
Notifications
You must be signed in to change notification settings - Fork 585
fix(openai): Attach response model with streamed Completions API #5557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5cee69e
d94f953
4ab8e74
fb12a44
2aa4b25
4f84f98
9d89b90
3fe3499
ece696a
6c5f254
9683ef6
5a36e3d
0ce3879
731754f
f1fdaf9
f93c208
63a9c71
f7c5356
1cdc590
edf0a4f
0bd6503
89baf7d
85e1791
071d1f0
f12cf5d
3fb20f0
4dade58
b07d1df
82843e2
ed9596e
e7c5c5a
2ed1a94
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -612,6 +612,8 @@ | |
| def new_iterator() -> "Iterator[ChatCompletionChunk]": | ||
| nonlocal ttft | ||
| for x in old_iterator: | ||
| span.set_data(SPANDATA.GEN_AI_RESPONSE_MODEL, x.model) | ||
|
Check warning on line 615 in sentry_sdk/integrations/openai.py
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ungarded streamed model access can raiseMedium Severity
Additional Locations (1)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Spec says it's required: developers.openai.com/api/reference/resources/chat/subresources/completions/streaming-events |
||
|
|
||
alexander-alderman-webb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| with capture_internal_exceptions(): | ||
| if hasattr(x, "choices"): | ||
| choice_index = 0 | ||
|
|
@@ -654,6 +656,8 @@ | |
| async def new_iterator_async() -> "AsyncIterator[ChatCompletionChunk]": | ||
| nonlocal ttft | ||
| async for x in old_iterator: | ||
| span.set_data(SPANDATA.GEN_AI_RESPONSE_MODEL, x.model) | ||
github-actions[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| with capture_internal_exceptions(): | ||
| if hasattr(x, "choices"): | ||
| choice_index = 0 | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.