Hemimoon's picture
Update README.md
1fb171c verified

A newer version of the Gradio SDK is available: 6.9.0

Upgrade
metadata
title: Agents Course Final Assignment
emoji: πŸ•΅πŸ»β€β™‚οΈ
colorFrom: indigo
colorTo: indigo
sdk: gradio
sdk_version: 5.34.0
app_file: app.py
pinned: true
hf_oauth: true
hf_oauth_expiration_minutes: 480
license: mit
short_description: Developed for the Agents Course final project.

πŸ•΅πŸ»β€β™‚οΈ Agents Course Final Assignment

certification

⚠️ Important Notice:
After this project is made public, the OPENAI_API_KEY in Hugging Face Space settings has been set to an invalid value
to protect API key security. To run this project, please use your own OpenAI API key.

This is a multi-agent system developed for the Hugging Face Agents Course Unit 4 final project. The system is designed to evaluate AI agent performance through the GAIA benchmark.

Due to the fact that this agent system does not provide file processing capabilities, multimodal reasoning, and other advanced features, some questions like the following cannot be answered by this agent system:

The attached Excel file contains the sales of menu items for a local fast-food chain. What were the total sales that the chain made from food (not including drinks)? Express your answer in USD with two decimal places.

Review the chess position provided in the image. It is black's turn. Provide the correct next move for black which guarantees a win. Please provide your response in algebraic notation.

In the video https://www.youtube.com/watch?v=L1vXCYZAYYM, what is the highest number of bird species to be on camera simultaneously?

Even so, this agent system is able to pass the GAIA benchmark with a score of 50% by correctly answering 10 out of 20 questions.

Submission Successful!
User: Hemimoon
Overall Score: 50.0% (10/20 correct)
Message: Score calculated successfully: 10/20 total questions answered correctly (20 valid tasks attempted). High score updated on leaderboard.

πŸ—οΈ Architecture Design

This project adopts a multi-agent architecture with two specialized sub-agents:

1. Web Search Agent

  • Functions: Web search, webpage access, Wikipedia queries
  • Tools:
    • WebSearchTool(): Web search
    • VisitWebpageTool(): Access specific webpages
    • WikipediaSearchTool(): Wikipedia search
  • Authorized Imports: requests, beautifulsoup4

2. Calculation Agent

  • Functions: Mathematical calculations, data analysis, statistical computing
  • Authorized Imports: pandas, numpy, math, statistics, scipy
  • Features: Specialized in numerical computation and data processing tasks

3. Main Agent

  • Role: Coordinate and manage sub-agents
  • Functions: Task distribution, result integration, decision making
  • Features: Uses managed_agents mode to uniformly manage sub-agents

πŸ“ Project Structure

β”œβ”€β”€ agent.py          # Main agent definition and configuration
β”œβ”€β”€ prompt.py         # Agent prompt templates and system instructions
β”œβ”€β”€ app.py            # Gradio interface and GAIA evaluation logic
β”œβ”€β”€ test_agent.py     # Agent functionality test scripts
β”œβ”€β”€ requirements.txt  # Python dependencies
β”œβ”€β”€ pyproject.toml    # Project configuration file
└── README.md         # Project documentation

πŸ”§ Tech Stack

  • AI Framework: smolagents - Hugging Face's agent framework
  • LLM: OpenAI GPT-4.1 (via OpenAI API)
  • Frontend Interface: Gradio 5.34.0
  • Data Processing: pandas, numpy, scipy
  • Web Requests: requests, beautifulsoup4
  • Environment Management: python-dotenv

πŸš€ Quick Start

Environment Setup

  1. Clone the project
git clone https://huggingface.co/spaces/Hemimoon/Agents-Course-Final-Assignment
cd Agents-Course-Final-Assignment
  1. Install dependencies
pip install -r requirements.txt
  1. Configure API Key Create a .env file and add your OpenAI API key:
OPENAI_API_KEY=your_openai_api_key_here

πŸ”— Related Links


Created with ❀️ for the Hugging Face Agents Course Final Assignment