mirror of
https://github.com/google/adk-docs.git
synced 2026-09-14 16:16:59 +08:00
loggingPluginsUpdate
16 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
674851324e |
Add the Kotlin tab for answering a long-running tool call (#2149)
* Show how a Kotlin client answers a long-running tool call The function-tools page documents long-running tools in two halves: defining one (which Kotlin already covered) and driving it from the client, which Kotlin did not. Nothing in the docs showed a Kotlin reader how the deferred result gets back to the model - the only Kotlin mention of longRunningToolIds in the repo is a commented-out field listing in events/index.md. The new region continues the reimbursement scenario the Kotlin tab above it already sets up, rather than importing the nav-agent scenario the upstream demos use. It shows the two things that are easy to get wrong: - A pending call is one whose id the event also lists in `longRunningToolIds`; the FunctionResponse must reuse that id or the model cannot match the answer to the request it is waiting on. - A resumable app must pass `invocationId` to the second `runAsync`. Without it the response opens a new invocation instead of resuming the paused one, which the page's own resume note warns about for Python. Grounded in ResumableLongRunningToolDemoAgent.kt:84-99 at the v0.8.0 tag. Appended to the existing, already-registered LongRunningTool.kt instead of the new file the backlog row proposed: this page already owns that snippet, and a second file elsewhere would split one page's Kotlin across two directories. Also added a bullet to "Key aspects of this example", which explains the group purely in terms of `LongRunningFunctionTool` - a class Kotlin does not have. The Kotlin form is `@Tool(isLongRunning = true)` or a `BaseTool` subclass, and a long-running tool returning `Unit` suppresses even the placeholder response (InvocationContext.kt:447). Verified: runner.sh build and lint both PASS on the snippet (JDK 17), check_kotlin_snippets.sh passes, L0/L5/L6 pass. L3 reports two orphaned-tab problems at lines 123 and 227; both pre-date this change and are false positives - rendering the page with the repo's own markdown extensions shows every group, including the one edited here, as a single tabbed set with Kotlin among its labels. * Correct the long-running snippet's account of resume and turn count Review against the v0.8.0 sources found three claims in this branch that a reader would have acted on and been wrong. The invocationId argument was the worst of them. The snippet took an `appIsResumable` flag and passed `invocationId` on the second `runAsync`, commenting that a resumable app must do so or the response opens a new invocation. The runner does not work that way: `resolveInvocationId` (AbstractRunner.kt:468-483) looks the id up from the function-call event that matches the response's own id and discards whatever the caller passed. The flag was inert, and anyone plumbing it through their call sites would have got nothing for it. Both are gone; the comment now says what actually resumes the invocation - the response id itself. "Returns a placeholder and the turn ends" was wrong for the snippet's own default. This tool returns a data class, not `Unit`, so a non-resumable app emits the placeholder as a function response and calls the model again: LongRunningToolIntegrationTest's scenario table records two model calls and a trailing text event for that combination, and asserts it in runAsync_longRunningToolReturnsDict_propagatesPayloadAndAcknowledges. A reader building a HITL flow would have budgeted one model call and been surprised by an interim reply. The KDoc and the page bullet now describe both modes. Reusing the call id was described as something the model needs to match the answer to its request. The model never gets that far: an unknown id throws from HistoryRewriterProcessor.findMatchingFunctionCallEvent, and a null one throws too, because the id set is built with mapNotNull and an empty set matches no event. The comment now says it throws. Also prints turn 1, which is where the interim reply appears, and says so when the model answers without calling the tool instead of returning silently. Verified: runner.sh build and lint both PASS (JDK 17), L0/L1/L2/L5/L6 pass, and rendering the page with the repo's markdown extensions puts Kotlin in the target group's tab set. L3's two orphaned-tab reports are pre-existing on main and are false positives - the render shows those groups whole. * Update function-tools.md * Say that Kotlin resolves the invocation from the response itself Adding a Kotlin tab to this section quietly extended the Resume note to Kotlin, where it does not hold: resolveInvocationId matches the function response's own call ID against the session and ignores the invocationId the caller passes, so requiring one sends readers looking for a parameter that changes nothing. An ID matching no call throws rather than starting a fresh invocation. Also fix subject-verb agreement in the turn-count bullet. --------- Co-authored-by: Joe Fernandez <931947+joefernandez@users.noreply.github.com> |
||
|
|
e59783b904 |
Add the Kotlin tab for driving a long-running tool to completion (#2159)
The call_reimbursement_tool group showed Python, TypeScript, Go and Java but not Kotlin, even though the page already carries a Kotlin tab for defining the tool a few sections earlier. Defining a long-running tool without showing how to resume it leaves the Kotlin reader at the point where the invocation pauses. The new region extends the file that already backs this page rather than adding a second one. It mirrors the Python flow: watch for the call whose id appears in Event.longRunningToolIds, keep the matching FunctionResponse, then send a copy of it back with the final status to resume the paused invocation. Scoped deliberately to that group. RequestInputTool and GetUserChoiceTool were also on this backlog row, but they have no host page in ANY language - they appear nowhere in the narrative docs, only in generated API reference - so adding a Kotlin-only section for them would invent structure rather than close a gap. Recorded for a product-docs request instead. |
||
|
|
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> |
||
|
|
cd66bc5128 |
Update propagate grounding metadata as per Issue #1587 - 6 (#2033)
* Update propagate grounding metadata as per Issue #1587 - 6 Rendered view PR #1598 Original Issue #1587 -- - Improved explanation of original ask bot draft - Added code example * Update function-tools.md * Update function-tools.md * Update function-tools.md |
||
|
|
0a9cc3a7db |
Update include_plugins per Issue #1173 - 9 (#1990)
* Update include_plugins per Issue #1173 - 9 Rendered page> PRs> #1190 #1192 Original Issue> #1173 - Changed the proposed note format into a bullet point. - Made the explanation shorter and more direct so it matches Google's writing style guide. - Fixed and replaced the undefined agent variable with a concrete MyImageAgent placeholder class to make the Python snippet self-contained. - Added comments inside the code to explain exactly what happens when you turn plugins on or off (like how it affects things like tracing and events). - Did light formatting in the rest of the page * Update function-tools.md * Update function-tools.md fixed rendering mistakes * Update function-tools.md Adding a bullet did not work, I created a sub topic to stop the snippet from breaking in the rendering. * Update function-tools.md |
||
|
|
c78be66c78 |
Add docs for context injection for function tools (issue #1438 - 17) (#1958)
* Updated Context injection according to issue #1438 - 17 This PR adds documentation for context injection. * Update function-tools.md Worked on feedback. - Updated Imports: Fixed the import path for ToolContext to correctly pull from google.adk.tools instead of google.adk.types. - Snippet Formatting: Removed the unnecessary parentheses around "secondary_agent" in the commented-out transfer_to_agent action example. - Removed Dead Code: Removed the redundant pass statement at the end of the my_tool function. * Fix context injection docs and headings in function-tools.md * Format function-tools.md: line wrapping, bullet markers, and copy cleanup --------- Co-authored-by: Kristopher Overholt <koverholt@google.com> |
||
|
|
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> |
||
|
|
50f7df7f46 |
Add Kotlin language support to ADK docs (#1768)
* Add Kotlin to hero / front page * Add quickstart page for Kotlin * Complete Kotlin quickstart guide and fix hero code sample (#2) * Replace GitHub repo links with language icons in header (#3) * Fix header icon FOUC and homepage font weight regression (#4) * Testing staging pipeline * Revert test edit (for staging pipeline) * Update language icon tooltips to indicate GitHub destination (#5) * Add link to ADK Kotlin release notes (#7) * Initial commit of ADK Kotlin API reference docs (#6) * Add script to generate ADK Kotlin API reference docs (#8) * Update links and link checker ignore list (temporarily) (#9) * Add ADK Kotlin for Android getting started guide to Advanced setup page (#10) * Add advanced setup page with steps to "Use ADK Kotlin in Android projects" * Update temp link checker rules * Add placeholder folder for adk-samples (#13) * adding linter/compilation checks for kotlin snippets (#12) * adding linter/compilation checks for kotlin snippets * Add Kotlin validation scripts * Initial commit of Kotlin sample agents for adk-samples (#15) * Adding kotlin snippet for llm agents (#16) * Adding kotlin snippets to Events (#17) * Pull changes to docs/events/index.md from glaforge-kotlin-snippets * fixing kotlin event timestamp and longRunningToolIds * Fix language tags (#19) * Fix language tags * Update * Fix wrapping * Fix wrapping (again) * Fix wrapping/format * Fix language tag on integration page * Enable check_paths in PyMdown Snippets Extension to make the build fail if a snippet can't be found (#20) * Update mkdocs config (#21) * Fix broken links, update URLs to adk.dev, and improve (temp) lychee config (#22) * Add Kotlin/maven badge to README (#23) * Adding Kotlin snippets for artifacts (#18) * Pull Kotlin snippets for artifacts from glaforge-kotlin-snippets * Add comprehensive Kotlin snippets for artifacts * Refactor artifacts documentation to use external Kotlin snippets * Update Kotlin model to gemini-flash-latest * Fix GCS initialization in Kotlin artifact snippet * afixi failing test with capital-agent added to files_to_check * Fix snippet label syntax for MkDocs build * Configure proper Gradle project for Kotlin snippets and fix dependencies * Add KSP support and generated sources to Kotlin snippets build * fixing capital_agent turnComplete * Fix syntax error in build.gradle.kts by removing invalid placeholders (#25) * Adding Kotlin snippets to google-gemini.md (#27) Pulling kotlin changes to google-gemini.md from glaforge-kotlin-snippets * Add a warning about not adding an api key to production code. (#28) * Add a warning about not adding an api key to production code. * Update note --------- Co-authored-by: Kristopher Overholt <koverholt@google.com> * Add ADK Demo App sample showcasing Gemini-powered agents (#29) This sample demonstrates how to use the Google ADK (Agent Development Kit) in an Android application to create a chat interface powered by a Gemini-based "Fun Facts" agent. The implementation features: * Integration with the Kotlin ADK core and processor libraries. * A `FunFactsAgent` defined using `LlmAgent` and the Gemini model. * A `ChatViewModel` utilizing `InMemoryRunner` for asynchronous message streaming. * A modern UI built with Jetpack Compose and Material 3. * Build configuration logic for secure API key management via environment variables or `local.properties`. * Update Kotlin docs and samples to align with adk-kotlin API changes (#30) Rename GeminiModel to Gemini, @AdkTool/@AdkParam to @Tool/@Param, adkTools() to generatedTools(), replace DebugRunner with InMemoryRunner, fix AgentLoader import path, use SingleAgentLoader, bump Kotlin to 2.3.21 and KSP to 2.3.7, and update Android minSdk from 24 to 26. * adding kotlin info to READMEs (#14) * Reorganize Android sample agent and add READMEs (#31) * Move Android sample agent * Update repo README, add Android README, update sample agent README * Minor edit to language support tags (#32) * Remove blog post link (#33) Will re-add after it's published * Remove examples link (#34) * Adding Kotlin snippets for Sessions docs (#26) * initial kotlins snippets additions to sessions docs * Updating memory docs with kotlin snippets * Adding kotlin snippets to session state docs. * update model to gemini-flash-latest * sessions examples clean-up * fixing sessions snippet markers * adding kotlin session snippets to files to test * adding callback to memory_example * Fixing capital agent snippet (#35) Fixing file name Updating adkTool > Tool Updating GeminiModel > Gemini * Adding kotlin snippets for tools docs (#36) * adding function tool kotlin snippets * adding function_tools snippets to files to test * Adding kotlin snippets to observability docs (#37) * initial kotlin observability updates * adding observability snippets to file check (#38) * Adding Kotlin snippets to Callbacks docs (#39) * kotlin callbacks snippets * adding callbacks snippets to file check * Align Kotlin and KSP versions with published 0.1.0 artifacts (#40) * switch CLI entry points from InMemoryRunner to ReplRunner (#41) * Switch CLI entry points from InMemoryRunner to ReplRunner * Fix wording * Update API reference docs for Kotlin, 2026-05-18 (#42) * Remove ADK on Android note until published (#43) * Update Kotlin code samples (#44) * Rename GeminiModel to Gemini in Kotlin snippets and docs * Remove broken SessionKey call and use sessionId directly in AgentTool snippet * Rewrite Go hero snippet to use llmagent API * Use isFinalResponse with safe access in CapitalAgent snippet * Use Role.USER constant instead of raw string in SetupExample * Use full semver v0.1.0 in Kotlin language support tags * Remove Android setup steps, moving to new property (#45) * Tutorial Kotlin agent (#46) * Adding multi-tool-agent snippet and updating tutorial * Fixing Go language order on tutorial page * adding multi tool agent example to files to test * Inline Kotlin get-started code sample * Kotlin Multi agents snippets (#47) * Multi-agent kotlin snippets * Fixing docs tags in multiagent example * Fix Kotlin language support tags, code samples, and google-gemini.md cleanup (#48) * Add Kotlin v0.1.0 to language support tags across docs * Fix MultiToolAgent.kt model string and argument style * Update MultiAgentExample.kt to use gemini-flash-latest model string * Fix google-gemini.md: add Kotlin sample, remove unsupported Java tabs * Remove explicit apiKey from CallbackBasic.kt for consistency * Standardize Gemini() constructor to use named args in all snippets * Remove adk-samples directory (moved to google/adk-samples#1969) * Remove adk-samples directory (moved to google/adk-samples#1969) (#49) * Update API reference docs for ADK Kotlin 0.1.0 (#50) * Remove adk-samples directory (moved to google/adk-samples#1969) * Update API reference docs for ADK Kotlin 0.1.0 * Remove kotlin lycheeignore config (#51) * Remove adk-samples directory (moved to google/adk-samples#1969) * Remove Kotlin .lycheeignore config links --------- Co-authored-by: Toni Klopfenstein <2359976+ToniCorinne@users.noreply.github.com> Co-authored-by: Jolanda Verhoef <JolandaVerhoef@users.noreply.github.com> |
||
|
|
00c045504c |
docs: clarify function tool defaults (#1731)
Co-authored-by: Kristopher Overholt <koverholt@google.com> |
||
|
|
cd9fa20fa4 |
Update function-tools.md (#1621)
fix for b/417443399 |
||
|
|
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 |
||
|
|
06f553cfe9 |
Added missing java snippets to function-tools.md (#1467)
* Added missing java snippets to function-tools.md * Update function-tools.md --------- Co-authored-by: Joe Fernandez <joefernandez@users.noreply.github.com> |
||
|
|
159e536aed |
doc: fixing typos in various files (#1140)
* doc: fixing typos in various files * Update code-exec-agent-engine.md --------- Co-authored-by: Joe Fernandez <joefernandez@users.noreply.github.com> |
||
|
|
93be6e3dd2 | docs: fix typos and spacing across docs (#1079) | ||
|
|
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> |
||
|
|
2517d253e9 |
docs: MOVING files to /tools-custom/ (#926)
* docs: A2A guides, clearer nav for Go and Python * docs: minor fixes for ADK quickstarts * revert extra changes * docs: MOVING files to /tools-custom/ - move files, update links and navigation - add redirects |