generated from kyegomez/Python-Package-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
example.py
31 lines (25 loc) · 782 Bytes
/
example.py
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
29
30
31
# Import necessary modules
import os
from autort import AutoRTSwarm, AutoRTAgent
# Set the OpenAI API key
openai_api_key = os.getenv("OPENAI_API_KEY")
# Define a list of AutoRTAgent instances
agents = [
AutoRTAgent(openai_api_key, max_tokens=1000),
AutoRTAgent(openai_api_key, max_tokens=1000),
]
# Create an instance of AutoRTSwarm with the agents and datastore
autort_swarm = AutoRTSwarm(agents=agents)
# Run the AutoRTSwarm with the given inputs
autort_swarm.run(
"There is a bottle on the table.",
"https://i.imgur.com/2qY9f8U.png",
)
# Run a single agent in the swarm
run_agent = autort_swarm.run_single_agent(
autort_swarm.agents[0].id,
(
"Pick up the bottle and place it on the shelf."
"https://i.imgur.com/2qY9f8U.png"
),
)