Skip to content

docs: fix type annotation error and missing imports in function tools snippet#1979

Merged
koverholt merged 2 commits into
google:mainfrom
Syed-Umer-Ali:main
Jul 20, 2026
Merged

docs: fix type annotation error and missing imports in function tools snippet#1979
koverholt merged 2 commits into
google:mainfrom
Syed-Umer-Ali:main

Conversation

@Syed-Umer-Ali

Copy link
Copy Markdown
Contributor

Why

Two content bugs in the human_in_the_loop.py snippet used by the Function Tools docs page:

  1. Type errorreimburse() annotated -> str but returns {'status': 'ok'} (a dict). Type checkers will flag this.

  2. Import errorfrom typing import Any and from google.adk.tools import LongRunningFunctionTool are placed above the [start:define_long_running_function] snippet tag. The docs site only renders lines inside the tag, so the code block shown to readers is missing these imports. Copy-pasting the example causes NameError.

Fix

  • Changed -> str to -> dict[str, Any] on reimburse()
  • Moved the two import lines inside the snippet region so they appear in the rendered code block

Verification

  • The example is syntactically valid Python 3.10+
  • Total change: +4/−3 lines in one file. No behavioral impact.

@netlify

netlify Bot commented Jul 19, 2026

Copy link
Copy Markdown

Deploy Preview for adk-docs-preview ready!

Name Link
🔨 Latest commit ec5b623
🔍 Latest deploy log https://app.netlify.com/projects/adk-docs-preview/deploys/6a5e898a7b28ad0008d00ab0
😎 Deploy Preview https://deploy-preview-1979--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.

@koverholt koverholt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks for contributing this fix. I verified the fixes against the latest ADK Python SDK/release and everything checks out. LGTM, merging!

@koverholt
koverholt merged commit 04655e1 into google:main Jul 20, 2026
12 checks passed
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.

2 participants