Camel.agents.task agent
TaskSpecifyAgent
An agent that specifies a given task prompt by prompting the user to provide more details.
Attributes: DEFAULT_WORD_LIMIT (int): The default word limit for the task prompt. task_specify_prompt (TextPrompt): The prompt for specifying the task.
Parameters:
- model (BaseModelBackend, optional): The model backend to use for generating responses. (default: :obj:
OpenAIModel
withGPT_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
)
init
run
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.
TaskPlannerAgent
An agent that helps divide a task into subtasks based on the input task prompt.
Attributes: task_planner_prompt (TextPrompt): A prompt for the agent to divide the task into subtasks.
Parameters:
- model (BaseModelBackend, optional): The model backend to use for generating responses. (default: :obj:
OpenAIModel
withGPT_4O_MINI
) - output_language (str, optional): The language to be output by the agent. (default: :obj:
None
)
init
run
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.
TaskCreationAgent
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>
_.
Attributes: task_creation_prompt (TextPrompt): A prompt for the agent to create new tasks.
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
withGPT_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)
init
run
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.
TaskPrioritizationAgent
An agent that helps re-prioritize the task list and
returns numbered prioritized list. Modified from
BabyAGI <https://github.com/yoheinakajima/babyagi>
_.
Attributes: task_prioritization_prompt (TextPrompt): A prompt for the agent to prioritize tasks.
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
withGPT_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
)
init
run
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.