-
Notifications
You must be signed in to change notification settings - Fork 576
feat(ai): add cache writes for gen_ai #5319
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
Conversation
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Ai
Other
Bug Fixes 🐛Integrations
Litellm
Other
Documentation 📚
Internal Changes 🔧Release
Other
🤖 This preview updates automatically when you update the PR. |
bf3310b to
37782db
Compare
| if ( | ||
| hasattr(usage, "output_tokens_reasoning") | ||
| and usage.output_tokens_reasoning is not None | ||
| ): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is adding the reasoning tokens to pydantic-ai intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah no, forgot to remove that - thanks for catching that!
| import sentry_sdk | ||
| from pydantic_ai.usage import RequestUsage | ||
| from sentry_sdk.integrations.pydantic_ai.spans.utils import _set_usage_data | ||
| from sentry_sdk.consts import SPANDATA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please move these to the top of the file before merging 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
excuse the slop 🙏
gen_ai.usage.input_tokens.cache_writeCloses TET-1732
Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com