MCPcopy Create free account
hub / github.com/THUDM/AgentTuning / __init__

Method __init__

AgentBench.old/src/tasks/composite_task.py:19–30  ·  view source on GitHub ↗
(self, **configs)

Source from the content-addressed store, hash-verified

17
18class CompositeTask(Task):
19 def __init__(self, **configs):
20 tasks = configs.pop("tasks", [])
21 self.tasks: List[Task] = []
22 super().__init__(**configs)
23 for task in tasks:
24 assert "src" in task
25 if self.workers:
26 task.update({"workers": self.workers})
27 src = os.path.join(os.path.dirname(configs["src"]), task.pop("src"))
28 sub_task = YAMLConfig.create_from_yaml(src, task)
29 sub_task.get_output_dir = (lambda s: (lambda: self._sub_output_dir(s)))(sub_task)
30 self.tasks.append(sub_task)
31
32 def evaluate(self, agent: Agent) -> Dict[str, Dict[str, Any]]:
33 print(f"Evaluating Composite Task '{self.name}' ...")

Callers

nothing calls this directly

Calls 4

_sub_output_dirMethod · 0.95
updateMethod · 0.80
joinMethod · 0.80
create_from_yamlMethod · 0.80

Tested by

no test coverage detected