Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available:
6.5.1
metadata
title: First Agent with smolagents
emoji: 🤖
colorFrom: blue
colorTo: indigo
sdk: gradio
sdk_version: 4.44.1
app_file: app.py
pinned: false
license: apache-2.0
tags:
- agents
- smolagents
- web-search
- weather
- huggingface-course
datasets:
- none
language:
- en
library_name: smolagents
pipeline_tag: conversational
My First Agent with smolagents
This project is part of the Hugging Face Agents Course. It demonstrates how to create a simple but powerful agent using the smolagents library version 1.9.2.
Features
This agent can:
- Search the web using DuckDuckGo
- Get weather information for locations (using OpenWeatherMap API)
- Provide natural conversational responses
Requirements
- Python 3.10 or higher
- smolagents==1.9.2
- gradio==4.44.1
- Other dependencies listed in requirements.txt
Environment Variables
The following environment variables need to be set:
HUGGINGFACE_TOKEN: Your Hugging Face API tokenOPENWEATHERMAP_API_KEY: Your OpenWeatherMap API key
How to Use
- Clone the repository
- Install the dependencies:
pip install -r requirements.txt - Set up your environment variables:
export HUGGINGFACE_TOKEN=your_token_here export OPENWEATHERMAP_API_KEY=your_key_here - Run the application:
python app.py
Example Queries
- "What's the weather like in Tokyo?"
- "Tell me the temperature in New York"
- "Search for the latest news about AI"
Weather Tool Limitations
The weather tool has some limitations:
- Cannot disambiguate between cities with the same name
- Only accepts letters, digits, spaces, and hyphens in city names
- Does not support additional location information (state, country, etc.)
- Returns temperatures in Fahrenheit and wind speeds in mph
Technical Details
This agent uses:
- smolagents 1.9.2 for the agent framework
- Qwen/Qwen2.5-Coder-32B-Instruct as the language model
- Gradio 4.44.1 for the user interface
- OpenWeatherMap API for weather data
- DuckDuckGo for web searches
Credits
Created as part of the Hugging Face Agents Course.