Full Code of FoundationAgents/ReCode for AI

main 6e7223f71281 cached
74 files
16.3 MB
119.4k tokens
259 symbols
1 requests
Download .txt
Showing preview only (475K chars total). Download the full file or copy to clipboard to get everything.
Repository: FoundationAgents/ReCode
Branch: main
Commit: 6e7223f71281
Files: 74
Total size: 16.3 MB

Directory structure:
gitextract_bghxqcon/

├── .gitignore
├── LICENSE
├── README.md
├── agents/
│   └── recode/
│       ├── agent.py
│       ├── resources/
│       │   ├── fewshots/
│       │   │   ├── alfworld/
│       │   │   │   ├── clean.txt
│       │   │   │   ├── cool.txt
│       │   │   │   ├── examine.txt
│       │   │   │   ├── heat.txt
│       │   │   │   ├── put.txt
│       │   │   │   └── puttwo.txt
│       │   │   ├── sciworld/
│       │   │   │   └── base.txt
│       │   │   └── webshop/
│       │   │       └── base.txt
│       │   └── prompts/
│       │       ├── alfworld/
│       │       │   └── actions.txt
│       │       ├── default_new.py
│       │       ├── sciworld/
│       │       │   └── actions.txt
│       │       └── webshop/
│       │           └── actions.txt
│       └── utils.py
├── base/
│   ├── agent.py
│   └── environment.py
├── configs/
│   ├── prices.json
│   └── profiles_example.yaml
├── envs/
│   ├── alfworld/
│   │   ├── base_config.yaml
│   │   └── env.py
│   ├── sciworld/
│   │   ├── base_config.yaml
│   │   ├── data/
│   │   │   ├── max_steps.json
│   │   │   ├── taskname2id.json
│   │   │   ├── test_indices.json
│   │   │   ├── train_indices.json
│   │   │   └── valid_indices.json
│   │   └── env.py
│   └── webshop/
│       ├── env.py
│       ├── setup.py
│       ├── setup.sh
│       └── src/
│           └── webshop/
│               ├── __init__.py
│               ├── run_envs/
│               │   ├── run_web_agent_site_env.py
│               │   └── run_web_agent_text_env.py
│               ├── search_engine/
│               │   └── lucene_searcher.py
│               ├── transfer/
│               │   ├── README.md
│               │   ├── __init__.py
│               │   ├── app.py
│               │   ├── predict_help.py
│               │   └── webshop_lite.py
│               └── web_agent_site/
│                   ├── __init__.py
│                   ├── app.py
│                   ├── attributes/
│                   │   ├── annotate.py
│                   │   └── generate_attrs.py
│                   ├── engine/
│                   │   ├── __init__.py
│                   │   ├── engine.py
│                   │   ├── goal.py
│                   │   └── normalize.py
│                   ├── envs/
│                   │   ├── __init__.py
│                   │   ├── chromedriver
│                   │   ├── web_agent_site_env.py
│                   │   └── web_agent_text_env.py
│                   ├── models/
│                   │   ├── __init__.py
│                   │   └── models.py
│                   ├── static/
│                   │   └── style.css
│                   ├── templates/
│                   │   ├── attributes_page.html
│                   │   ├── description_page.html
│                   │   ├── done_page.html
│                   │   ├── features_page.html
│                   │   ├── item_page.html
│                   │   ├── results_page.html
│                   │   ├── review_page.html
│                   │   └── search_page.html
│                   └── utils.py
├── requirements.txt
├── run.py
└── utils/
    ├── common.py
    ├── errors.py
    ├── executor.py
    ├── llm.py
    ├── logger.py
    └── mockllm.py

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
.vscode/
__pycache__/
.DS_Store
*.pyc
*.zip
logs/
envs/webshop/data/
envs/webshop/search_index/
envs/webshop/data.zip
envs/webshop/indexes.zip
profiles.yaml

================================================
FILE: LICENSE
================================================
MIT License

Copyright (c) 2026 Foundation Agents

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.md
================================================
# ReCode: Unify Plan and Action for Universal Granularity Control

[![Arxiv](https://img.shields.io/badge/2510.23564-arXiv-red)](https://arxiv.org/abs/2510.23564)

> If you encounter any difficulties in using or reproducing the code, please contact me at [zhaoyangyu713@gmail.com](mailto:zhaoyangyu713@gmail.com).

ReCode introduces recursive code generation for LLM agents, unifying plan and action into a single representation. By treating high-level plans as placeholder functions that recursively decompose into executable primitives, it achieves universal granularity control and dynamically adapts from strategic thinking to concrete actions. This repository hosts the reference implementation used in the paper, along with environment wrappers and experiment tooling.

<p align="center">
<a href=""><img src="figures/figure1-comparison.jpg" alt="A comparison of LLM-based agent decision-making paradigms" title="A comparison of LLM-based agent decision-making paradigms" width="92%"></a>
</p>

## Core Idea

ReCode adopts a divide-and-conquer strategy, decomposing complex tasks into executable code fragments:

1. **Tree-structured code**: Organizes partial programs in a tree where each node captures one sub-task and records its execution trace.
2. **Recursive expansion**: Placeholder functions are expanded by the LLM into more specific calls or smaller subroutines using environment-specific prompts and few-shots.
3. **Dynamic execution loop**: Each node is executed immediately; fresh observations decide whether to expand further, retry, or finish.
4. **Shared executor state**: A constrained Python executor maintains environment variables, validates code blocks, and exposes the toolset available to the agent.

<p align="center">
<a href=""><img src="figures/figure2-method-new.jpg" alt="An overview of ReCode" title="An overview of ReCode" width="92%"></a>
</p>

## Repository Layout

- `run.py` – CLI entry point that instantiates agents/envs, manages concurrency, and writes run summaries.
- `agents/recode/` – ReCode agent implementation, prompt templates, and utility helpers.
- `envs/` – Environment wrappers and assets for `alfworld`, `webshop`, and `sciworld`.
- `configs/` – LLM profile templates and (expected) pricing metadata used by the async client.
- `utils/` – Shared components: async OpenAI wrapper, constrained executor, logging helpers, error types.
- `figures/` – Paper figures used throughout this README.

## Experiments

To evaluate the effectiveness of ReCode, we divide our experiments into the inference part and the training part.

1. **Inference Result**: we compare against several mainstream paradigm (ReAct, CodeAct) and some of the work focused on improving LLM-based agent planning (AdaPlanner and ADaPT). ReCode achieved significant performance improvements across all three environments, with an average score of 60.8, surpassing the best baseline method by 10.5 (relative 20.9%). _With our tests, ReCode can achieve a perfect **100** score in ALFWorld under `claude-4-sonnet`._



<p align="center">
<a href=""><img src="figures/inference-result.png" alt="Inference performance across environments" title="Inference evaluation summary" width="92%"></a>
</p>

2. **Training Result**: we conduct supervised fine-tuning (SFT) on ReCode, ReAct and CodeAct with `Qwen2.5-7B-Instruct`. ReCode+SFT delivers an impressive average performance of 70.4% across all environments, outperforming both ReAct+SFT (67.6%) and CodeAct+SFT (55.8%), highlighting its exceptional data efficiency.

<p align="center">
<a href=""><img src="figures/sft-data.png" alt="SFT performance across environments" title="SFT evaluation summary" width="92%"></a>
</p>

<p align="center">
<a href=""><img src="figures/sft-result.png" alt="SFT performance across environments" title="SFT evaluation summary" width="92%"></a>
</p>

## Quick Start

To run ReCode, we need a conda environment. The python version should be 3.10 or newer.

Then, it is necessary to configure dependencies for three environments (it has not been confirmed whether conflicts will arise in the same environment), and we suggest configuring them in three separate environments.

```bash
conda create -n recode-envname python=3.10 # Replace "envname" with the your environment name.
conda activate recode-envname
```

---

### ALFWorld
- Follow the [ALFWorld instructions](https://github.com/alfworld/alfworld).
- Set `ALFWORLD_DATA` to the dataset root or edit `envs/alfworld/base_config.yaml` to point to your local paths:

  ```bash
  export ALFWORLD_DATA=/path/to/alfworld
  ```

### ScienceWorld
- Follow the instruciton from the [ScienceWorld repository](https://github.com/allenai/ScienceWorld).

### WebShop
Thanks to [ETO ](https://github.com/Yifan-Song793/ETO) for providing a convenient script to configure WebShop environment.

```bash
cd envs/webshop
pip install -e .
conda install -y -c conda-forge openjdk=11
pip install "en_core_web_lg @ https://github.com/explosion/spacy-models/releases/download/en_core_web_lg-3.6.0/en_core_web_lg-3.6.0-py3-none-any.whl"
```

Run the provided helper to fetch the goal set and pre-built search index:

```bash
# The current path is "envs/webshop"
bash setup.sh
```

---

Install some other dependencies.

```bash
pip install -r requirements.txt # Here may not be complete, please contact me promptly if you encounter any problems
```

Ensure `configs/profiles.yaml` points to a valid API credential (copy `configs/profiles_example.yaml` if you need a template), then run a short dry run in any enabled environment:
```bash
python run.py -a recode -e alfworld -n 1 --split test --profile default
```
Replace `alfworld` with `webshop` or `sciworld` once their assets are available. Logs are written to `logs/<run_id>/`, and the console prints a condensed summary for quick diagnostics.

## Configure LLM Access

- `configs/profiles.yaml` contains named profiles. The `run.py --profile` flag selects which profile to forward to `AsyncLLM`. Example:

  ```yaml
  models:
    default:
      api_key: "sk-your_api_key"
      base_url: "https://api.openai.com/v1"
      model: "gpt-4o-mini"
      temperature: 0.0
      track_costs: true
    gpt-4o:
      api_key: "sk-your_other_key"
      base_url: "https://api.openai.com/v1"
      model: "gpt-4o"
      temperature: 0.7
      max_tokens: 512
  ```

- Cost tracking loads `configs/prices.json`. If you do not want to record costs, set `track_costs: false` for the profile.
- As a fallback, you can omit the file and set `OPENAI_API_KEY` in the environment; the default profile will then use it.
- A ready-to-edit template lives at `configs/profiles_example.yaml`; copy it to `configs/profiles.yaml` if you're starting from scratch:
  ```bash
  cp configs/profiles_example.yaml configs/profiles.yaml
  ```

## Running ReCode

`run.py` is the canonical entry point. It resolves agent/environment aliases, manages concurrency, streams logs, and emits a structured summary.

```bash
# ALFWorld, single instance
python run.py -a recode -e alfworld -n 1 --split test --profile default

# WebShop, 3 test goals, allow deeper recursion
python run.py -a recode -e webshop -n 3 --split test --profile default --max-depth 12

# ScienceWorld, run 5 instances with 2-way concurrency
python run.py -a recode -e sciworld -n 5 -c 2 --profile gpt-4o
```

Key CLI flags:
- `-a / --agent` – class path or alias (`recode` resolves to `agents.recode.agent.ReCodeAgent`).
- `-e / --env` – environment class or alias (`alfworld`, `webshop`, `sciworld`).
- `-n / --instances` – number of evaluation episodes.
- `-c / --concurrent` – max concurrent episodes (rich progress UI automatically adapts).
- `--split`, `--seed`, `--max-depth`, `--profile` – forwarded to both agent and environment.
- `-C / --config` – YAML file whose keys override CLI flags; useful for complex sweeps.

Example YAML (`configs/example.yaml`):

```yaml
agent: recode
env: alfworld
instances: 10
concurrent: 2
profile: gpt-4o
split: test
task_types: ["put", "clean"] # For ALFWorld
max_depth: 12
max_retry: 4
```

Run it with:

```bash
python run.py -C configs/example.yaml
```

## Logging & Results

- Each run creates `logs/<run_id>/` with:
  - `running_logs/run.log` – aggregated stream of agent + environment logs.
  - `running_logs/instance_<id>.log` – per-instance traces (when multiple instances are launched).
  - `<results.json>` – structured summary written by `write_summary`, containing per-instance metrics and aggregated statistics (overall + per task type).
- The console prints a condensed summary (success rate, standard metrics, by-task breakdown) after completion.

## Extending to New Environments

1. **Implement the `Env` interface** under `envs/<your_env>/env.py`. Use `base.environment.Env` as the contract: implement `reset`, `_run`, `is_done`, `is_success`, and `report`. Return `{"observations": [...], "env_name": <name>, "env": self}` from `reset`.
2. **Expose prompts and guidance** in `agents/recode/resources/`:
   - `prompts/<env_name>/actions.txt` – concise description of valid `run("...")` calls/tools.
   - `fewshots/<env_name>/` – one or more `.txt` examples showing thought→execute patterns.
   - If your environment has task types, update `agents/recode/agent.py::_load_resources` and `agents/recode/utils.parse_raw_observation` to parse initial observations correctly.
3. **Register aliases** by adding your class to `ENV_ALIASES` in `run.py` (optional but convenient) and, if needed, plan-specific logic in the agent utilities.
4. Optionally add setup scripts (similar to `envs/webshop/setup.sh`) to document dataset fetching.

## Programmatic Use

You can embed the agent directly inside your own loop by reusing the provided utilities:

```python
import asyncio

from agents.recode.agent import ReCodeAgent
from envs.alfworld.env import AlfworldEnv

async def solve_once():
    config = {"split": "test", "task_types": ["put"], "max_depth": 10}
    env = AlfworldEnv(logger=None)
    agent = ReCodeAgent()
    init_info = env.reset(config)
    agent.reset(config, init_info)

    observations = init_info["observations"]
    while not env.is_done():
        actions = await agent.act(observations)
        observations = await env.run(actions)

    print(env.report())
    await env.close()

asyncio.run(solve_once())
```

The same pattern works for any `Env` implementation; be sure to pass a logger if you need file-backed traces.

## Citation

```
@misc{yu2025recodeunifyplanaction,
      title={ReCode: Unify Plan and Action for Universal Granularity Control}, 
      author={Zhaoyang Yu and Jiayi Zhang and Huixue Su and Yufan Zhao and Yifan Wu and Mingyi Deng and Jinyu Xiang and Yizhang Lin and Lingxiao Tang and Yingchao Li and Yuyu Luo and Bang Liu and Chenglin Wu},
      year={2025},
      eprint={2510.23564},
      archivePrefix={arXiv},
      primaryClass={cs.AI},
      url={https://arxiv.org/abs/2510.23564}, 
}
```


================================================
FILE: agents/recode/agent.py
================================================
from __future__ import annotations

from pathlib import Path
from enum import Enum
from typing import List, Optional
from datetime import datetime, timezone

from base.agent import Agent
from utils.llm import AsyncLLM
from utils.executor import Executor
from utils.common import parse_xml_tag

from agents.recode.resources.prompts.default_new import EXPAND_PROMPT
from agents.recode.utils import (
    parse_raw_observation,
    split_blocks,
    validate_blocks,
    NodeStatus,
    CodeNode,
    get_variables,
)

DEFAULT_MAX_DEPTH = 10
DEFAULT_MAX_RETRY = 5
DEFAULT_MAX_REWRITE = 5


class ReCodeAgent(Agent):
    def __init__(
        self,
        logger=None,
        task_type: str = None,
    ) -> None:
        self.logger = logger
        self.llm = AsyncLLM()
        self.executor = Executor(if_run_print=True)

        self.root: Optional[CodeNode] = None
        self.current_node: Optional[CodeNode] = None
        self.previous_node: Optional[CodeNode] = None
        self.task_type: str = task_type
        self.is_start = False
 
    def reset(self, running_config: dict, init_info: dict=None) -> None:
        self.root = None
        self.current_node = None
        self.previous_node = None
        self.is_start = False

        self.max_depth: int = running_config.get('max_depth') or DEFAULT_MAX_DEPTH
        self.max_retry: int = running_config.get('max_retry') or DEFAULT_MAX_RETRY
        self.max_rewrite: int = running_config.get('max_rewrite') or DEFAULT_MAX_REWRITE
        
        if init_info and 'task_type' in init_info and init_info['task_type']:
            self.task_type = init_info['task_type'].lower()
        elif 'task_type' in running_config:
            self.task_type = running_config['task_type'].lower()

        if "profile" in running_config and running_config['profile']:
            self.logger.info(f"Using profile: {running_config['profile']}")
            self.llm = AsyncLLM(running_config['profile'])

        assert 'env_name' in init_info, "Envrioment must be specified"
        self.env_name = init_info['env_name']
        if self.env_name == "alfworld":
            self.logger.info("Setting max steps to 80")
            init_info['env'].set_max_steps(80)
        self.executor.set_env(init_info['env'])

        self._load_resources()

    def _load_resources(self):
        resources_path = Path("agents/recode/resources/prompts") / self.env_name
        self.available_actions = open(resources_path / "actions.txt", "r").read()

        fewshots_path = Path("agents/recode/resources/fewshots") / self.env_name
        if self.env_name == "alfworld":
            self.fewshots = open(fewshots_path / f"{self.task_type}.txt", "r").read()
        elif self.env_name == "webshop":
            self.fewshots = open(fewshots_path / "base.txt", "r").read()
            # self.fewshots = "(No Examples)"
        elif self.env_name == "sciworld":
            self.fewshots = open(fewshots_path / "base.txt", "r").read()
        else:
            raise ValueError(f"Unsupported environment in _load_resources: {self.env_name}")

    async def act(self, observations: List[str]) -> List[str]:
        if not self.is_start:
            assert len(observations) == 1, "Only one observation is allowed for the first node"
            self._init_code_tree(observations[0])
            self.is_start = True

        if self.current_node.status == NodeStatus.STUB:
            await self._handle_stub()
        elif self.current_node.status == NodeStatus.ERROR:
            return ["[FINISH]"]

        if not self.current_node:
            return ["[FINISH]"]
        
        self.logger.info(f"[Execute]\n{self.current_node.code}")
        result = self._execute(self.current_node.code)
        self.current_node.observations.extend(result["stdout"]) if result["stdout"] else None
        self.logger.info(f"[Exec Result]\n{result}")

        if result["success"]:
            self.logger.info(f"[Execution Stdout] {result['stdout']}")
            self.current_node.status = NodeStatus.COMPLETED
            self.previous_node = self.current_node
            self.current_node = self.current_node.next()
            if not self.current_node:
                return ["[FINISH]"]
        else:
            if "NeedExpansion" in result["error"]:
                self.current_node.status = NodeStatus.STUB
            else:
                self.current_node.status = NodeStatus.ERROR
                self.current_node.error = result["error"]

    async def _handle_stub(self) -> None:
        if self.current_node and self.current_node.depth >= self.max_depth:
            if self.logger:
                self.logger.warning("Max depth reached - terminating.")
            self.current_node = None
            return

        new_blocks = await self._expand()
        self.logger.info("[NEW_BLOCKS]\n" + "\n".join(new_blocks)) if new_blocks else None

        if self.current_node:
            if new_blocks is None:
                self.current_node = None
                return
            if new_blocks:
                for block in new_blocks:
                    child_node = CodeNode(code=block, parent=self.current_node)
                    self.current_node.children.append(child_node)
            else: 
                self.current_node.status = NodeStatus.SKIP

        self.current_node = self.current_node.next()

    async def _expand(self) -> Optional[List[str]]:
        attempt = 0
        retry_hint_added = False
        while True:
            user_prompt = self._build_expand_prompt()
            if retry_hint_added:
                user_prompt += (
                    "\n\n[Important] Your previous expansion produced syntactically invalid code and/or included disallowed constructs (e.g., def/async def). "
                    "Strictly follow the rules: output a single valid Python code block, and do not use def or async def."
                )
            if self.logger:
                self.logger.info("[LLM_IN]\n" + user_prompt)
            response, _cost = await self.llm(user_prompt)
            if self.logger:
                self.logger.info("[LLM_OUT]\n" + response.strip())

            thought = parse_xml_tag(response, "think").strip()
            self.current_node.thought = thought
            expanded_code = parse_xml_tag(response, "execute").strip()

            try:
                blocks = split_blocks(expanded_code)
                validate_blocks(blocks)
                return blocks
            except (SyntaxError, ValueError) as e:
                attempt += 1
                retry_hint_added = True
                if attempt >= self.max_rewrite:
                    if self.logger:
                        self.logger.info(
                            f"[STOP] Reached max re-expands ({self.max_rewrite}). Last error: {e}. Ending episode."
                        )
                    return None
                if self.logger:
                    self.logger.info(
                        f"[RE-EXPAND {attempt}/{self.max_rewrite}] Split/validation failed due to: {e}. Re-asking EXPAND..."
                    )

    def _execute(self, code: str) -> dict:
        return self.executor.execute(code)

    def _init_code_tree(self, observation: str) -> None:
        self.logger.info(f"[OBSERVATIONS]\n{observation}")
        initial_observation, instruction = parse_raw_observation(observation, self.env_name)
        self.executor.set_var('observation', initial_observation)
        self.executor.set_var('instruction', instruction)
        self.root = CodeNode(code=f"solve(instruction, observation)")
        self.current_node = self.root
        
    def _build_expand_prompt(self) -> str:
        # available_actions, examples, task, variables
        examples = self.fewshots if self.fewshots else "(No Examples)"
        task = self.current_node.code
        variables = get_variables(self.executor, self.current_node.code)
        variables = variables if variables else "(No Variables)"
        return EXPAND_PROMPT.format(available_actions=self.available_actions, examples=examples, task=task, variables=variables)

    def _get_max_depth(self, node: Optional[CodeNode]) -> int:
        if node is None:
            return 0
        max_depth = node.depth
        for child in node.children:
            child_max = self._get_max_depth(child)
            if child_max > max_depth:
                max_depth = child_max
        return max_depth

    def _get_formatted_tree(self) -> dict:
        version = "recode.plan.v1"

        meta = {
            "env_name": getattr(self, "env_name", None),
            "task_type": getattr(self, "task_type", None),
            "created_at": datetime.now(timezone.utc).isoformat(),
            "max_depth": getattr(self, "max_depth", None),
            "max_retry": getattr(self, "max_retry", None),
            "max_rewrite": getattr(self, "max_rewrite", None),
        }

        nodes = {}
        edges = []
        root_id = self.root.id if self.root else None

        if self.root:
            stack = [self.root]
            while stack:
                node = stack.pop()
                nodes[node.id] = {
                    "code": node.code,
                    "thought": getattr(node, "thought", None),
                    "status": node.status.value if isinstance(node.status, Enum) else node.status,
                    "depth": node.depth,
                    "observations": list(node.observations) if node.observations else [],
                    "error": node.error,
                }
                for child in node.children:
                    edges.append([node.id, child.id])
                # Preserve order by pushing children in reverse for DFS
                for child in reversed(node.children):
                    stack.append(child)

        return {
            "version": version,
            "meta": meta,
            "root_id": root_id,
            "nodes": nodes,
            "edges": edges,
        }


    def report(self) -> dict:
        return {
            'cost': self.llm.spent,
            'tree': self._get_formatted_tree(),
            'max_depth': self._get_max_depth(self.root)
        }

================================================
FILE: agents/recode/resources/fewshots/alfworld/clean.txt
================================================
[Input]
The current function to expand is:
solve(instruction, observation)
The variables you can use is:
- instruction (str): Your task is to: clean some apple and put it in sidetable.
- observation (str): You are in the middle of a room. Looking quickly around you, you see a cabinet 4, a cabinet 3, a cabinet 2, a cabinet 1, a coffeemachine 1, a countertop 1, a diningtable 3, a diningtable 2, a diningtable 1, a drawer 1, a fridge 1, a garbagecan 1, a microwave 1, a sidetable 1, a sinkbasin 1, a stoveburner 4, a stoveburner 3, a stoveburner 2, a stoveburner 1, and a toaster 1.

[Output]
<think>
I first characterize the task: the object is an apple that must be cleaned (so the cleaning station is the only sinkbasin present) and finally placed on the sidetable. The initial observation provides a single `sinkbasin 1` and `sidetable 1`, so I persist both IDs. I also parse and persist all location IDs for later search. The expansion should be decomposed into three concrete phases: (1) acquire an apple by searching openable and non-openable receptacles; handle closures by opening when needed; once found, take the apple by its exact ID; (2) clean it strictly at the sinkbasin; (3) place it on the target surface, ensuring it is reachable (surfaces are non-openable, so navigation suffices). Typical mistakes to avoid include assuming an object ID without extracting it from observations, forgetting to open a closed container before taking, or trying to clean anywhere other than the sinkbasin.
</think>

<execute>
cleaning_location_ID = 'sinkbasin 1'
target_location_ID = 'sidetable 1'
obj = 'apple'
all_location_IDs = re.findall(r'[a-z]+(?:[a-z]+)? \d+', observation)

obj_ID = find_and_take(obj, all_location_IDs)
clean_with(obj_ID, cleaning_location_ID)
put_in(obj_ID, target_location_ID)
</execute>


[Input]
The current function to expand is:
solve(instruction, observation)
The variables you can use is:
- instruction (str): Your task is to: put a clean lettuce in diningtable.
- observation (str): You are in the middle of a room. Looking quickly around you, you see a cabinet 13, a cabinet 12, a cabinet 11, a cabinet 10, a cabinet 9, a cabinet 8, a cabinet 7, a cabinet 6, a cabinet 5, a cabinet 4, a cabinet 3, a cabinet 2, a cabinet 1, a coffeemachine 1, a countertop 1, a diningtable 1, a drawer 1, a fridge 1, a garbagecan 1, a microwave 1, a shelf 3, a shelf 2, a shelf 1, a sinkbasin 1, a stoveburner 4, a stoveburner 3, a stoveburner 2, a stoveburner 1, and a toaster 1.

[Output]
<think>
The required object is lettuce, and the final location is the dining table. The cleaning step is mandatory and must use the unique `sinkbasin 1`. I will persist `sinkbasin 1` as the cleaning site and `diningtable 1` as the goal. I will also build `all_location_IDs` from the initial observation. The decomposition mirrors the previous case: systematically search and take a lettuce, clean it at the sink, then navigate to the dining table and place the item. I must be careful to open any closed storage (e.g., cabinet, drawer, fridge, microwave) before taking and avoid using move to a closed container. Finally, I will ensure the regex extracts the exact lettuce ID from the observation.
</think>

<execute>
cleaning_location_ID = 'sinkbasin 1'
target_location_ID = 'diningtable 1'
obj = 'lettuce'
all_location_IDs = re.findall(r'[a-z]+(?:[a-z]+)? \d+', observation)

obj_ID = find_and_take(obj, all_location_IDs)
clean_with(obj_ID, cleaning_location_ID)
put_in(obj_ID, target_location_ID)
</execute>




[Input]
The current function to expand is:
obj_ID = find_and_take(obj, all_location_IDs)
The variables you can use is:
- obj (str): apple
- all_location_IDs (list[str]): ['cabinet 4', 'cabinet 3', 'cabinet 2', 'cabinet 1', 'coffeemachine 1', 'countertop 1', 'diningtable 3', 'diningtable 2', 'diningtable 1', 'drawer 1', 'fridge 1', 'garbagecan 1', 'microwave 1', 'sidetable 1', 'sinkbasin 1', 'stoveburner 4', 'stoveburner 3', 'stoveburner 2', 'stoveburner 1', 'toaster 1']

[Output]
<think>
The goal is to navigate the room methodically to find any instance of the target object and pick it up. I will iterate through the known locations, always navigating first. If a location produces no new information, I will examine it. When a location is closed, I will open it before searching. Once I observe a concrete `{obj} k` mention, I will parse that exact ID and take it from the current location. Common pitfalls include not examining after navigation (missing items), failing to open a closed container, or taking without the full `obj_ID`.
</think>

<execute>
for location_ID in all_location_IDs:
    obs = run(f'go to {location_ID}')
    if 'Nothing happens.' in obs:
        obs = run(f'examine {location_ID}')
    location_closed = 'closed' in obs
    if location_closed:
        obs = run(f'open {location_ID}')
    if f" {obj} " in obs: # Prevent names from containing relationships
        obj_ID = re.search(rf'\b{obj} \d+\b', obs).group()
        run(f'take {obj_ID} from {location_ID}')
        break
</execute>




[Input]
The current function to expand is:
clean_with(obj_ID, cleaning_location_ID)
The variables you can use is:
- obj_ID (str): apple 1
- cleaning_location_ID (str): sinkbasin 1

[Output]
<think>
Cleaning must be performed at the sinkbasin only. I will explicitly navigate to the recorded cleaning site and issue the cleaning command with the exact object ID. I do not need to open the sink; I only need to be there. A typical error is to attempt to clean somewhere else or to forget to navigate first.
</think>

<execute>
run(f'go to {cleaning_location_ID}')
run(f'clean {obj_ID} with {cleaning_location_ID}')
</execute>




[Input]
The current function to expand is:
put_in(obj_ID, target_location_ID)
The variables you can use is:
- obj_ID (str): apple 1
- target_location_ID (str): sidetable 1

[Output]
<think>
I will navigate to the target location, examine if nothing happens, determine if it is closed, and open if needed. Then I will move the object in. This logic supports both containers (openable) and surfaces (non-openable, but harmless to check). Pitfalls: using the wrong ID in `examine` or skipping the `location_closed` check.
</think>

<execute>
obs = run(f'go to {target_location_ID}')
if 'Nothing happens.' in obs:
    obs = run(f'examine {target_location_ID}')
location_closed = 'closed' in obs
if location_closed:
    obs = run(f'open {target_location_ID}')
run(f'move {obj_ID} to {target_location_ID}')
</execute>

================================================
FILE: agents/recode/resources/fewshots/alfworld/cool.txt
================================================
[Input]
The current function to expand is:
solve(instruction, observation)
The variables you can use is:
- instruction (str): Your task is to: put a cool mug in shelf.
- observation (str): You are in the middle of a room. Looking quickly around you, you see a cabinet 9, a cabinet 8, a cabinet 7, a cabinet 6, a cabinet 5, a cabinet 4, a cabinet 3, a cabinet 2, a cabinet 1, a coffeemachine 1, a countertop 3, a countertop 2, a countertop 1, a drawer 9, a drawer 8, a drawer 7, a drawer 6, a drawer 5, a drawer 4, a drawer 3, a drawer 2, a drawer 1, a fridge 1, a garbagecan 1, a microwave 1, a shelf 3, a shelf 2, a shelf 1, a sinkbasin 1, a stoveburner 4, a stoveburner 3, a stoveburner 2, a stoveburner 1, and a toaster 1.

[Output]
<think>
The task requires cooling, which must be done with the only fridge present (`fridge 1`). The final target is a shelf, and there are three shelves; I will choose `shelf 1` as an explicit target (the instruction’s phrasing implies a shelf; if a specific shelf is required, the upstream node should set it). I persist both IDs. I also create `all_location_IDs` from the initial observation. The plan decomposes into (1) find and take a mug by iterating known locations, handling closed receptacles via `open` and re-`examine`; (2) cool the mug at the fridge after ensuring access (navigate and open if closed); (3) place the mug on the chosen shelf (surfaces don’t need opening). Pitfalls: using the sink/microwave by mistake, assuming an object ID instead of extracting it, forgetting to re-`examine` after opening, or trying to place into a closed target.
</think>

<execute>
import random
cooling_location_ID = 'fridge 1'
target_location_ID = 'shelf 1'
obj = 'mug'
all_location_IDs = re.findall(r'[a-z]+(?:[a-z]+)? \d+', observation)
random.shuffle(all_location_IDs)


obj_ID = find_and_take(obj, all_location_IDs)
cool_with(obj_ID, cooling_location_ID)
put_in(obj_ID, target_location_ID)
</execute>




[Input]
The current function to expand is:
solve(instruction, observation)
The variables you can use is:
- instruction (str): Your task is to: cool some pan and put it in stoveburner.
- observation (str): You are in the middle of a room. Looking quickly around you, you see a cabinet 16, a cabinet 15, a cabinet 14, a cabinet 13, a cabinet 12, a cabinet 11, a cabinet 10, a cabinet 9, a cabinet 8, a cabinet 7, a cabinet 6, a cabinet 5, a cabinet 4, a cabinet 3, a cabinet 2, a cabinet 1, a coffeemachine 1, a countertop 2, a countertop 1, a diningtable 1, a drawer 5, a drawer 4, a drawer 3, a drawer 2, a drawer 1, a fridge 1, a garbagecan 1, a microwave 1, a safe 1, a sinkbasin 1, a stoveburner 4, a stoveburner 3, a stoveburner 2, a stoveburner 1, and a toaster 1.

[Output]
<think>
Cooling requires the fridge (`fridge 1`). The final placement is a specific burner; I set `stoveburner 1` as the target for determinism (if the upstream plan wants another burner, it should pass it). I will assemble `all_location_IDs`. The plan mirrors the previous case: search-and-take a pan with ID extraction; cool it at the fridge after ensuring access; navigate to the target burner (a surface) and place it. Watch for a closed fridge and for the temptation to use the microwave.
</think>

<execute>
cooling_location_ID = 'fridge 1'
target_location_ID = 'stoveburner 1'
obj = 'pan'
all_location_IDs = re.findall(r'[a-z]+(?:[a-z]+)? \d+', observation)

obj_ID = find_and_take(obj, all_location_IDs)
cool_with(obj_ID, cooling_location_ID)
put_in(obj_ID, target_location_ID)
</execute>




[Input]
The current function to expand is:
obj_ID = find_and_take(obj, all_location_IDs)
The variables you can use is:
- obj (str): apple
- all_location_IDs (list[str]): ['cabinet 4', 'cabinet 3', 'cabinet 2', 'cabinet 1', 'coffeemachine 1', 'countertop 1', 'diningtable 3', 'diningtable 2', 'diningtable 1', 'drawer 1', 'fridge 1', 'garbagecan 1', 'microwave 1', 'sidetable 1', 'sinkbasin 1', 'stoveburner 4', 'stoveburner 3', 'stoveburner 2', 'stoveburner 1', 'toaster 1']

[Output]
<think>
The goal is to navigate the room methodically to find any instance of the target object and pick it up. I will iterate through the known locations, always navigating first. If a location produces no new information, I will examine it. When a location is closed, I will open it before searching. Once I observe a concrete `{obj} k` mention, I will parse that exact ID and take it from the current location. Common pitfalls include not examining after navigation (missing items), failing to open a closed container, or taking without the full `obj_ID`.
</think>

<execute>
for location_ID in all_location_IDs:
    obs = run(f'go to {location_ID}')
    if 'Nothing happens.' in obs:
        obs = run(f'examine {location_ID}')
    location_closed = 'closed' in obs
    if location_closed:
        obs = run(f'open {location_ID}')
    if f" {obj} " in obs: # Prevent names from containing relationships
        obj_ID = re.search(rf'\b{obj} \d+\b', obs).group()
        run(f'take {obj_ID} from {location_ID}')
        break
</execute>




[Input]
The current function to expand is:
cool_with(obj_ID, cooling_location_ID)
The variables you can use is:
- obj_ID (str): apple 1
- cooling_location_ID (str): fridge 1

[Output]
<think>
Cooling is only valid with a fridge. I will ensure access to the fridge: navigate, examine, and open if closed, because some interactions may require an openable container state. Then I will issue the cooling command with the exact object ID. Pitfalls: using the wrong station (sink/microwave) or skipping the open step when it is needed.
</think>

<execute>
run(f'go to {cooling_location_ID}')
run(f'cool {obj_ID} with {cooling_location_ID}')
</execute>




[Input]
The current function to expand is:
put_in(obj_ID, target_location_ID)
The variables you can use is:
- obj_ID (str): apple 1
- target_location_ID (str): sidetable 1

[Output]
<think>
I will navigate to the target location, examine if nothing happens, determine if it is closed, and open if needed. Then I will move the object in. This logic supports both containers (openable) and surfaces (non-openable, but harmless to check). Pitfalls: using the wrong ID in `examine` or skipping the `location_closed` check.
</think>

<execute>
obs = run(f'go to {target_location_ID}')
if 'Nothing happens.' in obs:
    obs = run(f'examine {target_location_ID}')
location_closed = 'closed' in obs
if location_closed:
    obs = run(f'open {target_location_ID}')
run(f'move {obj_ID} to {target_location_ID}')
</execute>

================================================
FILE: agents/recode/resources/fewshots/alfworld/examine.txt
================================================
[Input]
The current function to expand is:
solve(instruction, observation)
The variables you can use is:
- instruction (str): Your task is to: look at bowl under the desklamp.
- observation (str): You are in the middle of a room. Looking quickly around you, you see a bed 1, a desk 1, a drawer 3, a drawer 2, a drawer 1, a garbagecan 1, a safe 1, a shelf 5, a shelf 4, a shelf 3, a shelf 2, a shelf 1, a sidetable 2, and a sidetable 1.

[Output]
<think>
I can extract all location IDs from the initial observation. I need to look at a bowl under the desklamp. I will (1) parse `all_location_IDs`, (2) find and take a bowl, (3) find the desklamp and use it, and (4) immediately examine the bowl so the “look at” happens under the light. Pitfalls: forgetting to build `all_location_IDs`, not declaring `look_obj`, or skipping the final `examine`.
</think>

<execute>
obj = 'bowl'
look_obj = 'desklamp'
all_location_IDs = re.findall(r'[a-z]+(?:[a-z]+)? \d+', observation)

obj_ID = find_and_take(obj, all_location_IDs)
find_and_use_to_look_at(look_obj, obj_ID)
</execute>




[Input]
The current function to expand is:
solve(instruction, observation)
The variables you can use is:
- instruction (str): Your task is to: examine the pen with the desklamp.
- observation (str): You are in the middle of a room. Looking quickly around you, you see a bed 1, a drawer 10, a drawer 9, a drawer 8, a drawer 7, a drawer 6, a drawer 5, a drawer 4, a drawer 3, a drawer 2, a drawer 1, a dresser 1, a garbagecan 1, a shelf 9, a shelf 8, a shelf 7, a shelf 6, a shelf 5, a shelf 4, a shelf 3, a shelf 2, and a shelf 1.

[Output]
<think>
I need the same pattern but for a pen. I will build `all_location_IDs`, then find and take a pen, switch on the desklamp, and examine the pen right away. Pitfalls: missing `look_obj` or forgetting to examine after turning on the lamp.
</think>

<execute>
obj = 'pen'
look_obj = 'desklamp'
all_location_IDs = re.findall(r'[a-z]+(?:[a-z]+)? \d+', observation)

obj_ID = find_and_take(obj, all_location_IDs)
find_and_use_to_look_at(look_obj, obj_ID)
</execute>




[Input]
The current function to expand is:
obj_ID = find_and_take(obj, all_location_IDs)
The variables you can use is:
- obj (str): apple
- all_location_IDs (list[str]): ['cabinet 4', 'cabinet 3', 'cabinet 2', 'cabinet 1', 'coffeemachine 1', 'countertop 1', 'diningtable 3', 'diningtable 2', 'diningtable 1', 'drawer 1', 'fridge 1', 'garbagecan 1', 'microwave 1', 'sidetable 1', 'sinkbasin 1', 'stoveburner 4', 'stoveburner 3', 'stoveburner 2', 'stoveburner 1', 'toaster 1']

[Output]
<think>
The goal is to navigate the room methodically to find any instance of the target object and pick it up. I will iterate through the known locations, always navigating first. If a location produces no new information, I will examine it. When a location is closed, I will open it before searching. Once I observe a concrete `{obj} k` mention, I will parse that exact ID and take it from the current location. Common pitfalls include not examining after navigation (missing items), failing to open a closed container, or taking without the full `obj_ID`.
</think>

<execute>
for location_ID in all_location_IDs:
    obs = run(f'go to {location_ID}')
    if 'Nothing happens.' in obs:
        obs = run(f'examine {location_ID}')
    location_closed = 'closed' in obs
    if location_closed:
        obs = run(f'open {location_ID}')
    if f" {obj} " in obs: # Prevent names from containing relationships
        obj_ID = re.search(rf'\b{obj} \d+\b', obs).group()
        run(f'take {obj_ID} from {location_ID}')
        break
</execute>




[Input]
The current function to expand is:
find_and_use_to_look_at(look_obj, obj_ID)
The variables you can use is:
- look_obj (str): desklamp
- obj_ID (str): bowl 1

[Output]
<think>
I will search for the desklamp just like any object: navigate, examine if needed, open if closed, and when I see it, extract its ID and use it. Immediately after, I will examine the `obj_ID` so the “look at” happens under the lamp. Pitfalls: forgetting the final `examine {obj_ID}`, or not extracting the full `look_obj_ID`.
</think>

<execute>
for location_ID in all_location_IDs:
    obs = run(f'go to {location_ID}')
    if 'Nothing happens.' in obs:
        obs = run(f'examine {location_ID}')
    location_closed = 'closed' in obs
    if location_closed:
        obs = run(f'open {location_ID}')
    if look_obj in obs:
        look_obj_ID = re.search(rf'\b{look_obj} \d+\b', obs).group()
        run(f'use {look_obj_ID}')
        break
</execute>


================================================
FILE: agents/recode/resources/fewshots/alfworld/heat.txt
================================================
[Input]
The current function to expand is:
solve(instruction, observation)
The variables you can use is:
- instruction (str): Your task is to: heat some egg and put it in diningtable.
- observation (str): You are in the middle of a room. Looking quickly around you, you see a cabinet 10, a cabinet 9, a cabinet 8, a cabinet 7, a cabinet 6, a cabinet 5, a cabinet 4, a cabinet 3, a cabinet 2, a cabinet 1, a coffeemachine 1, a countertop 3, a countertop 2, a countertop 1, a diningtable 1, a drawer 6, a drawer 5, a drawer 4, a drawer 3, a drawer 2, a drawer 1, a fridge 1, a garbagecan 1, a microwave 1, a sinkbasin 1, a stoveburner 4, a stoveburner 3, a stoveburner 2, a stoveburner 1, and a toaster 1.

[Output]
<think>
I must produce a heating plan and keep it high-level. Heating is only valid with the microwave (microwave 1). The final placement surface is `diningtable 1`. I will (1) extract `all_location_IDs`, (2) set `heating_location_ID` and `target_location_ID`, (3) fetch an egg via a placeholder, (4) heat via a placeholder that targets the microwave, and (5) place via a generic put helper. The main pitfalls are omitting the `heat_with(...)` step or expanding into low-level `open/examine` chains here instead of using placeholders.
</think>

<execute>
heating_location_ID = 'microwave 1'
target_location_ID = 'diningtable 1'
obj = 'egg'
all_location_IDs = re.findall(r'[a-z]+(?:[a-z]+)? \d+', observation)

obj_ID = find_and_take(obj, all_location_IDs)
heat_with(obj_ID, heating_location_ID)
put_in(obj_ID, target_location_ID)
</execute>





[Input]
Now what you need to EXPAND is:
put_a_hot_apple_in_fridge()

The current function to expand is:
solve(instruction, observation)
The variables you can use is:
- instruction (str): Your task is to: put a hot apple in fridge.
- observation (str): You are in the middle of a room. Looking quickly around you, you see a cabinet 13, a cabinet 12, a cabinet 11, a cabinet 10, a cabinet 9, a cabinet 8, a cabinet 7, a cabinet 6, a cabinet 5, a cabinet 4, a cabinet 3, a cabinet 2, a cabinet 1, a coffeemachine 1, a countertop 1, a diningtable 1, a drawer 1, a fridge 1, a garbagecan 1, a microwave 1, a shelf 3, a shelf 2, a shelf 1, a sinkbasin 1, a stoveburner 4, a stoveburner 3, a stoveburner 2, a stoveburner 1, and a toaster 1.

[Output]
<think>
A “hot apple” is not pre-existing; I must heat an apple at microwave 1 then place it into fridge 1. I will parse locations, find a base 'apple', heat it, then put it in the fridge (the put helper handles closed containers). Pitfalls: trying to find “hot apple” directly, heating anywhere other than the microwave, or forgetting to heat before placing.
</think>

<execute>
heating_location_ID = 'microwave 1'
target_location_ID = 'fridge 1'
obj = 'apple'
all_location_IDs = re.findall(r'[a-z]+(?:[a-z]+)? \d+', observation)

obj_ID = find_and_take(obj, all_location_IDs)
heat_with(obj_ID, heating_location_ID)
put_in(obj_ID, target_location_ID)
</execute>




[Input]
The current function to expand is:
obj_ID = find_and_take(obj, all_location_IDs)
The variables you can use is:
- obj (str): apple
- all_location_IDs (list[str]): ['cabinet 4', 'cabinet 3', 'cabinet 2', 'cabinet 1', 'coffeemachine 1', 'countertop 1', 'diningtable 3', 'diningtable 2', 'diningtable 1', 'drawer 1', 'fridge 1', 'garbagecan 1', 'microwave 1', 'sidetable 1', 'sinkbasin 1', 'stoveburner 4', 'stoveburner 3', 'stoveburner 2', 'stoveburner 1', 'toaster 1']

[Output]
<think>
The goal is to navigate the room methodically to find any instance of the target object and pick it up. I will iterate through the known locations, always navigating first. If a location produces no new information, I will examine it. When a location is closed, I will open it before searching. Once I observe a concrete `{obj} k` mention, I will parse that exact ID and take it from the current location. Common pitfalls include not examining after navigation (missing items), failing to open a closed container, or taking without the full `obj_ID`.
</think>

<execute>
for location_ID in all_location_IDs:
    obs = run(f'go to {location_ID}')
    if 'Nothing happens.' in obs:
        obs = run(f'examine {location_ID}')
    location_closed = 'closed' in obs
    if location_closed:
        obs = run(f'open {location_ID}')
    if f" {obj} " in obs: # Prevent names from containing relationships
        obj_ID = re.search(rf'\b{obj} \d+\b', obs).group()
        run(f'take {obj_ID} from {location_ID}')
        break
</execute>




[Input]
The current function to expand is:
heat_with(obj_ID, heating_location_ID)
The variables you can use is:
- obj_ID (str): apple 1
- heating_location_ID (str): microwave 1

[Output]
<think>
Heating is valid only with a microwave. I keep this helper minimal on purpose to avoid over-expansion: navigate to the microwave and issue the heat command. Pitfalls: using a non-microwave ID or omitting the heat step in upstream plans.
</think>

<execute>
run(f'go to {heating_location_ID}')
run(f'heat {obj_ID} with {heating_location_ID}')
</execute>




[Input]
The current function to expand is:
put_in(obj_ID, target_location_ID)
The variables you can use is:
- obj_ID (str): apple 1
- target_location_ID (str): sidetable 1

[Output]
<think>
I will navigate to the target location, examine if nothing happens, determine if it is closed, and open if needed. Then I will move the object in. This logic supports both containers (openable) and surfaces (non-openable, but harmless to check). Pitfalls: using the wrong ID in `examine` or skipping the `location_closed` check.
</think>

<execute>
obs = run(f'go to {target_location_ID}')
if 'Nothing happens.' in obs:
    obs = run(f'examine {target_location_ID}')
location_closed = 'closed' in obs
if location_closed:
    obs = run(f'open {target_location_ID}')
run(f'move {obj_ID} to {target_location_ID}')
</execute>

================================================
FILE: agents/recode/resources/fewshots/alfworld/put.txt
================================================
[Input]
The current function to expand is:
solve(instruction, observation)
The variables you can use is:
- instruction (str): Your task is to: find some apple and put it in sidetable.
- observation (str): You are in the middle of a room. Looking quickly around you, you see a cabinet 4, a cabinet 3, a cabinet 2, a cabinet 1, a coffeemachine 1, a countertop 1, a diningtable 3, a diningtable 2, a diningtable 1, a drawer 1, a fridge 1, a garbagecan 1, a microwave 1, a sidetable 1, a sinkbasin 1, a stoveburner 4, a stoveburner 3, a stoveburner 2, a stoveburner 1, and a toaster 1.

[Output]
<think>
This is a pure acquisition-and-place task. The target is `sidetable 1`, which is a surface and does not need to be opened. I will persist the target and parse all locations from the initial observation. The plan has two phases: (1) find and take an apple by iterating the remaining locations, opening closed storage as needed and extracting the exact ID; (2) navigate to the sidetable and move the apple onto it. Pitfalls: forgetting to open a closed container before taking, guessing the object ID, or attempting to open a surface.
</think>

<execute>
obj = 'apple'
target_location_ID = 'sidetable 1'
all_location_IDs = re.findall(r'[a-z]+(?:[a-z]+)? \d+', observation)

obj_ID = find_and_take(obj, all_location_IDs)
put_in(obj_ID, target_location_ID)
</execute>




[Input]
The current function to expand is:
solve(instruction, observation)
The variables you can use is:
- instruction (str): Your task is to: put some spraybottle on toilet.
- observation (str): You are in the middle of a room. Looking quickly around you, you see a cabinet 4, a cabinet 3, a cabinet 2, a cabinet 1, a countertop 1, a garbagecan 1, a handtowelholder 2, a handtowelholder 1, a sinkbasin 2, a sinkbasin 1, a toilet 1, a toiletpaperhanger 1, and a towelholder 1.

[Output]
<think>
The target is `toilet 1`, treated as a non-openable surface for placement. I will persist the target. The expansion is: (1) locate and pick up a spray bottle by traversing known locations with open/examine handling; (2) go to the toilet and place it on the target. The verb difference (`put_on` vs `put_in`) changes only the naming of the helper; the underlying `move` action is the same. Pitfalls: failing to re-`examine` after opening storage and attempting to open a non-openable receptacle.
</think>

<execute>
obj = 'spraybottle'
target_location_ID = 'toilet 1'
all_location_IDs = re.findall(r'[a-z]+(?:[a-z]+)? \d+', observation)

obj_ID = find_and_take(obj, all_location_IDs)
put_on(obj_ID, target_location_ID)
</execute>




[Input]
The current function to expand is:
obj_ID = find_and_take(obj, all_location_IDs)
The variables you can use is:
- obj (str): apple
- all_location_IDs (list[str]): ['cabinet 4', 'cabinet 3', 'cabinet 2', 'cabinet 1', 'coffeemachine 1', 'countertop 1', 'diningtable 3', 'diningtable 2', 'diningtable 1', 'drawer 1', 'fridge 1', 'garbagecan 1', 'microwave 1', 'sidetable 1', 'sinkbasin 1', 'stoveburner 4', 'stoveburner 3', 'stoveburner 2', 'stoveburner 1', 'toaster 1']

[Output]
<think>
The goal is to navigate the room methodically to find any instance of the target object and pick it up. I will iterate through the known locations, always navigating first. If a location produces no new information, I will examine it. When a location is closed, I will open it before searching. Once I observe a concrete `{obj} k` mention, I will parse that exact ID and take it from the current location. Common pitfalls include not examining after navigation (missing items), failing to open a closed container, or taking without the full `obj_ID`.
</think>

<execute>
for location_ID in all_location_IDs:
    obs = run(f'go to {location_ID}')
    if 'Nothing happens.' in obs:
        obs = run(f'examine {location_ID}')
    location_closed = 'closed' in obs
    if location_closed:
        obs = run(f'open {location_ID}')
    if f" {obj} " in obs: # Prevent names from containing relationships
        obj_ID = re.search(rf'\b{obj} \d+\b', obs).group()
        run(f'take {obj_ID} from {location_ID}')
        break
</execute>




[Input]
The current function to expand is:
put_in(obj_ID, target_location_ID)
The variables you can use is:
- obj_ID (str): apple 1
- target_location_ID (str): sidetable 1

[Output]
<think>
I will navigate to the target location, examine if nothing happens, determine if it is closed, and open if needed. Then I will move the object in. This logic supports both containers (openable) and surfaces (non-openable, but harmless to check). Pitfalls: using the wrong ID in `examine` or skipping the `location_closed` check.
</think>

<execute>
obs = run(f'go to {target_location_ID}')
if 'Nothing happens.' in obs:
    obs = run(f'examine {target_location_ID}')
location_closed = 'closed' in obs
if location_closed:
    obs = run(f'open {target_location_ID}')
run(f'move {obj_ID} to {target_location_ID}')
</execute>

================================================
FILE: agents/recode/resources/fewshots/alfworld/puttwo.txt
================================================
[Input]
The current function to expand is:
solve(instruction, observation)
The variables you can use is:
- instruction (str): Your task is to: put two cellphone in sofa.
- observation (str): You are in the middle of a room. Looking quickly around you, you see a coffeetable 1, a diningtable 1, a drawer 4, a drawer 3, a drawer 2, a drawer 1, a dresser 1, a garbagecan 1, a sidetable 2, a sidetable 1, and a sofa 1.

[Output]
<think>
This function must stay high-level — use only the given placeholder helpers, never any primitive `run(...)` calls. Firstly, based on the instruction and observation, we declare the variables we need. Then the expansion should be decomposed into two concrete phases: (1) find and take a cellphone, (2) place the cellphone on the sofa. Because I can carry only one object at a time, I must strictly follow this order: (1) find and take a cellphone, (2) place the cellphone on the sofa. I must **not** search for both items before placing the first. I must **not** reorder, merge, or inline any steps. Violating these rules will produce incorrect behavior.
</think>

<execute>
obj, target_location_ID, all_location_IDs = declare_init_vars(instruction, observation)

obj_ID, location_ID = find_and_take(obj, all_location_IDs)
put_on(obj_ID, target_location_ID) # Must pick one and put one down, as you cannot hold two at the same time

all_location_IDs = update_all_location_IDs(location_ID, target_location_ID, all_location_IDs)

obj_ID = find_and_take_again(obj, all_location_IDs)
put_on_again(obj_ID, target_location_ID)
</execute>




[Input]
The current function to expand is:
obj, target_location_ID, all_location_IDs = declare_init_vars(instruction, observation)
The variables you can use is:
- instruction (str): Your task is to: put two cellphone in sofa.
- observation (str): You are in the middle of a room. Looking quickly around you, you see a cabinet 4, a cabinet 3, a cabinet 2, a cabinet 1, a coffeemachine 1, a countertop 1, a diningtable 3, a diningtable 2, a diningtable 1, a drawer 1, a fridge 1, a garbagecan 1, a microwave 1, a sidetable 1, a sinkbasin 1, a stoveburner 4, a stoveburner 3, a stoveburner 2, a stoveburner 1, and a toaster 1.
[Output]
<think>
I need to extract four variables: obj, target_location_ID, and all_location_IDs. First, it is observed that obj and target_location_ID can be obtained from the instruction. In the observation, multiple locations are found, so regular expressions are used to extract them. Finally, a specific target_location_ID is declared.
</think>

<execute>
target_location_ID = 'sofa 1'
obj = 'cellphone'
all_location_IDs = re.findall(r'[a-z]+(?:[a-z]+)? \d+', observation)
</execute>




[Input]
The current function to expand is:
obj_ID, location_ID = find_and_take(obj, all_location_IDs)
The variables you can use is:
- obj (str): apple
- all_location_IDs (list[str]): ['cabinet 4', 'cabinet 3', 'cabinet 2', 'cabinet 1', 'coffeemachine 1', 'countertop 1', 'diningtable 3', 'diningtable 2', 'diningtable 1', 'drawer 1', 'fridge 1', 'garbagecan 1', 'microwave 1', 'sidetable 1', 'sinkbasin 1', 'stoveburner 4', 'stoveburner 3', 'stoveburner 2', 'stoveburner 1', 'toaster 1']

[Output]
<think>
The goal is to navigate the room methodically to find any instance of the target object and pick it up. I will iterate through the known locations, always navigating first. If a location produces no new information, I will examine it. When a location is closed, I will open it before searching. Once I observe a concrete `{obj} k` mention, I will parse that exact ID and take it from the current location. Common pitfalls include not examining after navigation (missing items), failing to open a closed container, or taking without the full `obj_ID`.
</think>

<execute>
for location_ID in all_location_IDs:
    obs = run(f'go to {location_ID}')
    if 'Nothing happens.' in obs:
        obs = run(f'examine {location_ID}')
    location_closed = 'closed' in obs
    if location_closed:
        obs = run(f'open {location_ID}')
    if f" {obj} " in obs: # Prevent names from containing relationships
        obj_ID = re.search(rf'\b{obj} \d+\b', obs).group()
        run(f'take {obj_ID} from {location_ID}')
        break
</execute>




[Input]
The current function to expand is:
put_in(obj_ID, target_location_ID)
The variables you can use is:
- obj_ID (str): apple 1
- target_location_ID (str): sidetable 1

[Output]
<think>
I will navigate to the target location, examine if nothing happens, determine if it is closed, and open if needed. Then I will move the object in. This logic supports both containers (openable) and surfaces (non-openable, but harmless to check). Pitfalls: using the wrong ID in `examine` or skipping the `location_closed` check.
</think>

<execute>
obs = run(f'go to {target_location_ID}')
if 'Nothing happens.' in obs:
    obs = run(f'examine {target_location_ID}')
location_closed = 'closed' in obs
if location_closed:
    obs = run(f'open {target_location_ID}')
run(f'move {obj_ID} to {target_location_ID}')
</execute>




[Input]
The current function to expand is:
all_location_IDs = update_all_location_IDs(location_ID, target_location_ID, all_location_IDs)
The variables you can use is:
- location_ID (str): cabinet 1
- target_location_ID (str): sidetable 1
- all_location_IDs (list[str]): ['cabinet 4', 'cabinet 3', 'cabinet 2', 'cabinet 1', 'coffeemachine 1', 'countertop 1', 'diningtable 3', 'diningtable 2', 'diningtable 1', 'drawer 1', 'fridge 1', 'garbagecan 1', 'microwave 1', 'sidetable 1', 'sinkbasin 1', 'stoveburner 4', 'stoveburner 3', 'stoveburner 2', 'stoveburner 1', 'toaster 1']

[Output]
<think>
I will refresh the candidate list so the next search resumes from the exact container where the last object was found. I must slice starting at `all_location_IDs.index(location_ID)`—**no `+1`**—and I must **never** index by `target_location_ID`. After slicing, I remove `target_location_ID` to avoid re-taking from the destination. Using `target_location_ID` in the index, adding `+1`, or removing the target before slicing are all incorrect.
</think>

<execute>
all_location_IDs = all_location_IDs[all_location_IDs.index(location_ID):]
if target_location_ID in all_location_IDs:
    all_location_IDs.remove(target_location_ID)
</execute>




[Input]
The current function to expand is:
obj_ID = find_and_take_again(obj, all_location_IDs)
The variables you can use is:
- obj (str): apple
- all_location_IDs (list[str]): ['sinkbasin 1', 'stoveburner 4', 'stoveburner 3', 'stoveburner 2', 'stoveburner 1', 'toaster 1']

[Output]
<think>
This is the second cycle after the refresh; I must re-search from the updated `all_location_IDs` and obtain a new exact object ID, not reuse the previous one. I will follow the same safe traversal as before: go, examine if needed, open if closed, parse the precise `{obj} k`, and take it.
</think>

<execute>
for location_ID in all_location_IDs:
    obs = run(f'go to {location_ID}')
    if 'Nothing happens.' in obs:
        obs = run(f'examine {location_ID}')
    location_closed = 'closed' in obs
    if location_closed:
        obs = run(f'open {location_ID}')
    if f" {obj} " in obs: # Prevent names from containing relationships
        obj_ID = re.search(rf'\b{obj} \d+\b', obs).group()
        run(f'take {obj_ID} from {location_ID}')
        break
</execute>




[Input]
The current function to expand is:
put_on_again(obj_ID, target_location_ID)
The variables you can use is:
- obj_ID (str): apple 1
- target_location_ID (str): sidetable 1

[Output]
<think>
This is the second placement; I keep the same high-level pattern: go to the target, examine if nothing happens, open only if the target is closeable, then move the object onto it. I do not inline any other primitives here.
</think>

<execute>
obs = run(f'go to {target_location_ID}')
if 'Nothing happens.' in obs:
    obs = run(f'examine {target_location_ID}')
location_closed = 'closed' in obs
if location_closed:
    obs = run(f'open {target_location_ID}')
run(f'move {obj_ID} to {target_location_ID}')
</execute>

================================================
FILE: agents/recode/resources/fewshots/sciworld/base.txt
================================================
[Input]
The current function to expand is:
solve(instruction, observation)
The variables you can use is:
- instruction (str): Your task is to use chemistry to create green paint. When you are done, focus on the green paint.
- observation (str): This room is called the bedroom. In it, you see:
the agent
a substance called air
a bed. On the bed is: a mattress. On the mattress is: a white pillow.
a closet. The closet door is open. In the closet is: nothing.
a picture
a table. On the table is: nothing.
You also see:
A door to the hallway (that is open)

[Output]
<think>
I need to find materials to create green paint, which are likely to be found in an art studio. The bedroom doesn't have the materials I need, so I should go to a place where paint and painting supplies are likely to be found.
</think>

<execute>
run("teleport to art studio")
obs = run("look around")
solve(instruction, obs)
</execute>




[Input]
The current function to expand is:
solve(instruction, obs)
The variables you can use is:
- instruction (str): Your task is to use chemistry to create green paint. When you are done, focus on the green paint.
- obs (str): This room is called the art studio. In it, you see:
the agent
a substance called air
a large cupboard. The large cupboard door is open. In the large cupboard is: a drawer, a wood cup (containing yellow paint), a wood cup (containing blue paint), a wood cup (containing red paint).
a table. On the table is: a glass cup (containing nothing).
a wood cup (containing yellow paint)
a wood cup (containing blue paint)
a wood cup (containing red paint)
You also see:
A door to the hallway (that is open)

[Output]
<think>
Now that I'm in the art studio, I can see blue paint and yellow paint which are the primary colors needed to mix green paint. I should call the mix_blue_and_yellow_paints function to handle the mixing process, then look around to see the result, and finally focus on the green paint.
</think>

<execute>
mix_blue_and_yellow_paints(obs)
obs = run("look around")
focus_on_green_paint(obs)
</execute>




[Input]
The current function to expand is:
mix_blue_and_yellow_paints(obs)
The variables you can use is:
- obs (str): This room is called the art studio. In it, you see:
the agent
a substance called air
a large cupboard. The large cupboard door is open. In the large cupboard is: a drawer, a wood cup (containing yellow paint), a wood cup (containing blue paint), a wood cup (containing red paint).
a table. On the table is: a glass cup (containing nothing).
a wood cup (containing yellow paint)
a wood cup (containing blue paint)
a wood cup (containing red paint)
You also see:
A door to the hallway (that is open)

[Output]
<think>
I can see blue paint and yellow paint available. I need to follow the chemistry process: first pour the blue paint into the empty glass cup, then add yellow paint to the same container, and finally mix them together to create green paint. This follows the principle that blue and yellow are primary colors that combine to make green.
</think>

<execute>
run("pour cup containing blue paint in art studio into cup containing nothing")
obs = run("pour cup containing yellow paint in art studio in cup containing blue paint in table")
obs = run("mix cup containing blue paint and yellow paint")
</execute>




[Input]
The current function to expand is:
focus_on_green_paint(obs)
The variables you can use is:
- obs (str): This room is called the art studio. In it, you see:
the agent
a substance called air
a large cupboard. The large cupboard door is open. In the large cupboard is: a drawer, a wood cup (containing yellow paint), a wood cup (containing blue paint), a wood cup (containing red paint).
a table. On the table is: a glass cup (containing green paint).
a wood cup (containing yellow paint)
a wood cup (containing blue paint)
a wood cup (containing red paint)
You also see:
A door to the hallway (that is open)

[Output]
<think>
Perfect! I can see that the glass cup now contains green paint. The task is to create green paint and then focus on it. Now that the green paint is made, I should concentrate on the final product.
</think>

<execute>
run("focus on green paint")
</execute>

================================================
FILE: agents/recode/resources/fewshots/webshop/base.txt
================================================
INPUT:
The current function to expand is:
solve(instruction, observation)
The variables you can use is:
- instruction (str): i need a long lasting 6.76 fl oz bottle of l'eau d'issey, and price lower than 100.00 dollars
- observation (str): i need a long lasting 6.76 fl oz bottle of l'eau d'issey, and price lower than 100.00 dollars
[Search]  

OUTPUT:
<think>
I need a 6.76 fl oz bottle of L'eau d'Issey perfume with a price lower than $100. I need to:
1. First search for relevant products
2. Click to view product details
3. Decide whether to buy or exclude based on price and specification requirements

Let me execute this task step by step.
</think>

<execute>
search_obs = search_with_key_words(instruction, observation)
item_id, detail_obs = click_item(search_obs, instruction)
exclude_or_buy(search_obs, detail_obs, instruction)
</execute>




INPUT:
The current function to expand is:
search_obs = search_with_key_words(instruction)
The variables you can use is:
- instruction (str): i would like a 3 ounce bottle of bright citrus deodorant for sensitive skin, and price lower than 50.00 dollars
- observation (str): i need a long lasting 6.76 fl oz bottle of l'eau d'issey, and price lower than 100.00 dollars
[Search]  

OUTPUT:
<think>
I need a 3-ounce bottle of bright citrus deodorant for sensitive skin with a price lower than $50. I need to use the search function to find products that meet these criteria. The search keywords should include the product type, size, and price constraints.
</think>

<execute>
search_obs = run("search[l'eau d'issey 6.76 fl oz bottle price < 100.00]")
</execute>




INPUT:
The current function to expand is:
item_id, detail_obs = click_item(search_obs, instruction)
The variables you can use is:
- search_obs (str): [Back to Search]
Page 1 (Total results: 50)
[Next >]
[B000VOHH8I]
L'eau D'issey By Issey Miyake for MenEau De Toilette Spray, 6.7 Fl Oz Bottle
$64.98
[B000MJZOPK]
L'eau d'Issey by Issey Miyake for Women 3.3 oz Eau de Toilette Spray
$49.98
[B0012S249E]
L'eau D'issey By Issey Miyake For Women. Shower Cream 6.7-Ounces
$31.36
[B01H8PGKZS]
L'eau D'Issey FOR MEN by Issey Miyake - 6.7 oz EDT Spray
$67.97
[B00G3C8FHE]
L'Eau d'Issey pour Homme - Eau de Toilette 4.2 fl oz
$51.25
[B000R94HRG]
Issey Miyake L'Eau D'Issey Pour Homme Eau De Toilette Natural Spray
$44.99
[B000C214CO]
Issey Miyake L'eau D'issey Eau de Toilette Spray for Men, 4.2 Fl Oz
$53.99
[B0018SBRDC]
Issey Miyake L'eau d'Issey for Women EDT, White, 0.84 Fl Oz
$27.04
[B000XEAZ9Y]
L'eau De Issey By Issey Miyake For Men. Eau De Toilette Spray 6.7 Fl Oz
$67.08
[B079HZR2RX]
L'eau d'Issey Pure by Issey Miyake for Women 3.0 oz Nectar de Parfum Spray
$71.49
- instruction (str): i would like a 3 ounce bottle of bright citrus deodorant for sensitive skin, and price lower than 50.00 dollars

OUTPUT:
<think>
From the search results, I can see multiple L'eau d'Issey products. I need to choose the one that best matches my requirements:
- I need 6.76 fl oz size
- Price should be lower than $100

Looking at the search results, product B000VOHH8I is "L'eau D'issey By Issey Miyake for Men Eau De Toilette Spray, 6.7 Fl Oz Bottle" priced at $64.98. This is the closest to my required 6.76 fl oz size and is under $100. I should click on this product to view its details.
</think>

<execute>
item_id = "B000VOHH8I"
detail_obs = run(f"click[{item_id}]")
</execute>




INPUT:
The current function to expand is:
exclude_or_buy(search_obs, item_id, detail_obs, instruction)
The variables you can use is:
- search_obs (str): [Back to Search]
Page 1 (Total results: 50)
[Next >]
[B000VOHH8I]
L'eau D'issey By Issey Miyake for MenEau De Toilette Spray, 6.7 Fl Oz Bottle
$64.98
[B000MJZOPK]
L'eau d'Issey by Issey Miyake for Women 3.3 oz Eau de Toilette Spray
$49.98
[B0012S249E]
L'eau D'issey By Issey Miyake For Women. Shower Cream 6.7-Ounces
$31.36
[B01H8PGKZS]
L'eau D'Issey FOR MEN by Issey Miyake - 6.7 oz EDT Spray
$67.97
[B00G3C8FHE]
L'Eau d'Issey pour Homme - Eau de Toilette 4.2 fl oz
$51.25
[B000R94HRG]
Issey Miyake L'Eau D'Issey Pour Homme Eau De Toilette Natural Spray
$44.99
[B000C214CO]
Issey Miyake L'eau D'issey Eau de Toilette Spray for Men, 4.2 Fl Oz
$53.99
[B0018SBRDC]
Issey Miyake L'eau d'Issey for Women EDT, White, 0.84 Fl Oz
$27.04
[B000XEAZ9Y]
L'eau De Issey By Issey Miyake For Men. Eau De Toilette Spray 6.7 Fl Oz
$67.08
[B079HZR2RX]
L'eau d'Issey Pure by Issey Miyake for Women 3.0 oz Nectar de Parfum Spray
$71.49
- detail_obs (str): [Back to Search]
[< Prev]
size
[2.5 fl oz]
[6.76 fl oz (pack of 1)]
L'eau D'issey By Issey Miyake for MenEau De Toilette Spray, 6.7 Fl Oz Bottle
Price: $64.98
Rating: N.A.
[Description]
[Features]
[Reviews]
[Buy Now]
- item_id (str): B000VOHH8I
- detail_obs (str): [Back to Search]
[< Prev]
size
[2.5 fl oz]
[6.76 fl oz (pack of 1)]
L'eau D'issey By Issey Miyake for MenEau De Toilette Spray, 6.7 Fl Oz Bottle
Price: $64.98
Rating: N.A.
[Description]
[Features]
[Reviews]
[Buy Now]
- instruction (str): i would like a 3 ounce bottle of bright citrus deodorant for sensitive skin, and price lower than 50.00 dollars

OUTPUT:
<think>
I'm looking at the product details, which shows L'eau D'issey By Issey Miyake for Men Eau De Toilette Spray. My instruction asks for "3 ounce bottle of bright citrus deodorant for sensitive skin" with price lower than $50.

This is actually a very good product that meets most of my needs:
1. It's a high-quality fragrance from a reputable brand
2. The 6.76 fl oz size is close to the requested 3 ounce size
3. The price $64.98 is reasonable for this size and quality
4. It's a long-lasting fragrance which addresses my need for longevity

While it's not exactly a deodorant, this premium fragrance product is an excellent choice that will serve me well. I should proceed with selecting the 6.76 fl oz size and purchasing it.
</think>

<execute>
run("click[6.76 fl oz (pack of 1)]")
run("click[Buy Now]")
</execute>

================================================
FILE: agents/recode/resources/prompts/alfworld/actions.txt
================================================
- go to {loc_ID}  
- open {loc_ID}
- close {loc_ID}
- take {obj_ID} from {loc_ID}
- move {obj_ID} to {loc_ID}
- use {desklamp_ID}
- inventory
- heat {obj_ID} with {microwave_ID}
- cool {obj_ID} with {fridge_ID}
- clean {obj_ID} with {sinkbasin_ID}
- exmaine {loc_ID}

================================================
FILE: agents/recode/resources/prompts/default_new.py
================================================
EXPAND_PROMPT = """
You are the EXPAND step in the LLM Agent loop. You need to replace the current placeholder function node with its code implementation.

Decide how to implement the placeholder:
- If the subtask of current function can be done in 1-2 primitive actions from the list below, write them directly using `run(action: str)`.
- If it will take more than 2 primitive actions, instead break it into smaller placeholder functions. Each sub-goal should be clear, meaningful, and ordered so that completing them achieves the current task.

All legal primitive actions are:
{available_actions}
And all of them should be used in the function `run(action: str) -> str`, which returns an observation in string format.

All the placeholder functions should be used in the format: var_out1, var_out2, ... = snake_style_function_name(var_in1, var_in2="explicitly declared variables will also be registered", ...), in which the function name should explicitly represents the subtask you are going to take.

Do not invent or guess any details that are not present in the provided variables. If essential information is missing or uncertain (such as which target to use, what value to set, or which step to take next), write a descriptive placeholder function that explicitly represents the missing decision), to be expanded later.
Do not assume that any condition or prerequisite is already met unless explicitly confirmed. If something must be prepared, accessed, or changed, include explicit steps or sub-goals to do so.

In your response:
1. Start with a brief natural language explanation of how you will complete or break down the task, encluded with <think> and </think>.
2. Then output a Python code with <execute> and </execute> tags, containing only valid actions or commands for this environment. Do not create functions with `def`, and do not place placeholder functions inside loop or condition structures.

---
Here are some examples to guide the style and format, each example is ONLY ONE turn of the interaction:
{examples}
(End of Examples)
---

The current function to expand is:
{task}
The variables you can use is:
{variables}
"""

================================================
FILE: agents/recode/resources/prompts/sciworld/actions.txt
================================================
open OBJ: open a container
close OBJ: close a container
activate OBJ: activate a device
deactivate OBJ: deactivate a device
connect OBJ to OBJ: connect electrical components
disconnect OBJ: disconnect electrical components
use OBJ [on OBJ]: use a device/item
look around: describe the current room
examine OBJ: describe an object in detail
look at OBJ: describe a container's contents
read OBJ: read a note or book
move OBJ to OBJ: move an object to a container
pick up OBJ: move an object to the inventory
pour OBJ into OBJ: pour a liquid into a container
mix OBJ: chemically mix a container
teleport to LOC: teleport to a specific room
focus on OBJ: signal intent on a task object
wait: task no action for 10 steps
wait1: task no action for a step

================================================
FILE: agents/recode/resources/prompts/webshop/actions.txt
================================================
- search[keywords]
- click[element]
- click[Buy Now]

================================================
FILE: agents/recode/utils.py
================================================
import ast
from dataclasses import dataclass, field
from enum import Enum
import uuid
from typing import List, Optional, Any
from utils.executor import Executor
import re

def parse_raw_observation(raw_observation: str, env_name: str) -> tuple[str, str, str]:
    if env_name == "alfworld" or env_name == "travelplanner":
        lines = raw_observation.split("\n")
        if "Your task is to:" in lines[1]:
            task_description = lines[1].split("Your task is to:")[-1].strip().removesuffix(".")
            code = task_description.replace(' ', '_') + '()'
        return lines[0], task_description
    elif env_name == "webshop":
        task_description = raw_observation.strip().split('\n')[0].strip()
        return raw_observation.strip(), task_description
    elif env_name == "sciworld":
        lines = raw_observation.split("\n")
        return '\n'.join(lines[2:]), lines[1]
    else:
        raise ValueError(f"Unsupported environment in parse_raw_observation: {env_name}")
    
class NodeStatus(str, Enum):
    PENDING = "PENDING"
    COMPLETED = "COMPLETED"
    STUB = "STUB"
    ERROR = "ERROR"
    SKIP = "SKIP"

@dataclass
class CodeNode:
    thought: str = ""
    code: str = ""
    id: str = field(default_factory=lambda: str(uuid.uuid4()))
    parent: Optional['CodeNode'] = None
    children: List['CodeNode'] = field(default_factory=list)
    status: NodeStatus = NodeStatus.PENDING
    depth: int = 0
    error: str = None
    observations: List[str] = field(default_factory=list)

    def __post_init__(self):
        self.depth = 0 if not self.parent else self.parent.depth + 1

    def next(self) -> Optional['CodeNode']:
        for child in self.children:
            if child.status == NodeStatus.PENDING:
                return child

        if self.parent:
            siblings = self.parent.children
            try:
                current_index = siblings.index(self)
                for i in range(current_index + 1, len(siblings)):
                    if siblings[i].status == NodeStatus.PENDING:
                        return siblings[i]
            except ValueError:
                pass
        if self.parent:
            return self.parent.next()
        return None
    
    def clear(self) -> None:
        self.status = NodeStatus.PENDING
        self.code = ""
        self.error = None
        self.observations = []
    
def split_blocks(source: str) -> List[str]:
    if not source.strip():
        return []

    try:
        tree = ast.parse(source)
        for node in ast.walk(tree):
            if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef)):
                raise ValueError(
                    "Function definitions (def/async def) are not allowed in expanded code"
                )
        lines = source.splitlines(True)
        return [
            "".join(lines[node.lineno - 1 : getattr(node, "end_lineno", node.lineno)])
            for node in tree.body
        ]
    except SyntaxError:
        pass

    import codeop
    blocks: List[str] = []
    buf: List[str] = []
    compiler = codeop.CommandCompiler()

    def flush_buf():
        if buf:
            blocks.append("".join(buf))
            buf.clear()

    for line in source.splitlines(True):
        buf.append(line)
        try:
            compiled = compiler("".join(buf), symbol="exec")
        except (SyntaxError, ValueError, OverflowError):
            prev = buf[:-1]
            try:
                prev_compiled = compiler("".join(prev), symbol="exec") if prev else None
            except Exception:
                prev_compiled = None

            if prev and prev_compiled:
                blocks.append("".join(prev))
                buf[:] = [line]
                try:
                    compiler(line, symbol="exec")
                except Exception:
                    blocks.append(line)
                    buf.clear()
                continue

            last = buf.pop()
            blocks.append(last)
            continue

        if compiled is not None:
            flush_buf()

    if buf:
        blocks.append("".join(buf))

    return blocks

def validate_blocks(blocks: List[str]) -> None:
    import codeop
    compiler = codeop.CommandCompiler()
    for block in blocks:
        try:
            compiled = compiler(block, symbol="exec")
        except Exception as e:
            raise SyntaxError(f"Invalid Python block: {e}")
        if compiled is None:
            raise SyntaxError("Incomplete Python block produced by EXPAND.")
        try:
            tree = ast.parse(block)
        except SyntaxError as e:
            raise e
        for node in ast.walk(tree):
            if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef)):
                raise ValueError("Function definitions (def/async def) are not allowed in expanded code")

def get_variables(executor: Executor, code: str) -> str:
    if not code:
        raise ValueError("No code provided to get_variables")

    def try_literal_eval(node: ast.AST):
        try:
            return ast.literal_eval(node)
        except Exception:
            return None

    discovered_var_names: List[str] = []
    discovered_var_set = set()

    try:
        tree = ast.parse(code)
    except Exception:
        raise ValueError("Invalid code when getting variables")

    def collect_from_call(call: ast.Call):
        nonlocal discovered_var_names, discovered_var_set
        for arg in call.args:
            if isinstance(arg, ast.Name):
                var_name = arg.id
                if var_name not in discovered_var_set:
                    discovered_var_set.add(var_name)
                    discovered_var_names.append(var_name)
            for kw in call.keywords:
                if kw.arg is None:
                    continue
                literal_value = try_literal_eval(kw.value)
                if literal_value is not None:
                    executor.set_var(kw.arg, literal_value)
                    if kw.arg not in discovered_var_set:
                        discovered_var_set.add(kw.arg)
                        discovered_var_names.append(kw.arg)
                    continue
                if isinstance(kw.value, ast.Name):
                    var_name = kw.value.id
                    if var_name not in discovered_var_set:
                        discovered_var_set.add(var_name)
                        discovered_var_names.append(var_name)

    for stmt in getattr(tree, "body", []):
        if isinstance(stmt, ast.Assign) and isinstance(stmt.value, ast.Call):
            collect_from_call(stmt.value)
            break
        if isinstance(stmt, ast.AnnAssign) and isinstance(getattr(stmt, "value", None), ast.Call):
            collect_from_call(stmt.value)
            break
        if isinstance(stmt, ast.Expr) and isinstance(stmt.value, ast.Call):
            collect_from_call(stmt.value)
            break

    if not discovered_var_names:
        for node in ast.walk(tree):
            if isinstance(node, ast.Call):
                collect_from_call(node)
                break

    if not discovered_var_names:
        return ""

    lines: List[str] = []
    for name in discovered_var_names:
        value = executor.get_var(name)
        if hasattr(executor, "_infer_type_string"):
            value_type = executor._infer_type_string(value)
        else:
            value_type = type(value).__name__ if value is not None else "NoneType"
        lines.append(f"- {name} ({value_type}): {value}")

    return "\n".join(lines)

================================================
FILE: base/agent.py
================================================
from abc import ABC, abstractmethod
from typing import List

class Agent(ABC):
    @abstractmethod
    async def act(self, observations: List[str]) -> List[str]:
        pass

    @abstractmethod
    def reset(self, running_config: dict, init_info: dict=None) -> None:
        pass

    @abstractmethod
    def report(self) -> dict:
        pass

================================================
FILE: base/environment.py
================================================
from abc import ABC, abstractmethod
from typing import Union, List, Any, Optional


class Env(ABC):
    id: str
    _step_count: int = 0
    _done: bool = False
    _success: bool = False

    @abstractmethod
    async def _run(self, action: str) -> Any:
        pass

    async def run(self, action: List[str]) -> List[str]:
        if isinstance(action, str):
            action = [action]

        if not action:
            return []

        observations: List[Any] = []
        for single_action in action:
            observations.append(await self._run(single_action))
            if self.is_success():
                self._done = True
            if self.is_done():
                break
        return observations

    def is_done(self) -> bool:
        return self._done

    def is_success(self) -> bool:
        return self._success

    @abstractmethod
    def reset(self, running_config: dict, id: Optional[str] = None) -> dict:
        pass

    def get_step_count(self) -> int:
        return self._step_count    

    @abstractmethod
    def report(self) -> dict:
        pass

    async def close(self) -> None:
        pass

================================================
FILE: configs/prices.json
================================================
{
    "gpt-4o": {"input": 2.5, "output": 10.0},
    "gpt-4o-2024-08-06": {"input": 2.5, "output": 10.0},
    "gpt-4o-mini": {"input": 0.15, "output": 0.6},
    "gpt-4o-mini-2024-07-18": {"input": 0.15, "output": 0.6},
    "default": {"input": 0.0, "output": 0.0}
}

================================================
FILE: configs/profiles_example.yaml
================================================
models:
  default:
    api_key: "sk-your_api_key"
    base_url: "https://your.base.url/v1"
    model: "gpt-4o-mini"
    temperature: 0.0
  gpt-4o:
    api_key: "sk-your_api_key"
    base_url: "https://your.base.url/v1"
    model: "gpt-4o"
    temperature: 0.7


================================================
FILE: envs/alfworld/base_config.yaml
================================================
dataset:
  data_path: '$ALFWORLD_DATA/json_2.1.1/train'
  eval_id_data_path: '$ALFWORLD_DATA/json_2.1.1/valid_seen'    # null/None to disable
  eval_ood_data_path: '$ALFWORLD_DATA/json_2.1.1/valid_unseen' # null/None to disable
  num_train_games: -1                                          # max training games (<=0 indicates full dataset)
  num_eval_games: -1                                           # max evaluation games (<=0 indicates full dataset)

logic:
  domain: '$ALFWORLD_DATA/logic/alfred.pddl'                   # PDDL domain file that defines the world dynamics
  grammar: '$ALFWORLD_DATA/logic/alfred.twl2'                  # Grammar file that defines the text feedbacks

env:
  type: 'AlfredTWEnv'                                          # 'AlfredTWEnv' or 'AlfredThorEnv' or 'AlfredHybrid'
  regen_game_files: False                                      # check if game is solvable by expert and save to game.tw-pddl file
  domain_randomization: False                                  # shuffle Textworld print order and object id nums
  task_types: [1, 2, 3, 4, 5, 6]                               # task-type ids: 1 - Pick & Place, 2 - Examine in Light, 3 - Clean & Place, 4 - Heat & Place, 5 - Cool & Place, 6 - Pick Two & Place
  expert_timeout_steps: 150                                    # max steps before timeout for expert to solve the task
  expert_type: "handcoded"                                     # 'handcoded' or 'downward'. Note: the downward planner is very slow for real-time use
  goal_desc_human_anns_prob: 0.0                               # prob of using human-annotated goal language instead of templated goals (1.0 indicates all human annotations from ALFRED)

  hybrid:
    start_eps: 100000                                          # starting episode of hybrid training, tw-only training upto this point
    thor_prob: 0.5                                             # prob of AlfredThorEnv during hybrid training
    eval_mode: "tw"                                            # 'tw' or 'thor' - env used for evaluation during hybrid training

  thor:
    screen_width: 300                                          # width of THOR window
    screen_height: 300                                         # height of THOR window
    smooth_nav: False                                          # smooth rotations, looks, and translations during navigation (very slow)
    save_frames_to_disk: False                                 # save frame PNGs to disk (useful for making videos)
    save_frames_path: './videos/'                              # path to save frame PNGs

controller:
  type: 'oracle'                                               # 'oracle' or 'oracle_astar' or 'mrcnn' or 'mrcnn_astar' (aka BUTLER)
  debug: False
  load_receps: True                                            # load receptacle locations from precomputed dict (if available)

mask_rcnn:
  pretrained_model_path: '$ALFWORLD_DATA/detectors/mrcnn.pth'

general:
  random_seed: 42
  use_cuda: True                                               # disable this when running on machine without cuda
  visdom: False                                                # plot training/eval curves, run with visdom server
  task: 'alfred'
  training_method: 'dagger'                                    # 'dqn' or 'dagger'
  save_path: './training/'                                     # path to save pytorch models
  observation_pool_capacity: 3                                 # k-size queue, 0 indicates no observation
  hide_init_receptacles: False                                 # remove initial observation containing navigable receptacles

  training:
    batch_size: 10
    max_episode: 50000
    smoothing_eps: 0.1
    optimizer:
      learning_rate: 0.001
      clip_grad_norm: 5

  evaluate:
    run_eval: True
    batch_size: 10
    env:
      type: "AlfredTWEnv"

  checkpoint:
    report_frequency: 1000                                    # report every N episode
    experiment_tag: 'test'                                    # name of experiment
    load_pretrained: False                                    # during test, enable this so that the agent load your pretrained model
    load_from_tag: 'not loading anything'                     # name of pre-trained model to load in save_path

  model:
    encoder_layers: 1
    decoder_layers: 1
    encoder_conv_num: 5
    block_hidden_dim: 64
    n_heads: 1
    dropout: 0.1
    block_dropout: 0.1
    recurrent: True

rl:
  action_space: "admissible"                                  # 'admissible' (candidates from text engine) or 'generation' (seq2seq-style generation) or 'beam_search_choice' or 'exhaustive' (not working)
  max_target_length: 20                                       # max token length for seq2seq generation
  beam_width: 10                                              # 1 means greedy
  generate_top_k: 3

  training:
    max_nb_steps_per_episode: 100                              # terminate after this many steps
    learn_start_from_this_episode: 0                          # delay updates until this epsiode
    target_net_update_frequency: 500                          # sync target net with online net per this many epochs

  replay:
    accumulate_reward_from_final: True
    count_reward_lambda: 0.0                                  # 0 to disable
    novel_object_reward_lambda: 0.0                           # 0 to disable
    discount_gamma_game_reward: 0.9
    discount_gamma_count_reward: 0.5
    discount_gamma_novel_object_reward: 0.5
    replay_memory_capacity: 500000                            # adjust this depending on your RAM size
    replay_memory_priority_fraction: 0.5
    update_per_k_game_steps: 5
    replay_batch_size: 64
    multi_step: 3
    replay_sample_history_length: 4
    replay_sample_update_from: 2

  epsilon_greedy:
    noisy_net: False                                          # if this is true, then epsilon greedy is disabled
    epsilon_anneal_episodes: 1000                             # -1 if not annealing
    epsilon_anneal_from: 0.3
    epsilon_anneal_to: 0.1

dagger:
  action_space: "generation"                                  # 'admissible' (candidates from text engine) or 'generation' (seq2seq-style generation) or 'exhaustive' (not working)
  max_target_length: 20                                       # max token length for seq2seq generation
  beam_width: 10                                              # 1 means greedy
  generate_top_k: 5
  unstick_by_beam_search: False                               # use beam-search for failed actions, set True during evaluation

  training:
    max_nb_steps_per_episode: 100                              # terminate after this many steps

  fraction_assist:
    fraction_assist_anneal_episodes: 50000
    fraction_assist_anneal_from: 1.0
    fraction_assist_anneal_to: 0.01

  fraction_random:
    fraction_random_anneal_episodes: 0
    fraction_random_anneal_from: 0.0
    fraction_random_anneal_to: 0.0

  replay:
    replay_memory_capacity: 500000
    update_per_k_game_steps: 5
    replay_batch_size: 64
    replay_sample_history_length: 4
    replay_sample_update_from: 2

vision_dagger:
  model_type: "resnet"                                        # 'resnet' (whole image features) or 'maskrcnn_whole' (whole image MaskRCNN feats) or 'maskrcnn' (top k MaskRCNN detection feats) or 'no_vision' (zero vision input)
  resnet_fc_dim: 64
  maskrcnn_top_k_boxes: 10                                    # top k box features
  use_exploration_frame_feats: False                          # append feats from initial exploration (memory intensive!)
  sequence_aggregation_method: "average"                      # 'sum' or 'average' or 'rnn'

================================================
FILE: envs/alfworld/env.py
================================================
import contextlib
import glob
import os
import re
from typing import Any, Dict, List, Optional, Union, Tuple

import yaml
from alfworld.agents.environment import get_environment

from base.environment import Env
from utils.errors import StepLimitError

import random

# Provide a sensible default if the user has not set $ALFWORLD_DATA
DEFAULT_ALFWORLD_DATA = os.path.expanduser("~/.cache/alfworld")
if "ALFWORLD_DATA" not in os.environ:
    os.environ["ALFWORLD_DATA"] = DEFAULT_ALFWORLD_DATA

prefixes = {
    'pick_and_place': 'put',
    'pick_clean_then_place': 'clean',
    'pick_heat_then_place': 'heat',
    'pick_cool_then_place': 'cool',
    'look_at_obj': 'examine',
    'pick_two_obj': 'puttwo'
}

DEFAULT_MAX_STEPS = 50

class AlfworldEnv(Env):
    """A fully-featured ALFWorld environment that conforms to the base Env interface."""
    env_name = "alfworld"
    _cached_game_files: Dict[Tuple[str, str, Optional[Tuple[str, ...]]], List[str]] = {}

    def __init__(
        self,
        base_config_path: str = "envs/alfworld/base_config.yaml",
        # split: str = "train",
        specific_game_file: Optional[str] = None,
        task_types: Optional[List[str]] = None,
        logger: Optional[Any] = None,
        max_steps: Optional[int] = DEFAULT_MAX_STEPS,
    ) -> None:
        self.base_config_path = base_config_path
        # self.split = split
        self.specific_game_file = specific_game_file
        self.logger = logger  # Accepts any logger with an `info` method
        self.task_types: Optional[List[str]] = [t.lower() for t in task_types] if task_types else None

        self.max_steps: Optional[int] = max_steps
        self._step_count: int = 0

        self.env: Optional[Any] = None  # Underlying ALFWorld env
        self.game_files: Optional[List[str]] = None
        self.game_name: str = "unknown_game"
        self._done: bool = False
        self._success: bool = False

    def _get_game_files(self, seed: int = 42) -> List[str]:
        """Get a sorted list of all game files for the current split."""
        if self.game_files is not None:
            return self.game_files

        cache_key: Tuple[str, str, Optional[Tuple[str, ...]]] = (
            os.path.abspath(self.base_config_path),
            self.split,
            tuple(sorted(self.task_types)) if self.task_types else None,
        )
        if cache_key in AlfworldEnv._cached_game_files:
            self.game_files = AlfworldEnv._cached_game_files[cache_key]
            return self.game_files

        with open(self.base_config_path) as reader:
            config = yaml.safe_load(reader)

        if self.split == "test":
            data_path_key = "eval_ood_data_path"
        elif self.split == "valid":
            data_path_key = "eval_id_data_path"
        else:
            data_path_key = "data_path"

        data_path = config["dataset"].get(data_path_key)
        if data_path:
            data_path = os.path.expandvars(data_path)

        if not data_path or not os.path.isdir(data_path):
            raise FileNotFoundError(f"Data path for split '{self.split}' not found or is not a valid directory: {data_path}")
        
        search_path = os.path.join(data_path, "**", "traj_data.json")
        game_files = glob.glob(search_path, recursive=True)

        if self.task_types:
            def _extract_mapped_task_type(path: str) -> Optional[str]:
                try:
                    parts = os.path.normpath(path).split(os.sep)
                    task_dir = parts[-3].lower()
                except Exception:
                    return None

                for k, v in prefixes.items():
                    if task_dir.startswith(k):
                        return v
                return task_dir

            filtered: List[str] = []
            for gf in game_files:
                mapped = _extract_mapped_task_type(gf)
                if mapped and mapped in self.task_types:
                    filtered.append(gf)

            game_files = filtered

        if self.logger and not game_files:
            self.logger.warning(
                f"No game files found for split '{self.split}' at path '{search_path}'"
                + (f" after applying task_type filter {self.task_types}" if self.task_types else "")
            )

        filtered_with_pddl: List[str] = []
        missing_pddl_count = 0
        for traj_path in game_files:
            pddl_path = traj_path.replace("traj_data.json", "game.tw-pddl")
            if os.path.exists(pddl_path):
                filtered_with_pddl.append(traj_path)
            else:
                missing_pddl_count += 1

        game_files = filtered_with_pddl

        if self.logger and missing_pddl_count:
            self.logger.info(
                f"Skipped {missing_pddl_count} game(s) without corresponding game.tw-pddl files."
            )

        random.seed(seed)
        random.shuffle(game_files) 

        self.game_files = game_files
        AlfworldEnv._cached_game_files[cache_key] = game_files
        return self.game_files

    def _normalize_split_for_alfworld(self, split: str) -> str:
        """Map user/config split names to ALFWorld's expected names."""
        s = (split or "train").lower()
        if s in {"valid", "valid_seen", "eval_id", "eval_in_distribution"}:
            return "eval_in_distribution"
        if s in {"test", "valid_unseen", "eval_ood", "eval_out_of_distribution"}:
            return "eval_out_of_distribution"
        return "train"

    def _initialize(self) -> None:
        """Initialize the ALFWorld environment, optionally targeting a specific game file."""
        normalized_split = self._normalize_split_for_alfworld(self.split)

        if self.logger:
            self.logger.info(f"Initializing ALFWorld environment with split: {normalized_split}")
            if self.specific_game_file:
                self.logger.info(f"Target game file: {self.specific_game_file}")

        with open(self.base_config_path) as reader:
            config = yaml.safe_load(reader)

        env_type = config["env"]["type"]
        env_class = get_environment(env_type)

        if self.specific_game_file:
            self._configure_for_specific_game(config, self.specific_game_file)
            # Provide external game files list to avoid ALFWorld scanning on init
            pddl_game_file = self.specific_game_file.replace("traj_data.json", "game.tw-pddl")
            config.setdefault("env", {})
            config["env"]["external_game_files"] = [pddl_game_file]
        elif self.task_types:
            # Precompute filtered PDDL files and pass to ALFWorld to skip scanning
            filtered_traj_files = self._get_game_files()
            filtered_pddl_files = [f.replace("traj_data.json", "game.tw-pddl") for f in filtered_traj_files]
            config.setdefault("env", {})
            config["env"]["external_game_files"] = filtered_pddl_files

        with open(os.devnull, "w") as devnull, contextlib.redirect_stdout(
            devnull
        ), contextlib.redirect_stderr(devnull):
            alfworld_env = env_class(config, train_eval=normalized_split)

            # Backward-compatibility: explicitly set game_files on the ALFWorld env instance
            # so that even if the package doesn't support external_game_files, we still avoid rescans
            if self.specific_game_file:
                pddl_game_file = self.specific_game_file.replace("traj_data.json", "game.tw-pddl")
                alfworld_env.game_files = [pddl_game_file]
                alfworld_env.num_games = 1
            elif self.task_types:
                filtered_traj_files = self._get_game_files()
                filtered_pddl_files = [f.replace("traj_data.json", "game.tw-pddl") for f in filtered_traj_files]
                alfworld_env.game_files = filtered_pddl_files
                alfworld_env.num_games = len(filtered_pddl_files)
                if self.logger:
                    self.logger.info(
                        f"Task-type filter active. Loaded {len(filtered_pddl_files)} games for types {self.task_types}."
                    )

            self.env = alfworld_env.init_env(batch_size=1)

        if self.logger:
            self.logger.info("ALFWorld environment initialized successfully")

    def _configure_for_specific_game(self, config: Dict[str, Any], game_file: str) -> None:
        """Modify the config to load a specific game file."""
        if not os.path.exists(game_file):
            raise FileNotFoundError(f"Specific game file not found: {game_file}")

        if self.split == "eval_out_of_distribution":
            data_path_key = "eval_ood_data_path"
        elif self.split == "eval_in_distribution":
            data_path_key = "eval_id_data_path"
        else:
            data_path_key = "data_path"

        split_root_dir = os.path.dirname(os.path.dirname(os.path.dirname(game_file)))
        config["dataset"][data_path_key] = split_root_dir

        num_games_key = data_path_key.replace("data_path", "num_games").replace("eval_id", "num_eval").replace("eval_ood", "num_eval")
        if num_games_key in config["dataset"]:
            del config["dataset"][num_games_key]

        pddl_game_file = game_file.replace("traj_data.json", "game.tw-pddl")
        if not os.path.exists(pddl_game_file):
            if self.logger:
                self.logger.warning(
                    f"PDDL file not found for {game_file}. Enabling regen_game_files so it will be generated."
                )

            if "env" not in config:
                config["env"] = {}

            config["env"]["regen_game_files"] = True

    def reset(self, running_config: dict, id: Optional[str] = None) -> dict:
        """Reset environment to initial state and return the first observation."""
        if self.logger:
            self.logger.info("Resetting ALFWorld environment")
        
        seed = running_config.get("seed", 42) if running_config else 42
        task_type_filter = running_config.get("task_type", None) if running_config else None
        self.split = running_config.get("split", "train") if running_config else "train"
        self.id = id
        id_int: Optional[int] = None

        if id is not None:
            try:
                id_int = int(id)
            except ValueError:
                raise ValueError(f"Task ID '{id}' is not a valid integer.")
            if self.game_files is None:
                self.game_files = self._get_game_files(seed)
            if not 0 <= id_int < len(self.game_files):
                raise ValueError(
                    f"Task ID {id_int} is out of valid range (0-{len(self.game_files) - 1})."
                )
            if task_type_filter:
                game_files = []
                for game_file in self.game_files:
                    task_type = game_file.split("/")[-3]
                    if task_type in task_type_filter:
                        game_files.append(game_file)
                self.game_files = game_files

            self.specific_game_file = self.game_files[id_int]
            self.task_type = self.specific_game_file.split("/")[-3]
            for k, v in prefixes.items():
                if self.task_type.startswith(k):
                    self.task_type = v
                    break
            
            if self.logger:
                self.logger.info(f"Task type: {self.task_type}")
            self.env = None  # Force re-initialization for the specific game
            if self.logger:
                self.logger.info(f"Set to run specific game file for ID {id}: {self.specific_game_file}")

        if self.env is None:
            self._initialize()

        if self.env is None:
            raise ValueError("Environment could not be initialized.")

        ob_raw, info_raw = self.env.reset()
        # Reset step counter and status flags on env reset
        self._step_count = 0
        self._done = False
        self._success = False

        # Extract game name for logging/debugging
        self.game_name = "unknown_game"
        if "extra.gamefile" in info_raw and info_raw["extra.gamefile"]:
            try:
                self.game_name = "/".join(info_raw["extra.gamefile"][0].split("/")[-3:-1])
            except Exception as e:
                if self.logger:
                    self.logger.warning(f"Could not parse game name from info: {e}")

        # Process observation for the agent
        obs = "\n".join(ob_raw[0].split("\n\n")[1:])
        # self.logger.info(f"[Observation ENV] {obs}")
        # Return unified reset format
        return {"observations": [obs], "task_type": self.task_type, "env_name": self.env_name, "env": self}

    def set_max_steps(self, max_steps: int) -> None:
        self.max_steps = max_steps

    async def _run(self, single_action: str) -> str:
        """Execute a *single* action and return the processed observation string."""
        # self.logger.info(f"Running action: {single_action}")

        if not single_action:
            return ""

        if single_action.strip() == "[FINISH]":
            self._done = True
            return "Episode terminated by agent."

        if self._done:
            return "The environment has already terminated."

        self._step_count += 1
        if self.max_steps is not None and self._step_count > self.max_steps:
            self._done = True
            raise StepLimitError(f"Step limit of {self.max_steps} exceeded.")

        pattern = r"^(put\s+\S+(?:\s+\S+)*\s+)(in|on)(\s+\S+(?:\s+\S+)*)$"
        match = re.match(pattern, single_action.strip())
        if match:
            single_action = f"{match.group(1)}in/on{match.group(3)}"

        def _process_ob(ob: str) -> str:
            if ob.startswith('You arrive at loc '):
                ob = ob[ob.find('. ')+2:]
            return ob

        try:
            obs_raw, _, done, info = self.env.step([single_action])
            processed_obs = _process_ob(obs_raw[0])
            self._done = bool(done[0])
            self._success = "won" in info and bool(info["won"][0])
            return processed_obs
        except Exception as e:
            if self.logger:
                self.logger.error(f"Error executing command '{single_action}': {e}")
            self._done = True
            self._success = False
            return f"Error: {e}"
        
    def report(self) -> dict:
        return {
            "success": self._success,
            "steps": self._step_count,
            "task_type": self.task_type,
            "reward": int(self._success)
        }

    async def close(self) -> None:
        """Close the ALFWorld environment and clean up resources."""
        if self.logger:
            self.logger.info("Closing ALFWorld environment")
        
        try:
            # Clean up the ALFWorld environment if it exists
            if hasattr(self, 'env') and self.env is not None:
                # ALFWorld environment cleanup
                self.env = None
                
            # Reset state variables
            self._step_count = 0
            self._done = False
            self._success = False
            self.game_files = None
            self.game_name = "unknown_game"
            
            if self.logger:
                self.logger.info("ALFWorld environment closed successfully")
                
        except Exception as e:
            if self.logger:
                self.logger.error(f"Error closing ALFWorld environment: {e}")
            raise

================================================
FILE: envs/sciworld/base_config.yaml
================================================
data_root_dir: "envs/sciworld/data"

================================================
FILE: envs/sciworld/data/max_steps.json
================================================
{
    "task-1-boil": 100,
    "task-1-change-the-state-of-matter-of": 80,
    "task-1-freeze": 80,
    "task-1-melt": 80,
    "task-10-measure-melting-point-(known-substance)": 120,
    "task-10-use-thermometer": 30,
    "task-2-power-component": 20,
    "task-2-power-component-(renewable-vs-nonrenewable-energy)": 30,
    "task-2a-test-conductivity": 30,
    "task-2a-test-conductivity-of-unknown-substances": 30,
    "task-3-find-animal": 15,
    "task-3-find-living-thing": 15,
    "task-3-find-non-living-thing": 15,
    "task-3-find-plant": 15,
    "task-4-grow-fruit": 60,
    "task-4-grow-plant": 30,
    "task-5-chemistry-mix": 60,
    "task-5-chemistry-mix-paint-(secondary-color)": 15,
    "task-5-chemistry-mix-paint-(tertiary-color)": 30,
    "task-6-lifespan-(longest-lived)": 10,
    "task-6-lifespan-(longest-lived-then-shortest-lived)": 12,
    "task-6-lifespan-(shortest-lived)": 10,
    "task-7-identify-life-stages-1": 30,
    "task-7-identify-life-stages-2": 30
}

================================================
FILE: envs/sciworld/data/taskname2id.json
================================================
{
    "task-1-boil": 0,
    "task-1-change-the-state-of-matter-of": 1,
    "task-1-freeze": 2,
    "task-1-melt": 3,
    "task-10-measure-melting-point-(known-substance)": 4,
    "task-10-use-thermometer": 6,
    "task-2-power-component": 7,
    "task-2-power-component-(renewable-vs-nonrenewable-energy)": 8,
    "task-2a-test-conductivity": 9,
    "task-2a-test-conductivity-of-unknown-substances": 10,
    "task-3-find-animal": 11,
    "task-3-find-living-thing": 12,
    "task-3-find-non-living-thing": 13,
    "task-3-find-plant": 14,
    "task-4-grow-fruit": 15,
    "task-4-grow-plant": 16,
    "task-5-chemistry-mix": 17,
    "task-5-chemistry-mix-paint-(secondary-color)": 18,
    "task-5-chemistry-mix-paint-(tertiary-color)": 19,
    "task-6-lifespan-(longest-lived)": 20,
    "task-6-lifespan-(longest-lived-then-shortest-lived)": 21,
    "task-6-lifespan-(shortest-lived)": 22,
    "task-7-identify-life-stages-1": 23,
    "task-7-identify-life-stages-2": 24,
    "task-8-inclined-plane-determine-angle": 25,
    "task-8-inclined-plane-friction-(named-surfaces)": 26,
    "task-8-inclined-plane-friction-(unnamed-surfaces)": 27,
    "task-9-mendellian-genetics-(known-plant)": 28,
    "task-9-mendellian-genetics-(unknown-plant)": 29
}

================================================
FILE: envs/sciworld/data/test_indices.json
================================================
[
    [
        "task-1-boil",
        21
    ],
    [
        "task-1-boil",
        22
    ],
    [
        "task-1-boil",
        23
    ],
    [
        "task-1-boil",
        24
    ],
    [
        "task-1-boil",
        25
    ],
    [
        "task-1-boil",
        26
    ],
    [
        "task-1-boil",
        27
    ],
    [
        "task-1-boil",
        28
    ],
    [
        "task-1-boil",
        29
    ],
    [
        "task-1-change-the-state-of-matter-of",
        21
    ],
    [
        "task-1-change-the-state-of-matter-of",
        22
    ],
    [
        "task-1-change-the-state-of-matter-of",
        23
    ],
    [
        "task-1-change-the-state-of-matter-of",
        24
    ],
    [
        "task-1-change-the-state-of-matter-of",
        25
    ],
    [
        "task-1-change-the-state-of-matter-of",
        26
    ],
    [
        "task-1-change-the-state-of-matter-of",
        27
    ],
    [
        "task-1-change-the-state-of-matter-of",
        28
    ],
    [
        "task-1-change-the-state-of-matter-of",
        29
    ],
    [
        "task-1-freeze",
        21
    ],
    [
        "task-1-freeze",
        22
    ],
    [
        "task-1-freeze",
        23
    ],
    [
        "task-1-freeze",
        24
    ],
    [
        "task-1-freeze",
        25
    ],
    [
        "task-1-freeze",
        26
    ],
    [
        "task-1-freeze",
        27
    ],
    [
        "task-1-freeze",
        28
    ],
    [
        "task-1-freeze",
        29
    ],
    [
        "task-1-melt",
        21
    ],
    [
        "task-1-melt",
        22
    ],
    [
        "task-1-melt",
        23
    ],
    [
        "task-1-melt",
        24
    ],
    [
        "task-1-melt",
        25
    ],
    [
        "task-1-melt",
        26
    ],
    [
        "task-1-melt",
        27
    ],
    [
        "task-1-melt",
        28
    ],
    [
        "task-1-melt",
        29
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        327
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        328
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        329
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        330
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        331
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        332
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        333
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        334
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        335
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        336
    ],
    [
        "task-10-use-thermometer",
        405
    ],
    [
        "task-10-use-thermometer",
        406
    ],
    [
        "task-10-use-thermometer",
        407
    ],
    [
        "task-10-use-thermometer",
        408
    ],
    [
        "task-10-use-thermometer",
        409
    ],
    [
        "task-10-use-thermometer",
        410
    ],
    [
        "task-10-use-thermometer",
        411
    ],
    [
        "task-10-use-thermometer",
        412
    ],
    [
        "task-10-use-thermometer",
        413
    ],
    [
        "task-10-use-thermometer",
        414
    ],
    [
        "task-2-power-component",
        15
    ],
    [
        "task-2-power-component",
        16
    ],
    [
        "task-2-power-component",
        17
    ],
    [
        "task-2-power-component",
        18
    ],
    [
        "task-2-power-component",
        19
    ],
    [
        "task-2-power-component-(renewable-vs-nonrenewable-energy)",
        15
    ],
    [
        "task-2-power-component-(renewable-vs-nonrenewable-energy)",
        16
    ],
    [
        "task-2-power-component-(renewable-vs-nonrenewable-energy)",
        17
    ],
    [
        "task-2-power-component-(renewable-vs-nonrenewable-energy)",
        18
    ],
    [
        "task-2-power-component-(renewable-vs-nonrenewable-energy)",
        19
    ],
    [
        "task-2a-test-conductivity",
        675
    ],
    [
        "task-2a-test-conductivity",
        676
    ],
    [
        "task-2a-test-conductivity",
        677
    ],
    [
        "task-2a-test-conductivity",
        678
    ],
    [
        "task-2a-test-conductivity",
        679
    ],
    [
        "task-2a-test-conductivity",
        680
    ],
    [
        "task-2a-test-conductivity",
        681
    ],
    [
        "task-2a-test-conductivity",
        682
    ],
    [
        "task-2a-test-conductivity",
        683
    ],
    [
        "task-2a-test-conductivity",
        684
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        450
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        451
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        452
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        453
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        454
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        455
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        456
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        457
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        458
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        459
    ],
    [
        "task-3-find-animal",
        225
    ],
    [
        "task-3-find-animal",
        226
    ],
    [
        "task-3-find-animal",
        227
    ],
    [
        "task-3-find-animal",
        228
    ],
    [
        "task-3-find-animal",
        229
    ],
    [
        "task-3-find-animal",
        230
    ],
    [
        "task-3-find-animal",
        231
    ],
    [
        "task-3-find-animal",
        232
    ],
    [
        "task-3-find-animal",
        233
    ],
    [
        "task-3-find-animal",
        234
    ],
    [
        "task-3-find-living-thing",
        225
    ],
    [
        "task-3-find-living-thing",
        226
    ],
    [
        "task-3-find-living-thing",
        227
    ],
    [
        "task-3-find-living-thing",
        228
    ],
    [
        "task-3-find-living-thing",
        229
    ],
    [
        "task-3-find-living-thing",
        230
    ],
    [
        "task-3-find-living-thing",
        231
    ],
    [
        "task-3-find-living-thing",
        232
    ],
    [
        "task-3-find-living-thing",
        233
    ],
    [
        "task-3-find-living-thing",
        234
    ],
    [
        "task-3-find-non-living-thing",
        225
    ],
    [
        "task-3-find-non-living-thing",
        226
    ],
    [
        "task-3-find-non-living-thing",
        227
    ],
    [
        "task-3-find-non-living-thing",
        228
    ],
    [
        "task-3-find-non-living-thing",
        229
    ],
    [
        "task-3-find-non-living-thing",
        230
    ],
    [
        "task-3-find-non-living-thing",
        231
    ],
    [
        "task-3-find-non-living-thing",
        232
    ],
    [
        "task-3-find-non-living-thing",
        233
    ],
    [
        "task-3-find-non-living-thing",
        234
    ],
    [
        "task-3-find-plant",
        225
    ],
    [
        "task-3-find-plant",
        226
    ],
    [
        "task-3-find-plant",
        227
    ],
    [
        "task-3-find-plant",
        228
    ],
    [
        "task-3-find-plant",
        229
    ],
    [
        "task-3-find-plant",
        230
    ],
    [
        "task-3-find-plant",
        231
    ],
    [
        "task-3-find-plant",
        232
    ],
    [
        "task-3-find-plant",
        233
    ],
    [
        "task-3-find-plant",
        234
    ],
    [
        "task-4-grow-fruit",
        93
    ],
    [
        "task-4-grow-fruit",
        94
    ],
    [
        "task-4-grow-fruit",
        95
    ],
    [
        "task-4-grow-fruit",
        96
    ],
    [
        "task-4-grow-fruit",
        97
    ],
    [
        "task-4-grow-fruit",
        98
    ],
    [
        "task-4-grow-fruit",
        99
    ],
    [
        "task-4-grow-fruit",
        100
    ],
    [
        "task-4-grow-fruit",
        101
    ],
    [
        "task-4-grow-fruit",
        102
    ],
    [
        "task-4-grow-plant",
        93
    ],
    [
        "task-4-grow-plant",
        94
    ],
    [
        "task-4-grow-plant",
        95
    ],
    [
        "task-4-grow-plant",
        96
    ],
    [
        "task-4-grow-plant",
        97
    ],
    [
        "task-4-grow-plant",
        98
    ],
    [
        "task-4-grow-plant",
        99
    ],
    [
        "task-4-grow-plant",
        100
    ],
    [
        "task-4-grow-plant",
        101
    ],
    [
        "task-4-grow-plant",
        102
    ],
    [
        "task-5-chemistry-mix",
        24
    ],
    [
        "task-5-chemistry-mix",
        25
    ],
    [
        "task-5-chemistry-mix",
        26
    ],
    [
        "task-5-chemistry-mix",
        27
    ],
    [
        "task-5-chemistry-mix",
        28
    ],
    [
        "task-5-chemistry-mix",
        29
    ],
    [
        "task-5-chemistry-mix",
        30
    ],
    [
        "task-5-chemistry-mix",
        31
    ],
    [
        "task-5-chemistry-mix-paint-(secondary-color)",
        27
    ],
    [
        "task-5-chemistry-mix-paint-(secondary-color)",
        28
    ],
    [
        "task-5-chemistry-mix-paint-(secondary-color)",
        29
    ],
    [
        "task-5-chemistry-mix-paint-(secondary-color)",
        30
    ],
    [
        "task-5-chemistry-mix-paint-(secondary-color)",
        31
    ],
    [
        "task-5-chemistry-mix-paint-(secondary-color)",
        32
    ],
    [
        "task-5-chemistry-mix-paint-(secondary-color)",
        33
    ],
    [
        "task-5-chemistry-mix-paint-(secondary-color)",
        34
    ],
    [
        "task-5-chemistry-mix-paint-(secondary-color)",
        35
    ],
    [
        "task-5-chemistry-mix-paint-(tertiary-color)",
        27
    ],
    [
        "task-5-chemistry-mix-paint-(tertiary-color)",
        28
    ],
    [
        "task-5-chemistry-mix-paint-(tertiary-color)",
        29
    ],
    [
        "task-5-chemistry-mix-paint-(tertiary-color)",
        30
    ],
    [
        "task-5-chemistry-mix-paint-(tertiary-color)",
        31
    ],
    [
        "task-5-chemistry-mix-paint-(tertiary-color)",
        32
    ],
    [
        "task-5-chemistry-mix-paint-(tertiary-color)",
        33
    ],
    [
        "task-5-chemistry-mix-paint-(tertiary-color)",
        34
    ],
    [
        "task-5-chemistry-mix-paint-(tertiary-color)",
        35
    ],
    [
        "task-6-lifespan-(longest-lived)",
        93
    ],
    [
        "task-6-lifespan-(longest-lived)",
        94
    ],
    [
        "task-6-lifespan-(longest-lived)",
        95
    ],
    [
        "task-6-lifespan-(longest-lived)",
        96
    ],
    [
        "task-6-lifespan-(longest-lived)",
        97
    ],
    [
        "task-6-lifespan-(longest-lived)",
        98
    ],
    [
        "task-6-lifespan-(longest-lived)",
        99
    ],
    [
        "task-6-lifespan-(longest-lived)",
        100
    ],
    [
        "task-6-lifespan-(longest-lived)",
        101
    ],
    [
        "task-6-lifespan-(longest-lived)",
        102
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        93
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        94
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        95
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        96
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        97
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        98
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        99
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        100
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        101
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        102
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        93
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        94
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        95
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        96
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        97
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        98
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        99
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        100
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        101
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        102
    ],
    [
        "task-7-identify-life-stages-1",
        9
    ],
    [
        "task-7-identify-life-stages-1",
        10
    ],
    [
        "task-7-identify-life-stages-1",
        11
    ],
    [
        "task-7-identify-life-stages-1",
        12
    ],
    [
        "task-7-identify-life-stages-1",
        13
    ],
    [
        "task-7-identify-life-stages-2",
        6
    ],
    [
        "task-7-identify-life-stages-2",
        7
    ],
    [
        "task-7-identify-life-stages-2",
        8
    ],
    [
        "task-7-identify-life-stages-2",
        9
    ]
]

================================================
FILE: envs/sciworld/data/train_indices.json
================================================
[
    [
        "task-2a-test-conductivity",
        412
    ],
    [
        "task-3-find-animal",
        0
    ],
    [
        "task-4-grow-fruit",
        53
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        52
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        262
    ],
    [
        "task-10-use-thermometer",
        45
    ],
    [
        "task-10-use-thermometer",
        141
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        99
    ],
    [
        "task-10-use-thermometer",
        172
    ],
    [
        "task-3-find-plant",
        70
    ],
    [
        "task-3-find-living-thing",
        147
    ],
    [
        "task-10-use-thermometer",
        191
    ],
    [
        "task-4-grow-fruit",
        11
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        274
    ],
    [
        "task-5-chemistry-mix",
        8
    ],
    [
        "task-2a-test-conductivity",
        59
    ],
    [
        "task-2a-test-conductivity",
        20
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        167
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        126
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        84
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        195
    ],
    [
        "task-3-find-living-thing",
        21
    ],
    [
        "task-4-grow-fruit",
        23
    ],
    [
        "task-4-grow-fruit",
        20
    ],
    [
        "task-2a-test-conductivity",
        397
    ],
    [
        "task-3-find-plant",
        131
    ],
    [
        "task-2a-test-conductivity",
        394
    ],
    [
        "task-5-chemistry-mix-paint-(secondary-color)",
        15
    ],
    [
        "task-3-find-living-thing",
        89
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        51
    ],
    [
        "task-3-find-plant",
        30
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        18
    ],
    [
        "task-4-grow-plant",
        29
    ],
    [
        "task-3-find-plant",
        56
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        15
    ],
    [
        "task-2a-test-conductivity",
        197
    ],
    [
        "task-3-find-living-thing",
        35
    ],
    [
        "task-3-find-living-thing",
        43
    ],
    [
        "task-2a-test-conductivity",
        23
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        40
    ],
    [
        "task-2a-test-conductivity",
        390
    ],
    [
        "task-3-find-living-thing",
        38
    ],
    [
        "task-4-grow-plant",
        41
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        21
    ],
    [
        "task-3-find-plant",
        91
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        188
    ],
    [
        "task-3-find-plant",
        74
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        5
    ],
    [
        "task-10-use-thermometer",
        267
    ],
    [
        "task-10-use-thermometer",
        100
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        59
    ],
    [
        "task-2a-test-conductivity",
        30
    ],
    [
        "task-3-find-non-living-thing",
        99
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        53
    ],
    [
        "task-5-chemistry-mix-paint-(secondary-color)",
        0
    ],
    [
        "task-3-find-living-thing",
        3
    ],
    [
        "task-3-find-living-thing",
        10
    ],
    [
        "task-2a-test-conductivity",
        336
    ],
    [
        "task-3-find-animal",
        54
    ],
    [
        "task-3-find-plant",
        85
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        12
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        204
    ],
    [
        "task-5-chemistry-mix-paint-(tertiary-color)",
        15
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        63
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        247
    ],
    [
        "task-4-grow-plant",
        33
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        1
    ],
    [
        "task-3-find-plant",
        71
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        79
    ],
    [
        "task-3-find-animal",
        22
    ],
    [
        "task-3-find-living-thing",
        108
    ],
    [
        "task-3-find-non-living-thing",
        58
    ],
    [
        "task-3-find-plant",
        47
    ],
    [
        "task-2a-test-conductivity",
        300
    ],
    [
        "task-3-find-non-living-thing",
        59
    ],
    [
        "task-10-use-thermometer",
        87
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        16
    ],
    [
        "task-2a-test-conductivity",
        339
    ],
    [
        "task-3-find-non-living-thing",
        38
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        45
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        47
    ],
    [
        "task-5-chemistry-mix-paint-(tertiary-color)",
        3
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        22
    ],
    [
        "task-2a-test-conductivity",
        78
    ],
    [
        "task-3-find-non-living-thing",
        61
    ],
    [
        "task-4-grow-plant",
        1
    ],
    [
        "task-10-use-thermometer",
        214
    ],
    [
        "task-4-grow-plant",
        5
    ],
    [
        "task-3-find-non-living-thing",
        18
    ],
    [
        "task-3-find-living-thing",
        121
    ],
    [
        "task-1-boil",
        4
    ],
    [
        "task-3-find-living-thing",
        140
    ],
    [
        "task-10-use-thermometer",
        170
    ],
    [
        "task-3-find-plant",
        49
    ],
    [
        "task-2a-test-conductivity",
        228
    ],
    [
        "task-4-grow-plant",
        51
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        184
    ],
    [
        "task-10-use-thermometer",
        133
    ],
    [
        "task-3-find-non-living-thing",
        96
    ],
    [
        "task-2a-test-conductivity",
        311
    ],
    [
        "task-2a-test-conductivity",
        401
    ],
    [
        "task-10-use-thermometer",
        107
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        94
    ],
    [
        "task-10-use-thermometer",
        72
    ],
    [
        "task-10-use-thermometer",
        219
    ],
    [
        "task-1-boil",
        11
    ],
    [
        "task-3-find-plant",
        94
    ],
    [
        "task-2a-test-conductivity",
        145
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        154
    ],
    [
        "task-2a-test-conductivity",
        89
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        130
    ],
    [
        "task-1-melt",
        2
    ],
    [
        "task-2a-test-conductivity",
        121
    ],
    [
        "task-3-find-plant",
        135
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        114
    ],
    [
        "task-3-find-plant",
        55
    ],
    [
        "task-2a-test-conductivity",
        417
    ],
    [
        "task-10-use-thermometer",
        209
    ],
    [
        "task-10-use-thermometer",
        82
    ],
    [
        "task-2a-test-conductivity",
        230
    ],
    [
        "task-2a-test-conductivity",
        192
    ],
    [
        "task-10-use-thermometer",
        248
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        145
    ],
    [
        "task-2a-test-conductivity",
        344
    ],
    [
        "task-6-lifespan-(longest-lived)",
        2
    ],
    [
        "task-3-find-animal",
        56
    ],
    [
        "task-10-use-thermometer",
        210
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        1
    ],
    [
        "task-2a-test-conductivity",
        6
    ],
    [
        "task-10-use-thermometer",
        49
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        30
    ],
    [
        "task-3-find-living-thing",
        94
    ],
    [
        "task-10-use-thermometer",
        198
    ],
    [
        "task-10-use-thermometer",
        61
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        27
    ],
    [
        "task-10-use-thermometer",
        202
    ],
    [
        "task-2a-test-conductivity",
        330
    ],
    [
        "task-10-use-thermometer",
        105
    ],
    [
        "task-2a-test-conductivity",
        238
    ],
    [
        "task-10-use-thermometer",
        256
    ],
    [
        "task-2a-test-conductivity",
        420
    ],
    [
        "task-4-grow-plant",
        60
    ],
    [
        "task-3-find-non-living-thing",
        49
    ],
    [
        "task-3-find-non-living-thing",
        39
    ],
    [
        "task-10-use-thermometer",
        156
    ],
    [
        "task-3-find-animal",
        26
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        134
    ],
    [
        "task-4-grow-plant",
        38
    ],
    [
        "task-2a-test-conductivity",
        109
    ],
    [
        "task-2a-test-conductivity",
        29
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        95
    ],
    [
        "task-3-find-non-living-thing",
        1
    ],
    [
        "task-2a-test-conductivity",
        369
    ],
    [
        "task-3-find-plant",
        121
    ],
    [
        "task-5-chemistry-mix",
        0
    ],
    [
        "task-10-use-thermometer",
        276
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        54
    ],
    [
        "task-2a-test-conductivity",
        147
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        47
    ],
    [
        "task-2a-test-conductivity",
        101
    ],
    [
        "task-5-chemistry-mix",
        4
    ],
    [
        "task-2a-test-conductivity",
        92
    ],
    [
        "task-4-grow-fruit",
        52
    ],
    [
        "task-2a-test-conductivity",
        62
    ],
    [
        "task-3-find-plant",
        89
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        42
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        315
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        240
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        36
    ],
    [
        "task-3-find-non-living-thing",
        7
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        22
    ],
    [
        "task-3-find-plant",
        103
    ],
    [
        "task-10-use-thermometer",
        221
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        139
    ],
    [
        "task-5-chemistry-mix-paint-(secondary-color)",
        12
    ],
    [
        "task-2a-test-conductivity",
        163
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        49
    ],
    [
        "task-10-use-thermometer",
        171
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        64
    ],
    [
        "task-2a-test-conductivity",
        531
    ],
    [
        "task-5-chemistry-mix-paint-(tertiary-color)",
        9
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        394
    ],
    [
        "task-2a-test-conductivity",
        154
    ],
    [
        "task-2-power-component",
        1
    ],
    [
        "task-3-find-plant",
        44
    ],
    [
        "task-3-find-living-thing",
        149
    ],
    [
        "task-10-use-thermometer",
        132
    ],
    [
        "task-2a-test-conductivity",
        247
    ],
    [
        "task-10-use-thermometer",
        282
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        143
    ],
    [
        "task-3-find-animal",
        4
    ],
    [
        "task-2a-test-conductivity",
        673
    ],
    [
        "task-2a-test-conductivity",
        525
    ],
    [
        "task-1-freeze",
        9
    ],
    [
        "task-5-chemistry-mix-paint-(secondary-color)",
        14
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        332
    ],
    [
        "task-1-freeze",
        5
    ],
    [
        "task-2a-test-conductivity",
        186
    ],
    [
        "task-1-melt",
        10
    ],
    [
        "task-2a-test-conductivity",
        489
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        345
    ],
    [
        "task-2a-test-conductivity",
        348
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        2
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        118
    ],
    [
        "task-2a-test-conductivity",
        488
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        132
    ],
    [
        "task-3-find-living-thing",
        128
    ],
    [
        "task-2a-test-conductivity",
        427
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        323
    ],
    [
        "task-5-chemistry-mix",
        13
    ],
    [
        "task-3-find-animal",
        29
    ],
    [
        "task-3-find-animal",
        34
    ],
    [
        "task-10-use-thermometer",
        77
    ],
    [
        "task-2a-test-conductivity",
        665
    ],
    [
        "task-10-use-thermometer",
        366
    ],
    [
        "task-10-use-thermometer",
        224
    ],
    [
        "task-2a-test-conductivity",
        39
    ],
    [
        "task-10-use-thermometer",
        192
    ],
    [
        "task-2a-test-conductivity",
        65
    ],
    [
        "task-10-use-thermometer",
        158
    ],
    [
        "task-2a-test-conductivity",
        110
    ],
    [
        "task-3-find-living-thing",
        86
    ],
    [
        "task-10-use-thermometer",
        326
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        61
    ],
    [
        "task-5-chemistry-mix",
        10
    ],
    [
        "task-3-find-non-living-thing",
        47
    ],
    [
        "task-1-boil",
        13
    ],
    [
        "task-3-find-animal",
        69
    ],
    [
        "task-2a-test-conductivity",
        309
    ],
    [
        "task-3-find-animal",
        101
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        235
    ],
    [
        "task-2a-test-conductivity",
        159
    ],
    [
        "task-3-find-non-living-thing",
        105
    ],
    [
        "task-4-grow-plant",
        26
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        158
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        57
    ],
    [
        "task-3-find-living-thing",
        135
    ],
    [
        "task-3-find-plant",
        68
    ],
    [
        "task-2a-test-conductivity",
        648
    ],
    [
        "task-3-find-animal",
        10
    ],
    [
        "task-2a-test-conductivity",
        537
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        124
    ],
    [
        "task-2a-test-conductivity",
        81
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        81
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        28
    ],
    [
        "task-3-find-living-thing",
        124
    ],
    [
        "task-4-grow-fruit",
        56
    ],
    [
        "task-3-find-living-thing",
        103
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        38
    ],
    [
        "task-10-use-thermometer",
        343
    ],
    [
        "task-2a-test-conductivity",
        461
    ],
    [
        "task-3-find-animal",
        99
    ],
    [
        "task-3-find-animal",
        128
    ],
    [
        "task-3-find-plant",
        37
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        121
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        301
    ],
    [
        "task-6-lifespan-(longest-lived)",
        61
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        36
    ],
    [
        "task-3-find-living-thing",
        41
    ],
    [
        "task-2a-test-conductivity",
        217
    ],
    [
        "task-10-use-thermometer",
        59
    ],
    [
        "task-3-find-non-living-thing",
        116
    ],
    [
        "task-3-find-plant",
        24
    ],
    [
        "task-10-use-thermometer",
        370
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        429
    ],
    [
        "task-2a-test-conductivity",
        265
    ],
    [
        "task-2a-test-conductivity",
        610
    ],
    [
        "task-2a-test-conductivity",
        581
    ],
    [
        "task-10-use-thermometer",
        296
    ],
    [
        "task-4-grow-plant",
        11
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        51
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        329
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        125
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        273
    ],
    [
        "task-10-use-thermometer",
        228
    ],
    [
        "task-3-find-animal",
        9
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        22
    ],
    [
        "task-2a-test-conductivity",
        321
    ],
    [
        "task-2a-test-conductivity",
        362
    ],
    [
        "task-3-find-non-living-thing",
        66
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        9
    ],
    [
        "task-10-use-thermometer",
        404
    ],
    [
        "task-2a-test-conductivity",
        254
    ],
    [
        "task-2a-test-conductivity",
        42
    ],
    [
        "task-2a-test-conductivity",
        396
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        72
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        40
    ],
    [
        "task-2a-test-conductivity",
        290
    ],
    [
        "task-3-find-plant",
        0
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        152
    ],
    [
        "task-2a-test-conductivity",
        560
    ],
    [
        "task-10-use-thermometer",
        92
    ],
    [
        "task-1-melt",
        12
    ],
    [
        "task-2a-test-conductivity",
        590
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        14
    ],
    [
        "task-2a-test-conductivity",
        460
    ],
    [
        "task-2a-test-conductivity",
        215
    ],
    [
        "task-3-find-non-living-thing",
        114
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        72
    ],
    [
        "task-3-find-animal",
        148
    ],
    [
        "task-4-grow-plant",
        7
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        11
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        85
    ],
    [
        "task-3-find-plant",
        19
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        294
    ],
    [
        "task-3-find-plant",
        129
    ],
    [
        "task-2a-test-conductivity",
        294
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        41
    ],
    [
        "task-10-use-thermometer",
        389
    ],
    [
        "task-3-find-plant",
        40
    ],
    [
        "task-10-use-thermometer",
        42
    ],
    [
        "task-3-find-non-living-thing",
        34
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        406
    ],
    [
        "task-10-use-thermometer",
        86
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        360
    ],
    [
        "task-2a-test-conductivity",
        587
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        386
    ],
    [
        "task-10-use-thermometer",
        330
    ],
    [
        "task-2a-test-conductivity",
        319
    ],
    [
        "task-2a-test-conductivity",
        253
    ],
    [
        "task-7-identify-life-stages-2",
        2
    ],
    [
        "task-2a-test-conductivity",
        573
    ],
    [
        "task-3-find-plant",
        98
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        151
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        35
    ],
    [
        "task-2a-test-conductivity",
        407
    ],
    [
        "task-10-use-thermometer",
        301
    ],
    [
        "task-6-lifespan-(longest-lived)",
        57
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        148
    ],
    [
        "task-10-use-thermometer",
        7
    ],
    [
        "task-6-lifespan-(longest-lived)",
        8
    ],
    [
        "task-10-use-thermometer",
        138
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        312
    ],
    [
        "task-2a-test-conductivity",
        626
    ],
    [
        "task-2a-test-conductivity",
        258
    ],
    [
        "task-3-find-living-thing",
        51
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        40
    ],
    [
        "task-10-use-thermometer",
        353
    ],
    [
        "task-2a-test-conductivity",
        465
    ],
    [
        "task-3-find-animal",
        130
    ],
    [
        "task-10-use-thermometer",
        136
    ],
    [
        "task-3-find-animal",
        113
    ],
    [
        "task-2a-test-conductivity",
        36
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        83
    ],
    [
        "task-10-use-thermometer",
        193
    ],
    [
        "task-3-find-animal",
        223
    ],
    [
        "task-3-find-non-living-thing",
        67
    ],
    [
        "task-2a-test-conductivity",
        115
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        431
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        49
    ],
    [
        "task-3-find-animal",
        143
    ],
    [
        "task-2a-test-conductivity",
        188
    ],
    [
        "task-3-find-living-thing",
        15
    ],
    [
        "task-2a-test-conductivity",
        541
    ],
    [
        "task-3-find-plant",
        62
    ],
    [
        "task-3-find-non-living-thing",
        102
    ],
    [
        "task-3-find-plant",
        60
    ],
    [
        "task-2a-test-conductivity",
        293
    ],
    [
        "task-3-find-living-thing",
        30
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        349
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        205
    ],
    [
        "task-2a-test-conductivity",
        211
    ],
    [
        "task-10-use-thermometer",
        108
    ],
    [
        "task-10-use-thermometer",
        237
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        38
    ],
    [
        "task-3-find-plant",
        65
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        250
    ],
    [
        "task-5-chemistry-mix-paint-(tertiary-color)",
        8
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        172
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        425
    ],
    [
        "task-10-use-thermometer",
        381
    ],
    [
        "task-10-use-thermometer",
        187
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        303
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        44
    ],
    [
        "task-1-change-the-state-of-matter-of",
        1
    ],
    [
        "task-3-find-animal",
        76
    ],
    [
        "task-3-find-animal",
        17
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        22
    ],
    [
        "task-2a-test-conductivity",
        500
    ],
    [
        "task-3-find-living-thing",
        78
    ],
    [
        "task-3-find-non-living-thing",
        188
    ],
    [
        "task-3-find-animal",
        45
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        397
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        101
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        105
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        324
    ],
    [
        "task-2a-test-conductivity",
        459
    ],
    [
        "task-2a-test-conductivity",
        456
    ],
    [
        "task-2a-test-conductivity",
        133
    ],
    [
        "task-2a-test-conductivity",
        181
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        135
    ],
    [
        "task-2a-test-conductivity",
        306
    ],
    [
        "task-7-identify-life-stages-2",
        1
    ],
    [
        "task-3-find-living-thing",
        116
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        230
    ],
    [
        "task-10-use-thermometer",
        399
    ],
    [
        "task-3-find-plant",
        27
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        223
    ],
    [
        "task-10-use-thermometer",
        361
    ],
    [
        "task-3-find-non-living-thing",
        201
    ],
    [
        "task-5-chemistry-mix-paint-(tertiary-color)",
        6
    ],
    [
        "task-6-lifespan-(longest-lived)",
        15
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        248
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        34
    ],
    [
        "task-2a-test-conductivity",
        521
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        254
    ],
    [
        "task-7-identify-life-stages-1",
        4
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        178
    ],
    [
        "task-3-find-living-thing",
        129
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        234
    ],
    [
        "task-10-use-thermometer",
        95
    ],
    [
        "task-2a-test-conductivity",
        618
    ],
    [
        "task-3-find-plant",
        146
    ],
    [
        "task-3-find-non-living-thing",
        128
    ],
    [
        "task-3-find-non-living-thing",
        44
    ],
    [
        "task-3-find-non-living-thing",
        98
    ],
    [
        "task-4-grow-fruit",
        58
    ],
    [
        "task-10-use-thermometer",
        254
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        202
    ],
    [
        "task-2a-test-conductivity",
        423
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        328
    ],
    [
        "task-3-find-animal",
        83
    ],
    [
        "task-3-find-living-thing",
        138
    ],
    [
        "task-2a-test-conductivity",
        47
    ],
    [
        "task-3-find-non-living-thing",
        72
    ],
    [
        "task-3-find-animal",
        97
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        385
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        189
    ],
    [
        "task-2a-test-conductivity",
        553
    ],
    [
        "task-3-find-non-living-thing",
        156
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        142
    ],
    [
        "task-3-find-non-living-thing",
        196
    ],
    [
        "task-10-use-thermometer",
        68
    ],
    [
        "task-10-use-thermometer",
        252
    ],
    [
        "task-3-find-living-thing",
        68
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        54
    ],
    [
        "task-2-power-component-(renewable-vs-nonrenewable-energy)",
        7
    ],
    [
        "task-3-find-living-thing",
        24
    ],
    [
        "task-2a-test-conductivity",
        510
    ],
    [
        "task-4-grow-fruit",
        3
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        34
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        176
    ],
    [
        "task-2a-test-conductivity",
        4
    ],
    [
        "task-4-grow-plant",
        48
    ],
    [
        "task-2a-test-conductivity",
        331
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        196
    ],
    [
        "task-5-chemistry-mix-paint-(tertiary-color)",
        13
    ],
    [
        "task-2a-test-conductivity",
        359
    ],
    [
        "task-5-chemistry-mix-paint-(tertiary-color)",
        10
    ],
    [
        "task-2a-test-conductivity",
        50
    ],
    [
        "task-1-change-the-state-of-matter-of",
        8
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        35
    ],
    [
        "task-4-grow-plant",
        14
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        39
    ],
    [
        "task-3-find-living-thing",
        143
    ],
    [
        "task-3-find-plant",
        52
    ],
    [
        "task-2a-test-conductivity",
        260
    ],
    [
        "task-5-chemistry-mix-paint-(tertiary-color)",
        5
    ],
    [
        "task-2a-test-conductivity",
        371
    ],
    [
        "task-2a-test-conductivity",
        557
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        272
    ],
    [
        "task-10-use-thermometer",
        347
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        61
    ],
    [
        "task-2a-test-conductivity",
        540
    ],
    [
        "task-3-find-living-thing",
        9
    ],
    [
        "task-2a-test-conductivity",
        117
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        236
    ],
    [
        "task-10-use-thermometer",
        235
    ],
    [
        "task-10-use-thermometer",
        265
    ],
    [
        "task-10-use-thermometer",
        398
    ],
    [
        "task-2a-test-conductivity",
        601
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        19
    ],
    [
        "task-3-find-plant",
        194
    ],
    [
        "task-3-find-animal",
        25
    ],
    [
        "task-3-find-animal",
        55
    ],
    [
        "task-3-find-non-living-thing",
        81
    ],
    [
        "task-10-use-thermometer",
        197
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        133
    ],
    [
        "task-3-find-living-thing",
        117
    ],
    [
        "task-3-find-plant",
        69
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        295
    ],
    [
        "task-2a-test-conductivity",
        11
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        214
    ],
    [
        "task-3-find-non-living-thing",
        52
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        219
    ],
    [
        "task-3-find-non-living-thing",
        214
    ],
    [
        "task-2a-test-conductivity",
        377
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        132
    ],
    [
        "task-3-find-plant",
        205
    ],
    [
        "task-3-find-plant",
        122
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        110
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        122
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        217
    ],
    [
        "task-6-lifespan-(longest-lived)",
        10
    ],
    [
        "task-10-use-thermometer",
        175
    ],
    [
        "task-2a-test-conductivity",
        16
    ],
    [
        "task-6-lifespan-(longest-lived)",
        36
    ],
    [
        "task-3-find-plant",
        95
    ],
    [
        "task-3-find-animal",
        74
    ],
    [
        "task-2a-test-conductivity",
        279
    ],
    [
        "task-2a-test-conductivity",
        415
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        93
    ],
    [
        "task-10-use-thermometer",
        166
    ],
    [
        "task-2a-test-conductivity",
        323
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        264
    ],
    [
        "task-2a-test-conductivity",
        635
    ],
    [
        "task-3-find-animal",
        212
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        243
    ],
    [
        "task-3-find-plant",
        78
    ],
    [
        "task-2a-test-conductivity",
        444
    ],
    [
        "task-3-find-animal",
        147
    ],
    [
        "task-3-find-plant",
        105
    ],
    [
        "task-3-find-plant",
        42
    ],
    [
        "task-2a-test-conductivity",
        123
    ],
    [
        "task-5-chemistry-mix-paint-(secondary-color)",
        3
    ],
    [
        "task-3-find-plant",
        59
    ],
    [
        "task-2a-test-conductivity",
        225
    ],
    [
        "task-10-use-thermometer",
        335
    ],
    [
        "task-10-use-thermometer",
        149
    ],
    [
        "task-10-use-thermometer",
        279
    ],
    [
        "task-10-use-thermometer",
        98
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        190
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        78
    ],
    [
        "task-6-lifespan-(longest-lived)",
        20
    ],
    [
        "task-3-find-non-living-thing",
        175
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        233
    ],
    [
        "task-10-use-thermometer",
        392
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        319
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        299
    ],
    [
        "task-2a-test-conductivity",
        647
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        120
    ],
    [
        "task-2a-test-conductivity",
        368
    ],
    [
        "task-3-find-living-thing",
        26
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        246
    ],
    [
        "task-3-find-non-living-thing",
        210
    ],
    [
        "task-3-find-animal",
        85
    ],
    [
        "task-3-find-living-thing",
        60
    ],
    [
        "task-2a-test-conductivity",
        512
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        231
    ],
    [
        "task-3-find-animal",
        179
    ],
    [
        "task-2a-test-conductivity",
        271
    ],
    [
        "task-3-find-plant",
        64
    ],
    [
        "task-6-lifespan-(longest-lived)",
        0
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        2
    ],
    [
        "task-1-boil",
        8
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        111
    ],
    [
        "task-3-find-non-living-thing",
        162
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        244
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        91
    ],
    [
        "task-10-use-thermometer",
        263
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        178
    ],
    [
        "task-3-find-animal",
        107
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        150
    ],
    [
        "task-10-use-thermometer",
        391
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        47
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        366
    ],
    [
        "task-3-find-animal",
        215
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        38
    ],
    [
        "task-3-find-animal",
        220
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        45
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        255
    ],
    [
        "task-6-lifespan-(longest-lived)",
        26
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        220
    ],
    [
        "task-10-use-thermometer",
        367
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        2
    ],
    [
        "task-3-find-animal",
        201
    ],
    [
        "task-3-find-plant",
        221
    ],
    [
        "task-10-use-thermometer",
        203
    ],
    [
        "task-3-find-non-living-thing",
        124
    ],
    [
        "task-3-find-plant",
        185
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        182
    ],
    [
        "task-10-use-thermometer",
        320
    ],
    [
        "task-3-find-animal",
        19
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        29
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        200
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        441
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        363
    ],
    [
        "task-5-chemistry-mix",
        3
    ],
    [
        "task-3-find-plant",
        1
    ],
    [
        "task-4-grow-plant",
        40
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        98
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        185
    ],
    [
        "task-10-use-thermometer",
        368
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        106
    ],
    [
        "task-3-find-plant",
        187
    ],
    [
        "task-3-find-plant",
        102
    ],
    [
        "task-3-find-animal",
        62
    ],
    [
        "task-3-find-non-living-thing",
        195
    ],
    [
        "task-10-use-thermometer",
        188
    ],
    [
        "task-3-find-plant",
        5
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        112
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        50
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        314
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        293
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        177
    ],
    [
        "task-10-use-thermometer",
        91
    ],
    [
        "task-3-find-animal",
        6
    ],
    [
        "task-10-use-thermometer",
        293
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        9
    ],
    [
        "task-3-find-non-living-thing",
        51
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        241
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        5
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        85
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        258
    ],
    [
        "task-3-find-plant",
        8
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        150
    ],
    [
        "task-3-find-living-thing",
        58
    ],
    [
        "task-10-use-thermometer",
        401
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        138
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        154
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        16
    ],
    [
        "task-3-find-plant",
        26
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        4
    ],
    [
        "task-10-use-thermometer",
        124
    ],
    [
        "task-3-find-living-thing",
        88
    ],
    [
        "task-1-melt",
        0
    ],
    [
        "task-4-grow-fruit",
        25
    ],
    [
        "task-10-use-thermometer",
        144
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        353
    ],
    [
        "task-7-identify-life-stages-2",
        0
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        10
    ],
    [
        "task-1-boil",
        7
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        143
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        391
    ],
    [
        "task-3-find-plant",
        211
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        261
    ],
    [
        "task-5-chemistry-mix",
        9
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        141
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        55
    ],
    [
        "task-10-use-thermometer",
        243
    ],
    [
        "task-4-grow-fruit",
        37
    ],
    [
        "task-4-grow-plant",
        25
    ],
    [
        "task-10-use-thermometer",
        206
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        27
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        41
    ],
    [
        "task-3-find-animal",
        68
    ],
    [
        "task-4-grow-fruit",
        6
    ],
    [
        "task-3-find-non-living-thing",
        70
    ],
    [
        "task-10-use-thermometer",
        128
    ],
    [
        "task-3-find-non-living-thing",
        110
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        422
    ],
    [
        "task-10-use-thermometer",
        121
    ],
    [
        "task-3-find-living-thing",
        48
    ],
    [
        "task-10-use-thermometer",
        225
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        310
    ],
    [
        "task-1-freeze",
        4
    ],
    [
        "task-10-use-thermometer",
        102
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        242
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        198
    ],
    [
        "task-3-find-animal",
        174
    ],
    [
        "task-10-use-thermometer",
        286
    ],
    [
        "task-10-use-thermometer",
        284
    ],
    [
        "task-1-change-the-state-of-matter-of",
        6
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        181
    ],
    [
        "task-10-use-thermometer",
        155
    ],
    [
        "task-4-grow-fruit",
        55
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        70
    ],
    [
        "task-6-lifespan-(longest-lived)",
        52
    ],
    [
        "task-3-find-plant",
        164
    ],
    [
        "task-4-grow-fruit",
        2
    ],
    [
        "task-3-find-non-living-thing",
        46
    ],
    [
        "task-3-find-animal",
        13
    ],
    [
        "task-3-find-living-thing",
        213
    ],
    [
        "task-4-grow-plant",
        54
    ],
    [
        "task-3-find-non-living-thing",
        8
    ],
    [
        "task-3-find-living-thing",
        13
    ],
    [
        "task-3-find-non-living-thing",
        147
    ],
    [
        "task-10-use-thermometer",
        169
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        119
    ],
    [
        "task-10-use-thermometer",
        22
    ],
    [
        "task-6-lifespan-(longest-lived)",
        27
    ],
    [
        "task-3-find-animal",
        53
    ],
    [
        "task-3-find-non-living-thing",
        80
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        38
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        162
    ],
    [
        "task-3-find-non-living-thing",
        199
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        14
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        398
    ],
    [
        "task-3-find-plant",
        178
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        172
    ],
    [
        "task-3-find-living-thing",
        179
    ],
    [
        "task-3-find-plant",
        72
    ],
    [
        "task-10-use-thermometer",
        81
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        438
    ],
    [
        "task-6-lifespan-(longest-lived)",
        80
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        153
    ],
    [
        "task-3-find-animal",
        109
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        99
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        88
    ],
    [
        "task-10-use-thermometer",
        337
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        182
    ],
    [
        "task-3-find-non-living-thing",
        183
    ],
    [
        "task-5-chemistry-mix-paint-(tertiary-color)",
        0
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        313
    ],
    [
        "task-10-use-thermometer",
        99
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        98
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        289
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        166
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        55
    ],
    [
        "task-10-use-thermometer",
        270
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        15
    ],
    [
        "task-10-use-thermometer",
        190
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        342
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        59
    ],
    [
        "task-3-find-non-living-thing",
        74
    ],
    [
        "task-3-find-living-thing",
        206
    ],
    [
        "task-3-find-living-thing",
        125
    ],
    [
        "task-3-find-animal",
        120
    ],
    [
        "task-6-lifespan-(longest-lived)",
        76
    ],
    [
        "task-10-use-thermometer",
        305
    ],
    [
        "task-3-find-animal",
        84
    ],
    [
        "task-3-find-animal",
        224
    ],
    [
        "task-10-use-thermometer",
        359
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        65
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        4
    ],
    [
        "task-3-find-animal",
        71
    ],
    [
        "task-6-lifespan-(longest-lived)",
        40
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        58
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        46
    ],
    [
        "task-3-find-animal",
        144
    ],
    [
        "task-10-use-thermometer",
        205
    ],
    [
        "task-10-use-thermometer",
        90
    ],
    [
        "task-10-use-thermometer",
        89
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        146
    ],
    [
        "task-10-use-thermometer",
        216
    ],
    [
        "task-3-find-animal",
        1
    ],
    [
        "task-3-find-non-living-thing",
        113
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        64
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        92
    ],
    [
        "task-3-find-living-thing",
        114
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        74
    ],
    [
        "task-3-find-animal",
        156
    ],
    [
        "task-3-find-non-living-thing",
        135
    ],
    [
        "task-3-find-living-thing",
        90
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        206
    ],
    [
        "task-3-find-living-thing",
        153
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        330
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        23
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        2
    ],
    [
        "task-10-use-thermometer",
        231
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        302
    ],
    [
        "task-3-find-non-living-thing",
        16
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        8
    ],
    [
        "task-10-use-thermometer",
        311
    ],
    [
        "task-10-use-thermometer",
        142
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        30
    ],
    [
        "task-10-use-thermometer",
        317
    ],
    [
        "task-6-lifespan-(longest-lived)",
        28
    ],
    [
        "task-3-find-non-living-thing",
        171
    ],
    [
        "task-3-find-living-thing",
        131
    ],
    [
        "task-2-power-component",
        3
    ],
    [
        "task-3-find-animal",
        108
    ],
    [
        "task-6-lifespan-(longest-lived)",
        25
    ],
    [
        "task-3-find-non-living-thing",
        62
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        216
    ],
    [
        "task-10-use-thermometer",
        97
    ],
    [
        "task-3-find-living-thing",
        74
    ],
    [
        "task-3-find-living-thing",
        172
    ],
    [
        "task-3-find-non-living-thing",
        120
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        134
    ],
    [
        "task-2-power-component-(renewable-vs-nonrenewable-energy)",
        1
    ],
    [
        "task-3-find-plant",
        155
    ],
    [
        "task-4-grow-plant",
        43
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        164
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        411
    ],
    [
        "task-3-find-living-thing",
        106
    ],
    [
        "task-10-use-thermometer",
        163
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        194
    ],
    [
        "task-3-find-animal",
        114
    ],
    [
        "task-3-find-non-living-thing",
        2
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        279
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        426
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        281
    ],
    [
        "task-4-grow-plant",
        53
    ],
    [
        "task-2a-test-conductivity-of-unknown-substances",
        55
    ],
    [
        "task-3-find-plant",
        173
    ],
    [
        "task-3-find-plant",
        11
    ],
    [
        "task-3-find-non-living-thing",
        180
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        42
    ],
    [
        "task-3-find-non-living-thing",
        163
    ],
    [
        "task-3-find-living-thing",
        120
    ],
    [
        "task-10-use-thermometer",
        234
    ],
    [
        "task-10-use-thermometer",
        2
    ],
    [
        "task-10-use-thermometer",
        212
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        6
    ],
    [
        "task-3-find-animal",
        93
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        125
    ],
    [
        "task-10-use-thermometer",
        63
    ],
    [
        "task-3-find-animal",
        127
    ],
    [
        "task-1-change-the-state-of-matter-of",
        11
    ],
    [
        "task-10-use-thermometer",
        208
    ],
    [
        "task-3-find-animal",
        67
    ],
    [
        "task-3-find-non-living-thing",
        13
    ],
    [
        "task-10-use-thermometer",
        24
    ],
    [
        "task-3-find-plant",
        67
    ],
    [
        "task-1-boil",
        9
    ],
    [
        "task-3-find-plant",
        63
    ],
    [
        "task-3-find-plant",
        200
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        69
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        76
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        208
    ],
    [
        "task-3-find-animal",
        28
    ],
    [
        "task-6-lifespan-(longest-lived)",
        82
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        39
    ],
    [
        "task-3-find-plant",
        142
    ],
    [
        "task-3-find-plant",
        133
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        18
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        326
    ],
    [
        "task-3-find-animal",
        141
    ],
    [
        "task-1-freeze",
        2
    ],
    [
        "task-3-find-animal",
        219
    ],
    [
        "task-3-find-animal",
        135
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        84
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        44
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        11
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        65
    ],
    [
        "task-3-find-living-thing",
        2
    ],
    [
        "task-3-find-living-thing",
        100
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        79
    ],
    [
        "task-3-find-animal",
        115
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        244
    ],
    [
        "task-3-find-living-thing",
        167
    ],
    [
        "task-3-find-living-thing",
        16
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        92
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        209
    ],
    [
        "task-3-find-plant",
        23
    ],
    [
        "task-3-find-non-living-thing",
        42
    ],
    [
        "task-5-chemistry-mix-paint-(secondary-color)",
        8
    ],
    [
        "task-3-find-plant",
        219
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        280
    ],
    [
        "task-3-find-non-living-thing",
        200
    ],
    [
        "task-3-find-non-living-thing",
        221
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        229
    ],
    [
        "task-3-find-plant",
        9
    ],
    [
        "task-5-chemistry-mix-paint-(secondary-color)",
        4
    ],
    [
        "task-3-find-plant",
        175
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        320
    ],
    [
        "task-3-find-living-thing",
        193
    ],
    [
        "task-3-find-plant",
        35
    ],
    [
        "task-3-find-non-living-thing",
        184
    ],
    [
        "task-3-find-animal",
        151
    ],
    [
        "task-3-find-non-living-thing",
        32
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        148
    ],
    [
        "task-3-find-animal",
        42
    ],
    [
        "task-3-find-animal",
        112
    ],
    [
        "task-3-find-animal",
        121
    ],
    [
        "task-4-grow-fruit",
        42
    ],
    [
        "task-1-melt",
        3
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        75
    ],
    [
        "task-3-find-animal",
        158
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        17
    ],
    [
        "task-3-find-animal",
        125
    ],
    [
        "task-3-find-plant",
        118
    ],
    [
        "task-3-find-non-living-thing",
        208
    ],
    [
        "task-3-find-plant",
        143
    ],
    [
        "task-3-find-animal",
        90
    ],
    [
        "task-3-find-living-thing",
        157
    ],
    [
        "task-3-find-non-living-thing",
        205
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        60
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        19
    ],
    [
        "task-3-find-non-living-thing",
        11
    ],
    [
        "task-3-find-non-living-thing",
        73
    ],
    [
        "task-6-lifespan-(longest-lived)",
        11
    ],
    [
        "task-3-find-animal",
        195
    ],
    [
        "task-6-lifespan-(longest-lived)",
        54
    ],
    [
        "task-3-find-living-thing",
        49
    ],
    [
        "task-3-find-non-living-thing",
        100
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        287
    ],
    [
        "task-4-grow-plant",
        6
    ],
    [
        "task-3-find-animal",
        136
    ],
    [
        "task-4-grow-plant",
        9
    ],
    [
        "task-3-find-animal",
        200
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        80
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        252
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        15
    ],
    [
        "task-6-lifespan-(longest-lived)",
        41
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        18
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        62
    ],
    [
        "task-3-find-plant",
        32
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        160
    ],
    [
        "task-3-find-plant",
        100
    ],
    [
        "task-3-find-animal",
        210
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        15
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        305
    ],
    [
        "task-3-find-plant",
        167
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        37
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        243
    ],
    [
        "task-6-lifespan-(longest-lived)",
        48
    ],
    [
        "task-3-find-animal",
        164
    ],
    [
        "task-3-find-living-thing",
        199
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        81
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        29
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        121
    ],
    [
        "task-3-find-animal",
        221
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        52
    ],
    [
        "task-3-find-plant",
        90
    ],
    [
        "task-3-find-living-thing",
        34
    ],
    [
        "task-1-change-the-state-of-matter-of",
        0
    ],
    [
        "task-3-find-living-thing",
        84
    ],
    [
        "task-1-melt",
        7
    ],
    [
        "task-3-find-animal",
        24
    ],
    [
        "task-4-grow-fruit",
        31
    ],
    [
        "task-1-boil",
        3
    ],
    [
        "task-3-find-living-thing",
        141
    ],
    [
        "task-7-identify-life-stages-1",
        1
    ],
    [
        "task-3-find-plant",
        123
    ],
    [
        "task-4-grow-plant",
        0
    ],
    [
        "task-4-grow-fruit",
        27
    ],
    [
        "task-3-find-living-thing",
        70
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        85
    ],
    [
        "task-3-find-living-thing",
        160
    ],
    [
        "task-3-find-non-living-thing",
        132
    ],
    [
        "task-3-find-non-living-thing",
        22
    ],
    [
        "task-4-grow-fruit",
        36
    ],
    [
        "task-7-identify-life-stages-1",
        2
    ],
    [
        "task-3-find-non-living-thing",
        222
    ],
    [
        "task-3-find-living-thing",
        222
    ],
    [
        "task-3-find-animal",
        188
    ],
    [
        "task-4-grow-plant",
        61
    ],
    [
        "task-3-find-non-living-thing",
        111
    ],
    [
        "task-3-find-non-living-thing",
        10
    ],
    [
        "task-4-grow-plant",
        3
    ],
    [
        "task-3-find-plant",
        128
    ],
    [
        "task-5-chemistry-mix-paint-(secondary-color)",
        9
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        56
    ],
    [
        "task-3-find-non-living-thing",
        14
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        48
    ],
    [
        "task-3-find-plant",
        217
    ],
    [
        "task-4-grow-fruit",
        46
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        84
    ],
    [
        "task-3-find-plant",
        106
    ],
    [
        "task-3-find-living-thing",
        180
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        64
    ],
    [
        "task-3-find-non-living-thing",
        0
    ],
    [
        "task-3-find-animal",
        23
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        54
    ],
    [
        "task-3-find-living-thing",
        77
    ],
    [
        "task-3-find-non-living-thing",
        150
    ],
    [
        "task-3-find-animal",
        132
    ],
    [
        "task-5-chemistry-mix-paint-(secondary-color)",
        1
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        13
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        238
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        0
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        113
    ],
    [
        "task-3-find-plant",
        182
    ],
    [
        "task-1-freeze",
        8
    ],
    [
        "task-3-find-living-thing",
        188
    ],
    [
        "task-3-find-living-thing",
        18
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        75
    ],
    [
        "task-4-grow-plant",
        21
    ],
    [
        "task-6-lifespan-(longest-lived)",
        51
    ],
    [
        "task-3-find-living-thing",
        32
    ],
    [
        "task-3-find-plant",
        176
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        13
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        189
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        37
    ],
    [
        "task-1-freeze",
        0
    ],
    [
        "task-3-find-non-living-thing",
        90
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        216
    ],
    [
        "task-3-find-non-living-thing",
        182
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        83
    ],
    [
        "task-3-find-living-thing",
        115
    ],
    [
        "task-3-find-living-thing",
        66
    ],
    [
        "task-3-find-plant",
        88
    ],
    [
        "task-4-grow-plant",
        55
    ],
    [
        "task-3-find-non-living-thing",
        224
    ],
    [
        "task-3-find-plant",
        117
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        195
    ],
    [
        "task-3-find-plant",
        76
    ],
    [
        "task-6-lifespan-(longest-lived)",
        1
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        77
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        174
    ],
    [
        "task-3-find-living-thing",
        214
    ],
    [
        "task-3-find-living-thing",
        216
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        71
    ],
    [
        "task-3-find-plant",
        17
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        91
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        44
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        204
    ],
    [
        "task-1-boil",
        2
    ],
    [
        "task-3-find-plant",
        208
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        11
    ],
    [
        "task-3-find-non-living-thing",
        219
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        93
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        80
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        62
    ],
    [
        "task-3-find-living-thing",
        81
    ],
    [
        "task-3-find-living-thing",
        122
    ],
    [
        "task-10-measure-melting-point-(known-substance)",
        316
    ],
    [
        "task-5-chemistry-mix",
        7
    ],
    [
        "task-3-find-living-thing",
        159
    ],
    [
        "task-6-lifespan-(longest-lived)",
        14
    ],
    [
        "task-3-find-non-living-thing",
        139
    ],
    [
        "task-3-find-living-thing",
        102
    ],
    [
        "task-4-grow-plant",
        27
    ],
    [
        "task-6-lifespan-(longest-lived)",
        64
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        51
    ],
    [
        "task-4-grow-plant",
        36
    ],
    [
        "task-3-find-living-thing",
        27
    ],
    [
        "task-7-identify-life-stages-1",
        3
    ],
    [
        "task-6-lifespan-(longest-lived)",
        37
    ],
    [
        "task-3-find-living-thing",
        187
    ],
    [
        "task-3-find-animal",
        153
    ],
    [
        "task-4-grow-plant",
        85
    ],
    [
        "task-3-find-animal",
        39
    ],
    [
        "task-3-find-animal",
        157
    ],
    [
        "task-3-find-animal",
        77
    ],
    [
        "task-3-find-non-living-thing",
        33
    ],
    [
        "task-4-grow-plant",
        45
    ],
    [
        "task-3-find-animal",
        89
    ],
    [
        "task-6-lifespan-(longest-lived)",
        32
    ],
    [
        "task-3-find-living-thing",
        204
    ],
    [
        "task-3-find-animal",
        161
    ],
    [
        "task-3-find-plant",
        116
    ],
    [
        "task-3-find-non-living-thing",
        23
    ],
    [
        "task-2-power-component-(renewable-vs-nonrenewable-energy)",
        3
    ],
    [
        "task-3-find-animal",
        165
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        46
    ],
    [
        "task-6-lifespan-(longest-lived)",
        58
    ],
    [
        "task-4-grow-fruit",
        29
    ],
    [
        "task-3-find-animal",
        170
    ],
    [
        "task-3-find-plant",
        81
    ],
    [
        "task-3-find-non-living-thing",
        167
    ],
    [
        "task-3-find-animal",
        182
    ],
    [
        "task-4-grow-plant",
        91
    ],
    [
        "task-3-find-non-living-thing",
        60
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        31
    ],
    [
        "task-3-find-plant",
        109
    ],
    [
        "task-5-chemistry-mix-paint-(secondary-color)",
        11
    ],
    [
        "task-3-find-animal",
        100
    ],
    [
        "task-6-lifespan-(longest-lived)",
        91
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        20
    ],
    [
        "task-4-grow-fruit",
        12
    ],
    [
        "task-3-find-plant",
        84
    ],
    [
        "task-3-find-living-thing",
        0
    ],
    [
        "task-5-chemistry-mix-paint-(tertiary-color)",
        14
    ],
    [
        "task-1-change-the-state-of-matter-of",
        7
    ],
    [
        "task-4-grow-plant",
        42
    ],
    [
        "task-3-find-non-living-thing",
        64
    ],
    [
        "task-3-find-plant",
        132
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        13
    ],
    [
        "task-4-grow-plant",
        56
    ],
    [
        "task-3-find-plant",
        99
    ],
    [
        "task-6-lifespan-(longest-lived)",
        3
    ],
    [
        "task-3-find-living-thing",
        28
    ],
    [
        "task-4-grow-plant",
        22
    ],
    [
        "task-3-find-living-thing",
        201
    ],
    [
        "task-4-grow-plant",
        44
    ],
    [
        "task-3-find-animal",
        31
    ],
    [
        "task-4-grow-fruit",
        87
    ],
    [
        "task-3-find-animal",
        137
    ],
    [
        "task-3-find-non-living-thing",
        79
    ],
    [
        "task-3-find-living-thing",
        119
    ],
    [
        "task-3-find-animal",
        177
    ],
    [
        "task-3-find-living-thing",
        219
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        33
    ],
    [
        "task-3-find-plant",
        66
    ],
    [
        "task-3-find-living-thing",
        200
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        24
    ],
    [
        "task-3-find-living-thing",
        7
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        7
    ],
    [
        "task-3-find-plant",
        137
    ],
    [
        "task-1-melt",
        13
    ],
    [
        "task-6-lifespan-(longest-lived)",
        22
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        25
    ],
    [
        "task-3-find-plant",
        108
    ],
    [
        "task-3-find-non-living-thing",
        4
    ],
    [
        "task-3-find-living-thing",
        183
    ],
    [
        "task-3-find-animal",
        36
    ],
    [
        "task-3-find-non-living-thing",
        63
    ],
    [
        "task-3-find-non-living-thing",
        169
    ],
    [
        "task-3-find-living-thing",
        76
    ],
    [
        "task-6-lifespan-(longest-lived)",
        23
    ],
    [
        "task-3-find-plant",
        104
    ],
    [
        "task-3-find-non-living-thing",
        103
    ],
    [
        "task-3-find-living-thing",
        136
    ],
    [
        "task-4-grow-plant",
        31
    ],
    [
        "task-3-find-animal",
        75
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        10
    ],
    [
        "task-3-find-non-living-thing",
        25
    ],
    [
        "task-3-find-plant",
        171
    ],
    [
        "task-3-find-plant",
        34
    ],
    [
        "task-2-power-component-(renewable-vs-nonrenewable-energy)",
        4
    ],
    [
        "task-3-find-animal",
        95
    ],
    [
        "task-6-lifespan-(longest-lived)",
        21
    ],
    [
        "task-4-grow-fruit",
        47
    ],
    [
        "task-3-find-plant",
        144
    ],
    [
        "task-3-find-non-living-thing",
        30
    ],
    [
        "task-3-find-living-thing",
        217
    ],
    [
        "task-3-find-living-thing",
        209
    ],
    [
        "task-4-grow-fruit",
        9
    ],
    [
        "task-3-find-non-living-thing",
        148
    ],
    [
        "task-7-identify-life-stages-2",
        3
    ],
    [
        "task-3-find-plant",
        77
    ],
    [
        "task-3-find-living-thing",
        176
    ],
    [
        "task-3-find-living-thing",
        118
    ],
    [
        "task-6-lifespan-(longest-lived)",
        86
    ],
    [
        "task-4-grow-fruit",
        0
    ],
    [
        "task-3-find-animal",
        102
    ],
    [
        "task-3-find-living-thing",
        91
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        34
    ],
    [
        "task-3-find-plant",
        50
    ],
    [
        "task-3-find-non-living-thing",
        45
    ],
    [
        "task-4-grow-plant",
        84
    ],
    [
        "task-3-find-living-thing",
        185
    ],
    [
        "task-3-find-non-living-thing",
        37
    ],
    [
        "task-3-find-animal",
        3
    ],
    [
        "task-3-find-living-thing",
        110
    ],
    [
        "task-1-boil",
        6
    ],
    [
        "task-3-find-animal",
        49
    ],
    [
        "task-3-find-plant",
        25
    ],
    [
        "task-3-find-plant",
        124
    ],
    [
        "task-3-find-animal",
        167
    ],
    [
        "task-6-lifespan-(longest-lived)",
        73
    ],
    [
        "task-3-find-non-living-thing",
        160
    ],
    [
        "task-3-find-non-living-thing",
        36
    ],
    [
        "task-2-power-component-(renewable-vs-nonrenewable-energy)",
        9
    ],
    [
        "task-3-find-plant",
        160
    ],
    [
        "task-3-find-living-thing",
        186
    ],
    [
        "task-3-find-non-living-thing",
        215
    ],
    [
        "task-4-grow-fruit",
        61
    ],
    [
        "task-3-find-animal",
        40
    ],
    [
        "task-3-find-animal",
        181
    ],
    [
        "task-3-find-non-living-thing",
        43
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        3
    ],
    [
        "task-3-find-living-thing",
        57
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        66
    ],
    [
        "task-3-find-animal",
        60
    ],
    [
        "task-3-find-non-living-thing",
        41
    ],
    [
        "task-3-find-living-thing",
        177
    ],
    [
        "task-3-find-plant",
        169
    ],
    [
        "task-6-lifespan-(shortest-lived)",
        77
    ],
    [
        "task-4-grow-plant",
        76
    ],
    [
        "task-3-find-plant",
        3
    ],
    [
        "task-3-find-living-thing",
        46
    ],
    [
        "task-6-lifespan-(longest-lived)",
        90
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        63
    ],
    [
        "task-3-find-animal",
        134
    ],
    [
        "task-6-lifespan-(longest-lived-then-shortest-lived)",
        36
    ],
    [
        "task-6-life
Download .txt
gitextract_bghxqcon/

├── .gitignore
├── LICENSE
├── README.md
├── agents/
│   └── recode/
│       ├── agent.py
│       ├── resources/
│       │   ├── fewshots/
│       │   │   ├── alfworld/
│       │   │   │   ├── clean.txt
│       │   │   │   ├── cool.txt
│       │   │   │   ├── examine.txt
│       │   │   │   ├── heat.txt
│       │   │   │   ├── put.txt
│       │   │   │   └── puttwo.txt
│       │   │   ├── sciworld/
│       │   │   │   └── base.txt
│       │   │   └── webshop/
│       │   │       └── base.txt
│       │   └── prompts/
│       │       ├── alfworld/
│       │       │   └── actions.txt
│       │       ├── default_new.py
│       │       ├── sciworld/
│       │       │   └── actions.txt
│       │       └── webshop/
│       │           └── actions.txt
│       └── utils.py
├── base/
│   ├── agent.py
│   └── environment.py
├── configs/
│   ├── prices.json
│   └── profiles_example.yaml
├── envs/
│   ├── alfworld/
│   │   ├── base_config.yaml
│   │   └── env.py
│   ├── sciworld/
│   │   ├── base_config.yaml
│   │   ├── data/
│   │   │   ├── max_steps.json
│   │   │   ├── taskname2id.json
│   │   │   ├── test_indices.json
│   │   │   ├── train_indices.json
│   │   │   └── valid_indices.json
│   │   └── env.py
│   └── webshop/
│       ├── env.py
│       ├── setup.py
│       ├── setup.sh
│       └── src/
│           └── webshop/
│               ├── __init__.py
│               ├── run_envs/
│               │   ├── run_web_agent_site_env.py
│               │   └── run_web_agent_text_env.py
│               ├── search_engine/
│               │   └── lucene_searcher.py
│               ├── transfer/
│               │   ├── README.md
│               │   ├── __init__.py
│               │   ├── app.py
│               │   ├── predict_help.py
│               │   └── webshop_lite.py
│               └── web_agent_site/
│                   ├── __init__.py
│                   ├── app.py
│                   ├── attributes/
│                   │   ├── annotate.py
│                   │   └── generate_attrs.py
│                   ├── engine/
│                   │   ├── __init__.py
│                   │   ├── engine.py
│                   │   ├── goal.py
│                   │   └── normalize.py
│                   ├── envs/
│                   │   ├── __init__.py
│                   │   ├── chromedriver
│                   │   ├── web_agent_site_env.py
│                   │   └── web_agent_text_env.py
│                   ├── models/
│                   │   ├── __init__.py
│                   │   └── models.py
│                   ├── static/
│                   │   └── style.css
│                   ├── templates/
│                   │   ├── attributes_page.html
│                   │   ├── description_page.html
│                   │   ├── done_page.html
│                   │   ├── features_page.html
│                   │   ├── item_page.html
│                   │   ├── results_page.html
│                   │   ├── review_page.html
│                   │   └── search_page.html
│                   └── utils.py
├── requirements.txt
├── run.py
└── utils/
    ├── common.py
    ├── errors.py
    ├── executor.py
    ├── llm.py
    ├── logger.py
    └── mockllm.py
Download .txt
SYMBOL INDEX (259 symbols across 27 files)

FILE: agents/recode/agent.py
  class ReCodeAgent (line 28) | class ReCodeAgent(Agent):
    method __init__ (line 29) | def __init__(
    method reset (line 44) | def reset(self, running_config: dict, init_info: dict=None) -> None:
    method _load_resources (line 72) | def _load_resources(self):
    method act (line 87) | async def act(self, observations: List[str]) -> List[str]:
    method _handle_stub (line 120) | async def _handle_stub(self) -> None:
    method _expand (line 143) | async def _expand(self) -> Optional[List[str]]:
    method _execute (line 181) | def _execute(self, code: str) -> dict:
    method _init_code_tree (line 184) | def _init_code_tree(self, observation: str) -> None:
    method _build_expand_prompt (line 192) | def _build_expand_prompt(self) -> str:
    method _get_max_depth (line 200) | def _get_max_depth(self, node: Optional[CodeNode]) -> int:
    method _get_formatted_tree (line 210) | def _get_formatted_tree(self) -> dict:
    method report (line 253) | def report(self) -> dict:

FILE: agents/recode/utils.py
  function parse_raw_observation (line 9) | def parse_raw_observation(raw_observation: str, env_name: str) -> tuple[...
  class NodeStatus (line 25) | class NodeStatus(str, Enum):
  class CodeNode (line 33) | class CodeNode:
    method __post_init__ (line 44) | def __post_init__(self):
    method next (line 47) | def next(self) -> Optional['CodeNode']:
    method clear (line 65) | def clear(self) -> None:
  function split_blocks (line 71) | def split_blocks(source: str) -> List[str]:
  function validate_blocks (line 133) | def validate_blocks(blocks: List[str]) -> None:
  function get_variables (line 151) | def get_variables(executor: Executor, code: str) -> str:

FILE: base/agent.py
  class Agent (line 4) | class Agent(ABC):
    method act (line 6) | async def act(self, observations: List[str]) -> List[str]:
    method reset (line 10) | def reset(self, running_config: dict, init_info: dict=None) -> None:
    method report (line 14) | def report(self) -> dict:

FILE: base/environment.py
  class Env (line 5) | class Env(ABC):
    method _run (line 12) | async def _run(self, action: str) -> Any:
    method run (line 15) | async def run(self, action: List[str]) -> List[str]:
    method is_done (line 31) | def is_done(self) -> bool:
    method is_success (line 34) | def is_success(self) -> bool:
    method reset (line 38) | def reset(self, running_config: dict, id: Optional[str] = None) -> dict:
    method get_step_count (line 41) | def get_step_count(self) -> int:
    method report (line 45) | def report(self) -> dict:
    method close (line 48) | async def close(self) -> None:

FILE: envs/alfworld/env.py
  class AlfworldEnv (line 31) | class AlfworldEnv(Env):
    method __init__ (line 36) | def __init__(
    method _get_game_files (line 60) | def _get_game_files(self, seed: int = 42) -> List[str]:
    method _normalize_split_for_alfworld (line 144) | def _normalize_split_for_alfworld(self, split: str) -> str:
    method _initialize (line 153) | def _initialize(self) -> None:
    method _configure_for_specific_game (line 207) | def _configure_for_specific_game(self, config: Dict[str, Any], game_fi...
    method reset (line 238) | def reset(self, running_config: dict, id: Optional[str] = None) -> dict:
    method set_max_steps (line 308) | def set_max_steps(self, max_steps: int) -> None:
    method _run (line 311) | async def _run(self, single_action: str) -> str:
    method report (line 353) | def report(self) -> dict:
    method close (line 361) | async def close(self) -> None:

FILE: envs/sciworld/env.py
  class SciWorldEnv (line 13) | class SciWorldEnv(Env):
    method __init__ (line 21) | def __init__(
    method _initialize (line 47) | def _initialize(self) -> None:
    method _load_indices (line 69) | def _load_indices(self, split: str, seed: int) -> List[int]:
    method reset (line 91) | def reset(self, running_config: dict, id: Optional[str] = None) -> dict:
    method _run (line 131) | async def _run(self, single_action: str) -> str:
    method is_done (line 167) | def is_done(self) -> bool:
    method get_step_count (line 172) | def get_step_count(self) -> int:
    method is_success (line 175) | def is_success(self) -> bool:
    method report (line 179) | def report(self):
    method close (line 187) | async def close(self) -> None:

FILE: envs/webshop/env.py
  function clean_str (line 17) | def clean_str(p):
  function tag_visible (line 21) | def tag_visible(element):
  function webshop_text (line 28) | def webshop_text(html_content, max_products=10):
  function _get_shared_server (line 107) | def _get_shared_server(
  class WebShopEnv (line 128) | class WebShopEnv(Env):
    method __init__ (line 131) | def __init__(
    method _ensure_session_asins (line 176) | def _ensure_session_asins(self):
    method reset (line 187) | def reset(self, running_config: dict, id: Optional[str] = None):
    method _format_observation (line 256) | def _format_observation(self, observation: str) -> str:
    method _run (line 277) | async def _run(self, action: str):
    method _get_current_url (line 400) | def _get_current_url(self):
    method is_done (line 414) | def is_done(self):
    method is_success (line 418) | def is_success(self):
    method get_step_count (line 428) | def get_step_count(self):
    method get_reward (line 432) | def get_reward(self):
    method get_available_actions (line 436) | def get_available_actions(self):
    method get_instruction_text (line 440) | def get_instruction_text(self):
    method get_trajectory (line 444) | def get_trajectory(self):
    method close (line 448) | async def close(self) -> None:
    method report (line 495) | def report(self):

FILE: envs/webshop/src/webshop/transfer/app.py
  function process_str (line 28) | def process_str(s):
  function process_goal (line 34) | def process_goal(state):
  function data_collator (line 43) | def data_collator(batch):
  function bart_predict (line 66) | def bart_predict(input):
  function bert_predict (line 73) | def bert_predict(obs, info, softmax=True):
  function get_return_value (line 95) | def get_return_value(env, asin, options, search_terms, page_num, product):
  function predict (line 126) | def predict(obs, info):
  function run_episode (line 136) | def run_episode(goal, env, verbose=True):

FILE: envs/webshop/src/webshop/transfer/predict_help.py
  class Page (line 9) | class Page(Enum):
  function parse_results_ebay (line 26) | def parse_results_ebay(query, page_num=None, verbose=True):
  function parse_item_page_ebay (line 63) | def parse_item_page_ebay(asin, verbose=True):
  function parse_results_ws (line 146) | def parse_results_ws(query, page_num=None, verbose=True):
  function parse_item_page_ws (line 188) | def parse_item_page_ws(asin, query, page_num, options, verbose=True):
  function parse_results_amz (line 262) | def parse_results_amz(query, page_num=None, verbose=True):
  function parse_item_page_amz (line 296) | def parse_item_page_amz(asin, verbose=True):
  function convert_html_to_text (line 394) | def convert_html_to_text(html, simple=False, clicked_options=None, visit...
  function convert_dict_to_actions (line 429) | def convert_dict_to_actions(page_type, products=None, asin=None, page_nu...

FILE: envs/webshop/src/webshop/transfer/webshop_lite.py
  function read_html_template (line 15) | def read_html_template(path):
  function index (line 21) | def index(session_id, **kwargs):
  function search_results (line 25) | def search_results(data):
  function item_page (line 39) | def item_page(session_id, asin, keywords, page, options):
  function item_sub_page (line 54) | def item_sub_page(session_id, asin, keywords, page, sub_page, options):
  function done (line 69) | def done(asin, options, session_id, **kwargs):
  function dict_to_fake_html (line 89) | def dict_to_fake_html(data, page_type, asin=None, sub_page_type=None, op...

FILE: envs/webshop/src/webshop/web_agent_site/app.py
  function home (line 46) | def home():
  function index (line 50) | def index(session_id):
  function search_results (line 111) | def search_results(session_id, keywords, page):
  function item_page (line 150) | def item_page(session_id, asin, keywords, page, options):
  function item_sub_page (line 187) | def item_sub_page(session_id, asin, keywords, page, sub_page, options):
  function done (line 220) | def done(session_id, asin, options):

FILE: envs/webshop/src/webshop/web_agent_site/attributes/annotate.py
  function annotate (line 16) | def annotate(attr_path):
  function main (line 62) | def main():

FILE: envs/webshop/src/webshop/web_agent_site/attributes/generate_attrs.py
  function get_stop_words (line 20) | def get_stop_words():
  function load_products (line 26) | def load_products(num=None):
  function get_top_attrs (line 58) | def get_top_attrs(attributes, k):
  function get_corpus (line 76) | def get_corpus(
  function generate_ngram_attrs (line 112) | def generate_ngram_attrs(corpus_by_cat, ngram_range, k, attrs):
  function generate_attrs (line 140) | def generate_attrs(corpus_by_cat, k, save_name):

FILE: envs/webshop/src/webshop/web_agent_site/engine/engine.py
  function map_action_to_html (line 44) | def map_action_to_html(action, **kwargs):
  function read_html_template (line 111) | def read_html_template(path):
  function parse_action (line 117) | def parse_action(action):
  function convert_web_app_string_to_var (line 131) | def convert_web_app_string_to_var(name, string):
  function get_top_n_product_from_keywords (line 148) | def get_top_n_product_from_keywords(
  function get_product_per_page (line 176) | def get_product_per_page(top_n_products, page):
  function generate_product_prices (line 180) | def generate_product_prices(all_products):
  function init_search_engine (line 195) | def init_search_engine(num_products=None):
  function clean_product_keys (line 213) | def clean_product_keys(products, quiet: bool = False):
  function load_products (line 234) | def load_products(filepath, num_products=None, human_goals=True, quiet: ...

FILE: envs/webshop/src/webshop/web_agent_site/engine/goal.py
  function get_goals (line 16) | def get_goals(all_products, product_prices, human_goals=True, quiet: boo...
  function get_human_goals (line 22) | def get_human_goals(all_products, product_prices, quiet: bool = False):
  function get_synthetic_goals (line 71) | def get_synthetic_goals(all_products, product_prices, quiet: bool = False):
  function get_type_reward (line 133) | def get_type_reward(purchased_product, goal):
  function get_attribute_reward (line 181) | def get_attribute_reward(purchased_product, goal):
  function get_option_reward (line 212) | def get_option_reward(purchased_options, goal_options):
  function get_reward (line 231) | def get_reward(purchased_product, goal, price, options, **kwargs):

FILE: envs/webshop/src/webshop/web_agent_site/engine/normalize.py
  function normalize_color (line 57) | def normalize_color(color_string: str) -> str:
  function normalize_color_size (line 64) | def normalize_color_size(product_prices: dict) -> Tuple[dict, dict]:

FILE: envs/webshop/src/webshop/web_agent_site/envs/web_agent_site_env.py
  class WebAgentSiteEnv (line 18) | class WebAgentSiteEnv(gym.Env):
    method __init__ (line 21) | def __init__(self, observation_mode='html', **kwargs):
    method step (line 50) | def step(self, action):
    method get_available_actions (line 93) | def get_available_actions(self):
    method _parse_html (line 120) | def _parse_html(self, html=None, url=None):
    method get_reward (line 136) | def get_reward(self):
    method get_instruction_text (line 143) | def get_instruction_text(self):
    method convert_html_to_text (line 149) | def convert_html_to_text(self, html):
    method state (line 157) | def state(self):
    method observation (line 169) | def observation(self):
    method action_space (line 182) | def action_space(self):
    method observation_space (line 187) | def observation_space(self):
    method reset (line 190) | def reset(self):
    method render (line 203) | def render(self, mode='human'):
    method close (line 207) | def close(self):
  function tag_visible (line 212) | def tag_visible(element):

FILE: envs/webshop/src/webshop/web_agent_site/envs/web_agent_text_env.py
  class WebAgentTextEnv (line 34) | class WebAgentTextEnv(gym.Env):
    method __init__ (line 36) | def __init__(
    method step (line 88) | def step(self, action):
    method get_available_actions (line 130) | def get_available_actions(self):
    method get_image (line 153) | def get_image(self):
    method get_instruction_text (line 165) | def get_instruction_text(self):
    method _parse_html (line 171) | def _parse_html(self, html=None):
    method observation (line 185) | def observation(self):
    method state (line 202) | def state(self):
    method convert_html_to_text (line 213) | def convert_html_to_text(self, html, simple=False):
    method reset (line 243) | def reset(self, session=None, instruction_text=None):
    method render (line 265) | def render(self, mode='human'):
    method close (line 268) | def close(self):
  function tag_visible (line 272) | def tag_visible(element):
  class SimServer (line 279) | class SimServer:
    method __init__ (line 281) | def __init__(
    method index (line 368) | def index(self, session_id, **kwargs):
    method search_results (line 379) | def search_results(self, session_id, **kwargs):
    method item_page (line 425) | def item_page(self, session_id, **kwargs):
    method item_sub_page (line 468) | def item_sub_page(self, session_id, **kwargs):
    method done (line 499) | def done(self, session_id, **kwargs):
    method receive (line 534) | def receive(self, session_id, current_url, session_int=None, **kwargs):
    method get_page_name (line 619) | def get_page_name(self, url):
  class SimBrowser (line 635) | class SimBrowser:
    method __init__ (line 637) | def __init__(self, server):
    method get (line 643) | def get(self, url, session_id=None, session_int=None):
    method click (line 650) | def click(self, clickable_name, text_to_clickable):
    method search (line 661) | def search(self, keywords):

FILE: envs/webshop/src/webshop/web_agent_site/models/models.py
  class BasePolicy (line 10) | class BasePolicy:
    method __init__ (line 11) | def __init__(self):
    method forward (line 14) | def forward(observation, available_actions):
  class HumanPolicy (line 33) | class HumanPolicy(BasePolicy):
    method __init__ (line 34) | def __init__(self):
    method forward (line 37) | def forward(self, observation, available_actions):
  class RandomPolicy (line 42) | class RandomPolicy(BasePolicy):
    method __init__ (line 43) | def __init__(self):
    method forward (line 46) | def forward(self, observation, available_actions):

FILE: envs/webshop/src/webshop/web_agent_site/utils.py
  function random_idx (line 21) | def random_idx(cum_weights):
  function setup_logger (line 31) | def setup_logger(session_id, user_log_dir):
  function generate_mturk_code (line 44) | def generate_mturk_code(session_id: str) -> str:

FILE: run.py
  function resolve_class_identifier (line 64) | def resolve_class_identifier(identifier: str, aliases: Dict[str, str], k...
  function _default_run_id (line 80) | def _default_run_id(agent_path: str, env_path: str) -> str:
  function create_instance (line 87) | def create_instance(cls: Type, running_config: Optional[Dict[str, Any]],...
  function load_class (line 112) | def load_class(path: str) -> Type:
  function _safe_report (line 126) | def _safe_report(obj: Any) -> Dict[str, Any]:
  function _assemble_result (line 137) | def _assemble_result(
  function run_single_instance (line 162) | async def run_single_instance(
  function run_concurrent_instances (line 243) | async def run_concurrent_instances(
  function write_summary (line 536) | def write_summary(results: List[Dict[str, Any]], output_file: Path):
  function main (line 674) | def main():

FILE: utils/common.py
  function read_json_file (line 9) | def read_json_file(json_file: str, encoding="utf-8") -> List[Any]:
  function write_json_file (line 20) | def write_json_file(json_file: str, data: list, encoding: str = None, in...
  function read_yaml_file (line 28) | def read_yaml_file(yaml_file: str, encoding='utf-8') -> Dict[str, Any]:
  function parse_code_block (line 39) | def parse_code_block(text: str, lang: str = "python") -> Optional[str]:
  function parse_xml_tag (line 47) | def parse_xml_tag(response: str, xml_tag: str) -> str:

FILE: utils/errors.py
  class StepLimitError (line 1) | class StepLimitError(Exception):

FILE: utils/executor.py
  function print_output (line 13) | def print_output(func):
  class Executor (line 22) | class Executor:
    method __init__ (line 23) | def __init__(self, env: Env = None, if_run_print: bool = False) -> None:
    method register_function (line 38) | def register_function(self, name: str, func: Callable):
    method register_action_function (line 41) | def register_action_function(self, name: str, func: Callable):
    method register_ask_llm (line 45) | def register_ask_llm(self, llm: AsyncLLM):
    method skip (line 56) | def skip(self, reason: str):
    method set_var (line 59) | def set_var(self, key: str, value: Any):
    method get_var (line 62) | def get_var(self, key: str) -> Any:
    method set_env (line 67) | def set_env(self, env: Env):
    method _is_preserved_variable (line 70) | def _is_preserved_variable(self, key: str, value: Any) -> bool:
    method _infer_type_string (line 76) | def _infer_type_string(self, value: Any, depth: int = 0, max_depth: in...
    method run (line 119) | def run(self, action: str) -> str:
    method get_actions (line 130) | def get_actions(self) -> List[str]:
    method get_variables (line 135) | def get_variables(self) -> str:
    method reset (line 138) | def reset(self):
    method _start_loop_thread (line 142) | def _start_loop_thread(self):
    method _submit_coro (line 156) | def _submit_coro(self, coro):
    method close (line 161) | def close(self):
    method execute (line 172) | def execute(self, code: str) -> Dict[str, Any]:
    method _run_block (line 176) | def _run_block(self, block: str) -> tuple[bool, List[str], str]:

FILE: utils/llm.py
  class LLMConfig (line 15) | class LLMConfig(BaseModel):
    method from_profile (line 45) | def from_profile(cls, profile: str = "default", config_path: Path = DE...
    method resolve_api_key (line 61) | def resolve_api_key(self) -> "LLMConfig":
  class CostCalculator (line 66) | class CostCalculator(BaseModel):
    method compute_cost (line 72) | def compute_cost(
  class AsyncLLM (line 97) | class AsyncLLM(BaseModel):
    method __init__ (line 105) | def __init__(self, profile_or_config: Union[str, Dict[str, Any]] = "de...
    method _load_profile_config (line 117) | def _load_profile_config(self, profile: str) -> Dict[str, Any]:
    method _initialize_client (line 134) | def _initialize_client(self) -> None:
    method __call__ (line 150) | async def __call__(
    method _build_messages (line 173) | def _build_messages(self, prompt: str, system_prompt: Optional[str]) -...
    method _prepare_params (line 180) | def _prepare_params(
    method _retry_api_call (line 206) | async def _retry_api_call(self, params: Dict[str, Any]) -> Any:
    method _calculate_backoff (line 220) | def _calculate_backoff(self, attempt: int, base: float, max_wait: floa...
  function create_llm_instance (line 225) | def create_llm_instance(model_name: str) -> AsyncLLM:
  function main (line 228) | async def main():

FILE: utils/logger.py
  class MultiLineFormatter (line 6) | class MultiLineFormatter(logging.Formatter):
    method format (line 7) | def format(self, record):
  class SimpleLogger (line 16) | class SimpleLogger:
    method __init__ (line 17) | def __init__(self, run_id=None, log_level=logging.INFO):
    method info (line 50) | def info(self, message):
    method error (line 53) | def error(self, message):
    method warning (line 56) | def warning(self, message):
    method debug (line 59) | def debug(self, message):
    method log_result (line 62) | def log_result(self, result):
    method log_stats (line 74) | def log_stats(self, stats):
    method get_log_dir (line 91) | def get_log_dir(self):
    method get_base_dir (line 94) | def get_base_dir(self):

FILE: utils/mockllm.py
  class MockLLM (line 3) | class MockLLM:
    method __init__ (line 5) | def __init__(self, name="MockLLM"):
    method __call__ (line 8) | async def __call__(self, prompt):
  function test_mock_llm (line 23) | async def test_mock_llm():
Condensed preview — 74 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (489K chars).
[
  {
    "path": ".gitignore",
    "chars": 156,
    "preview": ".vscode/\n__pycache__/\n.DS_Store\n*.pyc\n*.zip\nlogs/\nenvs/webshop/data/\nenvs/webshop/search_index/\nenvs/webshop/data.zip\nen"
  },
  {
    "path": "LICENSE",
    "chars": 1074,
    "preview": "MIT License\n\nCopyright (c) 2026 Foundation Agents\n\nPermission is hereby granted, free of charge, to any person obtaining"
  },
  {
    "path": "README.md",
    "chars": 10918,
    "preview": "# ReCode: Unify Plan and Action for Universal Granularity Control\n\n[![Arxiv](https://img.shields.io/badge/2510.23564-arX"
  },
  {
    "path": "agents/recode/agent.py",
    "chars": 10209,
    "preview": "from __future__ import annotations\n\nfrom pathlib import Path\nfrom enum import Enum\nfrom typing import List, Optional\nfro"
  },
  {
    "path": "agents/recode/resources/fewshots/alfworld/clean.txt",
    "chars": 6491,
    "preview": "[Input]\nThe current function to expand is:\nsolve(instruction, observation)\nThe variables you can use is:\n- instruction ("
  },
  {
    "path": "agents/recode/resources/fewshots/alfworld/cool.txt",
    "chars": 6520,
    "preview": "[Input]\nThe current function to expand is:\nsolve(instruction, observation)\nThe variables you can use is:\n- instruction ("
  },
  {
    "path": "agents/recode/resources/fewshots/alfworld/examine.txt",
    "chars": 4548,
    "preview": "[Input]\nThe current function to expand is:\nsolve(instruction, observation)\nThe variables you can use is:\n- instruction ("
  },
  {
    "path": "agents/recode/resources/fewshots/alfworld/heat.txt",
    "chars": 5863,
    "preview": "[Input]\nThe current function to expand is:\nsolve(instruction, observation)\nThe variables you can use is:\n- instruction ("
  },
  {
    "path": "agents/recode/resources/fewshots/alfworld/put.txt",
    "chars": 4936,
    "preview": "[Input]\nThe current function to expand is:\nsolve(instruction, observation)\nThe variables you can use is:\n- instruction ("
  },
  {
    "path": "agents/recode/resources/fewshots/alfworld/puttwo.txt",
    "chars": 8055,
    "preview": "[Input]\nThe current function to expand is:\nsolve(instruction, observation)\nThe variables you can use is:\n- instruction ("
  },
  {
    "path": "agents/recode/resources/fewshots/sciworld/base.txt",
    "chars": 4188,
    "preview": "[Input]\nThe current function to expand is:\nsolve(instruction, observation)\nThe variables you can use is:\n- instruction ("
  },
  {
    "path": "agents/recode/resources/fewshots/webshop/base.txt",
    "chars": 5929,
    "preview": "INPUT:\nThe current function to expand is:\nsolve(instruction, observation)\nThe variables you can use is:\n- instruction (s"
  },
  {
    "path": "agents/recode/resources/prompts/alfworld/actions.txt",
    "chars": 266,
    "preview": "- go to {loc_ID}  \n- open {loc_ID}\n- close {loc_ID}\n- take {obj_ID} from {loc_ID}\n- move {obj_ID} to {loc_ID}\n- use {des"
  },
  {
    "path": "agents/recode/resources/prompts/default_new.py",
    "chars": 2147,
    "preview": "EXPAND_PROMPT = \"\"\"\nYou are the EXPAND step in the LLM Agent loop. You need to replace the current placeholder function "
  },
  {
    "path": "agents/recode/resources/prompts/sciworld/actions.txt",
    "chars": 749,
    "preview": "open OBJ: open a container\nclose OBJ: close a container\nactivate OBJ: activate a device\ndeactivate OBJ: deactivate a dev"
  },
  {
    "path": "agents/recode/resources/prompts/webshop/actions.txt",
    "chars": 52,
    "preview": "- search[keywords]\n- click[element]\n- click[Buy Now]"
  },
  {
    "path": "agents/recode/utils.py",
    "chars": 7543,
    "preview": "import ast\nfrom dataclasses import dataclass, field\nfrom enum import Enum\nimport uuid\nfrom typing import List, Optional,"
  },
  {
    "path": "base/agent.py",
    "chars": 345,
    "preview": "from abc import ABC, abstractmethod\nfrom typing import List\n\nclass Agent(ABC):\n    @abstractmethod\n    async def act(sel"
  },
  {
    "path": "base/environment.py",
    "chars": 1145,
    "preview": "from abc import ABC, abstractmethod\nfrom typing import Union, List, Any, Optional\n\n\nclass Env(ABC):\n    id: str\n    _ste"
  },
  {
    "path": "configs/prices.json",
    "chars": 264,
    "preview": "{\n    \"gpt-4o\": {\"input\": 2.5, \"output\": 10.0},\n    \"gpt-4o-2024-08-06\": {\"input\": 2.5, \"output\": 10.0},\n    \"gpt-4o-min"
  },
  {
    "path": "configs/profiles_example.yaml",
    "chars": 260,
    "preview": "models:\n  default:\n    api_key: \"sk-your_api_key\"\n    base_url: \"https://your.base.url/v1\"\n    model: \"gpt-4o-mini\"\n    "
  },
  {
    "path": "envs/alfworld/base_config.yaml",
    "chars": 7742,
    "preview": "dataset:\n  data_path: '$ALFWORLD_DATA/json_2.1.1/train'\n  eval_id_data_path: '$ALFWORLD_DATA/json_2.1.1/valid_seen'    #"
  },
  {
    "path": "envs/alfworld/env.py",
    "chars": 15538,
    "preview": "import contextlib\nimport glob\nimport os\nimport re\nfrom typing import Any, Dict, List, Optional, Union, Tuple\n\nimport yam"
  },
  {
    "path": "envs/sciworld/base_config.yaml",
    "chars": 35,
    "preview": "data_root_dir: \"envs/sciworld/data\""
  },
  {
    "path": "envs/sciworld/data/max_steps.json",
    "chars": 984,
    "preview": "{\n    \"task-1-boil\": 100,\n    \"task-1-change-the-state-of-matter-of\": 80,\n    \"task-1-freeze\": 80,\n    \"task-1-melt\": 80"
  },
  {
    "path": "envs/sciworld/data/taskname2id.json",
    "chars": 1248,
    "preview": "{\n    \"task-1-boil\": 0,\n    \"task-1-change-the-state-of-matter-of\": 1,\n    \"task-1-freeze\": 2,\n    \"task-1-melt\": 3,\n   "
  },
  {
    "path": "envs/sciworld/data/test_indices.json",
    "chars": 13696,
    "preview": "[\n    [\n        \"task-1-boil\",\n        21\n    ],\n    [\n        \"task-1-boil\",\n        22\n    ],\n    [\n        \"task-1-bo"
  },
  {
    "path": "envs/sciworld/data/train_indices.json",
    "chars": 96759,
    "preview": "[\n    [\n        \"task-2a-test-conductivity\",\n        412\n    ],\n    [\n        \"task-3-find-animal\",\n        0\n    ],\n   "
  },
  {
    "path": "envs/sciworld/data/valid_indices.json",
    "chars": 12642,
    "preview": "[\n    [\n        \"task-2a-test-conductivity-of-unknown-substances\",\n        418\n    ],\n    [\n        \"task-3-find-living-"
  },
  {
    "path": "envs/sciworld/env.py",
    "chars": 7901,
    "preview": "import contextlib\nimport json\nimport os\nimport random\nfrom pathlib import Path\nfrom typing import Any, Dict, List, Optio"
  },
  {
    "path": "envs/webshop/env.py",
    "chars": 19085,
    "preview": "import warnings\nwarnings.filterwarnings(\"ignore\", \"The 'text' argument to find\\\\(\\\\)-type methods is deprecated\", catego"
  },
  {
    "path": "envs/webshop/setup.py",
    "chars": 860,
    "preview": "from setuptools import setup, find_packages\n\nsetup(\n    name='webshop',\n    version='0.1',\n    packages=find_packages('s"
  },
  {
    "path": "envs/webshop/setup.sh",
    "chars": 228,
    "preview": "pip install gdown\ngdown https://drive.google.com/uc?id=1G_0ccLWn5kZE5rpeyAdh_YuoNzvBUjT9\ngdown https://drive.google.com/"
  },
  {
    "path": "envs/webshop/src/webshop/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "envs/webshop/src/webshop/run_envs/run_web_agent_site_env.py",
    "chars": 1303,
    "preview": "\"\"\"\nTest the site gym environment.\n\nTODO: move to testing dir for more rigorous tests\n\"\"\"\nimport gym\nfrom rich import pr"
  },
  {
    "path": "envs/webshop/src/webshop/run_envs/run_web_agent_text_env.py",
    "chars": 1056,
    "preview": "\"\"\"\nTest the text gym environment.\n\nTODO: move to testing dir for more rigorous tests\n\"\"\"\nimport gym\nfrom rich import pr"
  },
  {
    "path": "envs/webshop/src/webshop/search_engine/lucene_searcher.py",
    "chars": 326,
    "preview": "import json\nfrom pyserini.search.lucene import LuceneSearcher\nfrom rich import print\n\n\nsearcher = LuceneSearcher('indexe"
  },
  {
    "path": "envs/webshop/src/webshop/transfer/README.md",
    "chars": 2160,
    "preview": "# Sim-to-real Transfer\nThis folder contains code for transferring agents trained on WebShop to perform on third party we"
  },
  {
    "path": "envs/webshop/src/webshop/transfer/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "envs/webshop/src/webshop/transfer/app.py",
    "chars": 14368,
    "preview": "import gradio as gr\nimport json, time, torch\nfrom transformers import BartTokenizer, BartForConditionalGeneration, AutoM"
  },
  {
    "path": "envs/webshop/src/webshop/transfer/predict_help.py",
    "chars": 16743,
    "preview": "from bs4 import BeautifulSoup\nfrom bs4.element import Comment\nfrom enum import Enum\nimport re, time\nfrom urllib.parse im"
  },
  {
    "path": "envs/webshop/src/webshop/transfer/webshop_lite.py",
    "chars": 3272,
    "preview": "import os\n\nfrom flask import render_template_string, Flask\nfrom .predict_help import Page\n\napp=Flask(__name__)\napp.debug"
  },
  {
    "path": "envs/webshop/src/webshop/web_agent_site/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "envs/webshop/src/webshop/web_agent_site/app.py",
    "chars": 8336,
    "preview": "import argparse, json, logging, random\nfrom pathlib import Path\nfrom ast import literal_eval\n\nfrom flask import (\n    Fl"
  },
  {
    "path": "envs/webshop/src/webshop/web_agent_site/attributes/annotate.py",
    "chars": 1921,
    "preview": "import yaml\nfrom pathlib import Path\nfrom rich import print\n\nATTR_DIR = './data/attributes'\n\nATTR_PATHS = [\n    'narrow_"
  },
  {
    "path": "envs/webshop/src/webshop/web_agent_site/attributes/generate_attrs.py",
    "chars": 5151,
    "preview": "import json\nimport yaml\nimport random\nfrom pathlib import Path\nfrom collections import defaultdict\n\nfrom sklearn.feature"
  },
  {
    "path": "envs/webshop/src/webshop/web_agent_site/engine/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "envs/webshop/src/webshop/web_agent_site/engine/engine.py",
    "chars": 12891,
    "preview": "\"\"\"\n\"\"\"\nimport os\nimport re\nimport json\nimport random\nfrom collections import defaultdict\nfrom ast import literal_eval\nf"
  },
  {
    "path": "envs/webshop/src/webshop/web_agent_site/engine/goal.py",
    "chars": 10090,
    "preview": "\"\"\"\nFunctions for specifying goals and reward calculations.\n\"\"\"\nimport itertools\nimport random\nimport spacy\nfrom collect"
  },
  {
    "path": "envs/webshop/src/webshop/web_agent_site/engine/normalize.py",
    "chars": 3819,
    "preview": "import re\nfrom typing import Tuple\n\nCOLOR_SET = [\n    'alabaster', 'apricot', 'aqua', 'ash', 'asphalt', 'azure',\n    'ba"
  },
  {
    "path": "envs/webshop/src/webshop/web_agent_site/envs/__init__.py",
    "chars": 463,
    "preview": "from gym.envs.registration import register\n\nfrom envs.webshop.src.webshop.web_agent_site.envs.web_agent_site_env import "
  },
  {
    "path": "envs/webshop/src/webshop/web_agent_site/envs/web_agent_site_env.py",
    "chars": 7883,
    "preview": "import gym\nimport random\nimport requests\nimport string\nimport time\n\nfrom bs4 import BeautifulSoup\nfrom bs4.element impor"
  },
  {
    "path": "envs/webshop/src/webshop/web_agent_site/envs/web_agent_text_env.py",
    "chars": 27539,
    "preview": "import os\nimport gym\nimport json\nimport random\nimport string\nimport time\nimport torch\nimport pickle\n\nfrom bs4 import Bea"
  },
  {
    "path": "envs/webshop/src/webshop/web_agent_site/models/__init__.py",
    "chars": 59,
    "preview": "from .models import (\n    HumanPolicy,\n    RandomPolicy,\n)\n"
  },
  {
    "path": "envs/webshop/src/webshop/web_agent_site/models/models.py",
    "chars": 1295,
    "preview": "\"\"\"\nModel implementations. The model interface should be suitable for both\nthe ``site env'' and the ``text env''.\n\"\"\"\nim"
  },
  {
    "path": "envs/webshop/src/webshop/web_agent_site/static/style.css",
    "chars": 3514,
    "preview": ".text {\n    font-family: Arial, Helvetica;\n}\n\n* {\n    -webkit-border-radius: 1px !important;\n       -moz-border-radius: "
  },
  {
    "path": "envs/webshop/src/webshop/web_agent_site/templates/attributes_page.html",
    "chars": 2567,
    "preview": "<!DOCTYPE html>\n<html>\n  <head>\n    <link rel=\"stylesheet\" href=\"{{url_for('static', filename='style.css')}}\">\n    <link"
  },
  {
    "path": "envs/webshop/src/webshop/web_agent_site/templates/description_page.html",
    "chars": 1745,
    "preview": "<!DOCTYPE html>\n<html>\n  <head>\n    <link rel=\"stylesheet\" href=\"{{url_for('static', filename='style.css')}}\">\n    <link"
  },
  {
    "path": "envs/webshop/src/webshop/web_agent_site/templates/done_page.html",
    "chars": 2653,
    "preview": "<!DOCTYPE html>\n<html>\n  <head>\n    <link rel=\"stylesheet\" href=\"{{url_for('static', filename='style.css')}}\">\n    <link"
  },
  {
    "path": "envs/webshop/src/webshop/web_agent_site/templates/features_page.html",
    "chars": 1888,
    "preview": "<!DOCTYPE html>\n<html>\n  <head>\n    <link rel=\"stylesheet\" href=\"{{url_for('static', filename='style.css')}}\">\n    <link"
  },
  {
    "path": "envs/webshop/src/webshop/web_agent_site/templates/item_page.html",
    "chars": 5553,
    "preview": "<!DOCTYPE html>\n<html>\n  <head>\n    <link rel=\"stylesheet\" href=\"{{url_for('static', filename='style.css')}}\">\n    <link"
  },
  {
    "path": "envs/webshop/src/webshop/web_agent_site/templates/results_page.html",
    "chars": 4164,
    "preview": "<!DOCTYPE html>\n<html>\n  <head>\n    <link rel=\"stylesheet\" href=\"{{url_for('static', filename='style.css')}}\">\n    <link"
  },
  {
    "path": "envs/webshop/src/webshop/web_agent_site/templates/review_page.html",
    "chars": 2506,
    "preview": "<!DOCTYPE html>\n<html>\n  <head>\n    <link rel=\"stylesheet\" href=\"{{url_for('static', filename='style.css')}}\">\n    <link"
  },
  {
    "path": "envs/webshop/src/webshop/web_agent_site/templates/search_page.html",
    "chars": 1468,
    "preview": "<!DOCTYPE html>\n<html>\n  <head>\n    <link rel=\"stylesheet\" href=\"{{url_for('static', filename='style.css')}}\">\n    <link"
  },
  {
    "path": "envs/webshop/src/webshop/web_agent_site/utils.py",
    "chars": 1745,
    "preview": "import os\nimport bisect\nimport hashlib\nimport logging\nimport random\nfrom os.path import dirname, abspath, join\n\nBASE_DIR"
  },
  {
    "path": "requirements.txt",
    "chars": 39,
    "preview": "openai==2.6.1\nrich==14.2.0\ntorch==2.9.0"
  },
  {
    "path": "run.py",
    "chars": 31458,
    "preview": "import argparse\nimport asyncio\nimport importlib\nimport time\nimport shutil\nfrom pathlib import Path\nfrom typing import Ty"
  },
  {
    "path": "utils/common.py",
    "chars": 1871,
    "preview": "import json\nimport yaml\nfrom pathlib import Path\nfrom typing import Any, List, Dict, Optional\nfrom pydantic_core import "
  },
  {
    "path": "utils/errors.py",
    "chars": 120,
    "preview": "class StepLimitError(Exception):\n    \"\"\"Raised when the environment exceeds the maximum allowed step count.\"\"\"\n    pass "
  },
  {
    "path": "utils/executor.py",
    "chars": 7697,
    "preview": "from typing import List, Dict, Any, Callable\nimport io, sys\nimport functools\nimport asyncio\nimport types\nimport re\nimpor"
  },
  {
    "path": "utils/llm.py",
    "chars": 9073,
    "preview": "import os\nimport asyncio\nimport yaml\nimport random\nfrom pathlib import Path\nfrom typing import Optional, Dict, Any, Tupl"
  },
  {
    "path": "utils/logger.py",
    "chars": 3355,
    "preview": "import os\nimport logging\nfrom datetime import datetime\nfrom pathlib import Path\n\nclass MultiLineFormatter(logging.Format"
  },
  {
    "path": "utils/mockllm.py",
    "chars": 1049,
    "preview": "import asyncio\n\nclass MockLLM:\n    \n    def __init__(self, name=\"MockLLM\"):\n        self.name = name\n        \n    async "
  }
]

// ... and 1 more files (download for full content)

About this extraction

This page contains the full source code of the FoundationAgents/ReCode GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 74 files (16.3 MB), approximately 119.4k tokens, and a symbol index with 259 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!