CoolFace
Apppublic

dlaima/First_agent_template

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
README.md98 linesDownload Raw Back to root
1---2title: Greet & Time3emoji: ⚡4colorFrom: pink5colorTo: yellow6sdk: gradio7sdk_version: 5.23.18app_file: app.py9pinned: false10tags:11- smolagents12- agent13- smolagent14- tool15- agent-course16short_description: Personalized Greeting  &  Timezone Clock17---18 19 20## First Agent Template : Greet & Time21 22This application allows users to create personalized greeting messages and check the current local time in any global timezone.23 24An Agent from scratch using Python code has been created. Besides, to develop this Agent, smolagents has been used. In short, smolagents 25is a library that focuses on codeAgent, a kind of agent that performs “Actions” through code blocks, and then “Observes” results by executing 26the 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 27performing actions such as time creating personalized greeting messages and zone checki h using Python code, 28 29 30> 🧑‍🏫 This app is part of the **Hugging Face Courses** series and was developed as an educational project to showcase how machine learning31> can be used in real-world event scenarios.32> Learn more at [Hugging Face Courses](https://huggingface.co/learn).33---34 35 36 37### Repository Structure (🗂 Folder Structure)38 39```40gradio_greet_time_app/41│42├── app.py                       # Main launcher script that initializes and runs the Gradio app.43├── agent.json                   # JSON config for defining tools used by the agent.44├── Gradio_UI.py                 # Contains the Gradio Blocks interface layout and connects UI to the tools.45├── screenshot.jpeg              # Sample preview for the use of the app (used in README)46├── prompt_config.yaml           # Prompt configurations for examples47├── .env.template                # Environment variables template /Template file showing expected environment variables (e.g., API keys).48├── requirements.txt             # Python dependencies / List of Python dependencies to install 49└── README.md                    # Project overview, setup instructions, usage examples, and screenshot link.50```51 52 53### Features54 55_The Tools_56- 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  57 cheerful message like "Hello, HuggingFace!" multiple times.58- Timezone Clock: Input a valid timezone (e.g., Europe/London, America/New_York), and the app will show the current local time  59 for that region.60 61_The Agent_  62It uses gpt-4o as the LLM engine. This is a very capable model that we’ll access via the serverless API.63 64_The System Prompt_  65The agent’s system prompt is stored in a separate prompts.yaml file. This file contains predefined instructions that guide the agent’s 66behavior. Storing prompts in a YAML file allows for easy customization and reuse across different agents or use cases.67 68---69 70 71### Preview 72 73Examples of prompts for the use of the app can be found on [First Agent Template](Screenshot_15-5-2025_154725_huggingface.co.jpeg)74 75 76---77## 🤝 Contributing78 79We welcome contributions to improve GalaGuide!80 811. Fork the repository  822. Create a new branch:83   ```bash84   git checkout -b feature-xyz85 86 87 88 89 90 91 92 93 94 95 96 97 98Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference