Prompt Modules
This page documents internal prompt-library modules for contributor visibility. These underscored module paths are intentionally unstable.
Loader and renderer for packaged prompt templates.
Prompt files live in package resources so they can be versioned independently from agent code and loaded consistently across environments.
- design_research_agents._prompts._library.load_prompt(name)[source]
Load a prompt template by logical name from packaged resources.
The function validates that the name is registered and that the resolved file is non-empty, then returns a stripped text template ready for rendering.
- Parameters:
name – Logical prompt template name in the registry.
- Returns:
The stripped prompt template text.
- Raises:
ValueError – If the prompt name is unknown or the template is empty.
- design_research_agents._prompts._library.render_prompt(name, *, variables)[source]
Render a prompt template with
string.Templatevariable substitution.All variable values are coerced to strings before substitution. Missing variables raise
ValueErrorwith the missing key name for easier debugging.- Parameters:
name – Logical prompt template name in the registry.
variables – Mapping of template variable names to replacement values.
- Returns:
The rendered prompt text.
- Raises:
ValueError – If the prompt name is unknown or a variable is missing.