Tornadosky/Final_Assignment_Template
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
GAIA Benchmark Agent
This repository contains an enhanced agent designed to perform well on the GAIA benchmark. The goal is to achieve a score of 30% or higher on a subset of GAIA Level 1 questions.
Project Structure
api.py: Main file that is used to run gradio app and start the whole testing and submission loopapi_utils.py: Functions for interacting with the GAIA benchmark APItool_implementations.py: Enhanced implementations of tools for web search, calculation, image analysisanswer_formatter.py: Specialized formatter to ensure answers match expected formatsfinal_integration.py: Main script that integrates everything and provides a Gradio interface
Setup and Usage
1. Install Dependencies
pip install -r requirements.txt2. Set API Keys
You'll need to set up the following API keys:
- OpenAI API Key: Required for the language model and image analysis
- SerpAPI Key: Optional but recommended for web search capability
- Anthropic API Key: Optional if you want to use Claude models
These can be set as environment variables, added to a .env file (see .env-example), or added directly in the Gradio interface.
3. Run the Application
python final_integration.pyThis will launch a Gradio interface where you can:
- Configure your agent
- Test on individual questions
- Run batch tests
- Submit your full results to the GAIA benchmark
Enhancement Strategies
This agent uses several strategies to achieve good performance:
- Structured Tool Usage: Makes efficient use of web search, image analysis, and calculation tools
- Careful Answer Formatting: Ensures answers match the expected format exactly
- Robust Error Handling: Implements retries and failure recovery
- Effective Prompting: Uses detailed prompts with specific instructions
Testing and Debugging
Before submitting your full results, it's recommended to:
- Test individual questions to ensure the agent is working correctly
- Run batch tests on a small subset of questions
- Review the answers for formatting issues
Submission Process
- Fill in your Hugging Face username
- Add your agent code URL (URL to this repository)
- Set your API keys
- Click "Process All Questions and Submit"
Further Improvements
To potentially improve your score further:
- Fine-tune prompt engineering for specific question types
- Implement more specialized tools for particular tasks
- Add more sophisticated answer formatting for complex response types
- Experiment with different LLM models and parameters
Troubleshooting
Common issues:
- API key errors: Ensure all required keys are set correctly
- Answer formatting: Review the GAIA requirements for exact matching
- Tool failures: Check logs for specific error messages
If you encounter issues, check the error message in the output panel or review the logs.
