Skip to content

Initial Kotlin port of the Python A2UI SDK.#1012

Merged
jgindin merged 8 commits intogoogle:mainfrom
jgindin:kotlin-sdk
Mar 31, 2026
Merged

Initial Kotlin port of the Python A2UI SDK.#1012
jgindin merged 8 commits intogoogle:mainfrom
jgindin:kotlin-sdk

Conversation

@jgindin
Copy link
Copy Markdown
Collaborator

@jgindin jgindin commented Mar 27, 2026

Description

Port of the Python SDK. Developed with significant help from various forms of Gemini.

See the later PRs which create new versions of the rizzcharts sample for both Kotlin and Java as demonstrations of this SDK.

Pre-launch Checklist

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 Kotlin SDK for the Agent-to-App (A2A) protocol with A2UI integration, featuring request handlers, event converters, and a toolset for rich UI rendering. It also includes a schema management system and a validator for A2UI payload integrity. Review feedback suggests several improvements: replacing printStackTrace with a logging framework, fixing a numeric type conversion bug in JSON parsing, refactoring hardcoded strings and versions into constants, and adopting more idiomatic Kotlin collection operations.

Comment thread agent_sdks/kotlin/src/main/kotlin/com/google/a2ui/a2a/A2aHandler.kt Outdated
Comment thread agent_sdks/kotlin/src/main/kotlin/com/google/a2ui/a2a/A2aHandler.kt Outdated
Comment thread agent_sdks/kotlin/build.gradle.kts
Comment thread agent_sdks/kotlin/src/main/kotlin/com/google/a2ui/a2a/A2aHandler.kt Outdated
Comment thread agent_sdks/kotlin/src/main/kotlin/com/google/a2ui/a2a/A2aHandler.kt Outdated
jgindin and others added 5 commits March 27, 2026 15:00
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Decompose the `handleA2aPost` method into smaller ones.

Also, fix the previous commit, which Github messed up.
Comment thread agent_sdks/kotlin/src/main/kotlin/com/google/a2ui/a2a/A2uiA2a.kt
Comment thread agent_sdks/kotlin/src/main/kotlin/com/google/a2ui/a2a/A2uiA2a.kt Outdated
Comment thread agent_sdks/kotlin/src/main/kotlin/com/google/a2ui/a2a/A2aHandler.kt
@jgindin jgindin requested a review from nan-yu March 27, 2026 21:13
Copy link
Copy Markdown
Collaborator

@nan-yu nan-yu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good to me overall!

Copy link
Copy Markdown
Collaborator

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The A2UI parts of this looks good to me (I'm not a Kotlin expert...)

@jgindin jgindin merged commit 259a270 into google:main Mar 31, 2026
9 checks passed
@jgindin jgindin deleted the kotlin-sdk branch March 31, 2026 14:32
@github-project-automation github-project-automation bot moved this from Todo to Done in A2UI Mar 31, 2026
peterblazejewicz pushed a commit to peterblazejewicz/A2UI that referenced this pull request Apr 5, 2026
* Initial Kotlin port of the Python A2UI SDK.

* Add copyright to all new files.

* Check for long before double.

* Extract constants

* Address PR feedback.

Decompose the `handleA2aPost` method into smaller ones.

Also, fix the previous commit, which Github messed up.

* Add more comments to a complex method.

* Address PR feedback.

* Address PR feedback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants