iclbench.environments.baba_is_ai package

Submodules

iclbench.environments.baba_is_ai.base module

class iclbench.environments.baba_is_ai.base.BabaIsAIWrapper(env: Env, add_ruleset=True, vlm=False)[source]

Bases: Wrapper

__init__(env: Env, add_ruleset=True, vlm=False)[source]

Wraps an environment to allow a modular transformation of the step() and reset() methods.

Parameters:

env – The environment to wrap

property default_action
get_ruleset()[source]

Retrieve and format the ruleset for the current environment.

This method extracts rules from the environment’s grid ruleset, formats them into human-readable strings, and returns them as a single string with each rule on a new line.

get_stats()[source]
get_text_action(action)[source]
get_text_observation(obs)[source]

Generate a text-based observation of the environment.

This method creates a textual description of the environment, including the relative positions of various objects with respect to the player’s position (represented by ‘baba’).

reset(**kwargs)[source]

Resets the environment with kwargs.

step(action)[source]

Steps through the environment with action.

textworld_process_obsv(textworld_obsv)[source]

Module contents

iclbench.environments.baba_is_ai.get_instruction_prompt(env, task=None)[source]