{"data":{"kind":"file","path":"README.md","version_id":"pewqzaie7u2mlnnhlq243jhm","entry":{"name":"README.md","path":"README.md","is_directory":false,"size":2673,"modified_at":"2025-09-01T17:59:52.748000","content_hash":"3127fcf7c073f706f27e46d48c44d56baa720ee27c9c879e25ca51adc46e57fd"},"entries":[],"content":"# textworld-env\n\n### Overview\n- **Environment ID**: `textworld-env`\n- **Short description**: Uses the TextWorld environment to play procedurally generated text-based adventure games\n- **Tags**: multi-turn, games\n\n### Datasets\n- **Primary dataset(s)**: Wraps the TextWorld environment to \n- **Source links**: [https://github.com/microsoft/TextWorld](https://github.com/microsoft/TextWorld)\n- **Split sizes**: n/a\n\n### Task\n- **Type**: multi-turn\n- **Parser**: custom\n- **Rubric overview**: Measure quest completion and penalizes for each step taken\n\n### Quickstart\nCreate a TextWorld game:\n\n```bash\nuv run tw-make custom --world-size 5 --nb-objects 10 --quest-length 5 --seed 1234 --output tw_games/custom_game.z8\n```\nRead the [docs](https://github.com/microsoft/TextWorld/tree/main?tab=readme-ov-file#usage) for more info on creating games.\n\nRun an evaluation with default settings:\n\n```bash\nuv run vf-eval textworld-env -a '{\"game\": \"tw_games/custom_game.z8\" }'\n```\n\n### Environment Arguments\nDocument any supported environment arguments and their meaning. Example:\n\n| Arg | Type | Default | Description |\n| --- | ---- | ------- | ----------- |\n| `game` | str |  | Path to a generated TextWorld game | \n| `system_prompt` | str | `SYSTEM_PROMPT` | System prompt sent to the model (see below) | \n| `max_turns` | int | `25` | Limit the number of turns the model can take within each rollout |\n\n```\nSYSTEM_PROMPT = \"\"\"\\\nYou are trying to solve a text-based puzzle game.\nOn each turn you'll be given the history of the actions/observations you've taken so far.\nThink through your current state step-by-step to consider how to make progress towards your goal.\n\nAvailable commands:\n- look\n- look <object>\n- take <object>\n- open <object>\n- go <direction>\n- unlock <object> with <object>\n- use <object>\n- drop <object>\n- inventory # lists the objects you are carrying\n\nYou cannot execute multiple commands in a single turn!\nThen return the SINGLE command you want to execute next.\nYou must always return the command in a `\\\\boxed{...}` format!\n\nExample response:\nYou've stumbled into a normal room. Your mind races to think of what kind of\nroom would be normal. And then it hits you. Of course. You're in the scullery.\nYou begin to take stock of what's in the room.\n\n\\\\boxed{look}\n\"\"\"\n```\n\n### Metrics\nSummarize key metrics your rubric emits and how they’re interpreted.\n\n| Metric | Meaning |\n| ------ | ------- |\n| `reward` | Equally weighted scalar reward using the below metrics |\n| `quest_completed` | +1 for each quest completed |\n| `game_completed` | Did the agent complete the full game |\n| `game_length` | Negative penalty for each step taken `1 - (turn / max_turns)` |\n\n","encoding":"utf-8","truncated":false,"total_bytes":2673},"status":null}