File size: 900 Bytes
dd39c08
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
32
33
34
35
36
37
38
39
40
41
MiniWoB++
^^^^^^^^^

`BrowserGym` integrates `MiniWoB++` enviroment. For more information about this enviroment, please refer to the `MiniWoB+ <https://miniwob.farama.org/>`_ official documentation.


BrowserGym API 
""""""""""""""

.. currentmodule:: browsergym

.. autosummary::
   :recursive:
   :toctree: generated
   :caption: MiniWoB++

   miniwob


Usage 
"""""

Before running the sample code, install `MiniWoB++` by following the steps in the `docs <https://github.com/ServiceNow/BrowserGym/blob/main/miniwob/README.md>`_.

.. code-block:: python

    import gym
    import browsergym.minwob

    env = gym.make('browsergym/miniwob.book-flight')
    obs, info = env.reset()
    done = False

    while not done:
        action = "noop()"
        obs, reward, terminated, truncated, info = env.step(action)
        print(f"Reward: {reward}, Done: {done}, Info: {info}")
    
    env.close()