Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -16,3 +16,40 @@ tags:
|
|
| 16 |
---
|
| 17 |
|
| 18 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
---
|
| 17 |
|
| 18 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
| 19 |
+
|
| 20 |
+
# 🤖 First Agent Project with smolagents
|
| 21 |
+
|
| 22 |
+
An intelligent, code-backed AI agent capable of dynamic tool execution, reasoning, and multi-modal tasks (like text-to-image generation and timezone calculations). Built using the `smolagents` framework, powered by `Qwen2.5-Coder-32B-Instruct`, and deployed seamlessly on Hugging Face Spaces with a user-friendly Gradio interface.
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
## 🚀 What This Project Is About
|
| 26 |
+
|
| 27 |
+
This project demonstrates the implementation of a full **CodeAgent** using the `smolagents` library. Unlike traditional rigid chatbots, this agent operates on a **Thought-Action-Observation** cycle. When given a complex prompt, it writes execution blocks in Python, leverages specialized tools, evaluates the live feedback, and formulates an accurate final response.
|
| 28 |
+
|
| 29 |
+
### Core Features
|
| 30 |
+
* **Dynamic Code Execution:** Solves problems by interpreting and running Python blocks on the fly.
|
| 31 |
+
* **Custom Tool Integration:** Extensible structure to add your own Python functions as agent tools.
|
| 32 |
+
* **Text-to-Image Generation:** Connects directly to Hugging Face Hub inference models to visualize user prompts.
|
| 33 |
+
* **Gradio Web UI:** A clean, shareable interface for interactive chatting and multi-modal outputs.
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
## 🛠️ Tech Stack
|
| 38 |
+
|
| 39 |
+
* **Framework:** [smolagents](https://github.com/huggingface/smolagents) (Hugging Face)
|
| 40 |
+
* **LLM Engine:** `Qwen/Qwen2.5-Coder-32B-Instruct` (via Hugging Face Serverless Inference API)
|
| 41 |
+
* **UI Framework:** [Gradio](https://gradio.app/)
|
| 42 |
+
* **Language:** Python 3.10+
|
| 43 |
+
* **Libraries:** `pytz`, `pyyaml`, `requests`
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
## 📁 Project Structure
|
| 48 |
+
|
| 49 |
+
```text
|
| 50 |
+
├── app.py # Main entry point: initializes the model, tools, and Gradio UI
|
| 51 |
+
├── prompts.yaml # System prompts and instruction templates for the agent
|
| 52 |
+
├── requirements.txt # Python dependencies
|
| 53 |
+
├── Gradio_UI.py # Helper script setting up the Gradio layout
|
| 54 |
+
└── tools/
|
| 55 |
+
└── final_answer.py # Core tool defining how the agent concludes its reasoning
|