|
| 1 | +# GAIA Environment Server |
| 2 | + |
| 3 | +A comprehensive environment server for GAIA (Generative AI Agent) tasks, designed to work with OpenManus-RL. This server provides a research environment with powerful tools and real-time observation tracking. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- Loads GAIA datasets from HuggingFace or local files |
| 8 | +- Integrates real functional tools for web search, Python code execution, and bash commands |
| 9 | +- Concurrency support with environment locking |
| 10 | +- Realistic research workflow simulation |
| 11 | +- Detailed memory of actions and results |
| 12 | +- Answer evaluation with true answer comparison |
| 13 | + |
| 14 | +## Installation |
| 15 | + |
| 16 | +```bash |
| 17 | +pip install -e . |
| 18 | +``` |
| 19 | + |
| 20 | +## Usage |
| 21 | + |
| 22 | +### Starting the server |
| 23 | + |
| 24 | +```bash |
| 25 | +# Start the server with default settings |
| 26 | +gaia-server |
| 27 | + |
| 28 | +# Start with custom host and port |
| 29 | +gaia-server --host 127.0.0.1 --port 8080 |
| 30 | + |
| 31 | +# Start with custom data directory |
| 32 | +gaia-server --data-dir /path/to/data/ |
| 33 | +``` |
| 34 | + |
| 35 | +### API Endpoints |
| 36 | + |
| 37 | +The GAIA environment server provides the following endpoints: |
| 38 | + |
| 39 | +- `GET /` - Test connection |
| 40 | +- `GET /list_envs` - List all active environments |
| 41 | +- `POST /create` - Create a new environment |
| 42 | +- `GET /observation?env_idx={env_id}` - Get the current observation for an environment |
| 43 | +- `POST /step` - Execute an action in an environment |
| 44 | +- `POST /reset` - Reset an environment |
| 45 | +- `GET /available_actions?env_idx={env_id}` - Get available actions for an environment |
| 46 | + |
| 47 | +### Available Tools |
| 48 | + |
| 49 | +The environment provides the following powerful tools: |
| 50 | + |
| 51 | +- **web_search** - Search the web for real-time information about any topic |
| 52 | +- **bash** - Execute bash commands in the terminal |
| 53 | +- **python_execute** - Execute Python code and get the results |
| 54 | +- **terminate** - Submit your final answer and terminate the task |
| 55 | + |
| 56 | +### Alternative Action Formats |
| 57 | + |
| 58 | +The server supports multiple action formats: |
| 59 | + |
| 60 | +#### Standard Format |
| 61 | +``` |
| 62 | +Action: tool_name Action Input: your_input |
| 63 | +``` |
| 64 | + |
| 65 | +#### Direct Format |
| 66 | +``` |
| 67 | +tool_name: your_input |
| 68 | +``` |
| 69 | + |
| 70 | +#### JSON Format |
| 71 | +``` |
| 72 | +{"tool_name": "web_search", "query": "What is the capital of France?"} |
| 73 | +``` |
| 74 | + |
| 75 | +#### Specific Parameter Formats |
| 76 | + |
| 77 | +**Web Search:** |
| 78 | +``` |
| 79 | +Action: web_search Action Input: your search query |
| 80 | +``` |
| 81 | + |
| 82 | +**Python Execute:** |
| 83 | +``` |
| 84 | +Action: python_execute Action Input: print("Hello, World!") |
| 85 | +``` |
| 86 | + |
| 87 | +**Bash:** |
| 88 | +``` |
| 89 | +Action: bash Action Input: ls -la |
| 90 | +``` |
| 91 | + |
| 92 | +**Terminate:** |
| 93 | +``` |
| 94 | +Action: terminate Action Input: Your final answer text here |
| 95 | +``` |
| 96 | + |
| 97 | +## Dataset Format |
| 98 | + |
| 99 | +Place GAIA datasets in the `data/gaia/` directory. The server will automatically load from this location or download the datasets from HuggingFace if not available locally. |
| 100 | + |
| 101 | +Dataset loading is handled automatically through the `load_gaia_data` utility function. |
0 commit comments