> ## Documentation Index
> Fetch the complete documentation index at: https://docs.camel-ai.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Camel.agents.task agent

<a id="camel.agents.task_agent" />

<a id="camel.agents.task_agent.TaskSpecifyAgent" />

## TaskSpecifyAgent

```python theme={"system"}
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__" />

### **init**

```python theme={"system"}
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" />

### run

```python theme={"system"}
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" />

## TaskPlannerAgent

```python theme={"system"}
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__" />

### **init**

```python theme={"system"}
def __init__(
    self,
    model: Optional[BaseModelBackend] = None,
    output_language: Optional[str] = None
):
```

<a id="camel.agents.task_agent.TaskPlannerAgent.run" />

### run

```python theme={"system"}
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" />

## TaskCreationAgent

```python theme={"system"}
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__" />

### **init**

```python theme={"system"}
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" />

### run

```python theme={"system"}
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" />

## TaskPrioritizationAgent

```python theme={"system"}
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__" />

### **init**

```python theme={"system"}
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" />

### run

```python theme={"system"}
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.
