To create a custom scenario, edit demo/scenarios.py and define the following components:
make_agents(n): A function returning a list of agent dictionaries containing name, emoji, color, and direct_instruction.plan: A dictionary with system and user prompt templates using placeholders like {n_agents}, {topic}, and {agent_list}.system_prompt: The system instruction for the model.template: A function to build HTML from the results dictionary.- Register the scenario in the
SCENARIOS dictionary.
Example implementation:
def make_my_agents(n: int = 10) -> list[dict]:
return [
{
"name": f"Agent {i+1}",
"emoji": "🎯",
"color": _COLORS[i % len(_COLORS)],
"direct_instruction": "Process {topic} in style X",
}
for i in range(n)
]
MY_PLAN = {
"system": 'Output a JSON array with {n_agents} objects, each with "name" and "instruction".',
"user": 'Topic: "{topic}". Agents: {agent_list}.',
}
MY_SYSTEM = "You are a ... Output ONLY ..."
def my_template(topic, results, agents, tasks=None):
# Build HTML from results dict
...
SCENARIOS["my_scenario"] = {
"make_agents": make_my_agents,
"plan": MY_PLAN,
"template": my_template,
"system_prompt": MY_SYSTEM,
"default_n": 10,
}
Run your new scenario using:
bash run.sh --scenario my_scenario --topic "My Topic"