templates
code_context_agent.templates ¶
Jinja2 template loading and rendering for agent prompts.
This module provides a configured Jinja2 environment for rendering prompt templates. Templates are loaded from this directory using FileSystemLoader with StrictUndefined to catch missing variables.
render_prompt ¶
Render a prompt template with the given context.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
template_name | str | Template filename (e.g., "system.md.j2") | required |
**context | Any | Variables to pass to the template | {} |
Returns:
| Type | Description |
|---|---|
str | Rendered prompt string |
Source code in src/code_context_agent/templates/__init__.py
render_steering ¶
Render a steering template fragment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name | str | Steering template name (e.g., "size_limits") | required |
**context | Any | Variables to pass to the template | {} |
Returns:
| Type | Description |
|---|---|
str | Rendered steering prompt fragment |