refactor: remove model parameter from delegate_task function
Eliminated the model parameter from the delegate_task function and its associated schema, defaulting to None for subagent calls. This change simplifies the function signature and enforces consistent behavior across task delegation.
This commit is contained in:
parent
5a711f32b1
commit
fb0f579b16
1 changed files with 2 additions and 11 deletions
|
|
@ -293,7 +293,6 @@ def delegate_task(
|
||||||
context: Optional[str] = None,
|
context: Optional[str] = None,
|
||||||
toolsets: Optional[List[str]] = None,
|
toolsets: Optional[List[str]] = None,
|
||||||
tasks: Optional[List[Dict[str, Any]]] = None,
|
tasks: Optional[List[Dict[str, Any]]] = None,
|
||||||
model: Optional[str] = None,
|
|
||||||
max_iterations: Optional[int] = None,
|
max_iterations: Optional[int] = None,
|
||||||
parent_agent=None,
|
parent_agent=None,
|
||||||
) -> str:
|
) -> str:
|
||||||
|
|
@ -355,7 +354,7 @@ def delegate_task(
|
||||||
goal=t["goal"],
|
goal=t["goal"],
|
||||||
context=t.get("context"),
|
context=t.get("context"),
|
||||||
toolsets=t.get("toolsets") or toolsets,
|
toolsets=t.get("toolsets") or toolsets,
|
||||||
model=model,
|
model=None,
|
||||||
max_iterations=effective_max_iter,
|
max_iterations=effective_max_iter,
|
||||||
parent_agent=parent_agent,
|
parent_agent=parent_agent,
|
||||||
task_count=1,
|
task_count=1,
|
||||||
|
|
@ -380,7 +379,7 @@ def delegate_task(
|
||||||
goal=t["goal"],
|
goal=t["goal"],
|
||||||
context=t.get("context"),
|
context=t.get("context"),
|
||||||
toolsets=t.get("toolsets") or toolsets,
|
toolsets=t.get("toolsets") or toolsets,
|
||||||
model=model,
|
model=None,
|
||||||
max_iterations=effective_max_iter,
|
max_iterations=effective_max_iter,
|
||||||
parent_agent=parent_agent,
|
parent_agent=parent_agent,
|
||||||
task_count=n_tasks,
|
task_count=n_tasks,
|
||||||
|
|
@ -533,13 +532,6 @@ DELEGATE_TASK_SCHEMA = {
|
||||||
"When provided, top-level goal/context/toolsets are ignored."
|
"When provided, top-level goal/context/toolsets are ignored."
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
"model": {
|
|
||||||
"type": "string",
|
|
||||||
"description": (
|
|
||||||
"Model override for the subagent(s). Omit to use your "
|
|
||||||
"same model. Use a cheaper/faster model for simple subtasks."
|
|
||||||
),
|
|
||||||
},
|
|
||||||
"max_iterations": {
|
"max_iterations": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"description": (
|
"description": (
|
||||||
|
|
@ -565,7 +557,6 @@ registry.register(
|
||||||
context=args.get("context"),
|
context=args.get("context"),
|
||||||
toolsets=args.get("toolsets"),
|
toolsets=args.get("toolsets"),
|
||||||
tasks=args.get("tasks"),
|
tasks=args.get("tasks"),
|
||||||
model=args.get("model"),
|
|
||||||
max_iterations=args.get("max_iterations"),
|
max_iterations=args.get("max_iterations"),
|
||||||
parent_agent=kw.get("parent_agent")),
|
parent_agent=kw.get("parent_agent")),
|
||||||
check_fn=check_delegate_requirements,
|
check_fn=check_delegate_requirements,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue