Skip to content

Docs/fix template variable in instruction examples#1994

Open
Syed-Umer-Ali wants to merge 1 commit into
google:mainfrom
Syed-Umer-Ali:docs/fix-template-variable-in-instruction-examples
Open

Docs/fix template variable in instruction examples#1994
Syed-Umer-Ali wants to merge 1 commit into
google:mainfrom
Syed-Umer-Ali:docs/fix-template-variable-in-instruction-examples

Conversation

@Syed-Umer-Ali

Copy link
Copy Markdown
Contributor

What

Instruction strings across all 5 language examples in docs/agents/llm-agents.md
and the corresponding snippet files contain {country} as a documentation
placeholder inside the example query.

Why

ADK's template engine treats {var} as a state variable injection token. The
docs themselves state (line 127-128): "If the state variable ... does not exist,
the agent will raise an error." Since country is never set as a state variable
in any of these examples, running the code as-written fails with a template
resolution error.

Fix

Replace {country} with {{country}} in all instruction strings across Python,
TypeScript, Java (inline in docs/agents/llm-agents.md), Go
(examples/go/snippets/agents/llm-agents/snippets/main.go), and Kotlin
(examples/kotlin/snippets/agents/llm-agent/CapitalAgent.kt). Double-braces
escape ADK's template engine, rendering a literal {country} in the LLM
instruction — which is what the example intends.

Verification

Confirmed that {var} is documented as state variable syntax on the same page
(lines 123-128). The fix preserves the displayed output while preventing template
engine errors. Python f-strings containing {country} in actual code (e.g., line
239) were left untouched.

@netlify

netlify Bot commented Jul 22, 2026

Copy link
Copy Markdown

Deploy Preview for adk-docs-preview ready!

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

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.

1 participant