The `vertexai` extra does not exist in google-adk's pyproject.toml, so
`pip install google-adk[vertexai]` silently installs the base package
without the Agent Platform dependencies. Readers following these snippets
hit an ImportError when constructing VertexAiSessionService or
VertexAiMemoryBankService.
The correct extra is `gcp`, which pulls in
google-cloud-aiplatform[agent-engines].
Follow-up to review feedback on #2031, which flagged the two occurrences
in express-mode.md. The same stale extra appears once in
sessions/session/index.md, fixed here too.
Co-authored-by: Shahin Saadati <happyhuman@users.noreply.github.com>
* Add A2A consuming quickstart for Kotlin
adk-kotlin has been able to consume remote A2A agents since 0.6.0, and the docs
had no Kotlin page for it. This adds one alongside the Python, Go and Java
quickstarts, plus its nav entry.
A new page rather than a tab: docs/a2a has no tab groups at all, it is one page
per language, so this follows the section's own shape.
Two dependencies are needed, not one. The a2a artifact publishes the A2A SDK as
runtime-only, and A2AAgent's httpClient parameter defaults to JdkA2AHttpClient(),
so a2a-java-sdk-client has to be on the compile classpath as well. That number
was established by compiling, not by reading module metadata: the a2a artifact
alone fails with "Cannot access class 'A2AHttpClient'", and adding the client
artifact is sufficient -- spec and the jsonrpc transport arrive transitively.
Only the consuming side is documented, because that is all that exists: no
webserver source at v0.7.0 mentions a2a, so there is no Kotlin equivalent of the
exposing quickstarts. The page says so and links to the Python and Java ones.
A2AAgent is a suspending factory, and the implementation class behind it is
internal, so the factory is the only way to construct one. The snippet notes it.
Verified end to end rather than by compiling alone: served a real agent card
from a local server and ran the snippet, which fetched it, parsed it and wired
the remote agent in as a sub-agent --
"Root agent root_agent delegates to prime_agent".
* Correct the agent card claims and make the server step usable
A2AAgent does not read the remote's name from the card: the name is the
caller's, and independent of what the card advertises. It does not read the
transport either, which is hardcoded to JSON-RPC. What the card supplies is
the description and the streaming capability.
The server step told readers to start a server without saying how, and the
two obvious candidates do not work: adk-kotlin parses A2A 1.0 cards, which
require supportedInterfaces with a protocolBinding, and the adk-java and
adk-python samples both publish 0.3-style cards that A2AAgent rejects with
AgentCardResolutionError. State that, and give a minimal card verified by
running the snippet against it.
Also fix the root agent instruction, which referenced dice-rolling the agent
cannot do; match the Java snippet's prime-delegation wording.
* Point the A2A quickstart at the adk-python sample server
The page claimed neither the adk-java nor the adk-python sample works as the
server for this quickstart. The adk-python half is wrong. adk-python does not
serve its `agent.json` verbatim: `fast_api.py` parses it through
`_compat.parse_agent_card`, and under a2a-sdk 1.x that parse promotes the
legacy `url` and `preferredTransport` into `supportedInterfaces`. The dependency
is `a2a-sdk>=0.3.4,<2`, so a fresh install resolves to 1.x and the card on the
wire is A2A 1.0 - exactly what the Kotlin client requires.
So the page now names a server a reader can actually start, instead of asking
them to hand-write a card:
adk api_server --a2a --port 8001 \
contributing/samples/a2a/a2a_basic/remote_a2a
Its card is served under the agent's own prefix, and the snippet's agentCardUrl
follows it to http://localhost:8001/a2a/check_prime_agent. Confirmed the route
prefix in `attach_a2a_routes_to_app` and that the sample card's own `url`
already points there.
The adk-java half of the claim was correct and stays: `a2a_server` is pinned to
the 0.3.x A2A SDK and serves a 0.3 card. That, and the A2A 1.0 requirement it
illustrates, move into a note. The hand-written card survives as a collapsible
fallback for readers bringing their own server.
Reported by joefernandez in review of #2118.
* Upgrade Kotlin examples to adk-kotlin 0.8.0
The Kotlin examples project is pinned to adk-kotlin 0.7.0, which predates the
BigQuery agent analytics plugin and the JSON Schema constraint fields on
`Schema`. Bump the pin to 0.8.0 so snippets for those features can be written.
Only the three version strings change. Checked the 0.8.0 POM before bumping:
it still resolves Ktor 2.3.13 and kotlin-stdlib 2.1.20, so the explicit Ktor
pins and the 2.1.20 Kotlin/KSP plugin versions stay correct, and 0.8.0 removes
no API that the current snippets use.
Not compile-verified locally - no JDK 17 on hand, and the Gradle wrapper
rejects the JDK 26 that is. The PR check only builds .kt files changed in the
PR, so it will not cover this either; the first snippet PR on top of this one
is what will actually exercise the new version.
* Bump the Kotlin install instructions to 0.8.0
The dependency blocks readers copy from still pinned 0.5.0 - three releases
behind, and behind the examples project itself. Anyone following the quickstart
got an SDK without context caching, the Vertex AI memory and session services,
or the BigQuery analytics plugin, while the snippets on those same pages are
written against a newer API.
Verified on Maven Central that 0.8.0 is published for every artifact named
here: -core, -processor, -webserver, and -litertlm.
Only install instructions change. The `Kotlin v0.x` support badges are
deliberately left alone: they record the release a feature landed in, not the
current version.
* Add Kotlin snippet for the CallbackContext memory-write helpers
adk-kotlin 0.7.0 added addEventsToMemory and addMemory to CallbackContext,
alongside the addSessionToMemory the page already shows in Kotlin. They cover
the cases addSessionToMemory cannot: a chosen subset of events, and facts you
construct yourself rather than letting the service derive them.
Compiling changed the shape of this snippet. The obvious version read the
current turn's events off context.invocationContext, but that property is
internal -- CallbackContext exposes no way to reach the session. So
addEventsToMemory takes events the caller already holds, and the snippet says
so rather than quietly implying otherwise.
Both helpers, and addSessionToMemory, throw IllegalStateException when the
runner has no memory service. That is a runtime failure with nothing at compile
time to warn you, so the page states it. Verified by running both paths:
"Cannot add events to memory: memory service is not available." and
"Cannot add memory: memory service is not available."
Badged Kotlin v0.7.0, verified rather than assumed: neither helper exists on
CallbackContext at v0.6.0.
Appended to the existing MemoryExample.kt, already registered, so CI compiles
and lints it.
* docs: clarify CallbackContext memory methods and their default behavior
* Add Kotlin snippet for DebugLoggingPlugin
The Kotlin logging page covered LoggingPlugin's console output but not
DebugLoggingPlugin, available since adk-kotlin 0.6.0, which records the same
activity in full to a YAML file instead of truncated console summaries. Both
plugins override the same twelve callbacks, so the difference really is only
fidelity and destination.
Transcluded from the existing LoggingExamples.kt rather than written inline,
matching the rest of the page and keeping it in the compile regression suite --
the file is already registered in files_to_test.txt.
The sample passes includeSystemInstruction = false, since the plugin's KDoc
cautions that it writes raw prompts, tool arguments and session state to disk.
Verified against the upstream test that the flag records has_system_instruction
in place of the instruction text rather than dropping the field, and the
comment names that field so it can be found in the output.
outputPath is left at its default rather than passed explicitly; the default
filename is given in the prose instead, so the snippet does not imply the
parameter is required.
Page badge left at Kotlin v0.1.0: the other snippets on the page have worked
since then, so the version requirement for this one is noted in the prose.
* docs: add Kotlin version support tag to debug logging documentation
* Document how to check whether the context cache was used
The caching page explained how to turn caching on and never how to tell whether
it is working. CacheMetadata has been available since adk-kotlin 0.6.0 and is
undocumented: adk-python has fourteen code references to cache_metadata, while
adk-docs mentions it twice, both incidental -- a BigQuery schema table and a
bullet in the Live dev guide.
The snippet reads it from Event.cacheMetadata and covers both states the type
can be in, because the constructor enforces the split: cacheName, expireTime and
invocationsUsed must either all be set (an active cache) or all be null (the
fingerprint-only state used for prefix matching before a cache exists).
Notes that token counts live on LlmResponse.usageMetadata rather than here,
which the KDoc calls out to avoid duplication and a reader would otherwise
reasonably look for on CacheMetadata.
Badged Kotlin v0.6.0 and verified rather than assumed: the snippet compiles
against a temporary 0.6.0 pin as well as the current 0.7.0 one.
Transcluded and registered, so CI compiles and lints it. Exercised all four
paths with synthetic events: no metadata, fingerprint-only, active, and active
with expireSoon true.
* Correct when CacheMetadata is present on an event
The section claimed every event backed by an LLM response carries a
CacheMetadata. It does not: LlmResponse.cacheMetadata is null when caching
is disabled and also when the call produced no cache information, so the
claim was wrong even with caching on.
Say "can carry", name both null cases, and explain why the snippet checks
before reading. The snippet's own comment made the same overstatement.
* docs: clarify the behavior of expireSoon and cache status in documentation and snippets
* Document createHttpOptions on the Kotlin context cache config
ContextCacheConfig gained a fourth parameter, createHttpOptions, in adk-kotlin
0.7.0. It bounds the CachedContent.create() call specifically, and is fail-open:
when the create exceeds the timeout it fails and the request proceeds uncached,
so it is a latency guard rather than a correctness switch. The snippet says so,
since that is the part the signature does not convey.
No other language documents this. Python and Java have no equivalent parameter
at all -- the Java record has exactly three components -- so this is Kotlin-first
rather than a backfill.
HttpOptions is ADK's own com.google.adk.kt.types.HttpOptions, deliberately not
the backend SDK's, so the import matters: two other types share the name.
Extracted, compiled and ran the snippet against the 0.7.0 pin: OK timeout=10s.
* docs: add create_http_options parameter documentation for cache configuration
* Add Kotlin snippet for token-threshold context compaction
The compaction page had no Kotlin at all. EventsCompactionConfig gained
tokenThreshold and eventRetentionSize in adk-kotlin 0.6.0, so the Kotlin tab
shows that pair, matching the TypeScript tab's strategy.
Kotlin sits across the two groupings the prose already draws: the config
attaches to App, as in Python and Java, but supports the token-threshold pair
like TypeScript. Both parentheticals are updated to say so rather than adding
new prose.
The snippet notes that tokenThreshold and eventRetentionSize must be set
together. That is a runtime require, not a compile error, so it is easy to hit:
setting one alone throws "tokenThreshold and eventRetentionSize must be set
together or both null". The same rule applies to compactionInterval and
overlapSize, which Kotlin also supports.
Badged Kotlin v0.7.0 rather than 0.6.0, when the fields landed: appName is
"my-agent" to match the sibling tabs, and hyphens in app names were only
allowed from 0.7.0.
Inline to match the page's other tabs, so CI will not compile it. Extracted,
compiled and ran it against the 0.7.0 pin in a throwaway project:
OK app=my-agent tokenThreshold=1000 retention=1 paired=true.
* Note that Kotlin also supports the sliding-window pair
Self-review finding. The Kotlin tab shows tokenThreshold/eventRetentionSize
while Python and Java show compactionInterval/overlapSize, so a reader
comparing tabs could conclude the strategy is fixed per language. It is not:
EventsCompactionConfig accepts either pair, and exposes hasTokenThresholdConfig
and hasSlidingWindowConfig for each.
* Add Kotlin snippet for VertexAiSessionService
The VertexAiSessionService section showed Python, Go and Java. Kotlin gained
the service in adk-kotlin 0.7.0, so add a Kotlin tab and Kotlin to that
section's language-support badge.
Kotlin addresses the reasoning engine differently from every sibling tab on
the page, so the snippet says so at the point of use:
- The engine is fixed at construction via `reasoningEngineId`. The 0.7.0 KDoc
is explicit that, unlike the Python and Java ADK, `SessionKey.appName` is
never parsed to derive the engine -- it is only a label. The Python tab
above passes the engine through `app_name` on each call.
- `reasoningEngineId` must be the bare numeric id. The constructor rejects a
full resource name outright (`require(reasoningEngineId.all { it.isDigit() })`),
while the Python tab passes
`projects/.../locations/.../reasoningEngines/...`.
A reader copying the adjacent Python idiom would therefore fail twice over.
Written inline to match the two existing Kotlin tabs on this page. Inline
snippets never reach Gradle, so this one was additionally compiled against the
0.7.0 pin in a scratch file that is not part of the commit.
* Address review: JVM-only note, wire the service to a Runner
Five fixes from self-review against the 0.7.0 sources and upstream's own
VertexAiSessionServiceExample.kt, which I should have consulted before writing
the first version:
- State that the service is JVM-only. It lives in core/src/jvmMain, so it does
not exist on Android. Kotlin is the only language on this page where that
distinction applies, so if the Kotlin tab omits it, nothing carries it.
- Show the service actually being used. The snippet stopped at an uncalled
`suspend fun`; it now hands the service to an InMemoryRunner, which is what
the section is about and what the upstream example does.
- Use `runBlocking` in a `main`, matching upstream, instead of a suspend
function nothing calls.
- Drop `state = mapOf(...)`. It defaults to null, upstream omits it, and the
Java tab explicitly notes no initial state is needed, so it introduced a
concept the sibling tabs deliberately avoid.
- Widen the comparison from "the Python and Java tabs" to all the other tabs.
The KDoc phrasing names Python and Java, but this page also has a Go tab.
The added LlmAgent needs an explicit `model`; the first draft would not have
compiled without it, which the scratch compile caught.
* Trim the snippet back to parity with the sibling tabs
The previous revision added an LlmAgent, a Gemini model and an InMemoryRunner,
taking the tab to 30 code lines against Python's 5, Go's 8 and Java's 12. No
sibling tab on this page constructs a runner or an agent, and this section's
prose never mentions one -- it is a characteristics list, not a wiring guide.
That change came from misapplying a review finding. On sessions/memory the
equivalent note was right: the prose there says "instantiating the
VertexAiMemoryBankService and passing it to the Runner" and the Python tab
shows exactly that. Neither holds here, so the runner was answering a question
this page does not ask.
Now scoped like the Java tab, the closest analogue: construct the service, then
create one session. That is still enough to demonstrate both divergences -- the
engine pinned at construction as a bare numeric id, and appName being only a
label -- since showing the second requires a SessionKey.
`runBlocking` stays, because createSession is a suspend function; it is the
direct counterpart of the Java tab's `.blockingGet()`, and the comment now says
so. Recompiled against the 0.7.0 pin in a scratch file.
* docs: update experimental annotation placement and refine context caching documentation note
* docs(callbacks): correct Python callback signatures and return types
* docs(callbacks): state the real chain-stop rule per callback family
* docs(callbacks): tighten wording and drop out-of-scope safety page edits
* Update index.md
* Update types-of-callbacks.md
---------
Co-authored-by: Joe Fernandez <931947+joefernandez@users.noreply.github.com>
* docs(runtime): correct API routes, CLI flags, and RunConfig fields
* docs(runtime): correct per-agent service URI defaults and resume version
* docs: drop e.g. from the adk run timeout flag description
* Update event-loop.md
* Update runconfig.md
---------
Co-authored-by: Joe Fernandez <931947+joefernandez@users.noreply.github.com>
* docs(sessions): fix async examples, imports and state claims
* docs(sessions): correct event id/timestamp ownership and artifact service list
* docs: apply style guide pass and revert out-of-scope artifact section
---------
Co-authored-by: Joe Fernandez <931947+joefernandez@users.noreply.github.com>
adk-kotlin 0.7.0 added a plugins parameter to the agent-based InMemoryRunner
constructor. App.plugins already existed at 0.6.0, so this is an ergonomic
shorthand rather than a new capability, but it is the form a Kotlin reader
should see and the plugins page had no Kotlin at all.
Two tab groups rather than one. The Register group's prose refers to
"the CountInvocationPlugin plugin defined in the previous section", so a Kotlin
tab there alone would point at a class the page never defines in Kotlin. Adding
the Create group as well makes the pair self-contained.
Kotlin now appears in two of the page's nine groups; the remaining seven are
per-callback detail. Whether to finish the page is a separate decision.
Plugin declares exactly one abstract member, name -- all twelve callbacks and
close() have defaults -- so a custom plugin only overrides what it needs. The
snippet overrides beforeAgent and beforeModel, matching the callbacks the
surrounding prose describes.
Transcluded and registered, so CI compiles and lints it. Also run: the runner is
constructed with the plugin wired, and invoking beforeAgent twice prints
"[Plugin] Agent run count: 1" then 2, so the counter callbacks work.
* Add Kotlin snippet for remote MCP with a suspend headerProvider
The MCP tools page had no Kotlin content. This adds a Kotlin tab to the
"Agent Configuration for Remote MCP" group, where it differs from the sibling
tabs in a way worth showing: adk-kotlin 0.7.0 made McpToolset's headerProvider
a suspend function, so a token can be minted per request rather than baked in
as a static header the way the Python and Java tabs do.
Two things the snippet has to get right, both of which a reader porting from
the Java tab would otherwise hit:
- McpToolset's constructor is internal. The Java tab's
`new McpToolset(streamableParams)` has no Kotlin equivalent; instances come
from McpToolsetConfig.toToolset(), as the KDoc directs. Confirmed by
compiling the direct form, which fails with "Cannot access 'constructor
(...)': it is internal".
- Supplying a headerProvider disables session reuse, so that headers can vary
per context. That is a real cost, so the comment says so and points at static
headers on StreamableHttp for callers who want a single cached session.
Badged Kotlin v0.7.0: the page had no Kotlin badge, and the suspend
headerProvider signature is 0.7.0.
Inline to match the page's other tabs, so CI will not compile it. Extracted,
compiled and ran it against the 0.7.0 pin in a throwaway project:
OK toolset=McpToolset.
* Tighten the MCP snippet after self-review
Three presentation fixes; no change to what the snippet does.
- Comment cut from five lines to three. The Python and Java tabs in this group
carry a single comment line each, so the original block was well out of step
with its neighbours.
- Closed the config constructor before chaining .toToolset(), removing an
eight-space hanging indent that no formatter would produce. Nothing catches
it, since inline snippets are never linted.
- Said that fetchToken() awaits. The v0.7.0 badge on this page rests entirely
on that: headerProvider existed at 0.6.0, just not as a suspend function.
Compiling the snippet against a 0.6.0 pin confirms it -- with a suspend
fetchToken() it fails, with a plain one it compiles. A reader whose token
source is synchronous does not need 0.7.0, and nothing in the visible code
said which case this is.
Re-ran the snippet against the 0.7.0 pin: OK toolset=McpToolset.
* Create bashtool.md
This PR adds the integration documentation for the new ExecuteBashTool in the Python ADK.
Rendered view:
Agent's PR: #1442
Original Issue: #1438
Key additions:
- Documented the tool's core capabilities and experimental status.
- Added security and execution safeguards (User Confirmation, Command Validation, Resource Limits, Disabled Core Dumps, and Process Group Termination).
- Reviewed against ADK integration-create and review guidelines
- Checked against the repository> https://github.com/google/adk-python/blob/ecb759cc16bc870aa190d01c4c3f0e1e3e97afab/src/google/adk/tools/bash_tool.py
Icon PR: #2047
* Update bashtool.md
* Update bashtool.md
* Add files via upload
* Add files via upload
* docs(integrations): fix unresolvable imports and stale API claims
* docs: apply style pass and drop out-of-scope import cleanup
* docs(integrations): address review feedback on gcs, cloud-trace, reflect-and-retry
Restore the gcs_ tool name prefixes in the GCS tool tables, since both
toolsets set tool_name_prefix="gcs" and the tables list names as the
model sees them. Use the current Agent Platform SDK name in cloud-trace
prose, make the reflect-and-retry failure description language-neutral
for Python and Go, and drop the redundant re-export clause.
* docs(gcs): note that tool_filter matches unprefixed tool names
Tool filtering runs inside get_tools() against the unprefixed name, and
get_tools_with_prefix() applies the gcs_ prefix afterwards, so the names
in the tables are not the names tool_filter expects.
* docs(computer-use): drop unused Gemini and override imports
---------
Co-authored-by: Kristopher Overholt <koverholt@google.com>
* Update ADK doc according to issue #1521 - 25
* Document suppression of experimental feature warnings
Added instructions to suppress experimental feature warnings in logs in a note, whole section deleted
* Document suppression of experimental warnings
Added information on suppressing experimental feature warnings in logs.
* Update quickstart-exposing.md
---------
Co-authored-by: Juan Carlos Gonzalez Resendiz <juancarlosgon@google.com>
Co-authored-by: Zyan <zyanya@google.com>
* Add Kotlin snippet for context caching configuration
The context caching page showed Python and Java only. `ContextCacheConfig` and
the `App`-level wiring are available in adk-kotlin as of 0.7.0, so add a Kotlin
tab and advertise Kotlin support in the page badge.
The snippet is inline rather than transcluded to match the Python and Java tabs
on this page. It opts in at file level via `ExperimentalContextCachingFeature`,
which the API still requires, and uses `kotlin.time` durations so the TTL reads
as `10.minutes` rather than a `Duration.ofMinutes` call.
* Fix broken links to adk-python plugin samples
The three plugin sample links 404. adk-python renamed
`contributing/samples/plugin/` to `contributing/samples/plugins/`; the
directory contents are otherwise unchanged, so only the path segment moves.
This is what the repo-wide `link-check` job has been failing on. It is
unrelated to the 0.7.0 upgrade in this PR, but the check gates the merge and
the fix is confined to the three URLs.
Verified all three targets return 200.
* Use a minTokens value that actually has an effect
The snippet carried Python's `minTokens = 2048`. The 0.7.0 KDoc is explicit
that "Gemini enforces a hard 4096-token minimum that always applies, so values
below 4096 have no additional effect" -- so as written the line was inert and
the comment implied otherwise. Use a value above the floor and say where the
floor comes from.
* Upgrade Kotlin examples to adk-kotlin 0.7.0
The Kotlin examples were pinned to adk-kotlin 0.5.0, which predates the
context caching, Vertex AI memory, and RAG retrieval APIs. Bump the pin to
0.7.0 so snippets for those features can be added.
Three consequences of the bump are handled here:
- `ExperimentalResumabilityFeature` was removed in 0.7.0, so RunConfigExample
no longer opts into it. The annotation class is gone, not merely deprecated,
so this is a hard compile break rather than a warning that could be deferred.
- The Vertex AI session and memory services expose Ktor's `HttpClient` as a
defaulted constructor parameter, so any snippet naming them needs Ktor on the
compile classpath, not just at runtime.
- The `resolutionStrategy` block forcing kotlin-stdlib 2.1.20 is now dead. It
worked around 0.5.0 publishing a stdlib newer than this project's compiler;
0.6.0 fixed that upstream. Verified that the highest stdlib on the compile
classpath is still 2.1.20 without it.
Also fixes two unrelated snags found while validating the above:
- `check_kotlin_snippets.sh` walked `examples/kotlin` without pruning build
output, so after any local build it reported every generated KSP file as an
unregistered snippet. CI only ever ran it against a clean checkout, so the
bug was invisible there.
- A transclusion path in logging.md was split across two lines, so the include
never resolved and the code block rendered empty.
* Fix broken links to adk-python plugin samples
The three plugin sample links 404. adk-python renamed
`contributing/samples/plugin/` to `contributing/samples/plugins/`; the
directory contents are otherwise unchanged, so only the path segment moves.
This is what the repo-wide `link-check` job has been failing on. It is
unrelated to the 0.7.0 upgrade in this PR, but the check gates the merge and
the fix is confined to the three URLs.
Verified all three targets return 200.
* Add Kotlin snippets for Memory Bank and RAG memory
The memory page documented `VertexAiMemoryBankService` and
`VertexAiRagMemoryService` for Python and Java only; the Kotlin tab stopped at
the in-memory service. Both are available in adk-kotlin as of 0.7.0, so add
the two missing tabs.
Both services declare an `internal` primary constructor, so the snippets use
the public secondary one that takes project/location plus the engine or corpus
id -- reading the primary signature alone gives a constructor callers cannot
invoke.
The page's language-support badge stays at Kotlin v0.1.0: it marks when Kotlin
support for the page was introduced, and the other six Kotlin snippets on it
have worked since then.
The remaining diff in MemoryExample.kt is ktlint bringing pre-existing lines
into line with the repo style, which the linter now gates on because the file
is touched here.
* Correct the ragCorpus contract and wire both services to a Runner
Three fixes from review:
- The `rag_memory` KDoc claimed `ragCorpus` accepts a bare id or a full
resource name. It is the opposite: `normalizeCorpusName` does
`require(!ragCorpus.startsWith("projects/"))` and throws on a full name. The
Python tab directly above this snippet passes a full resource name, so a
reader switching tabs would have hit an IllegalArgumentException with a
comment telling them it was fine. The note now states the bare-id rule and
calls out the divergence from Python explicitly.
- Dropped "the primary constructor is internal" from the rendered snippet. It
is a note for reviewers, not for readers, who cannot see that constructor.
It stays in the PR description.
- Both snippets stopped at a factory function while the surrounding prose says
"instantiating the service and passing it to the Runner" and the Python tab
shows exactly that. They now build the service and pass it to a Runner.
* Upgrade Kotlin examples to adk-kotlin 0.7.0
The Kotlin examples were pinned to adk-kotlin 0.5.0, which predates the
context caching, Vertex AI memory, and RAG retrieval APIs. Bump the pin to
0.7.0 so snippets for those features can be added.
Three consequences of the bump are handled here:
- `ExperimentalResumabilityFeature` was removed in 0.7.0, so RunConfigExample
no longer opts into it. The annotation class is gone, not merely deprecated,
so this is a hard compile break rather than a warning that could be deferred.
- The Vertex AI session and memory services expose Ktor's `HttpClient` as a
defaulted constructor parameter, so any snippet naming them needs Ktor on the
compile classpath, not just at runtime.
- The `resolutionStrategy` block forcing kotlin-stdlib 2.1.20 is now dead. It
worked around 0.5.0 publishing a stdlib newer than this project's compiler;
0.6.0 fixed that upstream. Verified that the highest stdlib on the compile
classpath is still 2.1.20 without it.
Also fixes two unrelated snags found while validating the above:
- `check_kotlin_snippets.sh` walked `examples/kotlin` without pruning build
output, so after any local build it reported every generated KSP file as an
unregistered snippet. CI only ever ran it against a clean checkout, so the
bug was invisible there.
- A transclusion path in logging.md was split across two lines, so the include
never resolved and the code block rendered empty.
* Fix broken links to adk-python plugin samples
The three plugin sample links 404. adk-python renamed
`contributing/samples/plugin/` to `contributing/samples/plugins/`; the
directory contents are otherwise unchanged, so only the path segment moves.
This is what the repo-wide `link-check` job has been failing on. It is
unrelated to the 0.7.0 upgrade in this PR, but the check gates the merge and
the fix is confined to the three URLs.
Verified all three targets return 200.
* Add Kotlin snippet for the Knowledge Engine retrieval tool
The Knowledge Engine integration page only showed Python. `VertexAiRagRetrieval`
landed in adk-kotlin 0.7.0, so add a Kotlin tab and advertise Kotlin support in
the page badge.
Retrieval runs inside the model through the Gemini-native `vertexRagStore` kind
rather than as a locally executed tool, so the snippet configures the corpus via
`VertexRagStoreRagResource` and leaves invocation to the model.
Registers the new file in files_to_test.txt so it stays in the compile
regression suite.
* Use the conventional package for the RAG retrieval snippet
RagEngine.kt declared `package integrations`. Every other snippet in the tree
uses `com.google.adk.kt.examples.<area>`. It compiled either way because the
source root is `snippets/` and Kotlin does not require the directory to match
the package, so nothing would have caught it.
Also worth flagging for anyone reading this alongside the memory snippets: the
two APIs take opposite corpus formats. `VertexAiRagRetrieval` here wants the
full `projects/.../ragCorpora/...` resource name, while
`VertexAiRagMemoryService` wants a bare corpus id and rejects the full name.
That is the library's doing, not a docs inconsistency.
- Add pip install "google-adk[gcp]" step to Eventarc Prerequisites.
- Clarify datacontenttype inference defaults and specify application/json in snippet prompt.
- Update Runtime Lambda table entry to use ctx.session_id and note support for payload and Context.
- Update OMIT table entry to list all mandatory attributes (type, source, bus, id, specversion).
Addresses feedback in https://github.com/google/adk-docs/pull/2045#issuecomment-5184438669
Co-authored-by: Joe Fernandez <931947+joefernandez@users.noreply.github.com>
* Upgrade Kotlin examples to adk-kotlin 0.7.0
The Kotlin examples were pinned to adk-kotlin 0.5.0, which predates the
context caching, Vertex AI memory, and RAG retrieval APIs. Bump the pin to
0.7.0 so snippets for those features can be added.
Three consequences of the bump are handled here:
- `ExperimentalResumabilityFeature` was removed in 0.7.0, so RunConfigExample
no longer opts into it. The annotation class is gone, not merely deprecated,
so this is a hard compile break rather than a warning that could be deferred.
- The Vertex AI session and memory services expose Ktor's `HttpClient` as a
defaulted constructor parameter, so any snippet naming them needs Ktor on the
compile classpath, not just at runtime.
- The `resolutionStrategy` block forcing kotlin-stdlib 2.1.20 is now dead. It
worked around 0.5.0 publishing a stdlib newer than this project's compiler;
0.6.0 fixed that upstream. Verified that the highest stdlib on the compile
classpath is still 2.1.20 without it.
Also fixes two unrelated snags found while validating the above:
- `check_kotlin_snippets.sh` walked `examples/kotlin` without pruning build
output, so after any local build it reported every generated KSP file as an
unregistered snippet. CI only ever ran it against a clean checkout, so the
bug was invisible there.
- A transclusion path in logging.md was split across two lines, so the include
never resolved and the code block rendered empty.
* Fix broken links to adk-python plugin samples
The three plugin sample links 404. adk-python renamed
`contributing/samples/plugin/` to `contributing/samples/plugins/`; the
directory contents are otherwise unchanged, so only the path segment moves.
This is what the repo-wide `link-check` job has been failing on. It is
unrelated to the 0.7.0 upgrade in this PR, but the check gates the merge and
the fix is confined to the three URLs.
Verified all three targets return 200.
* docs(tutorials): fix ToolContext, output_key and persistence claims
* Update agent-team.md
* docs: address review — revert get-started changes, move streaming note
Reverts docs/get-started/python.md entirely and drops the edit to the
retired quickstart-streaming.md page. The corrected streaming caveat now
lands on docs/live/get-started/streaming-python.md, scoped to the
run_async path and naming SequentialAgent as the only workflow agent
with live support.
---------
Co-authored-by: Joe Fernandez <931947+joefernandez@users.noreply.github.com>
* Create enterprise-web-search.md
Rendered page:
Logo's PR: #2057
Agent's PR: #1121 and #1122
Original Issue: #1113
--
This PR adds the official documentation for the new EnterpriseWebSearchTool.
Key additions:
- Overview & Use Cases: Explains enterprise compliance, controlled web access, and regulated workflows.
- Code Examples checked against repositories: Provides initialization snippets for both Python (google-adk) and TypeScript (@google/adk).
* Update enterprise-web-search.md
* Update enterprise-web-search.md
* Add allow_origins flag to cloud run page per issue #1113 - 1
Rendered page:
Agent's PR: #1118
Original Issue: #1113
--
This PR updates the deployment documentation to include --allow_origins flag (with regex support).
While the original draft suggested updating multiple pages, a review of the live site confirmed that this feature is already documented in the main CLI reference for the api_server and web commands.
Additional format changes:
- Fixed Markdown rendering bugs: Repaired broken code blocks in the Environment variables and Cloud Build permissions sections, fixed the misplaced Secret command, and corrected the malformed numbered list under Prerequisites.
- Style changes.
* Update cloud-run.md
* Update cloud-run.md
The site rendered one language under two names. Tab labels were split
137 `TypeScript` / 53 `Typescript`, with three pages carrying both
spellings at once (custom-agents.md 7/7, patterns.md 1/7,
function-tools.md 4/1), and the language-support badges were split 67/18
the same way. Because pymdownx.tabbed slugifies tab labels to lowercase,
both variants rendered and linked fine, so no link check or build warning
ever flagged it -- it was visible only to readers, as two names for one
SDK.
Every user-visible occurrence is normalized to `TypeScript`, plus the two
inconsistencies that turned up while doing it. 80 changed lines, accounted
for exactly:
53 tab label === "Typescript" -> === "TypeScript"
18 badge span lst-typescript">Typescript -> TypeScript
3 prose mention cloud-run.md, mcp-tools.md, workflows/patterns.md
2 api-reference/index.md card heading and link text
1 badge div attr title="...Python and Typescript."
1 mkdocs.yml nav Typescript ADK -> TypeScript ADK
1 code fence ```javascript -> ```typescript on a .ts include
1 artifacts/index.md closing summary sentence
---
80
The first six rows are pure casing: 78 lines that differ from their
originals by nothing but `Typescript` -> `TypeScript`. The last two are
not, and are the reason this is not a `sed`:
llm-agents.md:872 fenced `--8<-- ".../capital_agent.ts"` as ```javascript.
It was the only javascript-fenced `.ts` include in docs/ (the other 189
TypeScript fences are correct), and it cost that one snippet its
TypeScript highlighting.
artifacts/index.md:1084 closed the page by naming languages and got the
list wrong. It described reaching the artifact methods "using Python's
context objects or directly interacting with the `BaseArtifactService` in
Java" -- a two-language enumeration at the end of a page that carries
Python, TypeScript, Go, Java and Kotlin tabs (11/10/10/10/11), and one
that contradicts :556, which correctly names four of them. The
enumeration is dropped rather than extended: the sentence now describes
the two ways to reach these methods -- through the context object, or
through `BaseArtifactService` -- which is what the page actually teaches
and does not rot when a sixth language is added.
docs/api-reference/index.md is included even though the rest of
docs/api-reference/ is generated output that must not be touched. That
tree holds 3,140 generated HTML files and exactly one hand-authored page:
this one. It is Markdown, it is the only api-reference entry mkdocs.yml
lists as `.md` rather than `index.html` (:272, :441), it uses Material
`grid cards` and `:fontawesome-*:` shortcodes, and it carries a
`CONTRIBUTORS:` note citing issues #1716 and #1717. Its TypeScript card
already said "TypeScript" twice in its body text while its heading and
link text said "Typescript"; those two are now consistent with the body.
No generated file is modified.
Not in this change: the broken `SseConnectionParams` sample in
mcp-tools.md (docs-ts/p6c-mcp-ts-sample) and the `@google/adk` example
version bumps (docs-ts/p6b-example-versions). Only the casing of the
prose line above that sample is touched here.
Verified: `mkdocs build` exits 0 with an empty warning set on both main
and this branch, and the two warning sets are identical. A rendered
before/after diff of the whole site shows every `__tabbed_*` id, every
tab radio id and every heading anchor unchanged. Zero `=== "Typescript"`
and zero `lst-typescript">Typescript` remain anywhere in the repo.
Co-authored-by: Amaad Martin <amaadmartin@google.com>
* Enhance BigQuery Agent Analytics documentation
Updated documentation to clarify Java and Python plugin differences, added details on dropped-event observability, and improved explanations of event types and attributes.
* Address review: use language support tags and a single drop-reasons table
- Replace the inline Java version callouts in prose with language-support-tag
blocks on the relevant sections (Built-in redaction, Dropped-event
observability; ADK 2.0 workflow events already carried one).
- Collapse the duplicated 'Drop reasons (Python)' / 'Drop reasons (Java)'
tables into a single table with a per-language column.
- Trim the duplicated Java scope prose in the intro and the ADK 2.0 note.
---------
Co-authored-by: Kristopher Overholt <koverholt@google.com>
* Create slack runner integration page #1521 - 4
Adds the official integration documentation for `SlackRunner`.
- Created `docs/integrations/slack.md` following the Plugin template.
- Added Socket Mode installation and initialization instructions (`google-adk[slack]`).
- Checked against the integration-review and integration-create instructions.
* Update slack.md
* Update slack.md
Worked on feedback