templating
strands_teams.templating ¶
Jinja2 environment factory for agent-prompt templates.
Adapted from the pre-split code_context_agent.templates package initializer. Generalized so the template directory is a parameter rather than the module's own directory: each use case supplies its own template dir.
make_environment ¶
Create a Jinja2 environment rooted at template_dir.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
template_dir | str | Path | Directory containing | required |
Returns:
| Type | Description |
|---|---|
Environment | Configured Jinja2 |
Source code in packages/strands-teams/src/strands_teams/templating.py
render_prompt ¶
Render a prompt template from a use-case template directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
template_dir | str | Path | Directory containing the template. | required |
template_name | str | Template filename (e.g., | required |
**context | object | Variables passed to the template. | {} |
Returns:
| Type | Description |
|---|---|
str | Rendered prompt string. |