Skip to content

How to pass an initial instruction in task_kwargs? #71

@xhluca

Description

@xhluca

Is it possible to do somehting like this:

import gymnasium as gym
import browsergym.core  # register the openended task as a gym environment

instruction = "Please find an apple pie recipe and summarize how to make it"

env = gym.make(
    "browsergym/openended", 
    task_kwargs={"start_url": "https://www.google.com/", "instruction": instruction}, 
    wait_for_user_message=True
)
obs, info = env.reset()
done = False
while not done:
    action = ...  # implement your agent here
    obs, reward, terminated, truncated, info = env.step(action)

where instruction = "Please find an apple pie recipe and summarize how to make it" is what I want to pass to the model first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions