swarmauri.core.prompts.ITemplate module
- class swarmauri.core.prompts.ITemplate.ITemplate[source]
Bases:
ABC
Interface for template-based prompt generation within the SwarmAURI framework. Defines standard operations and attributes for managing and utilizing templates.
- abstract generate_prompt(**kwargs)[source]
Generates a prompt string based on the current template and provided keyword arguments.
- Parameters:
**kwargs – Keyword arguments containing variables for template substitution.
- Returns:
- The generated prompt string with template variables replaced by their
corresponding values provided in kwargs.
- Return type:
str
- abstract set_template(template)[source]
Sets or updates the current template string.
- Parameters:
template (str) – The new template string to be used for generating prompts.
- Return type:
None
- abstract set_variables(variables={})[source]
Sets or updates the variables to be substituted into the template.
- Parameters:
variables (List[Dict[str, str]]) – A dictionary of variables where each key-value pair corresponds to a placeholder name and its replacement value in the template.
- Return type:
None