Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
A chat-style AI agent built with the OpenAI Agents SDK and a React frontend.
The agent has 3 custom tools:
| Tool | Description |
|---|---|
| 🕐 get_current_time | Get the current time in any IANA timezone |
| 🧮 calculator | Evaluate math expressions |
| 🎲 random_number | Generate random integers in a range |
Rendering mermaid diagram...
- Set the
OPENAI_API_KEYenvironment variable. Get your key at https://platform.openai.com/api-keys - Open the live URL and start chatting!
main.ts— Hono HTTP server (entrypoint)agent.ts— Agent definition with toolsfrontend/index.html— HTML shellfrontend/app.tsx— React chat UI