Skip to content

Commit eddfcd2

Browse files
docs(core): Updated docs for mustache_template_vars (#33481)
1 parent 9f470d2 commit eddfcd2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

libs/core/langchain_core/prompts/string.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,16 @@ def mustache_formatter(template: str, /, **kwargs: Any) -> str:
122122
def mustache_template_vars(
123123
template: str,
124124
) -> set[str]:
125-
"""Get the variables from a mustache template.
125+
"""Get the top-level variables from a mustache template.
126+
127+
For nested variables like `{{person.name}}`, only the top-level
128+
key (`person`) is returned.
126129
127130
Args:
128131
template: The template string.
129132
130133
Returns:
131-
The variables from the template.
134+
The top-level variables from the template.
132135
"""
133136
variables: set[str] = set()
134137
section_depth = 0

0 commit comments

Comments
 (0)