()
| 142 | json.dump(by_agent, f, ensure_ascii=False, indent=2) |
| 143 | |
| 144 | async def main(): |
| 145 | args = parse_args() |
| 146 | output_dir = Path(args.output_dir).expanduser() |
| 147 | output_dir.mkdir(parents=True, exist_ok=True) |
| 148 | agent_names = [name for name, num in zip(args.agent_names, args.agent_nums) for _ in range(num)] |
| 149 | kwargs = get_kwargs(args.mode, len(agent_names)) |
| 150 | kv_config = KVCommConfig.from_env().apply_overrides( |
| 151 | threshold=args.kv_threshold, |
| 152 | max_anchor_num=args.kv_max_anchor_num, |
| 153 | window_size=args.kv_window_size, |
| 154 | thread_pool_workers=args.kv_thread_workers, |
| 155 | worker_timeout=args.kv_worker_timeout, |
| 156 | ) |
| 157 | |
| 158 | graph = Graph( |
| 159 | domain=args.domain, |
| 160 | llm_name=args.llm_name, |
| 161 | agent_names=agent_names, |
| 162 | kv_config=kv_config, |
| 163 | **kwargs, |
| 164 | ) |
| 165 | |
| 166 | eval_kwargs = { |
| 167 | "prefix": args.prefix, |
| 168 | "output_dir": str(output_dir), |
| 169 | } |
| 170 | |
| 171 | configure_logging(log_path=output_dir / "logs/log.txt") |
| 172 | _ = await evaluate( |
| 173 | graph=graph, |
| 174 | mode=args.execution_mode, |
| 175 | samples=args.samples, |
| 176 | **eval_kwargs, |
| 177 | ) |
| 178 | |
| 179 | |
| 180 | def get_kwargs( |
no test coverage detected