-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun.py
More file actions
28 lines (21 loc) · 886 Bytes
/
run.py
File metadata and controls
28 lines (21 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import asyncio
from capyswarm import Swarm
from agents import white, black, orchestrator
from dotenv import load_dotenv
import os
load_dotenv()
async def main():
async with Swarm(
[white, black, orchestrator], api_key=os.getenv("SCRAPYBARA_API_KEY")
) as swarm:
await swarm.run(
prompt="""
Play a game of chess between White and Black agents on https://plainchess.timwoelfle.de/.
Before instructing White and Black agents to play the game, you must verify that the game is loaded.
The browser and website are already open, no need to create new ones.
Then, instruct the White and Black agents to play out the first 2 moves of the game (assign priority to each move accordingly).
""",
interactive=True,
)
if __name__ == "__main__":
asyncio.run(main())