CoolFace
Apppublic

aravpatel/First_Agent

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
App README

Overview This Space is a Gradio app powered by Hugging Face smolagents. It exposes a code-executing agent (CodeAgent) with a small, explicit toolset and a chat UI. The agent plans in Thought → Code → Observation steps and must finish using the final_answer tool.

What’s included

  • Gradio chat UI with step streaming and tool call visualization (Gradio_UI.py)
  • CodeAgent wired with prompt templates (prompts.yaml)
  • Tools:
  • final_answer: required to return the final result
  • imagegenerationtool: text-to-image tool loaded from the Hub
  • getcurrenttimeintimezone: returns current time in a given timezone (sentence/iso/json)
  • cryptomarketupdate: real‑time crypto prices and 24h change (Binance with Coinbase fallback)

Quickstart (local) 1) Install pip install -r requirements.txt 2) Run python app.py 3) Open the URL shown (local and share link) and chat with the agent

Example prompts

  • Generate an image of a cat drinking coffee
  • Use cryptomarketupdate(assets='BTC,ETH', vs_currency='USD')
  • What time is it in Asia/Dubai? Use getcurrenttimeintimezone(timezone='Asia/Dubai', return_format='iso')

Notes

  • The agent can only call registered tools. Do not import disallowed libraries in code blocks; use the tools instead.
  • The UI renders images inline and streams tool execution logs.
  • To deploy updates, push changes to this Space or upload files via the Space UI.

Reference

  • Spaces config reference: https://huggingface.co/docs/hub/spaces-config-reference