A2UI icon indicating copy to clipboard operation
A2UI copied to clipboard

Feat/go sdk

Open chenman9226 opened this issue 7 months ago • 4 comments

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

  • Schema Management: JSON Schema loading from embedded assets, catalog pruning, topology analysis, common type modifiers, and $ref resolution — fully aligned with the Python SDK's SchemaManager and A2uiValidator.
  • Streaming Parser: Incremental A2UI JSON parsing with partial payload fixing, delta streaming, multi-surface support, and built-in deduplication — matching the Python A2uiStreamParser behavior.
  • Basic Catalog: Out-of-the-box basiccatalog.GetConfig() for standard A2UI components (Button, Text, Row, Column, etc.), mirroring Python's BasicCatalog.get_config().
  • Conformance Tests: Full alignment with the cross-language conformance test suite.
  • Unit Tests: Comprehensive coverage for parser, schema, validator, catalog, and common modifiers.
  • Sample: Complete Go rizzcharts.
  • CI Workflow: GitHub Actions pipeline with build, vet, and test steps, scoped to Go SDK and specification changes.

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

  • [x] I signed the CLA.
  • [x] I read the Contributors Guide.
  • [x] I read the Style Guide.
  • [ ] I have added updates to the CHANGELOG.
  • [x] I updated/added relevant documentation.
  • [x] My code changes (if any) have tests.
  • [x] If my branch is on fork, I have verified that scripts/e2e_test.sh passes.

If you need help, consider asking for advice on the discussion board.

chenman9226 avatar Apr 25 '26 11:04 chenman9226

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.

google-cla[bot] avatar Apr 25 '26 11:04 google-cla[bot]

Hi @jacobsimionato Could you please review this PR? Thanks!

chenman9226 avatar Apr 28 '26 03:04 chenman9226

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?

jacobsimionato avatar Apr 28 '26 04:04 jacobsimionato

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:

  1. Both the ADK and the A2A protocol already have official Go implementations, so Go feels like a natural fit for the agent SDK layer too. Is Go on the radar when you revisit the shared architecture, or is the plan still Python/TypeScript-first for now?

  2. Since there's no firm timeline on stabilization, would you be open to adding a link to the Go SDK in the ecosystem or community section of the docs? I'd also like to avoid a situation where multiple independent Go implementations emerge in the wild — a single listed reference would help the community converge.

Happy to discuss any of this in a separate Discussion thread if that's easier. Thanks again for the quick response!

chenman9226 avatar Apr 28 '26 06:04 chenman9226

Adding the triage: flag label: the latest reply is from an external contributor and has gone unanswered for more than 1 day.

github-actions[bot] avatar Jun 30 '26 16:06 github-actions[bot]

"Both the ADK and the A2A protocol already have official Go implementations"

Now sure what you mane when you say 'offocial'. There is no go implementation maintained by https://github.com/a2ui-project/a2ui team.

polina-c avatar Jul 26 '26 20:07 polina-c

"Both the ADK and the A2A protocol already have official Go implementations"

Now sure what you mane when you say 'offocial'. There is no go implementation maintained by https://github.com/a2ui-project/a2ui team.

Perhaps the sentence was read a little too quickly: it says that ADK and A2A have official Go implementations, not that A2UI does.

In fact, the absence of an A2UI-maintained Go SDK was the premise of this contribution, not a point that needed correcting. The two actual questions—whether Go is on the roadmap and whether a community SDK could be listed—remain unanswered, but I understand from the immediate closure that the discussion is not welcome.

chenman9226 avatar Jul 30 '26 13:07 chenman9226