(
*,
benchmark: BenchmarkItem,
model: ModelSpec,
ip_addr: str,
config: AppConfig | None = None,
prompt_bundle_name: str = "default",
prompts: PromptBundle | None = None,
)
| 45 | |
| 46 | |
| 47 | def build_task_request( |
| 48 | *, |
| 49 | benchmark: BenchmarkItem, |
| 50 | model: ModelSpec, |
| 51 | ip_addr: str, |
| 52 | config: AppConfig | None = None, |
| 53 | prompt_bundle_name: str = "default", |
| 54 | prompts: PromptBundle | None = None, |
| 55 | ) -> TaskRequest: |
| 56 | app_config = config or AppConfig() |
| 57 | prompt_bundle = prompts or get_prompt_bundle(prompt_bundle_name, benchmark=benchmark) |
| 58 | tool_specs = build_default_tool_specs(runtime_config=app_config.runtime, tools_config=app_config.tools) |
| 59 | context = WorkflowContext( |
| 60 | benchmark_name=benchmark.name, |
| 61 | config=app_config, |
| 62 | benchmark=benchmark, |
| 63 | ) |
| 64 | context.bind_target(ip_addr, benchmark.target) |
| 65 | workflow = build_workflow_definition( |
| 66 | context=context, |
| 67 | prompts=prompt_bundle, |
| 68 | tool_specs=tool_specs, |
| 69 | metadata={"benchmark_name": benchmark.name, "model_alias": model.alias}, |
| 70 | ) |
| 71 | return TaskRequest( |
| 72 | benchmark=benchmark, |
| 73 | model=model, |
| 74 | ip_addr=ip_addr, |
| 75 | prompts=prompt_bundle, |
| 76 | workflow=workflow, |
| 77 | prompt_bundle_name=prompt_bundle_name, |
| 78 | config=app_config, |
| 79 | ) |
| 80 | |
| 81 | |
| 82 | class TaskRunner: |
no test coverage detected