# Local Testing Guide for GAIA Agent This document outlines how to test the GAIA agent locally during development. ## Setup 1. Install dependencies: ```bash pip install -r requirements.txt ``` 2. If you want to use the OAuth features locally: ```bash huggingface-cli login ``` Or set the `HF_TOKEN` environment variable with your token from [HF Settings](https://huggingface.co/settings/tokens). ## Running the Application ### Option 1: Simplified Local Testing (Recommended for Development) Use `app_local.py` which has a mock agent and doesn't require OAuth: ```bash python app_local.py ``` Or use the helper script: ```bash bash run_local.sh ``` This will: - Install required dependencies - Run the local version of the app - Use a mock agent that returns test responses - Use local sample questions without making API calls - Not submit any answers to the actual API ### Option 2: Full Application with Test Username If you want to test the full application but without requiring login: ```bash python app2.py ``` When the application loads: 1. Enter a test username in the "Or enter test username for local development" field 2. Click "Run Evaluation & Submit All Answers" ### Option 3: Full Application with OAuth To test the complete application with OAuth authentication: 1. Make sure you're logged in to Hugging Face CLI: `huggingface-cli login` 2. Run: `python app.py` or `python app2.py` 3. Click the "Login" button in the interface 4. After logging in, click "Run Evaluation & Submit All Answers" ## Debugging If you encounter OAuth-related errors: 1. Check if you're logged in with `huggingface-cli whoami` 2. Try setting your Hugging Face token as an environment variable: ``` export HF_TOKEN=your_token_here ``` 3. Use the local testing version (`app_local.py`) which avoids OAuth entirely ## Next Steps 1. Replace the mock agent in `app_local.py` with your real agent implementation 2. Test with a small set of sample questions before scaling up 3. Gradually add and test tools (web search, file reader, etc.) 4. When ready, deploy to Hugging Face Spaces for full evaluation