---
sidebar:
  hidden: true
title: roboto.templating
---
Generic `{{name}}` placeholder substitution shared across the SDK.

The same lightweight templating primitive powers reusable agent definitions (client-side substitution of caller-supplied values before a thread starts) and event triggers (server-side substitution of event-derived variables into a target's request). A [`VariableResolver`](/docs/reference/python-sdk/roboto/templating#roboto.templating.VariableResolver) binds placeholders to a source of values, so the substitution engine stays agnostic to where those values come from.

## Submodules

- [roboto.templating.substitution](/docs/reference/python-sdk/roboto/templating/substitution)

## Package Contents

- [MappingResolver](/reference/python-sdk/roboto/templating/substitution#roboto.templating.substitution.MappingResolver) (class): A [`VariableResolver`](/reference/python-sdk/roboto/templating/substitution#roboto.templating.substitution.VariableResolver) backed by a flat `name -> value` mapping.

- [PLACEHOLDER_RE](/reference/python-sdk/roboto/templating/substitution#roboto.templating.substitution.PLACEHOLDER_RE) (data): Recognizes `{{name}}` placeholders. Names start with a letter or underscore; dots are allowed so dotted names (`{{dataset.id}}`, `{{action.name}}`) work as a namespace convention for entity-bound expansion by a [`VariableResolver`](/reference/python-sdk/roboto/templating/substitution#roboto.templating.substitution.VariableResolver).

- [VARIABLE_NAME_RE](/reference/python-sdk/roboto/templating/substitution#roboto.templating.substitution.VARIABLE_NAME_RE) (data): Mirrors [`PLACEHOLDER_RE`](/reference/python-sdk/roboto/templating/substitution#roboto.templating.substitution.PLACEHOLDER_RE) so every declared variable name is referenceable by `{{name}}`.

- [VariableResolver](/reference/python-sdk/roboto/templating/substitution#roboto.templating.substitution.VariableResolver) (class): Decides what each `{{name}}` placeholder expands to during substitution.

- [collect_placeholders()](/reference/python-sdk/roboto/templating/substitution#roboto.templating.substitution.collect_placeholders) (function): Return every `{{name}}` placeholder found in the string leaves of `node`.

- [substitute()](/reference/python-sdk/roboto/templating/substitution#roboto.templating.substitution.substitute) (function): Return a copy of `node` with each `{{name}}` in a string leaf expanded via `resolver`.
