-
Notifications
You must be signed in to change notification settings - Fork 1k
Initial Kotlin port of the Python A2UI SDK. #1012
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
Open
jgindin
wants to merge
8
commits into
google:main
Choose a base branch
from
jgindin:kotlin-sdk
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
52da40d
Initial Kotlin port of the Python A2UI SDK.
jgindin 656bcad
Add copyright to all new files.
jgindin 767623f
Check for long before double.
jgindin 401b4ad
Extract constants
jgindin 7899067
Address PR feedback.
jgindin 4509d4d
Add more comments to a complex method.
jgindin 1b343ed
Address PR feedback.
jgindin 732968d
Address PR feedback.
jgindin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
| ### JetBrains template | ||
| # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider | ||
| # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 | ||
|
|
||
| # User-specific stuff | ||
| .idea/**/workspace.xml | ||
| .idea/**/tasks.xml | ||
| .idea/**/usage.statistics.xml | ||
| .idea/**/dictionaries | ||
| .idea/**/shelf | ||
|
|
||
| # AWS User-specific | ||
| .idea/**/aws.xml | ||
|
|
||
| # Generated files | ||
| .idea/**/contentModel.xml | ||
|
|
||
| # Sensitive or high-churn files | ||
| .idea/**/dataSources/ | ||
| .idea/**/dataSources.ids | ||
| .idea/**/dataSources.local.xml | ||
| .idea/**/sqlDataSources.xml | ||
| .idea/**/dynamic.xml | ||
| .idea/**/uiDesigner.xml | ||
| .idea/**/dbnavigator.xml | ||
|
|
||
| # Gradle | ||
| .idea/**/gradle.xml | ||
| .idea/**/libraries | ||
|
|
||
| # Gradle and Maven with auto-import | ||
| # When using Gradle or Maven with auto-import, you should exclude module files, | ||
| # since they will be recreated, and may cause churn. Uncomment if using | ||
| # auto-import. | ||
| # .idea/artifacts | ||
| # .idea/compiler.xml | ||
| # .idea/jarRepositories.xml | ||
| # .idea/modules.xml | ||
| # .idea/*.iml | ||
| # .idea/modules | ||
| # *.iml | ||
| # *.ipr | ||
|
|
||
| # CMake | ||
| cmake-build-*/ | ||
|
|
||
| # Mongo Explorer plugin | ||
| .idea/**/mongoSettings.xml | ||
|
|
||
| # File-based project format | ||
| *.iws | ||
|
|
||
| # IntelliJ | ||
| out/ | ||
|
|
||
| # mpeltonen/sbt-idea plugin | ||
| .idea_modules/ | ||
|
|
||
| # JIRA plugin | ||
| atlassian-ide-plugin.xml | ||
|
|
||
| # Cursive Clojure plugin | ||
| .idea/replstate.xml | ||
|
|
||
| # SonarLint plugin | ||
| .idea/sonarlint/ | ||
|
|
||
| # Crashlytics plugin (for Android Studio and IntelliJ) | ||
| com_crashlytics_export_strings.xml | ||
| crashlytics.properties | ||
| crashlytics-build.properties | ||
| fabric.properties | ||
|
|
||
| # Editor-based Rest Client | ||
| .idea/httpRequests | ||
|
|
||
| # Android studio 3.1+ serialized cache file | ||
| .idea/caches/build_file_checksums.ser | ||
|
|
||
| ### Gradle template | ||
| .gradle | ||
| **/build/ | ||
| !src/**/build/ | ||
|
|
||
| # Ignore Gradle GUI config | ||
| gradle-app.setting | ||
|
|
||
| # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) | ||
| !gradle-wrapper.jar | ||
|
|
||
| # Avoid ignore Gradle wrappper properties | ||
| !gradle-wrapper.properties | ||
|
|
||
| # Cache of project | ||
| .gradletasknamecache | ||
|
|
||
| # Eclipse Gradle plugin generated files | ||
| # Eclipse Core | ||
| .project | ||
| # JDT-specific (Eclipse Java Development Tools) | ||
| .classpath | ||
|
|
||
| ### Kotlin template | ||
| # Compiled class file | ||
| *.class | ||
|
|
||
| # Log file | ||
| *.log | ||
|
|
||
| # BlueJ files | ||
| *.ctxt | ||
|
|
||
| # Mobile Tools for Java (J2ME) | ||
| .mtj.tmp/ | ||
|
|
||
| # Package Files # | ||
| *.jar | ||
| *.war | ||
| *.nar | ||
| *.ear | ||
| *.zip | ||
| *.tar.gz | ||
| *.rar | ||
|
|
||
| # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
| hs_err_pid* | ||
| replay_pid* | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| /* | ||
| * Copyright 2026 Google LLC | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| plugins { | ||
| kotlin("jvm") version "2.1.10" | ||
| kotlin("plugin.serialization") version "2.1.10" | ||
| id("java-library") | ||
| id("com.ncorti.ktfmt.gradle") version "0.19.0" | ||
| id("org.jetbrains.kotlinx.kover") version "0.9.1" | ||
| } | ||
|
|
||
| ktfmt { | ||
| googleStyle() | ||
| } | ||
|
|
||
| version = "0.1.0" | ||
| group = "com.google.a2ui" | ||
|
|
||
| kotlin { | ||
| jvmToolchain(21) | ||
| } | ||
|
|
||
| repositories { | ||
| mavenCentral() | ||
| } | ||
|
|
||
| dependencies { | ||
| api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3") | ||
| implementation("com.networknt:json-schema-validator:1.5.1") | ||
| implementation("com.fasterxml.jackson.core:jackson-databind:2.17.2") | ||
|
|
||
| // Core Dependencies | ||
| api("com.google.adk:google-adk:0.9.0") | ||
| api("com.google.adk:google-adk-a2a:0.9.0") | ||
| api("io.github.a2asdk:a2a-java-sdk-client:1.0.0.Alpha3") | ||
| api("com.google.genai:google-genai:1.43.0") | ||
|
|
||
| testImplementation(kotlin("test")) | ||
| testImplementation("io.mockk:mockk:1.13.11") | ||
| } | ||
|
|
||
| tasks.test { | ||
| useJUnitPlatform() | ||
| } | ||
|
|
||
| val copySpecs by tasks.registering(Copy::class) { | ||
| val repoRoot = projectDir.parentFile.parentFile | ||
|
|
||
| from(File(repoRoot, "specification/v0_8/json/server_to_client.json")) { | ||
| into("com/google/a2ui/assets/0.8") | ||
| } | ||
| from(File(repoRoot, "specification/v0_8/json/standard_catalog_definition.json")) { | ||
| into("com/google/a2ui/assets/0.8") | ||
| } | ||
|
|
||
| from(File(repoRoot, "specification/v0_9/json/server_to_client.json")) { | ||
| into("com/google/a2ui/assets/0.9") | ||
| } | ||
| from(File(repoRoot, "specification/v0_9/json/common_types.json")) { | ||
| into("com/google/a2ui/assets/0.9") | ||
| } | ||
| from(File(repoRoot, "specification/v0_9/json/basic_catalog.json")) { | ||
| into("com/google/a2ui/assets/0.9") | ||
| } | ||
|
|
||
| into(layout.buildDirectory.dir("generated/resources/specs")) | ||
| } | ||
|
|
||
| sourceSets { | ||
| main { | ||
| resources { | ||
| srcDir(copySpecs) | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip | ||
| networkTimeout=10000 | ||
| validateDistributionUrl=true | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.