Welcome to the Swarms SDK! This repository offers a production-grade Python client for the Swarms API. It provides a simple and intuitive interface for creating and managing AI swarms. Whether you are a researcher, developer, or enthusiast, this SDK can help you harness the power of multi-agent systems.
- Intuitive Interface: Designed for ease of use, the SDK simplifies interactions with the Swarms API.
- Multi-Agent Support: Create and manage multiple agents working collaboratively.
- Documentation: Comprehensive documentation helps you get started quickly.
- Robust Performance: Built for production use, ensuring reliability and efficiency.
- Extensible: Easily extend the functionality to meet your needs.
To install the Swarms SDK, you can use pip. Run the following command:
pip install swarms-sdk
Make sure you have Python 3.6 or higher installed. You can verify your Python version with:
python --version
After installation, you can start using the SDK. Here’s a simple example to get you started:
from swarms_sdk import Swarm
# Create a new swarm
my_swarm = Swarm(name="My First Swarm")
# Add agents to the swarm
my_swarm.add_agent(agent_id="agent_1")
my_swarm.add_agent(agent_id="agent_2")
# Start the swarm
my_swarm.start()
This example shows how to create a swarm and add agents to it. You can customize the agents and their behaviors according to your requirements.
The SDK provides several functions to interact with the Swarms API. Here are some common operations:
To create a new swarm, use the Swarm
class. You can specify various parameters like name, type, and initial state.
swarm = Swarm(name="Example Swarm", swarm_type="cooperative")
You can add agents to your swarm using the add_agent
method. Each agent can have its own unique ID and parameters.
swarm.add_agent(agent_id="agent_1", params={"role": "leader"})
swarm.add_agent(agent_id="agent_2", params={"role": "follower"})
To start the swarm, simply call the start
method.
swarm.start()
You can monitor the swarm's performance and behavior through various methods. Use get_status
to check the current state of the swarm.
status = swarm.get_status()
print(status)
When you are done, you can stop the swarm using the stop
method.
swarm.stop()
For detailed information on all available classes and methods, refer to the API documentation.
We welcome contributions! If you would like to contribute to the Swarms SDK, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes and commit them (
git commit -m 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Open a pull request.
Please ensure that your code adheres to our coding standards and is well-documented.
This project is licensed under the MIT License. See the LICENSE file for details.
For questions or feedback, please reach out to the project maintainer:
- Name: Masum Sohel
- Email: [email protected]
For the latest releases, please visit our Releases section. You can download the latest version and execute it to get started with your AI swarms.
Thank you for checking out the Swarms SDK! We hope you find it useful for your projects involving AI swarms and multi-agent systems. Happy coding!