[[namespace.key]] placeholder syntax for inputs, outputs, and tools.
You’ll end up with. A server-stored canonical \{\{inputs.topic\}\} / \{\{tools.\<tool_id>\}\} form, plus three TemplateReferenceErrors demonstrating the validation guardrails.
Users author placeholders with an explicit namespace prefix:
[[inputs.X]] / [[outputs.X]] / [[tools.X]]. The SDK rewrites
them on Agent.new / Agent.save to the backend-canonical
\{\{inputs.X\}\} / \{\{outputs.X\}\} / \{\{tools.\<tool_id>\}\} forms that
the engine expects.
Why the [[ ]] brackets: \{\{ and \}\} are reserved escape sequences in
Python f-strings — authoring in \{\{ \}\} would force awkward
f"\{\{\{\{topic\}\}\}\}" boilerplate. [[ ]] has no special meaning in
f-strings so placeholders drop into normal interpolation cleanly.
Why the required namespace prefix: if an input, output, and tool all
share a name (say brief), a bare [[brief]] would be ambiguous. The
v2 SDK rejects bare placeholders outright and asks the author to write
[[inputs.brief]] / [[outputs.brief]] / [[tools.brief]] explicitly.
What this demonstrates:
- Input reference: [[inputs.topic]] -> {{inputs.topic}}
- Output reference: [[outputs.brief]] -> {{outputs.brief}}
- Tool by name: [[tools.google_search]] -> {{tools.<tool_id>}}
- Tool by raw id: [[tools.<tool_id>]] -> {{tools.<tool_id>}}
- Already-canonical {{inputs.topic}} content passes through unchanged
- Bare [[topic]] is rejected with a TemplateReferenceError
str(kb) /
str(pipeline) etc. (see Example 17 / vs-context).
Expected output
[[ ]] coexist cleanly — local interpolation runs and the placeholder syntax survives untouched until Agent.new.
See also
VS context stringification
The conversational counterpart —
str(kb) instead of placeholders.Functional agent with typed I/O
Where
inputs={} / outputs={} come from — the names placeholders bind to.Agent reference
Full method surface.
