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

Method run

camel/agents/task_agent.py:382–410  ·  view source on GitHub ↗

r"""Prioritize the task list given the agent objective. Args: task_list (List[str]): The unprioritized tasks of agent. Returns: List[str]: The new prioritized task list generated by the Agent.

(
        self,
        task_list: List[str],
    )

Source from the content-addressed store, hash-verified

380 )
381
382 def run(
383 self,
384 task_list: List[str],
385 ) -> List[str]:
386 r"""Prioritize the task list given the agent objective.
387
388 Args:
389 task_list (List[str]): The unprioritized tasks of agent.
390
391 Returns:
392 List[str]: The new prioritized task list generated by the Agent.
393 """
394 task_prioritization_prompt = self.task_prioritization_prompt.format(
395 task_list=task_list
396 )
397
398 task_msg = BaseMessage.make_user_message(
399 role_name="Task Prioritizer", content=task_prioritization_prompt
400 )
401
402 task_response = self.step(task_msg)
403
404 if task_response.terminated:
405 raise RuntimeError("Task prioritization failed.")
406 if len(task_response.msgs) == 0:
407 raise RuntimeError("Got no task prioritization message.")
408
409 sub_tasks_msg = task_response.msgs[0]
410 return get_task_list(sub_tasks_msg.content)

Callers

nothing calls this directly

Calls 4

get_task_listFunction · 0.90
formatMethod · 0.45
make_user_messageMethod · 0.45
stepMethod · 0.45

Tested by

no test coverage detected