Skip to content

AgentConfig

ToolkitConfig

Bases: ConfigBaseModel

Toolkit config.

Source code in utu/config/agent_config.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
class ToolkitConfig(ConfigBaseModel):
    """Toolkit config."""

    mode: Literal["builtin", "customized", "mcp"] = "builtin"
    """Toolkit mode."""
    env_mode: Literal["local", "e2b"] = "local"
    """Environment mode for the toolkit."""
    name: str | None = None
    """Toolkit name."""
    activated_tools: list[str] | None = None
    """Activated tools, if None, all tools will be activated."""
    config: dict | None = Field(default_factory=dict)
    """Specified  configs for certain toolkit. We use raw dict for simplicity"""
    config_llm: ModelConfigs | None = None  # | dict[str, ModelConfigs]
    """LLM config if used in toolkit."""
    customized_filepath: str | None = None
    """Customized toolkit filepath."""
    customized_classname: str | None = None
    """Customized toolkit classname."""
    mcp_transport: Literal["stdio", "sse", "streamable_http"] = "stdio"
    """MCP transport."""
    mcp_client_session_timeout_seconds: int = 20
    """The read timeout passed to the MCP ClientSession. We set it bigger to avoid timeout expections."""

mode class-attribute instance-attribute

mode: Literal['builtin', 'customized', 'mcp'] = 'builtin'

Toolkit mode.

env_mode class-attribute instance-attribute

env_mode: Literal['local', 'e2b'] = 'local'

Environment mode for the toolkit.

name class-attribute instance-attribute

name: str | None = None

Toolkit name.

activated_tools class-attribute instance-attribute

activated_tools: list[str] | None = None

Activated tools, if None, all tools will be activated.

config class-attribute instance-attribute

config: dict | None = Field(default_factory=dict)

Specified configs for certain toolkit. We use raw dict for simplicity

config_llm class-attribute instance-attribute

config_llm: ModelConfigs | None = None

LLM config if used in toolkit.

customized_filepath class-attribute instance-attribute

customized_filepath: str | None = None

Customized toolkit filepath.

customized_classname class-attribute instance-attribute

customized_classname: str | None = None

Customized toolkit classname.

mcp_transport class-attribute instance-attribute

mcp_transport: Literal[
    "stdio", "sse", "streamable_http"
] = "stdio"

MCP transport.

mcp_client_session_timeout_seconds class-attribute instance-attribute

mcp_client_session_timeout_seconds: int = 20

The read timeout passed to the MCP ClientSession. We set it bigger to avoid timeout expections.

AgentConfig

Bases: ConfigBaseModel

Overall agent config

Source code in utu/config/agent_config.py
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
class AgentConfig(ConfigBaseModel):
    """Overall agent config"""

    type: Literal["simple", "orchestra", "orchestrator", "workforce"] = "simple"
    """Agent type"""

    # simple agent config
    model: ModelConfigs = Field(default_factory=ModelConfigs)
    """Model config, with model_provider, model_settings, model_params"""
    agent: ProfileConfig = Field(default_factory=ProfileConfig)
    """Agent profile config"""
    context_manager: ContextManagerConfig = Field(default_factory=ContextManagerConfig)
    """Context manager config"""
    env: EnvConfig = Field(default_factory=EnvConfig)
    """Env config"""
    enabled_skills: list[str] = Field(default_factory=list)
    """Enabled skills for this agent, only available when env=`shell_local` for now."""
    toolkits: dict[str, ToolkitConfig] = Field(default_factory=dict)
    """Toolkits config"""
    max_turns: int = 50
    """Max turns for simple agent. This param is derived from @openai-agents"""
    stop_at_tool_names: list[str] | None = None
    """Stop at tools for simple agent. This param is derived from @openai-agents"""
    runner: Literal["openai", "react"] = "openai"
    """Runner name for simple agent."""

    # orchestra agent config
    planner_model: ModelConfigs = Field(default_factory=ModelConfigs)
    """Planner model config"""
    planner_config: dict = Field(default_factory=dict)
    """Planner config (dict)\n
    - `examples_path`: path to planner examples json file"""
    workers: dict[str, "AgentConfig"] = Field(default_factory=dict)
    """Workers config"""
    workers_info: list[dict] = Field(default_factory=list)
    """Workers info, list of {name, desc, strengths, weaknesses}\n
    - `name`: worker name
    - `desc`: worker description
    - `strengths`: worker strengths
    - `weaknesses`: worker weaknesses"""
    reporter_model: ModelConfigs = Field(default_factory=ModelConfigs)
    """Reporter model config"""
    reporter_config: dict = Field(default_factory=dict)
    """Reporter config (dict)\n
    - `template_path`: template Jinja2 file path, with `question` and `trajectory` variables"""

    # workforce agent config
    workforce_planner_model: ModelConfigs = Field(default_factory=ModelConfigs)
    """Workforce planner model config"""
    workforce_planner_config: dict = Field(default_factory=dict)
    """Workforce planner config (dict)"""
    workforce_assigner_model: ModelConfigs = Field(default_factory=ModelConfigs)
    """Workforce assigner model config"""
    workforce_assigner_config: dict = Field(default_factory=dict)
    """Workforce assigner config (dict)"""
    workforce_answerer_model: ModelConfigs = Field(default_factory=ModelConfigs)
    """Workforce answerer model config"""
    workforce_answerer_config: dict = Field(default_factory=dict)
    """Workforce answerer config (dict)"""
    workforce_executor_agents: dict[str, "AgentConfig"] = Field(default_factory=dict)
    """Workforce executor agents config"""
    workforce_executor_config: dict = Field(default_factory=dict)
    """Workforce executor config (dict)"""
    workforce_executor_infos: list[dict] = Field(default_factory=list)
    """Workforce executor infos, list of {name, desc, strengths, weaknesses}"""

    # orchestrator agent config
    orchestrator_router: "AgentConfig" = None
    """Orchestrator router agent config"""
    orchestrator_config: dict = Field(default_factory=dict)
    """Orchestrator config (dict)\n
    - `name`: name of the orchestrator-workers system
    - `examples_path`: path to planner examples. default utu/data/plan_examples/chain.json
    - `additional_instructions`: additional instructions for planner
    - `add_chitchat_subagent`: whether to add chitchat subagent. default True"""
    orchestrator_model: ModelConfigs = Field(default_factory=ModelConfigs)
    """Planner model config"""
    orchestrator_workers: dict[str, "AgentConfig"] = Field(default_factory=dict)
    """Workers config"""
    orchestrator_workers_info: list[dict] = Field(default_factory=list)
    """Workers info, list of {name, description}"""

    @model_validator(mode="after")
    def validate_enabled_skills(self):
        """Validate that enabled_skills is used with correct env and context_manager settings."""
        if not self.enabled_skills:
            return self

        # Check env is shell_local
        if not self.env or self.env.name != "shell_local":
            logger.warning(
                "enabled_skills requires env.name='shell_local'. "
                f"Current env: {self.env.name if self.env else None}. "
                "Skills may not work properly."
            )

        # Check context_manager is env
        if not self.context_manager or self.context_manager.name != "env":
            logger.warning(
                "enabled_skills requires context_manager.name='env' for skill prompts to be injected. "
                f"Current context_manager: {self.context_manager.name if self.context_manager else None}. "
                "Skills may not work properly."
            )

        return self

type class-attribute instance-attribute

type: Literal[
    "simple", "orchestra", "orchestrator", "workforce"
] = "simple"

Agent type

model class-attribute instance-attribute

model: ModelConfigs = Field(default_factory=ModelConfigs)

Model config, with model_provider, model_settings, model_params

agent class-attribute instance-attribute

agent: ProfileConfig = Field(default_factory=ProfileConfig)

Agent profile config

context_manager class-attribute instance-attribute

context_manager: ContextManagerConfig = Field(
    default_factory=ContextManagerConfig
)

Context manager config

env class-attribute instance-attribute

env: EnvConfig = Field(default_factory=EnvConfig)

Env config

enabled_skills class-attribute instance-attribute

enabled_skills: list[str] = Field(default_factory=list)

Enabled skills for this agent, only available when env=shell_local for now.

toolkits class-attribute instance-attribute

toolkits: dict[str, ToolkitConfig] = Field(
    default_factory=dict
)

Toolkits config

max_turns class-attribute instance-attribute

max_turns: int = 50

Max turns for simple agent. This param is derived from @openai-agents

stop_at_tool_names class-attribute instance-attribute

stop_at_tool_names: list[str] | None = None

Stop at tools for simple agent. This param is derived from @openai-agents

runner class-attribute instance-attribute

runner: Literal['openai', 'react'] = 'openai'

Runner name for simple agent.

planner_model class-attribute instance-attribute

planner_model: ModelConfigs = Field(
    default_factory=ModelConfigs
)

Planner model config

planner_config class-attribute instance-attribute

planner_config: dict = Field(default_factory=dict)

Planner config (dict)

  • examples_path: path to planner examples json file

workers class-attribute instance-attribute

workers: dict[str, AgentConfig] = Field(
    default_factory=dict
)

Workers config

workers_info class-attribute instance-attribute

workers_info: list[dict] = Field(default_factory=list)

Workers info, list of {name, desc, strengths, weaknesses}

  • name: worker name
  • desc: worker description
  • strengths: worker strengths
  • weaknesses: worker weaknesses

reporter_model class-attribute instance-attribute

reporter_model: ModelConfigs = Field(
    default_factory=ModelConfigs
)

Reporter model config

reporter_config class-attribute instance-attribute

reporter_config: dict = Field(default_factory=dict)

Reporter config (dict)

  • template_path: template Jinja2 file path, with question and trajectory variables

workforce_planner_model class-attribute instance-attribute

workforce_planner_model: ModelConfigs = Field(
    default_factory=ModelConfigs
)

Workforce planner model config

workforce_planner_config class-attribute instance-attribute

workforce_planner_config: dict = Field(default_factory=dict)

Workforce planner config (dict)

workforce_assigner_model class-attribute instance-attribute

workforce_assigner_model: ModelConfigs = Field(
    default_factory=ModelConfigs
)

Workforce assigner model config

workforce_assigner_config class-attribute instance-attribute

workforce_assigner_config: dict = Field(
    default_factory=dict
)

Workforce assigner config (dict)

workforce_answerer_model class-attribute instance-attribute

workforce_answerer_model: ModelConfigs = Field(
    default_factory=ModelConfigs
)

Workforce answerer model config

workforce_answerer_config class-attribute instance-attribute

workforce_answerer_config: dict = Field(
    default_factory=dict
)

Workforce answerer config (dict)

workforce_executor_agents class-attribute instance-attribute

workforce_executor_agents: dict[str, AgentConfig] = Field(
    default_factory=dict
)

Workforce executor agents config

workforce_executor_config class-attribute instance-attribute

workforce_executor_config: dict = Field(
    default_factory=dict
)

Workforce executor config (dict)

workforce_executor_infos class-attribute instance-attribute

workforce_executor_infos: list[dict] = Field(
    default_factory=list
)

Workforce executor infos, list of {name, desc, strengths, weaknesses}

orchestrator_router class-attribute instance-attribute

orchestrator_router: AgentConfig = None

Orchestrator router agent config

orchestrator_config class-attribute instance-attribute

orchestrator_config: dict = Field(default_factory=dict)

Orchestrator config (dict)

  • name: name of the orchestrator-workers system
  • examples_path: path to planner examples. default utu/data/plan_examples/chain.json
  • additional_instructions: additional instructions for planner
  • add_chitchat_subagent: whether to add chitchat subagent. default True

orchestrator_model class-attribute instance-attribute

orchestrator_model: ModelConfigs = Field(
    default_factory=ModelConfigs
)

Planner model config

orchestrator_workers class-attribute instance-attribute

orchestrator_workers: dict[str, AgentConfig] = Field(
    default_factory=dict
)

Workers config

orchestrator_workers_info class-attribute instance-attribute

orchestrator_workers_info: list[dict] = Field(
    default_factory=list
)

Workers info, list of {name, description}

validate_enabled_skills

validate_enabled_skills()

Validate that enabled_skills is used with correct env and context_manager settings.

Source code in utu/config/agent_config.py
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
@model_validator(mode="after")
def validate_enabled_skills(self):
    """Validate that enabled_skills is used with correct env and context_manager settings."""
    if not self.enabled_skills:
        return self

    # Check env is shell_local
    if not self.env or self.env.name != "shell_local":
        logger.warning(
            "enabled_skills requires env.name='shell_local'. "
            f"Current env: {self.env.name if self.env else None}. "
            "Skills may not work properly."
        )

    # Check context_manager is env
    if not self.context_manager or self.context_manager.name != "env":
        logger.warning(
            "enabled_skills requires context_manager.name='env' for skill prompts to be injected. "
            f"Current context_manager: {self.context_manager.name if self.context_manager else None}. "
            "Skills may not work properly."
        )

    return self