langchain_core.prompts.string.get_template_variables

langchain_core.prompts.string.get_template_variables(template: str, template_format: str) List[str][source]

从模板中获取变量。

参数:

template: 模板字符串。 template_format: 模板格式。应为”f-string”或”jinja2”之一。

返回:

模板中的变量。

引发:

ValueError: 如果模板格式不受支持。

Parameters
  • template (str) –

  • template_format (str) –

Return type

List[str]