Class swarmauri_core.prompts.ITemplate.ITemplate
swarmauri_core.prompts.ITemplate.ITemplate
Bases: ABC
Interface for template-based prompt generation within the SwarmAURI framework. Defines standard operations and attributes for managing and utilizing templates.
set_template
abstractmethod
set_template(template)
Sets or updates the current template string.
PARAMETER | DESCRIPTION |
---|---|
template
|
The new template string to be used for generating prompts.
TYPE:
|
Source code in swarmauri_core/prompts/ITemplate.py
11 12 13 14 15 16 17 18 19 |
|
set_variables
abstractmethod
set_variables(variables={})
Sets or updates the variables to be substituted into the template.
PARAMETER | DESCRIPTION |
---|---|
variables
|
A dictionary of variables where each key-value pair corresponds to a placeholder name and its replacement value in the template.
TYPE:
|
Source code in swarmauri_core/prompts/ITemplate.py
21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
generate_prompt
abstractmethod
generate_prompt(**kwargs)
Generates a prompt string based on the current template and provided keyword arguments.
PARAMETER | DESCRIPTION |
---|---|
**kwargs dict[str, Any]
|
Keyword arguments containing variables for template substitution.
|
RETURNS | DESCRIPTION |
---|---|
str
|
The generated prompt string with template variables replaced by their
corresponding values provided in
TYPE:
|
Source code in swarmauri_core/prompts/ITemplate.py
35 36 37 38 39 40 41 42 43 44 45 46 47 |
|