Spaces:
Runtime error
A newer version of the Gradio SDK is available:
6.2.0
title: Greet & Time
emoji: ⚡
colorFrom: pink
colorTo: yellow
sdk: gradio
sdk_version: 5.23.1
app_file: app.py
pinned: false
tags:
- smolagents
- agent
- smolagent
- tool
- agent-course
short_description: Personalized Greeting & Timezone Clock
First Agent Template : Greet & Time
This application allows users to create personalized greeting messages and check the current local time in any global timezone.
An Agent from scratch using Python code has been created. Besides, to develop this Agent, smolagents has been used. In short, smolagents is a library that focuses on codeAgent, a kind of agent that performs “Actions” through code blocks, and then “Observes” results by executing the code. The agent inside smolagents is going to think, act and observe in cycle until it reaches a final answer. This Agent is capable of performing actions such as time creating personalized greeting messages and zone checki h using Python code,
🧑🏫 This app is part of the Hugging Face Courses series and was developed as an educational project to showcase how machine learning can be used in real-world event scenarios. Learn more at Hugging Face Courses.
Repository Structure (🗂 Folder Structure)
gradio_greet_time_app/
│
├── app.py # Main launcher script that initializes and runs the Gradio app.
├── agent.json # JSON config for defining tools used by the agent.
├── Gradio_UI.py # Contains the Gradio Blocks interface layout and connects UI to the tools.
├── screenshot.jpeg # Sample preview for the use of the app (used in README)
├── prompt_config.yaml # Prompt configurations for examples
├── .env.template # Environment variables template /Template file showing expected environment variables (e.g., API keys).
├── requirements.txt # Python dependencies / List of Python dependencies to install
└── README.md # Project overview, setup instructions, usage examples, and screenshot link.
Features
The Tools
- Greeting Generator: Enter a name or phrase and choose how many times you'd like the greeting to be repeated. The app will generate a
cheerful message like "Hello, HuggingFace!" multiple times. - Timezone Clock: Input a valid timezone (e.g., Europe/London, America/New_York), and the app will show the current local time
for that region.
The Agent
It uses gpt-4o as the LLM engine. This is a very capable model that we’ll access via the serverless API.
The System Prompt
The agent’s system prompt is stored in a separate prompts.yaml file. This file contains predefined instructions that guide the agent’s
behavior. Storing prompts in a YAML file allows for easy customization and reuse across different agents or use cases.
Preview
Examples of prompts for the use of the app can be found on First Agent Template
🤝 Contributing
We welcome contributions to improve GalaGuide!
- Fork the repository
- Create a new branch:
git checkout -b feature-xyz
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference