This site is not affiliated with or endorsed by Vercel, Inc. Read the docs, then deploy or run each experiment yourself.
AI

Tool-Calling Weather Demo

Chat with mock weather, time, and calculator tools plus a visible tool-call trace via the AI SDK.

Run this experiment yourself

Demos are not embedded on this site. Deploy a standalone copy on Vercel or run the experiment app locally.

Local development

cd apps/experiments/tool-calling-weather-demo
pnpm install
pnpm dev

Then open http://localhost:3010.

This is an experimental demo. Use it as a starting point for your own projects.

Chat that calls mock weather, time, and calculator tools and surfaces a structured tool-call trace. Missing AI keys return 503.

Features

  • Standalone Next.js app under apps/experiments/tool-calling-weather-demo/.
  • Honest degradation when optional services are missing.
  • Unit-tested helpers in logic.ts.

Server Reference

POST /api/chat

{ "prompt": "..." }

Implementation Details

Run the demo

Use the embedded playground or pnpm dev in the experiment app.

Inspect the handlers

Copy Route Handlers from apps/experiments/tool-calling-weather-demo/ into your project.

Limitations

  • Educational demo — not a production-hardened product.
  • Inputs are length-capped.

Use in your project

Copy the experiment folder or individual Route Handlers.

Deployment

Deploy on Vercel

Local Development

cd apps/experiments/tool-calling-weather-demo
pnpm install
pnpm dev

Configuration

VariableRequiredPurpose
AI_GATEWAY_API_KEYYesLab configuration

Vercel / Next.js Features Used

  • AI SDK, AI Gateway, Zod

Next Steps

On this page