ref(openai): Separate output handling#5543
Conversation
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛Openai
Other
Documentation 📚
Internal Changes 🔧Agents
Openai Agents
Other
🤖 This preview updates automatically when you update the PR. |
Codecov Results 📊✅ 13 passed | Total: 13 | Pass Rate: 100% | Execution Time: 7.88s 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ❌ Patch coverage is 0.00%. Project has 13749 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 25.65% 30.75% +5.1%
==========================================
Files 189 189 —
Lines 19838 19854 +16
Branches 6430 6434 +4
==========================================
+ Hits 5089 6105 +1016
- Misses 14749 13749 -1000
- Partials 421 468 +47Generated by Codecov Action |
ericapisani
left a comment
There was a problem hiding this comment.
Couple of naming things but otherwise LGTM.
| kwargs: "dict[str, Any]", | ||
| integration: "OpenAIIntegration", | ||
| start_time: "Optional[float]" = None, | ||
| finish_span: bool = True, |
There was a problem hiding this comment.
Nit: I can see there being a possibility that the name finish_span could be interpreted as the "ending span" (a noun) rather than "mark the span as finished" (a verb/action).
If it's not a massive pain, it might be worth renaming to mark_span_as_finished
There was a problem hiding this comment.
very good point, naming is hard 😅
I'll follow up later with readability changes to keep this PR atomic
sentry_sdk/integrations/openai.py
Outdated
|
|
||
|
|
||
| def _set_output_data( | ||
| def _common_set_output_data( |
There was a problem hiding this comment.
Nit: _set_common_output_data
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Description
Create separate functions for output-handling of
openaiResponses, Completions, and Embedding API functions. Create streaming variants where applicable.Issues
Reminders
tox -e linters.feat:,fix:,ref:,meta:)