• Blog
  • Docs
  • Pricing
  • Weโ€™re hiring!
Log inSign up
bnelevitt

bnelevitt

untitled-2503

Public
Like
untitled-2503
Home
Code
4
frontend
2
README.md
agent.ts
H
main.ts
Environment variables
Branches
1
Pull requests
Remixes
History
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.
Sign up now
Code
/
Code
/
Search
README.md

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
Code
frontendREADME.mdagent.ts
H
main.ts
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
AboutAlternativesPricingBlogNewsletterCareers
Weโ€™re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
ยฉ 2026 Val Town, Inc.