# get_template_variables

> **Function** in `langchain_core`

📖 [View in docs](https://reference.langchain.com/python/langchain-core/prompts/string/get_template_variables)

Get the variables from the template.

## Signature

```python
get_template_variables(
    template: str,
    template_format: str,
) -> list[str]
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `template` | `str` | Yes | The template string. |
| `template_format` | `str` | Yes | The template format.  Should be one of `'f-string'`, `'mustache'` or `'jinja2'`. |

## Returns

`list[str]`

The variables from the template.

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/6fb37dba71da807af60aa7b909f71f0625a666bf/libs/core/langchain_core/prompts/string.py#L298)