MCPcopy Create free account
hub / github.com/Virtual-Protocol/virtuals-python / create_workers

Function create_workers

src/virtuals_sdk/game/utils.py:75–95  ·  view source on GitHub ↗

API call to create workers and worker description for the task generator

(base_url: str,
                   api_key: str,
                   workers: List)

Source from the content-addressed store, hash-verified

73
74
75def create_workers(base_url: str,
76 api_key: str,
77 workers: List) -> str:
78 """
79 API call to create workers and worker description for the task generator
80 """
81
82 res = post(
83 base_url,
84 api_key,
85 endpoint="/v2/maps",
86 data={
87 "locations": [
88 {"id": w.id, "name": w.id, "description": w.worker_description}
89 for w in workers
90 ]
91 },
92 )
93
94
95 return res["id"]

Callers 1

compileMethod · 0.90

Calls 1

postFunction · 0.85

Tested by

no test coverage detected