Skip to main content

autogen.agentchat.assistant_agent

AssistantAgent Objects

class AssistantAgent(ConversableAgent)

(In preview) Assistant agent, designed to solve tasks with LLM.

AssistantAgent is a subclass of ConversableAgent configured with a default system message. The default system message is designed to solve tasks with LLM, including suggesting Python code blocks and debugging. human_input_mode defaults to "NEVER" and code_execution_config defaults to False. This agent doesn't execute code by default and expects the user to execute the code.

__init__

def __init__(name: str, system_message: Optional[str] = DEFAULT_SYSTEM_MESSAGE, llm_config: Optional[Union[Dict, bool]] = None, is_termination_msg: Optional[Callable[[Dict], bool]] = None, max_consecutive_auto_reply: Optional[int] = None, human_input_mode: Optional[str] = "NEVER", code_execution_config: Optional[Union[Dict, bool]] = False, **kwargs: Dict, ,)

Arguments:

  • name str - Agent name.
  • system_message Optional[str] - System message for the ChatCompletion inference. Override this attribute if you want to reprogram the agent.
  • llm_config Optional[Union[Dict, bool]] - LLM inference configuration. Refer to autogen.Completion.create for available options.
  • is_termination_msg Optional[Callable[[Dict], bool]] - A 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".
  • max_consecutive_auto_reply Optional[int] - The maximum number of consecutive auto replies. Defaults 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".
  • **kwargs Dict - Additional keyword arguments. Refer to other kwargs in ConversableAgent.