🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org
Python agentai-societiesartificial-intelligencecommunicative-aicooperative-aideep-learninglarge-language-modelsmulti-agent-systemsnatural-language-processing
<a id="camel.agents.task_agent"></a>
<a id="camel.agents.task_agent.TaskSpecifyAgent"></a>
## TaskSpecifyAgent
```python
class TaskSpecifyAgent(ChatAgent):
```
An agent that specifies a given task prompt by prompting the user to
provide more details.
**Parameters:**
- **model** (BaseModelBackend, optional): The model backend to use for generating responses. (default: :obj:`OpenAIModel` with `GPT_4O_MINI`)
- **task_type** (TaskType, optional): The type of task for which to generate a prompt. (default: :obj:`TaskType.AI_SOCIETY`)
- **task_specify_prompt** (Union[str, TextPrompt], optional): The prompt for specifying the task. (default: :obj:`None`)
- **word_limit** (int, optional): The word limit for the task prompt. (default: :obj:`50`)
- **output_language** (str, optional): The language to be output by the agent. (default: :obj:`None`)
<a id="camel.agents.task_agent.TaskSpecifyAgent.__init__"></a>
### __init__
```python
def __init__(
self,
model: Optional[BaseModelBackend] = None,
task_type: TaskType = TaskType.AI_SOCIETY,
task_specify_prompt: Optional[Union[str, TextPrompt]] = None,
word_limit: int = DEFAULT_WORD_LIMIT,
output_language: Optional[str] = None
):
```
<a id="camel.agents.task_agent.TaskSpecifyAgent.run"></a>
### run
```python
def run(
self,
task_prompt: Union[str, TextPrompt],
meta_dict: Optional[Dict[str, Any]] = None
):
```
Specify the given task prompt by providing more details.
**Parameters:**
- **task_prompt** (Union[str, TextPrompt]): The original task prompt.
- **meta_dict** (Dict[str, Any], optional): A dictionary containing additional information to include in the prompt. (default: :obj:`None`)
**Returns:**
TextPrompt: The specified task prompt.
<a id="camel.agents.task_agent.TaskPlannerAgent"></a>
## TaskPlannerAgent
```python
class TaskPlannerAgent(ChatAgent):
```
An agent that helps divide a task into subtasks based on the input
task prompt.
**Parameters:**
- **model** (BaseModelBackend, optional): The model backend to use for generating responses. (default: :obj:`OpenAIModel` with `GPT_4O_MINI`)
- **output_language** (str, optional): The language to be output by the agent. (default: :obj:`None`)
<a id="camel.agents.task_agent.TaskPlannerAgent.__init__"></a>
### __init__
```python
def __init__(
self,
model: Optional[BaseModelBackend] = None,
output_language: Optional[str] = None
):
```
<a id="camel.agents.task_agent.TaskPlannerAgent.run"></a>
### run
```python
def run(self, task_prompt: Union[str, TextPrompt]):
```
Generate subtasks based on the input task prompt.
**Parameters:**
- **task_prompt** (Union[str, TextPrompt]): The prompt for the task to be divided into subtasks.
**Returns:**
TextPrompt: A prompt for the subtasks generated by the agent.
<a id="camel.agents.task_agent.TaskCreationAgent"></a>
## TaskCreationAgent
```python
class TaskCreationAgent(ChatAgent):
```
An agent that helps create new tasks based on the objective
and last completed task. Compared to :obj:`TaskPlannerAgent`,
it's still a task planner, but it has more context information
like last task and incomplete task list. Modified from
`BabyAGI <https://github.com/yoheinakajima/babyagi>`_.
**Parameters:**
- **role_name** (str): The role name of the Agent to create the task.
- **objective** (Union[str, TextPrompt]): The objective of the Agent to perform the task.
- **model** (BaseModelBackend, optional): The LLM backend to use for generating responses. (default: :obj:`OpenAIModel` with `GPT_4O_MINI`)
- **output_language** (str, optional): The language to be output by the agent. (default: :obj:`None`)
- **message_window_size** (int, optional): The maximum number of previous messages to include in the context window. If `None`, no windowing is performed. (default: :obj:`None`)
- **max_task_num** (int, optional): The maximum number of planned tasks in one round. (default: :obj:3)
<a id="camel.agents.task_agent.TaskCreationAgent.__init__"></a>
### __init__
```python
def __init__(
self,
role_name: str,
objective: Union[str, TextPrompt],
model: Optional[BaseModelBackend] = None,
output_language: Optional[str] = None,
message_window_size: Optional[int] = None,
max_task_num: Optional[int] = 3
):
```
<a id="camel.agents.task_agent.TaskCreationAgent.run"></a>
### run
```python
def run(self, task_list: List[str]):
```
Generate subtasks based on the previous task results and
incomplete task list.
**Parameters:**
- **task_list** (List[str]): The completed or in-progress tasks which should not overlap with new created tasks.
**Returns:**
List[str]: The new task list generated by the Agent.
<a id="camel.agents.task_agent.TaskPrioritizationAgent"></a>
## TaskPrioritizationAgent
```python
class TaskPrioritizationAgent(ChatAgent):
```
An agent that helps re-prioritize the task list and
returns numbered prioritized list. Modified from
`BabyAGI <https://github.com/yoheinakajima/babyagi>`_.
**Parameters:**
- **objective** (Union[str, TextPrompt]): The objective of the Agent to perform the task.
- **model** (BaseModelBackend, optional): The LLM backend to use for generating responses. (default: :obj:`OpenAIModel` with `GPT_4O_MINI`)
- **output_language** (str, optional): The language to be output by the agent. (default: :obj:`None`)
- **message_window_size** (int, optional): The maximum number of previous messages to include in the context window. If `None`, no windowing is performed. (default: :obj:`None`)
<a id="camel.agents.task_agent.TaskPrioritizationAgent.__init__"></a>
### __init__
```python
def __init__(
self,
objective: Union[str, TextPrompt],
model: Optional[BaseModelBackend] = None,
output_language: Optional[str] = None,
message_window_size: Optional[int] = None
):
```
<a id="camel.agents.task_agent.TaskPrioritizationAgent.run"></a>
### run
```python
def run(self, task_list: List[str]):
```
Prioritize the task list given the agent objective.
**Parameters:**
- **task_list** (List[str]): The unprioritized tasks of agent.
**Returns:**
List[str]: The new prioritized task list generated by the Agent.