MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / process_task

Method process_task

camel/societies/workforce/workforce.py:132–155  ·  view source on GitHub ↗

r"""The main entry point for the workforce to process a task. It will start the workforce and all the child nodes under it, process the task provided and return the updated task. Args: task (Task): The task to be processed. Returns: Task: The

(self, task: Task)

Source from the content-addressed store, hash-verified

130
131 @check_if_running(False)
132 def process_task(self, task: Task) -> Task:
133 r"""The main entry point for the workforce to process a task. It will
134 start the workforce and all the child nodes under it, process the
135 task provided and return the updated task.
136
137 Args:
138 task (Task): The task to be processed.
139
140 Returns:
141 Task: The updated task.
142 """
143 self.reset()
144 self._task = task
145 task.state = TaskState.FAILED
146 self._pending_tasks.append(task)
147 # The agent tend to be overconfident on the whole task, so we
148 # decompose the task into subtasks first
149 subtasks = self._decompose_task(task)
150 self._pending_tasks.extendleft(reversed(subtasks))
151 self.set_channel(TaskChannel())
152
153 asyncio.run(self.start())
154
155 return task
156
157 @check_if_running(False)
158 def add_single_agent_worker(

Callers

nothing calls this directly

Calls 6

resetMethod · 0.95
_decompose_taskMethod · 0.95
set_channelMethod · 0.95
startMethod · 0.95
TaskChannelClass · 0.90
runMethod · 0.45

Tested by

no test coverage detected