Sample Agent

A chat-style AI agent built with the OpenAI Agents SDK and a React frontend.

Tools

The agent has 3 custom tools:

ToolDescription
🕐 get_current_timeGet the current time in any IANA timezone
🧮 calculatorEvaluate math expressions
🎲 random_numberGenerate random integers in a range

Architecture

Rendering mermaid diagram...

Setup

  1. Set the OPENAI_API_KEY environment variable. Get your key at https://platform.openai.com/api-keys
  2. Open the live URL and start chatting!

Files

  • main.ts — Hono HTTP server (entrypoint)
  • agent.ts — Agent definition with tools
  • frontend/index.html — HTML shell
  • frontend/app.tsx — React chat UI