> ## 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.societies.babyagi playing

<a id="camel.societies.babyagi_playing" />

<a id="camel.societies.babyagi_playing.BabyAGI" />

## BabyAGI

```python theme={"system"}
class BabyAGI:
```

The BabyAGI Agent adapted from ["Task-driven Autonomous Agent"](https://github.com/yoheinakajima/babyagi).

**Parameters:**

* **assistant\_role\_name** (str): The name of the role played by the assistant.
* **user\_role\_name** (str): The name of the role played by the user.
* **task\_prompt** (str, optional): A prompt for the task to be performed. (default: :obj:`""`)
* **task\_type** (TaskType, optional): The type of task to perform. (default: :obj:`TaskType.AI_SOCIETY`)
* **max\_task\_history** (int): The maximum number of previous tasks information to include in the task agent. (default: :obj:10)
* **assistant\_agent\_kwargs** (Dict, optional): Additional arguments to pass to the assistant agent. (default: :obj:`None`)
* **task\_specify\_agent\_kwargs** (Dict, optional): Additional arguments to pass to the task specify agent. (default: :obj:`None`)
* **task\_creation\_agent\_kwargs** (Dict, optional): Additional arguments to pass to the task creation agent. (default: :obj:`None`)
* **task\_prioritization\_agent\_kwargs** (Dict, optional): Additional arguments to pass to the task prioritization agent. (default: :obj:`None`)
* **sys\_msg\_generator\_kwargs** (Dict, optional): Additional arguments to pass to the system message generator. (default: :obj:`None`)
* **extend\_task\_specify\_meta\_dict** (Dict, optional): A dict to extend the task specify meta dict with. (default: :obj:`None`)
* **output\_language** (str, optional): The language to be output by the agents. (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.societies.babyagi_playing.BabyAGI.__init__" />

### **init**

```python theme={"system"}
def __init__(
    self,
    assistant_role_name: str,
    user_role_name: str,
    task_prompt: str = '',
    task_type: TaskType = TaskType.AI_SOCIETY,
    max_task_history: int = 10,
    assistant_agent_kwargs: Optional[Dict] = None,
    task_specify_agent_kwargs: Optional[Dict] = None,
    task_creation_agent_kwargs: Optional[Dict] = None,
    task_prioritization_agent_kwargs: Optional[Dict] = None,
    sys_msg_generator_kwargs: Optional[Dict] = None,
    extend_task_specify_meta_dict: Optional[Dict] = None,
    output_language: Optional[str] = None,
    message_window_size: Optional[int] = None
):
```

<a id="camel.societies.babyagi_playing.BabyAGI.init_specified_task_prompt" />

### init\_specified\_task\_prompt

```python theme={"system"}
def init_specified_task_prompt(
    self,
    assistant_role_name: str,
    user_role_name: str,
    task_specify_agent_kwargs: Optional[Dict],
    extend_task_specify_meta_dict: Optional[Dict],
    output_language: Optional[str]
):
```

Use a task specify agent to generate a specified task prompt.
Generated specified task prompt will be used to replace original
task prompt. If there is no task specify agent, specified task
prompt will not be generated.

**Parameters:**

* **assistant\_role\_name** (str): The name of the role played by the assistant.
* **user\_role\_name** (str): The name of the role played by the user.
* **task\_specify\_agent\_kwargs** (Dict, optional): Additional arguments to pass to the task specify agent.
* **extend\_task\_specify\_meta\_dict** (Dict, optional): A dict to extend the task specify meta dict with.
* **output\_language** (str, optional): The language to be output by the agents.

<a id="camel.societies.babyagi_playing.BabyAGI.init_agents" />

### init\_agents

```python theme={"system"}
def init_agents(
    self,
    init_assistant_sys_msg: BaseMessage,
    assistant_agent_kwargs: Optional[Dict],
    task_creation_agent_kwargs: Optional[Dict],
    task_prioritization_agent_kwargs: Optional[Dict],
    output_language: Optional[str],
    message_window_size: Optional[int] = None
):
```

Initialize assistant and user agents with their system messages.

**Parameters:**

* **init\_assistant\_sys\_msg** (BaseMessage): Assistant agent's initial system message.
* **assistant\_agent\_kwargs** (Dict, optional): Additional arguments to pass to the assistant agent.
* **task\_creation\_agent\_kwargs** (Dict, optional): Additional arguments to pass to the task creation agent.
* **task\_prioritization\_agent\_kwargs** (Dict, optional): Additional arguments to pass to the task prioritization agent.
* **output\_language** (str, optional): The language to be output by the agents.
* **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.societies.babyagi_playing.BabyAGI.step" />

### step

```python theme={"system"}
def step(self):
```

**Returns:**

ChatAgentResponse: it contains the resulting assistant message,
whether the assistant agent terminated the conversation,
and any additional assistant information.
