Skip to content

docs: fix missing imports in custom agents and graph routes examples - #1995

Merged
joefernandez merged 2 commits into
google:mainfrom
Syed-Umer-Ali:docs/fix-missing-imports-custom-agents-routes
Jul 30, 2026
Merged

docs: fix missing imports in custom agents and graph routes examples#1995
joefernandez merged 2 commits into
google:mainfrom
Syed-Umer-Ali:docs/fix-missing-imports-custom-agents-routes

Conversation

@Syed-Umer-Ali

Copy link
Copy Markdown
Contributor

What

Three Python code examples in the docs were missing required imports, making them uncopy-pasteable (would raise NameError at runtime).

Fix

  1. docs/agents/custom-agents.md:866-900 — Added from google.adk import Event and from google.genai import types in the AgentTool example. ImageGeneratorAgent._run_async_impl used both without importing them.

  2. docs/graphs/routes.md:151-182 — Added from google.adk import Event, Workflow and from google.adk.agents import Agent in the branching code block.

  3. docs/graphs/routes.md:407-428 — Added from google.adk import Event, Workflow in the loop code block.

Verification

All three code blocks pass ast.parse() — no syntax errors.

@netlify

netlify Bot commented Jul 22, 2026

Copy link
Copy Markdown

Deploy Preview for adk-docs-preview ready!

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

@joefernandez joefernandez 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.

Thanks for the fixes!

@joefernandez
joefernandez enabled auto-merge (squash) July 30, 2026 23:03
@joefernandez
joefernandez merged commit b30cf33 into google:main Jul 30, 2026
11 of 12 checks passed
@Syed-Umer-Ali
Syed-Umer-Ali deleted the docs/fix-missing-imports-custom-agents-routes branch August 5, 2026 13:07
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