Hosted Mode

Running Suites in Hosted Mode allows you to create groupings of agents that are running in hosted mode. This is useful for build production-ready systems. Hosted mode relies on websockets for maintaining connections between various agents and the suite. Addiitonally, hosted mode allows for distributed systems, (agents from anywhere can connect to a single suite an d collaborate).

Using Hosted Mode

1

Create Agents

Create a few agents that you want to group together

2

Create a Suite

Create a suite containing the agents

file.py
suite = SwiftSuite(agents=[agent1, agent2])

3

Run the Suite

Run the Suite in Hosted Mode

file.py
async def main():
     await suite.run(mode='hosted')

asyncio.run(main())

4

Create a Client

client.py
from swiftagent import SwiftClient
import asyncio

client = SwiftClient(host="0.0.0.0", port=8001, type_='suite')

5

Query the Suite for the task

client.py
async def main():
     await client.send('Come up with a list of ideas that could be a creative fairy tale, making sure it is a concise and coherent paragraph')

asyncio.run(main())

Last updated