Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for multi-agent communication #4

Merged
merged 3 commits into from
Jan 30, 2025

Conversation

Thytu
Copy link
Owner

@Thytu Thytu commented Jan 30, 2025

Overview

This PR enhances the agent communication system by adding support for multi-agent messaging, allowing an agent to send messages to multiple recipients simultaneously. It also includes several improvements to error handling and message formatting.

Key Changes

  • Added support for sending messages to multiple agents at once via talk_to method
  • Enhanced error handling for agent communication with better error messages
  • Improved message formatting for both single and multi-agent conversations
  • Added reminder in prompt template to close XML tags
  • Fixed return type annotations for ask and talk_to methods
  • Bumped version from 0.3.0 to 0.3.1

Implementation Details

  • Modified Interaction class to store receivers as a list of agents
  • Updated AgentInteractionManager to handle multiple receivers
  • Added support for "all" keyword to broadcast messages to all agents
  • Enhanced error messages for invalid agent IDs
  • Improved string representation of interactions for better readability

Testing

  • Added new test cases for multi-agent communication
  • Updated existing tests to accommodate the new receiver list format
  • Added tests for manual and automatic action execution

Breaking Changes

None. All changes are backward compatible as single-agent communication continues to work as before.

Thytu added 3 commits January 25, 2025 12:05
- Split Interaction class into OneToOneInteraction and OneToManyInteraction
- Update AgentInteractionManager to handle group messages
- Modify talk action to support multiple receivers via comma-separated IDs
- Add all keyword to broadcast messages to all agents
- Update type hints and documentation throughout

Signed-off-by: Valentin De Matos <[email protected]>
Update talk_to method to return the result of execute_action instead of
implicitly returning None. This allows callers to access any response
data from the talk action.

Signed-off-by: Valentin De Matos <[email protected]>
@Thytu Thytu self-assigned this Jan 30, 2025
@Thytu Thytu merged commit 6e91868 into main Jan 30, 2025
1 check passed
@Thytu Thytu deleted the feat/talk-to-multiple-agents branch January 30, 2025 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant