Skip to content

Add Kotlin tabs for grounding with Agent Search - #2160

Open
happyhuman wants to merge 2 commits into
mainfrom
docs-kotlin-vertex-ai-search
Open

Add Kotlin tabs for grounding with Agent Search#2160
happyhuman wants to merge 2 commits into
mainfrom
docs-kotlin-vertex-ai-search

Conversation

@happyhuman

@happyhuman happyhuman commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

What

Adds Kotlin to both tab groups on docs/grounding/grounding_with_search.md — creating the grounded agent, and the optional citation display — plus the Kotlin v0.1.0 badge.

Why

Both groups showed Python and Java only. VertexAiSearchTool has been in adk-kotlin since v0.1.0; this was missed because earlier coverage audits diffed release tags against each other and never checked the v0.1.0 baseline.

Translation notes

  • No builder. The Java tab uses VertexAiSearchTool.builder().dataStoreId(...).build(). Kotlin has named parameters, so the tab uses the constructor directly. The builder does exist at v0.8.0, but it is marked @AdkJavaInteropApi and exists for Java callers.
  • collect, not a for-loop. Events arrive as a Flow<Event> in Kotlin, and isFinalResponse is a property rather than a method.
  • groundingChunks is nullable, so the count is guarded with isNullOrEmpty() rather than Java's isPresent().

Verification

Both tabs are inline, matching their siblings — the snippets elide surrounding setup and carry placeholder datastore ids, so there is nothing that could compile standalone. They are covered by L0, which validates every import and named argument against the real v0.8.0 signatures, and not by the compiler. That is the same level of assurance the Python and Java tabs on this page have.

Ladder: L0, L3, L5, L6 PASS; L1/L2 PASS across the unchanged snippet tree; L4 runSnippets SKIP (no such Gradle task in this repo).

Tracked as KT-27.


Update: the badge originally read Kotlin v0.8.0, which is the version adk-docs compiles against, not the release the feature shipped in. Corrected to the introducing version, matching the sibling badges and the rest of the site.

Both tab groups on the page showed Python and Java only, though
VertexAiSearchTool has existed in adk-kotlin since v0.1.0.

Kotlin uses the constructor directly rather than the builder the Java tab
reaches for, since dataStoreId is a named parameter. The citation snippet
collects from the event Flow instead of iterating a list, and reads
isFinalResponse as a property.

Both tabs are inline, matching their siblings: the snippets elide
surrounding setup and carry placeholder datastore ids, so there is
nothing here that could compile standalone.
@netlify

netlify Bot commented Aug 20, 2026

Copy link
Copy Markdown

Deploy Preview for adk-docs-preview ready!

Name Link
🔨 Latest commit 837d0f1
🔍 Latest deploy log https://app.netlify.com/projects/adk-docs-preview/deploys/6a8745c7d21c5d00082973fa
😎 Deploy Preview https://deploy-preview-2160--adk-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@happyhuman happyhuman self-assigned this Aug 20, 2026
The badge said Kotlin v0.8.0, the version adk-docs compiles against,
rather than the introducing release. VertexAiSearchTool has been present
since v0.1.0, matching the Python v0.1.0 and Java v0.1.0 badges already
on this page.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant