-
Notifications
You must be signed in to change notification settings - Fork 346
feat(go): introduce standalone sample #101
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
feat(go): introduce standalone sample #101
Conversation
Summary of ChangesHello @stefanoamorelli, 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 delivers a new, self-contained Go sample for the Agent Payments Protocol (AP2). It provides a practical demonstration of how different agents can collaborate to facilitate commerce transactions, covering the entire flow from product discovery to payment processing. The implementation emphasizes clear architecture, robust message handling, and the integration of advanced AI capabilities for tool selection, offering a valuable reference for developers looking to build agentic commerce solutions in Go. Highlights
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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces a comprehensive standalone Go sample for the Agent Payments Protocol. The implementation is well-structured, covering multiple agent roles, common utilities, AP2 types, and supporting infrastructure like a Makefile and a detailed README. The code is clean, idiomatic, and demonstrates the protocol flow effectively.
My review includes a few suggestions for improvement, mainly focusing on enhancing robustness, code clarity, and adhering to Go best practices. These include safer type assertions, using the standard library for efficiency, and clarifying mock implementations. Overall, this is an excellent addition that will serve as a great reference for developers.
c9fc058 to
2b8f93d
Compare
|
Could you add a README that instructs the user:
An example may be found at samples/python/scenarios/a2a/human-present/cards/README.md. |
- Add detailed scenario README at samples/go/scenarios/a2a/human-present/cards/README.md - Explains how to run the Go sample - Clarifies no shopping agent is included (backend only) - Documents what the sample demonstrates - Provides cURL examples for testing - Compares with Python samples - Update samples/go/README.md to be Go-specific - Removes incorrect Python-focused content - Provides Go project overview and structure - Documents development workflow Addresses PR feedback on google-agentic-commerce#101
…operability - Clarify Go sample provides backend agents only (no shopping agent) - Add detailed instructions for using Python shopping agent with Go backends - Highlight language-agnostic interoperability as key feature - Include cURL examples for direct API testing - Document architecture decisions and integration patterns - Add comparison table with Python sample This addresses PR google-agentic-commerce#101 feedback by clearly documenting: - How to run the Go sample (backend agents only) - How to interact with it (Python shopping agent or direct API calls) - What it demonstrates (backend infrastructure + interoperability)
Thanks for the feedback @joshlund-goog! I've updated the READMEs to address your points, but I also wanted to ask your opinion on something before finalizing this. Right now the Alternatively, we can demonstrate the What do you think makes more sense, or do you have other ideas? Please let me know if I'm missing out something. |
I like your solution of keeping the adk-python Shopping Agent as the entry point. I sent a review of the snags I ran into testing it out. Please fix and I'll continue testing/reviewing the go sample. |
|
Thanks @joshlund-goog, I've addressed your comments and added a few improvements. Here's also an E2E walkthrough of the process: video.mp4 |
104a1f8 to
3a98db2
Compare
joshlund-goog
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.
Verified the E2E test works. Nice work. Couple of README updates and then we can squash on merge.
Update scenario documentation to reflect correct agent endpoint paths and improve documentation clarity: - Add complete endpoint paths to agent descriptions (e.g., /a2a/merchant_agent instead of just port numbers) - Fix credentials provider endpoint from credentials_provider_agent to credentials_provider to match actual implementation - Update integration instructions to clarify Python Shopping Agent is pre-configured - Fix markdown linting issues (line length, list indentation, blank lines) - Update run.sh output to display correct credentials provider endpoint These changes align documentation with the actual implementation following commit 669f2a6 where agent cards are hosted at path level. Related to PR google-agentic-commerce#101
Refactor samples/go/README.md following the pattern established in Python samples to eliminate duplication with scenario-specific documentation: - Reduce from 307 to 86 lines (72% reduction) - Remove detailed content duplicated in scenario READMEs - Keep only essential overview, quick start, and navigation links - Point readers to scenario directories for detailed instructions - Remove "production-ready" wording per feedback - Align structure with samples/python/README.md (26 lines) This establishes scenario READMEs as the single source of truth for detailed documentation, making the codebase easier to maintain and reducing the risk of documentation drift. Benefits: - Single source of truth per scenario - Easier maintenance (update once, not twice) - Clearer navigation structure - Consistent with Python samples pattern Related to PR google-agentic-commerce#101
Reduce redundancy in the opening section by: - Shortening title to be more direct - Combining repetitive paragraphs into concise introduction - Using bullet list for what's included instead of prose - Removing repeated mentions of "sample", "Go", "backend agents" - Making the note about Python Shopping Agent more concise The new introduction is clearer and gets to the point faster while maintaining all essential information.
c51e4b7 to
b5b472d
Compare
b5b472d to
a5fa461
Compare
|
@joshlund-goog good stuff and thank you so much for all the feedback. I've given some love to the |
And thank you for the work on the go sample. We're very close. |
|
Adjusted as suggested ✔️ @joshlund-goog |
|
It appears we're blocked by this issue: https://github.com/orgs/community/discussions/144455. I'm looking into temporarily disabling the requirement for "conversations to be resolved". |
The requirement is removed now |
Tip
Better reviewed commit-by-commit.
Description
Implements a standalone
gosample.CONTRIBUTINGGuide.Closes #71 🦕