iclbench.environments.textworld package
Submodules
iclbench.environments.textworld.base module
- class iclbench.environments.textworld.base.TextWorldFactory(**kwargs)[source]
Bases:
objectA factory class for creating TextWorld environments.
This class manages the creation of TextWorld environments for different tasks, cycling through available games for each task or allowing specific game selection.
- get_textworld_env(task, seed=None, **kwargs)[source]
Create and return a TextWorld environment for the specified task.
- Parameters:
task (str) – The name of the task for which to create an environment.
seed (int, optional) – If provided, creates the environment for the specific game index. If None, cycles through available games.
- Returns:
A TextWorld gym environment.
- Return type:
gym.Env
- Raises:
KeyError – If the specified task is not found in the available tasks.
- class iclbench.environments.textworld.base.TextWorldWrapper(env: Env, max_steps=40)[source]
Bases:
Wrapper- __init__(env: Env, max_steps=40)[source]
Wraps an environment to allow a modular transformation of the
step()andreset()methods.- Parameters:
env – The environment to wrap
- property default_action
Module contents
- iclbench.environments.textworld.global_textworld_context(**kwargs) TextWorldFactory[source]