Index
templates
¶
Agent template system — pre-configured agent manifests.
Classes¶
AgentTemplate
dataclass
¶
AgentTemplate(
name: str,
description: str = "",
system_prompt: str = "",
agent_type: str = "simple",
tools: List[str] = list(),
max_turns: int = 10,
temperature: float = 0.7,
)
A pre-configured agent manifest loaded from a TOML template.
Functions:¶
discover_templates
¶
discover_templates(
extra_dirs: Optional[List[str | Path]] = None,
) -> List[AgentTemplate]
Discover and load all agent templates from known directories.
Search order:
1. Built-in templates shipped with the package (templates/data/).
2. User templates at ~/.diapason/templates/agents/.
3. Any additional directories supplied via extra_dirs.
Returns a list of :class:AgentTemplate instances sorted by name.
Source code in src/diapason/templates/agent_templates.py
load_template
¶
load_template(path: str | Path) -> AgentTemplate
Load an agent template from a TOML file.
Expected format::
[template]
name = "code-reviewer"
description = "Reviews code for bugs, style, and best practices"
[agent]
type = "native_react"
max_turns = 8
temperature = 0.3
tools = ["file_read", "think"]
system_prompt = """You are a code reviewer..."""
Raises: FileNotFoundError: If path does not exist.