CaptainAgent

CaptainAgent(
    name: str,
    system_message: str | None = None,
    llm_config: dict | Literal[False] | None = None,
    is_termination_msg: Callable[[dict], bool] | None = None,
    max_consecutive_auto_reply: int | None = None,
    human_input_mode: str | None = 'NEVER',
    code_execution_config: dict | Literal[False] | None = False,
    nested_config: dict | None = None,
    agent_lib: str | None = None,
    tool_lib: str | None = None,
    agent_config_save_path: str | None = None,
    description: str | None = 'A helpful AI assistant that can build a group of agents at a proper time to solve a task.',
    **kwargs
)

(In preview) Captain agent, designed to solve a task with an agent or a group of agents.

Parameters:
NameDescription
nameagent name.

Type: str
system_messagesystem message for the ChatCompletion inference.

Please override this attribute if you want to reprogram the agent.

Type: str | None

Default: None
llm_configllm inference configuration.

Please refer to OpenAIWrapper.create for available options.

Type: dict | Literal[False] | None

Default: None
is_termination_msga function that takes a message in the form of a dictionary and returns a boolean value indicating if this received message is a termination message.

The dict can contain the following keys: “content”, “role”, “name”, “function_call”.

Type: Callable[[dict], bool] | None

Default: None
max_consecutive_auto_replythe maximum number of consecutive auto replies.

default to None (no limit provided, class attribute MAX_CONSECUTIVE_AUTO_REPLY will be used as the limit in this case).

The limit only plays a role when human_input_mode is not “ALWAYS”.

Type: int | None

Default: None
human_input_modeType: str | None

Default: ‘NEVER’
code_execution_configType: dict | Literal[False] | None

Default: False
nested_configthe configuration for the nested chat instantiated by CaptainAgent.

A full list of keys and their functionalities can be found in docs.

Type: dict | None

Default: None
agent_libthe path or a JSON file of the agent library for retrieving the nested chat instantiated by CaptainAgent.

Type: str | None

Default: None
tool_libthe path to the tool library for retrieving the tools used in the nested chat instantiated by CaptainAgent.

Type: str | None

Default: None
agent_config_save_paththe path to save the generated or retrieved agent configuration.

Type: str | None

Default: None
descriptionType: str | None

Default: ‘A helpful AI assistant that can build a group of agents at a proper time to solve a task.‘
**kwargsPlease refer to other kwargs in ConversableAgent.

Class Attributes

AUTOBUILD_SYSTEM_MESSAGE



AUTOBUILD_TOOL



DEFAULT_DESCRIPTION



DEFAULT_NESTED_CONFIG



DEFAULT_SUMMARY_PROMPT