Commit Graph

27 Commits

Author SHA1 Message Date
Shahin Saadati c317e48208 Add Kotlin tabs for creating and registering a plugin (#2119)
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.
2026-08-14 07:57:23 -07:00
Shahin Saadati b1b2eaa102 Upgrade Kotlin examples to adk-kotlin 0.7.0 (#2088)
* 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.
2026-08-07 13:24:29 -07:00
Amaad Martin c75e61f5f3 docs: normalize Typescript to TypeScript across the site (#2079)
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>
2026-08-05 15:58:49 -07:00
Hyang-Ah Hana Kim af790ae141 docs: update more Go documentation and examples to ADK Go v2 (#1936)
* docs: update ADK Go imports to v2 for core concepts and tutorials

* docs: update ADK Go imports and APIs to v2 for runtime and safety

* docs: update ADK Go imports to v2 for features (workflows, tools, skills, sessions, plugins)

* docs: update ADK Go imports to v2 for operations and integrations

---------

Co-authored-by: Kristopher Overholt <koverholt@google.com>
2026-07-07 18:09:07 -05:00
yana-gi (Merino) e1edb10e44 docs(plugins): correct before_run_callback flow control behavior (#1822)
The "Runner start callbacks" section described `before_run_callback` as
returning a `types.Content` to "replace the user's original message". That is
actually the behavior of `on_user_message_callback`; the text (including the
"Purpose" line) was duplicated from that section.

In the implementation, returning a `Content` from `before_run_callback` halts
the run: the Runner yields it as an early-exit event and skips all subsequent
processing instead of invoking the agent.

See `Runner._exec_with_plugin` in `src/google/adk/runners.py`:

    early_exit_result = await plugin_manager.run_before_run_callback(...)
    if isinstance(early_exit_result, types.Content):
        early_exit_event = Event(..., content=early_exit_result)
        ...
        yield early_exit_event      # early exit, agent never runs
    else:
        # normal execution

This also matches the BasePlugin docstring: "Returning a value to halt
execution of the runner and ends the runner with that event."

Fix the "When It Runs", "Purpose", and "Flow Control" bullets accordingly.

Co-authored-by: Kristopher Overholt <koverholt@google.com>
2026-07-07 13:28:26 -05:00
Kristopher Overholt 1c93532ca6 Fix broken external links to adk-python contributing/samples and other internal links (#1773)
* Add link to ignore

* Update links to code samples

* Fix links related to graphs and workflows

* Fix more sample links
2026-05-19 13:53:51 -07:00
Kristopher Overholt fb0c030110 Switch link checkers (#1646)
* Switch link checker CI job

* Update

* Updates

* Update config

* Switch images to MD image syntax

* Update timeout settings

* Fix tools links

* Update links

* Update index files in config

* Fix more links

* Fix link; add ignores

* Fix more links

* Fix more links
2026-04-17 13:05:08 -07:00
Joe Fernandez f7ed80bbc6 docs: Update Gemini flash names (#1594)
* docs: home page

* updates based on feedback

* respond to review feedback

* docs: update gemini selector strings to "flash-latest"

* Update homepage.css
2026-04-09 16:14:27 -05:00
Joe Fernandez 7567175816 docs: move multi-tool agent and redirect links (#1557)
* docs: move multi-tool agent and redirect links

* update based on comments and testing
2026-04-03 17:55:27 -07:00
Kristopher Overholt 58f3aaebca Replace documentation URLs and paths for adk.dev migration (#1536)
* Replace google.github.io/adk-docs URLs and /adk-docs/ paths with adk.dev

Migrate all hardcoded documentation references to use the new custom
domain. Update root-relative links to remove the /adk-docs/ subpath
prefix since the site will be served from the root of adk.dev.

* Additional fixes
2026-04-01 12:48:27 -05:00
Toni Klopfenstein b45a2e7701 docs: adding Go plugins code snippets (#1437)
* Adding Go plugins code snippets

* updating language tags on plugins/index.md

* Update reflect-and-retry.md

* Update index.md

---------

Co-authored-by: Joe Fernandez <joefernandez@users.noreply.github.com>
2026-03-24 09:15:29 -07:00
Shahin Saadati ec9b61e5bf Implemented the missing java code snippets for plugins. (#1394)
Co-authored-by: Joe Fernandez <joefernandez@users.noreply.github.com>
2026-03-06 22:27:49 +00:00
Scott Mansfield 20569ed52e Update typescript context (#1393)
* Update snippets to new Context type

* Updating documentation to reflect the unified Context type in Typescript

* Incorporating review feedback

---------

Co-authored-by: Joe Fernandez <joefernandez@users.noreply.github.com>
2026-03-06 14:27:19 -08:00
Joe Fernandez 06a78591bd docs: MCP pages, add tip pointer to Tools and integrations (#1290)
* docs: MCP pages, add tip pointer to Tools and integrations

* adding Integration tips

- also removing incorrect Plugin / ADK Web incompatibility issue
2026-02-11 14:51:21 -08:00
Joe Fernandez b117fc695b docs: centralize 3P and 1P Integrations content (#1249)
* docs: centralize 3P and 1P Integrations content

- move all content to integrations/
- frontmatter headings for all integration listings

* respond to review comments
2026-02-06 09:30:13 -08:00
Shahin Saadati fd7c7a3dca feat: Merge all the typescript code samples and snippets into the main repo. (#1063)
* Deleted redundant files.

* Deleted redundant files.

* Deleted redundant files.

* Deleted redundant files.

* Deleted redundant files.

* Deleted redundant files.

* Delete .gitignore

Deleted redundant files.

* Delete .gitignore

Deleted redundant files.

* Delete .gitignore

* Delete .gitignore

* Delete .gitignore

* Revert changes to .gitignore

* Revert changes to .gitignore

* Revert changes to .gitignore

* Revert changes to .gitignore

* Revert changes to .gitignore

* Revert changes to .gitignore

* Add MCP Tools TS example

* Removed unnecessary changes

* Removed extra slashes

* Added the custom agent sample.

* Corrected an error in the package.json file.

* Updated custom-agent.md

* Made small fixes.

* Add Session TS examples

* Added the typescript code snippets for multi agent.

* added the code sample for loop agent

* Added the code sample for loop agent

* Added the code sample for parallel agent

* Fixed a few issues and bugs

* Added the code sample for sequential agent

* Renamed run back to runAsync

* Updated the capital agent code sample.

* Corrected the snippet

* Renamed run() to runAsync()

* Add Runtime TS examples

* Fixed the snippets after library updates.

* Fixed the sample code after library changes.

* Added final touchups and fixes.

* Updated the code based on recent library changes.

* Updated package.json

* Updated package.json

* Updated package.json

* Updated the code with runAsync and package.json

* Updated the typescript sample.

* Updated after_tool_callback.ts with runAsync

* Updated after_model_callback.ts

* Updated before_model_callback.ts

* Updated before_tool_callback.ts

* Created before_agent_callback.ts

* Update before_agent_callback.ts

Changed the condition

* Update before_model_callback.ts

Changed the condition

* Update after_model_callback.ts

Changed the condition

* Update after_tool_callback.ts

Changed the condition

* Update after_agent_callback.ts

Changed the condition

* Update callback_basic.ts

Changed the condition

* Update storyflow_agent.ts

Changed the condition

* Update sequential_agent_code_development_agent.ts

Changed the condition

* Updated before_agent_callback.ts

* Removed unnecessary comment.

* Updated comment

* Renamed run to runAsync

* Added artifact code snippets.

* Fixed .link-checker-config.json

* Added tsconfig.json

* Update .gitignore with node modules files

* Added 7 typescript code snippets

* Cleaned up and corrected the snippets for plugins

* Update index.md

Undid the changes in artifacts/index.md

* Escaped properly.

* Add Long Running Function Tool TS examples

* Resolved code review feedback

* Fixed the code sample per git comments.

* Fixed the code per git comments.

* Fixed the md file per git comments.

* Fixed the issues per git comments.

* Fixed issues per github comments.

* Fixed the issues per PR comments.

* Fixed issues per PR comments.

* Added a code sample for HITL

* Fixed the indentations in the typescript code

* Used createPartFromBase64 when appropriate.

* Switched to use createUserContent.

* docs: Add JavaScript Quickstart, short unified format

* Added a simulated user delay to the code sample.

* Made some cosmetic improvements

* Added the code snippet with HITL with policy

* Made cosmetic modifications to multi-agents.md

* Added more tutorial for the HITL with policy

* Modularized the main function and added helper functions.

* Resolved code review feedback

* Resolved code review feedback

* Resolved code review feedback

* Fixed minor things in the typescript code per PR comments.

* Fixed the import for Event and used createEventActions.

* Simplified functionResponse code.

* Corrected the Event import and used createEventActions.

* Updated ADK versions in package.json.

* Final review of all changes & Add Safety TS example

* Make tsconfig.json files consistent

* Generated the API Reference for typescript

* Resolved code review feedback

* feat: Add Typescript API reference to docs

This commit adds the generated TypeDoc documentation for the Typescript ADK to the documentation site.

It also updates the main API reference page to include a link to the new Typescript API reference.

* docs: update TypeScript quickstart

* docs: Add version tags for Build Agents topics

- add version tags
- move TS content to second position (after Python)

* docs: Add MCP Toolbox for databases TS SDK Documentation

* Update mcp-toolbox-for-databases.md

* use typescript code block

* minor changes

* Update mcp-toolbox-for-databases.md

* Auto generated the typescript API reference.

* Added the TS code snippets for context.

* Fixed TS code snippets for context.

* Modified the sample based on the comment.

* docs: adding TypeScript language tags (2 of 3)

- Update all Run Agents section topics
- change all TS tags to v0.2.0 per eng agreement

* docs: Add TypeScript language support tags, Components (3 of 3)

- add TS language support tags
- re-order TS examples to be second
- minor fixes: remove trailing spaces

* Added callback samples for typescript to the markdown files.

* Updated adk version in quickstart

* Updated google/adk version for typescript.

---------

Co-authored-by: manchan <manchan@google.com>
Co-authored-by: Mandy Chan <75594070+slothwriter@users.noreply.github.com>
Co-authored-by: Joe Fernandez <joefernandez@google.com>
Co-authored-by: Joe Fernandez <joefernandez@users.noreply.github.com>
Co-authored-by: Twisha Bansal <58483338+twishabansal@users.noreply.github.com>
2025-12-15 12:53:24 -08:00
Haiyuan Cao dd8d30d7a6 Move BigQuery Agent Analytics docs to observability directory and update the plugin doc to v2 (#1060)
* Move BigQuery Agent Analytics docs to plugins directory

* Enhance BigQuery Agent Analytics documentation

Updated the documentation for the BigQuery Agent Analytics plugin to clarify event logging configurations and added a code sample for setting up the plugin.

* Move BigQuery analytics to observability and update index link

* Remove default comment from max_content_length

* Update mkdocs.yml for BigQuery Analytics move

* Update BigQuery Agent Analytics configuration defaults

* Move BQ observabilty page in nav

* Fix markdown list formatting in IAM permissions

* Clarify ADK 1.21.0 version requirement

* Update BigQuery Agent Analytics documentation

* Strongly recommend latest ADK version

* Refine BigQuery Agent Analytics documentation

* Update bigquery-agent-analytics.md

* Remove deprecated documentation

---------

Co-authored-by: Kristopher Overholt <koverholt@google.com>
Co-authored-by: Joe Fernandez <joefernandez@users.noreply.github.com>
2025-12-12 15:55:04 -08:00
Kristopher Overholt 2bad58c487 Add autogeneration of llms.txt during mkdocs build; add docs page on using llms.txt (#1023)
* Add mkdocs-llmstxt and related config

* Remove existing llms.txt and llms-full.txt from repo

* Add docs page for llms.txt

* Minor edit

* Minor edit

* Add *.md to glob syntax in mkdocs-llmstxt config

* Add explicit URLs in API reference section to avoid build warnings

* Fix all build warnings related to bad cross-links and incorrect anchor links

* Suppress INFO logs about absolute links - the CI link checker will catch any issues

* Fix remaining build warnings

* Add Gemini CLI instructions

* Fix link to bidi tutorial
2025-12-05 11:08:14 -06:00
Joe Fernandez d4524570b8 Add link to BigQuery Plugin docs (#983) 2025-11-19 12:47:14 -08:00
Kristopher Overholt b5329d97bd Update link to BigQuery plugin (#937)
Co-authored-by: Joe Fernandez <joefernandez@users.noreply.github.com>
2025-11-13 10:19:28 -08:00
adk-bot e72a9640e4 docs: Reflect and Retry Tool Plugin - Update ADK doc according to issue #796 - 3 (#802)
* docs: Add documentation for ReflectAndRetryToolPlugin

* docs: add Reflect and Retry plugin page

* docs: Reflect and Retry Plugin page

* resolve review comments

* final review comments

* fix broken link

---------

Co-authored-by: Joe Fernandez <joefernandez@google.com>
Co-authored-by: Joe Fernandez <joefernandez@users.noreply.github.com>
2025-11-05 14:44:27 -08:00
Joe Fernandez f12068a4bb docs: add language support tags to pages (#850)
* docs: add language support tags to pages

- replace img.shield tags
- add language support tags where missing

* update Agents page with general tags

* update language and version tagging

- response to review comments
- rename css styles to avoid style name conflicts

* add tags to api-server page
2025-11-03 16:07:35 -08:00
Joe Fernandez 357b331fa4 docs: Update Plugins page (#780)
Add links to code examples, fix repetition of tips
2025-10-15 10:56:44 -07:00
Holt Skinner af2ee80fde docs: Fix formatting/spelling errors in Docs (#676)
* docs: Update formatting of logging information

- Remove duplicates

* Fix formatting/spelling issues in Express Mode page

* Fix code formatting

* Rename "Google Cloud's" -> Google Cloud per branding guidelines

* Spelling fix on A2A

* Formatting fixes in a2a consuming

* Fix typo/formatting error on API Reference homepage

* Remove custom anchors in CONTRIBUTING.md because GFM doesn't support them

* Add imports to A2A Samples and update agent.json to agent-card.json

---------

Co-authored-by: Joe Fernandez <joefernandez@users.noreply.github.com>
2025-09-10 08:18:12 -07:00
Joe Fernandez ca0a2fd0ba fix: Updating Safety PR to comply with style guidelines (#656)
* feat: Update Safety and Security page to include plugins as a method for implement agent-agnostic security

* Add hyperlinks to newly added plugin section

---------

Co-authored-by: sammalik-lgtm <sammalik@google.com>
2025-08-27 15:53:35 -07:00
sammalik-lgtm 0c5fe99c4c feat: Update Safety and Security page to introduce ADK Plugins as a method for implementing agent-agnostic, global security policies (#648)
* feat: Update Safety and Security page to include plugins as a method for implement agent-agnostic security

* Add hyperlinks to newly added plugin section

---------

Co-authored-by: Joe Fernandez <joefernandez@users.noreply.github.com>
2025-08-27 12:42:11 -07:00
Joe Fernandez 5136469bce docs: Add Plugins developer guide (#549) 2025-08-01 15:08:51 +01:00