Skip to content

rex-sheridan/smolagents-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smolagents Demo Project

This project demonstrates the usage of Smolagents, a minimalist AI agent framework developed by Hugging Face.

Setup

  1. Create a virtual environment (recommended):
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Create a .env file in the project root and add your Hugging Face API token:
HUGGINGFACE_API_TOKEN=your_token_here

Project Structure

  • requirements.txt: Project dependencies
  • example.py: Basic example of using Smolagents
  • smol_agents.ipynb: Interactive Jupyter notebook with multiple examples
  • .env: Environment variables (create this file)

Usage

Running the Python Script

python3 example.py

Running the Jupyter Notebook

jupyter notebook

Then open smol_agents.ipynb in your browser.

The notebook contains three examples:

  1. Calculator Function: Creates a function for basic arithmetic operations
  2. List Operations: Demonstrates various list manipulations (duplicates, second largest, rotation)
  3. String Manipulation: Shows advanced string operations (word reversal, palindrome checking, title case)

Resources

About

Experiments with smolagents

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published