-
Notifications
You must be signed in to change notification settings - Fork 30
add a method to Messages to set a cache breakpoint #335
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
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.
Pull request overview
Adds support for marking a Message as a “cache breakpoint” so that serialized content includes cache_control metadata for prompt caching (e.g., Anthropic).
Changes:
- Introduces a
cache_breakpointflag onMessage, excluded from dumps but used during serialization to injectcache_control. - Adds
Message.set_cache_breakpoint(enabled: bool = True)for fluent enabling/disabling. - Adds unit tests for default behavior and serialization outcomes, plus a new live integration-style test.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/aviary/message.py |
Adds cache_breakpoint field, serialization behavior to inject cache_control, and a setter method. |
tests/test_messages.py |
Adds test coverage for cache_breakpoint serialization and behavior, including a new live network test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This reverts commit 7825c7b.
jamesbraza
left a comment
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.
Nice work! Thanks for doing this
No description provided.