File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 11import os
22from pathlib import Path
33
4+ from claude_agent_sdk import AgentDefinition
45import yaml
56from pydantic import BaseModel , Field
67
1213class AgentConfig (BaseModel ):
1314 description : str
1415 prompt : str
15- mcp_servers : list [str ] = Field ( default_factory = list )
16- disallowed_tools : list [str ] = Field ( default_factory = list )
16+ tools : list [str ] | None = None
17+ model : list [str ] | None = None
1718
1819
1920class MCPServerConfig (BaseModel ):
@@ -63,10 +64,17 @@ def load_config(
6364 base_system_prompt = load_prompt (raw_config ["system_prompt" ])
6465
6566 if raw_config .get ("agents" ):
66- for agent_config in raw_config ["agents" ].values ():
67+ for agent_name , agent_config in raw_config ["agents" ].items ():
6768 if agent_config .get ("prompt" ):
6869 agent_config ["prompt" ] = load_prompt (agent_config ["prompt" ])
6970
71+ raw_config ["agents" ][agent_name ] = AgentDefinition (
72+ description = agent_config ["description" ],
73+ prompt = agent_config ["prompt" ],
74+ tools = agent_config ["tools" ],
75+ model = agent_config ["model" ],
76+ )
77+
7078 mcp_server_prompts = []
7179
7280 if raw_config .get ("mcp_servers" ):
You can’t perform that action at this time.
0 commit comments