langtree.core.prompt¶
Module Contents¶
Classes¶
A class to represent and process prompt templates. |
Functions¶
|
Render a template string by substituting placeholders with provided keyword arguments. |
- langtree.core.prompt.render_prompt(template, **kwargs)[source]¶
Render a template string by substituting placeholders with provided keyword arguments.
- Parameters:
template (str) – The template string containing placeholders.
**kwargs – Keyword arguments representing placeholder-value pairs.
- Returns:
The rendered string after substitutions.
- Return type:
str
- class langtree.core.prompt.Prompt(template)[source]¶
A class to represent and process prompt templates.
- __call__(**kwargs)[source]¶
Render the prompt using the provided keyword arguments.
- Parameters:
**kwargs – Keyword arguments for rendering the prompt.
- Returns:
The rendered prompt.
- Return type:
str