MCPcopy Create free account
hub / github.com/ScaleML/AgentSPEX / build_agent_args

Function build_agent_args

src/harness/ephemeral/runner.py:160–186  ·  view source on GitHub ↗

Build a standard agent args namespace with YAML config fallback applied.

(
    workflow_file: str,
    model: str | None = None,
    output_dir: str | None = None,
    mcp_url: str | None = None,
    resume: bool = False,
)

Source from the content-addressed store, hash-verified

158
159
160def build_agent_args(
161 workflow_file: str,
162 model: str | None = None,
163 output_dir: str | None = None,
164 mcp_url: str | None = None,
165 resume: bool = False,
166) -> types.SimpleNamespace:
167 """Build a standard agent args namespace with YAML config fallback applied."""
168 yaml_config = load_yaml_config(workflow_file)
169 args = types.SimpleNamespace(
170 workflow_file=workflow_file,
171 mode="simple",
172 model=model,
173 max_tokens_per_step=None,
174 max_tool_calls_per_step=None,
175 temperature=None,
176 plan_revision_max_steps=None,
177 model_kwargs=None,
178 output_dir=output_dir,
179 resume=resume,
180 checkpoint_path=None,
181 trace_path=None,
182 replay_trace=None,
183 mcp_url=mcp_url,
184 )
185 apply_yaml_config_fallback(args, yaml_config)
186 return args
187
188
189def run_ephemeral(

Callers 1

_run_workflow_flowFunction · 0.90

Calls 2

load_yaml_configFunction · 0.90

Tested by

no test coverage detected