### Install Project Dependencies Source: https://github.com/ahnjaewoo/flashadventure/blob/main/game_agent/README.md Installs required packages from the requirements.txt file. ```bash pip install -r requirements.txt ``` -------------------------------- ### Install FlashAdventure via Conda Source: https://github.com/ahnjaewoo/flashadventure/blob/main/README.md Commands to clone the repository, create a Python 3.11 Conda environment, and install required dependencies. ```bash # Clone the repository git clone https://github.com/ahnjaewoo/flashadventure.git cd flashadventure # Create and activate a new Conda environment conda create -n flashadventure python=3.11 -y conda activate flashadventure # Install dependencies pip install -r requirements.txt ``` -------------------------------- ### Launch VLLM Model Server Source: https://github.com/ahnjaewoo/flashadventure/blob/main/game_agent/UI-Tars/README.md Starts the VLLM model server on a remote GPU machine to serve the UI-TARS model. ```bash python -m vllm.entrypoints.openai.api_server --served-model-name ui-tars --model "ByteDance-Seed/UI-TARS-1.5-7B" --limit-mm-per-prompt image=10 --port 8000 ``` -------------------------------- ### Milestone Prompt Example Source: https://github.com/ahnjaewoo/flashadventure/blob/main/evaluator/README.md Example JSON structure for defining a milestone evaluation task. ```json { "sherlock_holmes_the_tea_shop_murder_mystery": { "milestone_prompt1":"You are an AI agent specializing in the Sherlock Holmes detective game. Your task is to locate and click the blue notebook icon in the game interface (usually found at the far right of the inventory bar). Once the notebook is opened, do not perform any additional actions. Carefully read the displayed text (do not scroll) and count how many times the phrase 'New Suspect' appears in the note. If there is nothing written in the note, it means there is no new suspect. Once counted, output the result in the following format: ### Output Format #### New Suspect: [Number of occurrences]Do not perform any further interactions after counting. Your task ends once the count is provided." } } ``` -------------------------------- ### Grant permissions and execute the agent Source: https://github.com/ahnjaewoo/flashadventure/blob/main/game_agent/gpt_operator/README.md Commands to make the bash script executable and start the agent process in the terminal. ```bash chmod +x run.bash # (Run this once to grant permissions) ./run.bash ``` -------------------------------- ### Initialize and run a PromptAgent Source: https://github.com/ahnjaewoo/flashadventure/blob/main/game_agent/UI-Tars/mm_agents/README.md Demonstrates how to instantiate a PromptAgent with a specific model and observation type, then perform a prediction using an instruction and a screenshot. ```python from mm_agents.agent import PromptAgent agent = PromptAgent( model="gpt-4-vision-preview", observation_type="screenshot", ) agent.reset() # say we have an instruction and observation instruction = "Please help me to find the nearest restaurant." obs = {"screenshot": open("path/to/observation.jpg", 'rb').read()} response, actions = agent.predict( instruction, obs ) ``` -------------------------------- ### Create Run Script Source: https://github.com/ahnjaewoo/flashadventure/blob/main/game_agent/README.md Shell script to execute the game agent with a specified configuration file. ```bash #!/bin/bash SCRIPT_NAME="game_agent.py" CONFIG_FILE="config.yaml" python "$SCRIPT_NAME" --config "$CONFIG_FILE" ``` -------------------------------- ### Agent Configuration Source: https://github.com/ahnjaewoo/flashadventure/blob/main/game_agent/README.md YAML file for fine-tuning agent behavior, including model selection and action limits. ```yaml # The total number of actions the agent can take in a single session. max_action_count: 1000 # The API provider for the large language model. api_provider: "anthropic" # The specific model used for high-level reasoning and planning. reasoning_model: "claude-3-7-sonnet-20250219" # The model used for low-level GUI control and action execution. gui_model: "claude_cua" # The maximum number of actions the SeekerBot can take in a single run. max_actions_seeker: 15 # The maximum number of actions the SolverBot can take to solve a single problem. max_actions_solver: 5 ``` -------------------------------- ### Configure the Agent Execution Script Source: https://github.com/ahnjaewoo/flashadventure/blob/main/game_agent/claude_computer_use/README.md Defines the environment variables and command-line arguments required to launch the agent via main.py. ```bash #!/bin/bash # Ensure Python can find the agent modules in the parent directory export PYTHONPATH=$(pwd)/.. # Configuration for the agent # The file containing game-specific prompts TASK_FILE="./json/game_prompt.json" # The type of prompt to use from the file (e.g., "prompt") PROMPT_TYPE="prompt" # The maximum number of actions the agent will take in a single session MAX_ACTIONS=1000 # Execute the main agent script with the defined parameters python main.py \ --task-file "$TASK_FILE" \ --prompt-type "$PROMPT_TYPE" \ --max-actions "$MAX_ACTIONS" ``` -------------------------------- ### Configure API Keys Source: https://github.com/ahnjaewoo/flashadventure/blob/main/game_agent/README.md Required environment variables for LLM access stored in a .env file. ```ini OPENAI_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxx" ANTHROPIC_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxx" GEMINI_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxx" ``` -------------------------------- ### Create the run.bash script Source: https://github.com/ahnjaewoo/flashadventure/blob/main/evaluator/README.md Defines the bash script used to trigger the evaluate_game.py entry point. ```bash #!/bin/bash # at AdventureBench_final/evaluator/. python evaluate_game.py ``` -------------------------------- ### Create the run.bash automation script Source: https://github.com/ahnjaewoo/flashadventure/blob/main/game_agent/gpt_operator/README.md This script automates the execution of the main agent script by handling prompt file detection and history parameter configuration. ```bash #!/bin/bash PYTHON=python MAIN_SCRIPT="main.py" DEFAULT_PROMPT_FILE="game_prompts.json" HISTORY=10 echo "🚀 Starting agent automation loop..." # Automatically use the tasks.json file if it exists if [ -f "$DEFAULT_PROMPT_FILE" ]; then echo "📝 $DEFAULT_PROMPT_FILE detected, using prompt automatically" $PYTHON $MAIN_SCRIPT "$DEFAULT_PROMPT_FILE" --history $HISTORY else echo "📄 $DEFAULT_PROMPT_FILE not found, running with default prompt" $PYTHON $MAIN_SCRIPT --history $HISTORY fi ``` -------------------------------- ### Create Agent Run Script Source: https://github.com/ahnjaewoo/flashadventure/blob/main/game_agent/UI-Tars/README.md Defines the bash script used to execute the main agent entry point. ```bash #!/bin/bash # Execute the main agent script python run_uitars.py ``` -------------------------------- ### Create and Activate Conda Environment Source: https://github.com/ahnjaewoo/flashadventure/blob/main/game_agent/README.md Initializes a Python 3.11 environment for the project dependencies. ```bash # Create a new Conda environment conda create -n flashadventure python=3.11 -y # Activate the new environment conda activate flashadventure ``` -------------------------------- ### Configure API Keys Source: https://github.com/ahnjaewoo/flashadventure/blob/main/README.md Format for the .env file required to store OpenAI and Anthropic API keys in the project root. ```ini OPENAI_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxx" ANTHROPIC_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxx" ``` -------------------------------- ### Configure the run.bash script Source: https://github.com/ahnjaewoo/flashadventure/blob/main/game_agent/cradle/README.md Defines the environment variables for the agent provider, model, and GUI agent type before executing the main Python script. ```bash #!/bin/bash # Configuration # API Provider: Select one of "anthropic" or "openai". PROVIDER="anthropic" # LLM Model: Specifies the model for high-level reasoning. MODEL="claude-3-7-sonnet-20250219" # GUI Agent Type: Select the agent responsible for mouse/keyboard operations. # "claude": A Claude agent specialized for computer control. # "sonnet": An agent that uses the original Claude Sonnet model directly. # "uground": An open-source UGround model. CUA="claude" # Execute python main.py --model "$MODEL" --provider "$PROVIDER" --cua "$CUA" ``` -------------------------------- ### Define Game Prompts Source: https://github.com/ahnjaewoo/flashadventure/blob/main/game_agent/README.md JSON structure for defining system and game-specific instructions. ```json { "system_prompt": "[Instruction] \nYou’re a game agent solving an adventure game. ...", "game_prompt": "[Prompt]\n You are now the lead agent in “Sherlock Holmes: The Tea Shop Murder Mystery” — a point-and-click detective game...." } ``` -------------------------------- ### Predict with multi-modal observation data Source: https://github.com/ahnjaewoo/flashadventure/blob/main/game_agent/UI-Tars/mm_agents/README.md Shows how to structure the observation dictionary when providing multiple data types like screenshots and accessibility trees to the agent. ```python # continue from the previous code snippet obs = { "screenshot": open("path/to/observation.jpg", 'rb').read(), "a11y_tree": "" # [a11y_tree data] } response, actions = agent.predict( instruction, obs ) ``` -------------------------------- ### Configure Agent API Endpoint Source: https://github.com/ahnjaewoo/flashadventure/blob/main/game_agent/UI-Tars/README.md Updates the base_url in the agent configuration to connect to the model server. ```python ## Line 574 self.vlm = OpenAI( base_url="http://your_server_url:8000/v1", api_key="empty" ) ``` -------------------------------- ### Cite FlashAdventure in BibTeX Source: https://github.com/ahnjaewoo/flashadventure/blob/main/README.md Use this BibTeX entry to cite the FlashAdventure paper in academic publications. ```bibtex @inproceedings{ahn2025flashadventure, title={FlashAdventure: A Benchmark for GUI Agents Solving Full Story Arcs in Diverse Adventure Games}, author={Ahn, Jaewoo and Kim, Junseo and Yun, Heeseung and Son, Jaehyeon and Park, Dongmin and Cho, Jaewoong and Kim, Gunhee}, booktitle={EMNLP}, year={2025} } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.