MCPcopy Create free account
hub / github.com/Dizzy-K/AutoPT / build_task_request

Function build_task_request

runner/task_runner.py:47–79  ·  view source on GitHub ↗
(
    *,
    benchmark: BenchmarkItem,
    model: ModelSpec,
    ip_addr: str,
    config: AppConfig | None = None,
    prompt_bundle_name: str = "default",
    prompts: PromptBundle | None = None,
)

Source from the content-addressed store, hash-verified

45
46
47def 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
82class TaskRunner:

Callers 2

handle_runFunction · 0.90
build_task_requestsMethod · 0.85

Calls 7

bind_targetMethod · 0.95
AppConfigClass · 0.90
get_prompt_bundleFunction · 0.90
build_default_tool_specsFunction · 0.90
WorkflowContextClass · 0.90
TaskRequestClass · 0.85

Tested by

no test coverage detected