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

Method set_task

src/virtuals_sdk/game/worker.py:65–83  ·  view source on GitHub ↗

Sets the task for the agent

(self, task: str)

Source from the content-addressed store, hash-verified

63 self._function_result: Optional[FunctionResult] = None
64
65 def set_task(self, task: str):
66 """
67 Sets the task for the agent
68 """
69 set_task_response = post(
70 base_url=self._base_url,
71 api_key=self._api_key,
72 endpoint=f"/v2/agents/{self._agent_id}/tasks",
73 data={"task": task},
74 )
75 # response_json = set_task_response.json()
76
77 # if set_task_response.status_code != 200:
78 # raise ValueError(f"Failed to assign task: {response_json}")
79
80 # task ID
81 self._submission_id = set_task_response["submission_id"]
82
83 return self._submission_id
84
85 def _get_action(
86 self,

Callers 1

runMethod · 0.95

Calls 1

postFunction · 0.90

Tested by

no test coverage detected