Skip to content

A production-grade Python client for the Swarms API, providing a simple and intuitive interface for creating and managing AI swarms.

License

Notifications You must be signed in to change notification settings

masumsohel/swarms-sdk

Repository files navigation

Swarms SDK 🐝

Version License Releases Releases

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.

Table of Contents

Features

  • 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.

Installation

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

Getting Started

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.

Usage

The SDK provides several functions to interact with the Swarms API. Here are some common operations:

Creating a Swarm

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")

Adding Agents

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"})

Starting the Swarm

To start the swarm, simply call the start method.

swarm.start()

Monitoring Swarm Behavior

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)

Stopping the Swarm

When you are done, you can stop the swarm using the stop method.

swarm.stop()

API Reference

For detailed information on all available classes and methods, refer to the API documentation.

Contributing

We welcome contributions! If you would like to contribute to the Swarms SDK, please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes and commit them (git commit -m 'Add new feature').
  4. Push to the branch (git push origin feature-branch).
  5. Open a pull request.

Please ensure that your code adheres to our coding standards and is well-documented.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For questions or feedback, please reach out to the project maintainer:

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!

About

A production-grade Python client for the Swarms API, providing a simple and intuitive interface for creating and managing AI swarms.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages