get_template_variables#

langchain_core.prompts.string.get_template_variables(template: str, template_format: str) β†’ list[str][source]#

Get the variables from the template.

Parameters:
  • template (str) – The template string.

  • template_format (str) – The template format. Should be one of β€œf-string” or β€œjinja2”.

Returns:

The variables from the template.

Raises:

ValueError – If the template format is not supported.

Return type:

list[str]