Represents a message between agents, extending BaseMessage.
This class extends the standard CAMEL BaseMessage with additional attributes needed for inter-agent communication.
A toolkit for agent-to-agent communication in multi-agent systems.
Enables agents to send messages to each other with message history tracking and integration with the CAMEL workforce system.
Parameters:
None
)None
)100
)False
)Register a new agent for communication.
Parameters:
Returns:
str: Confirmation message with registration details.
Find agent ID with flexible matching (case-insensitive, partial matches).
Sends a message to a specific agent.
This function allows one agent to communicate directly with another by
sending a message. The toolkit’s get_response setting determines
whether to get an immediate response or just send a notification. To
get the receiver_id
of the agent you want to communicate with, you
can use the list_available_agents
tool.
Parameters:
list_available_agents()
to find the ID of the agent you want to talk to."system"
)None
)None
)Returns:
str: A confirmation that the message was sent. If the toolkit’s get_response setting is True, includes the response from the receiving agent.
Deliver a message to the target agent, optionally getting a response.
Sends a message to all other agents in the system.
This function is useful for making announcements or sending information
that every agent needs. The message will be sent to all registered
agents except for the sender and any agents specified in the
exclude_agents
list.
Parameters:
"system"
)None
)Returns:
str: A summary of the broadcast, showing which agents received the message and their responses.
Retrieves the message history for a specific agent.
This function allows you to see the messages sent and received by a
particular agent, which can be useful for understanding past
conversations. To get the agent_id
for another agent, use the
list_available_agents
tool. You can also use this tool to get
your own message history by providing your agent ID.
Parameters:
list_available_agents()
to find available agent IDs.None
)Returns:
str: A formatted string containing the message history for the specified agent, or an error if the agent is not found.
Retrieves a full conversation thread based on a message ID.
When you send a message that is a reply to another, it creates a
conversation thread. This function lets you retrieve all messages
that are part of that thread. You can find message IDs in the
message history or from the output of the send_message
tool.
Parameters:
Returns:
str: A formatted string containing all messages in the conversation, sorted by time, or an error if the thread is not found.
Returns:
str: A formatted string listing the IDs and status of all available agents.
Remove an agent from the communication registry.
Parameters:
Returns:
str: Confirmation message with cleanup details.
Returns:
str: Detailed status information including metrics and queue state.
Add a message to the history with size management.
Update conversation threading.
Returns a list of FunctionTool objects representing the communication functions in the toolkit.
Returns:
List[FunctionTool]: A list of FunctionTool objects for agent communication and management.