Skip to content

Commit fb120d1

Browse files
authored
Merge pull request #93 from andyk/broken_agentos_run
fix bugs in quickstart code. fixes #88, #89, #90
2 parents 00cae7e + d0feb53 commit fb120d1

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

README.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ The AgentOS docs are at `agentos.org <https://agentos.org>`_.
3131
Install and Explore
3232
===================
3333

34-
AgentOS requires Python 3.5 - 3.8. To get started, use pip to install agentos,
35-
and then run a simple agent::
34+
AgentOS requires Python 3.5 - 3.8 and `conda`. To get started, use pip to
35+
install agentos, and then run a simple agent::
3636

37-
# First make sure you're using Python 3.5 - 3.8
37+
# Make sure you're using Python 3.5 - 3.8
38+
# Make sure you have miniforge, miniconda, or conda installed (required
39+
# for `agentos run`, which uses MLflow Projects).
3840
pip install agentos
3941
agentos run agentos.agents.RandomAgent gym.envs.classic_control.CartPoleEnv
4042

documentation/includes/install_and_try.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
Install and Explore
22
===================
33

4-
AgentOS requires Python 3.5 - 3.8. To get started, use pip to install agentos,
5-
and then run a simple agent::
4+
AgentOS requires Python 3.5 - 3.8 and `conda`. To get started, use pip to
5+
install agentos, and then run a simple agent::
66

7-
# First make sure you're using Python 3.5 - 3.8
7+
# Make sure you're using Python 3.5 - 3.8
8+
# Make sure you have miniforge, miniconda, or conda installed (required
9+
# for `agentos run`, which uses MLflow Projects).
810
pip install agentos
911
agentos run agentos.agents.RandomAgent gym.envs.classic_control.CartPoleEnv
1012

documentation/quickstart.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@ The best way to understand AgentOS is to use it, so let’s install agentos and
2323
write a simple agent in Python that behaves randomly. Installation is easy::
2424

2525
$ pip install agentos
26-
$ pip install gym # AgentOS uses OpenAI Gym's Environment abstraction.
2726

2827
Writing a trivial agent is also easy::
2928

3029
# Save this code in ./simple_agent.py
31-
from agentos import Agent
30+
import agentos
3231

33-
class SimpleAgent(Agent):
32+
class SimpleAgent(agentos.Agent):
3433
def advance(self):
3534
obs, reward, done, _ = self.env.step(self.env.action_space.sample())
3635
print(f"Took a random step, done = {done}.")
@@ -76,7 +75,8 @@ Now, instead of writing our own while loop, let’s run the agent in a Python
7675
Thread using a convenience function that AgentOS provides which serves as an
7776
Agent Runner::
7877

79-
>>> agentos.run_agent(SimpleAgent, CartPoleEnv)
78+
>>> from agentos import run_agent
79+
>>> run_agent(SimpleAgent, CartPoleEnv)
8080
Took a random step, done = False.
8181
8282
Took a random step, done = False.
@@ -94,8 +94,9 @@ As an alternative to using our custom agent above, let’s go back into the
9494
Python shell we opened above and use AgentOS’s RandomAgent::
9595

9696
>>> from agentos.agents import RandomAgent
97+
>>> from agentos import run_agent
9798
>>> from gym.envs.classic_control import CartPoleEnv
98-
>>> agentos.run_agent(RandomAgent, CartPoleEnv)
99+
>>> run_agent(RandomAgent, CartPoleEnv)
99100
Took a random step, done = False.
100101
101102
Took a random step, done = False.

0 commit comments

Comments
 (0)