Skip to content

WhatsAppAgent

fastagency.runtimes.autogen.agents.whatsapp.WhatsAppAgent #

WhatsAppAgent(
    *args: Any,
    name: str,
    llm_config: dict[str, Any],
    executor: Union[
        ConversableAgent, list[ConversableAgent]
    ],
    sender: str,
    whatsapp_api_key: str,
    **kwargs: Any
)

Bases: AssistantAgent

Initialize the WhatsAppAgent.

PARAMETER DESCRIPTION
*args

The positional arguments.

TYPE: Any DEFAULT: ()

name

The name of the agent.

TYPE: str

llm_config

The LLM configuration.

TYPE: dict[str, Any]

executor

The executor agent(s).

TYPE: Union[ConversableAgent, list[ConversableAgent]]

sender

Number of the sender for WhatsApp API.

TYPE: str

whatsapp_api_key

The WhatsApp API key

TYPE: str

**kwargs

The keyword arguments.

TYPE: Any DEFAULT: {}

Source code in fastagency/runtimes/autogen/agents/whatsapp.py
def __init__(
    self,
    *args: Any,
    name: str,
    llm_config: dict[str, Any],
    executor: Union[ConversableAgent, list[ConversableAgent]],
    sender: str,
    whatsapp_api_key: str,
    **kwargs: Any,
):
    """Initialize the WhatsAppAgent.

    Args:
        *args (Any): The positional arguments.
        name (str): The name of the agent.
        llm_config (dict[str, Any]): The LLM configuration.
        executor (Union[ConversableAgent, list[ConversableAgent]]): The executor agent(s).
        sender (str): Number of the sender for WhatsApp API.
        whatsapp_api_key (str): The WhatsApp API key
        **kwargs (Any): The keyword arguments.
    """
    super().__init__(
        *args,
        name=name,
        system_message=WHATSAPP_SYSTEM_MESSAGE.format(sender=sender),
        llm_config=llm_config,
        **kwargs,
    )
    self.whatsapp_tool = WhatsAppTool(
        whatsapp_api_key=whatsapp_api_key,
    )

    self.whatsapp_tool.register(caller=self, executor=executor)

whatsapp_tool instance-attribute #

whatsapp_tool = WhatsAppTool(
    whatsapp_api_key=whatsapp_api_key
)