File size: 1,862 Bytes
61ef662
e08ae01
 
 
 
61ef662
e08ae01
61ef662
e08ae01
61ef662
 
e08ae01
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
title: Tool-Using Agent
emoji: 🛠️
colorFrom: indigo
colorTo: purple
sdk: docker
app_port: 7860
pinned: false
short_description: An AI agent that calls live tools (ReAct) · 30-in-15 #9
---

# Tool-Using Agent 🛠️

Ask a question and watch the AI **call real, live tools** to answer it — a calculator, the current
date/time, live **weather**, and **Wikipedia** — running the **ReAct** loop (decide → call a tool →
read the result → repeat) and showing every tool call it made.

> Project **#9** of my *"30 AI Projects in 15 Days"* build-in-public challenge.

**▶ Live demo: https://agent.gritai.solutions**

![demo](demo.png)

## Try
- *"What's a 15% tip on $47.80, and what's the weather in Paris?"* → calculator + weather
- *"Who invented the World Wide Web, and how many days ago was Jan 1 2000?"* → Wikipedia + date + calc

## How it works
- The model is given four **keyless** tools (Open-Meteo for weather, MediaWiki for Wikipedia, plus a
  safe calculator and a clock). It decides which to call — possibly several — and the server executes
  them and feeds results back, looping until the model can answer (capped at a few steps).
- **Transparency:** the UI shows the exact tool calls and their live results, so you can see the
  reasoning, not just the answer.
- The calculator is a **safe AST evaluator** (no `eval`), limited to arithmetic + a few math functions.

## Run locally
```bash
pip install -r requirements.txt
export ANTHROPIC_API_KEY=sk-ant-...
python app.py                            # http://127.0.0.1:7860
```

## Deploy (always-on)
Ships with a `Dockerfile` — works on **Hugging Face Spaces**, Render, Railway, or Fly.io.
Set `ANTHROPIC_API_KEY` as a secret. The tools need no other keys.

---
Built by **Robert Lucyk** · [GritAI Solutions](https://gritai.solutions) · part of the 30-in-15 challenge.