Frontmatter#
- class langchain_prompty.core.Frontmatter[source]#
Class for reading frontmatter from a string or file.
Methods
__init__
()read
(string)Returns dict with separated frontmatter from string.
read_file
(path)Reads file at path and returns dict with separated frontmatter.
- __init__()#
- classmethod read(string: str) dict[str, Any] [source]#
Returns dict with separated frontmatter from string.
Returned dict keys: attributes – extracted YAML attributes in dict form. body – string contents below the YAML separators frontmatter – string representation of YAML
- Parameters:
string (str) –
- Return type:
dict[str, Any]