---
sidebar:
  hidden: true
title: roboto.templating
---
Substitution of `{{name}}` placeholders, such as those in an agent's request template or a trigger's target.

To expand the placeholders in a value, use [`substitute()`](/docs/reference/python-sdk/roboto/templating#roboto.templating.substitute) with a [`VariableResolver`](/docs/reference/python-sdk/roboto/templating#roboto.templating.VariableResolver), such as [`MappingResolver`](/docs/reference/python-sdk/roboto/templating#roboto.templating.MappingResolver); to find them, use [`collect_placeholders()`](/docs/reference/python-sdk/roboto/templating#roboto.templating.collect_placeholders).

## Submodules

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

## Package Contents

- [MappingResolver](/docs/reference/python-sdk/roboto/templating/substitution#roboto.templating.substitution.MappingResolver) (class): Variable resolver that reads each placeholder's text from a dictionary keyed by name.

- [PLACEHOLDER_RE](/docs/reference/python-sdk/roboto/templating/substitution#roboto.templating.substitution.PLACEHOLDER_RE) (data): Regular expression that matches a `{{name}}` placeholder and captures its name in group 1.

- [VARIABLE_NAME_RE](/docs/reference/python-sdk/roboto/templating/substitution#roboto.templating.substitution.VARIABLE_NAME_RE) (data): Regular expression a template variable's name must match.

- [VariableResolver](/docs/reference/python-sdk/roboto/templating/substitution#roboto.templating.substitution.VariableResolver) (class): Source of the text `{{name}}` placeholders expand to in `substitute`.

- [collect_placeholders()](/docs/reference/python-sdk/roboto/templating/substitution#roboto.templating.substitution.collect_placeholders) (function): Return the name of every `{{name}}` placeholder in the strings of a JSON-compatible value.

- [substitute()](/docs/reference/python-sdk/roboto/templating/substitution#roboto.templating.substitution.substitute) (function): Return a copy of a JSON-compatible value with each `{{name}}` placeholder in its strings expanded.
