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

Method from_args

src/harness/types/config.py:59–80  ·  view source on GitHub ↗

Create EffectiveArgs from an argparse namespace or similar object. Args: args: The original args object (typically from argparse) Returns: New EffectiveArgs instance with values from args

(cls, args)

Source from the content-addressed store, hash-verified

57
58 @classmethod
59 def from_args(cls, args) -> "EffectiveArgs":
60 """
61 Create EffectiveArgs from an argparse namespace or similar object.
62
63 Args:
64 args: The original args object (typically from argparse)
65
66 Returns:
67 New EffectiveArgs instance with values from args
68 """
69 return cls(
70 model=getattr(args, "model", "gpt-4.1-mini"),
71 api_base=getattr(args, "api_base", None),
72 max_tokens_per_step=getattr(args, "max_tokens_per_step", 100000),
73 max_tool_calls_per_step=getattr(args, "max_tool_calls_per_step", 10),
74 temperature=getattr(args, "temperature", 0.2),
75 model_kwargs=getattr(args, "model_kwargs", None) or {},
76 context_threshold=getattr(args, "context_threshold", 0.6),
77 plan_revision_max_steps=getattr(args, "plan_revision_max_steps", 0),
78 workflow_file=getattr(args, "workflow_file", None),
79 _original_args=args,
80 )
81
82 def with_yaml_config(self, yaml_config: Dict[str, Any]) -> "EffectiveArgs":
83 """

Calls

no outgoing calls