Skip to content

prompt_loader

diapason.agents.prompt_loader

Load system prompt and few-shot overrides from $DIAPASON_HOME.

LLM-guided spec search (M1) proposes edits that get written to disk by appliers. This module lets agents pick those overrides up at runtime:

  • System prompts: $DIAPASON_HOME/agents/{name}/system_prompt.md
  • Few-shot exemplars: $DIAPASON_HOME/agents/{name}/few_shot.json

Override files are templates — they may contain {tool_descriptions} and other format placeholders that the agent fills in via .format(), exactly like the hardcoded constants.

load_few_shot_exemplars(agent_name)

Return few-shot exemplars for agent_name, or empty list.

Looks for $DIAPASON_HOME/agents/<agent_name>/few_shot.json. Expected format: [{"input": "Q", "output": "A"}, ...].

load_system_prompt_override(agent_name)

Return the override prompt for agent_name, or None.

Looks for $DIAPASON_HOME/agents/<agent_name>/system_prompt.md. DIAPASON_HOME defaults to ~/.diapason when unset.