From f71da6aefac4ccb49267916c90fe8ae07dfbb04f Mon Sep 17 00:00:00 2001 From: Shiina Date: Sat, 21 Oct 2023 21:29:16 +0800 Subject: [PATCH] add test /index.py --- index.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 index.py diff --git a/index.py b/index.py new file mode 100644 index 0000000..ca367e5 --- /dev/null +++ b/index.py @@ -0,0 +1,21 @@ +import time +from jarvis.enviroment.base_env import BaseEnviroment +from jarvis.agent.openai_agent import OpenAIAgent + +if __name__ == '__main__': + environment = BaseEnviroment() + agent = OpenAIAgent( + config_path="examples/config.json", + environment=environment + ) + action = [ + 'turn_on_dark_mode', + 'turn_on_light_mode' + ] + + # environment.init_env() + for a in action: + print(a) + command = agent.action_lib[a] + print(agent.env.step(command)) + time.sleep(2)