Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions libs/core/langchain_core/prompts/string.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,16 @@ def mustache_formatter(template: str, /, **kwargs: Any) -> str:
def mustache_template_vars(
template: str,
) -> set[str]:
"""Get the variables from a mustache template.
"""Get the top-level variables from a mustache template.
For nested variables like `{{person.name}}`, only the top-level
key (`person`) is returned.
Args:
template: The template string.
Returns:
The variables from the template.
The top-level variables from the template.
"""
variables: set[str] = set()
section_depth = 0
Expand Down