feat: Send GenAI spans as V2 envelope items#6079
feat: Send GenAI spans as V2 envelope items#6079alexander-alderman-webb wants to merge 12 commits intomasterfrom
Conversation
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Codecov Results 📊✅ 13 passed | Total: 13 | Pass Rate: 100% | Execution Time: 7.48s All tests are passing successfully. ❌ Patch coverage is 19.30%. Project has 15120 uncovered lines. Files with missing lines (1)
Generated by Codecov Action |
| "role": "user", | ||
| "parts": [{"inline_data": {"data": b"binary_data", "mime_type": "image/gif"}}], | ||
| "parts": [ | ||
| {"inline_data": {"attributes": b"binary_data", "mime_type": "image/gif"}} |
There was a problem hiding this comment.
Test uses wrong key 'attributes' instead of 'data' for inline_data
The test changed the inline_data dict key from data to attributes, but the actual implementation in transform_google_content_part (sentry_sdk/ai/utils.py:286) expects inline_data.get("data", ""). Other tests in the same file (lines 1765, 1806) correctly use data. This change means the test no longer validates the real inline_data handling path - the content field would be set to an empty string instead of testing the binary data substitution.
Verification
Read transform_google_content_part in sentry_sdk/ai/utils.py which shows the expected format is {"inline_data": {"mime_type": "...", "data": "..."}} (line 260) and the code accesses inline_data.get("data", "") at line 286. Also verified other tests in the same file use "data" not "attributes" (lines 1765, 1806).
Identified by Warden code-review · NUR-Y7U
Description
Issues
Reminders
tox -e linters.feat:,fix:,ref:,meta:)