Feat/go sdk#1279
Conversation
…er, and basic catalog Implement the A2UI agent SDK for Go, including: - Schema management: JSON Schema loading, validation, catalog pruning, topology analysis, and common type modifiers - Streaming parser: incremental A2UI JSON parsing with partial payload fixing, delta streaming, and multi-surface support - Basic catalog: out-of-the-box configuration for standard A2UI components - Conformance tests: full alignment with the cross-language test suite - Unit tests: comprehensive coverage for parser, schema, and validator
- Add Go SDK README with installation, usage examples, and test instructions - Update agent_sdk_guide.md to reference Go ecosystem (encoding/json) - Add Go BasicCatalog entry to the SDK guide - Add GitHub Actions workflow for Go SDK build, vet, and test
Add a complete Go implementation of the rizzcharts demo agent, including: - Gemini LLM integration with function calling for chart generation - A2UI streaming parser for real-time UI rendering - Minimal A2A JSON-RPC endpoint for message/send - Regex-based a2ui-json tag parsing for LLM output tolerance - Environment-based configuration with .env.example
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request introduces the Go implementation of the A2UI Agent SDK, providing core functionality for schema management, validation, and both synchronous and streaming response parsing. It includes a bundled basic catalog and a sample agent implementation. Feedback focuses on enhancing the SDK's robustness and performance, specifically by completing the inline catalog merging logic, using json.Number to avoid numeric validation mismatches, and optimizing the validator to eliminate redundant serialization cycles. Additionally, corrections were suggested for the streaming parser's buffer management and placeholder heuristics, along with a recommendation to implement buffer size limits to prevent memory exhaustion from malformed LLM output.
- Merge $defs from inline catalogs to preserve local $ref references - Use json.Decoder with UseNumber() to avoid float64 numeric mismatches - Unify buffer cleanup logic to correctly handle non-zero startIdx - Add 10MB JSON buffer size limit to prevent memory exhaustion - Add clarifying comments for toJSONSchemaValue and placeholder heuristic
|
Hi @jacobsimionato Could you please review this PR? Thanks! |
|
chenman9226 thank you for preparing this PR and sorry that we missed the last one! I don't believe a Go SDK is on our roadmap for SDKs within the core repository at the moment. We have some plans to revisit the agent SDK design, and we're eager to not accumulate too many ports within our repository before we stabilize the shared architecture. Would you mind creating this in a separate repository and publishing it yourself? We aim for A2UI to be a decentralized ecosystem, with only a few core packages in small number of languages maintained centrally. @nan-yu does this match your understanding re Go? |
Thanks for the context, that makes a lot of sense, and I'm happy to maintain this as a separate repository in my organization. A couple of follow-up questions while I have your attention:
Happy to discuss any of this in a separate Discussion thread if that's easier. Thanks again for the quick response! |
Description
Summary of Changes
This pull request introduces a Go implementation of the A2UI agent SDK, addressing #539. An earlier attempt was made in #579, but that PR appears to be stale and now conflicts with the current codebase. This is a fresh implementation ported from the current Python SDK, fully aligned with the v0.9 specification and the latest conformance test suite.
Our team has been adopting A2UI for building agent-powered applications in production, and since Go is our primary technology stack, we implemented a native Go SDK to better integrate A2UI into our Go-based services. We hope this contribution is useful to the growing A2UI ecosystem and welcome any feedback.
Highlights
Acknowledgments
Huge thanks to the A2UI team and existing contributors — particularly the authors of the Python SDK, whose clean architecture and thorough conformance test suite made this port straightforward. We hope this Go implementation is a useful addition to the community.
Note
The adk and a2a extension packages are not included in this initial PR, as our current use case focuses on the core SDK capabilities. We may add adk and a2a integration in a follow-up contribution.
The sample agent includes a minimal A2A JSON-RPC endpoint for demonstration purposes rather than depending on the full a2a-go SDK, to keep the example self-contained and easy to follow.
Pre-launch Checklist
If you need help, consider asking for advice on the discussion board.