feat(types): add budget field to IntentMandate#198
feat(types): add budget field to IntentMandate#198ravyg wants to merge 2 commits intogoogle-agentic-commerce:mainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a crucial enhancement to the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new 'Budget' field to the IntentMandate type, allowing for an optional maximum total spend ceiling for AI agents. The change is implemented in both Go and Python, including updates to the specification documentation and comprehensive unit tests covering optionality, setting, JSON serialization, and round-trip functionality. The only feedback provided suggests using a standard apostrophe for consistency in the markdown documentation.
docs/specification.md
Outdated
| - Prompt Playback: The Agent’s understanding of the User’s prompt in natural | ||
| language. | ||
| - Time-to-Live (TTL): An expiration time for the mandate's validity. | ||
| - Time-to-Live (TTL): An expiration time for the mandate’s validity. |
There was a problem hiding this comment.
Consider using a standard apostrophe ' instead of the right single quotation mark ’ for consistency in markdown files, unless there's a specific style guide dictating otherwise. While ’ is typographically correct, '' is more common in plain text and code contexts.
| - Time-to-Live (TTL): An expiration time for the mandate’s validity. | |
| - Time-to-Live (TTL): An expiration time for the mandate's validity. |
Adds an optional `budget: PaymentCurrencyAmount` field to `IntentMandate` in both Python and Go, giving agents a machine-readable spend ceiling to enforce when fulfilling a purchase intent. - Python: `src/ap2/types/mandate.py` -- new field + import - Go: `samples/go/pkg/ap2/types/mandate.go` -- new field with omitempty - Tests: 6 Python tests + 5 Go tests (optional, set, JSON round-trip, absent-from-JSON) Closes google-agentic-commerce#133
Adds an optional
budget: PaymentCurrencyAmountfield toIntentMandatein both Python and Go, giving agents a machine-readable spend ceiling to enforce when fulfilling a purchase intent.src/ap2/types/mandate.py-- new field + importsamples/go/pkg/ap2/types/mandate.go-- new field with omitemptyCloses #133
Description
Thank you for opening a Pull Request!
Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
CONTRIBUTINGGuide.Fixes #<issue_number_goes_here> 🦕