Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Heroku Engineering 11 min read How-to mediumAdept

Working with ChatGPT Functions on Heroku

Menu Maker is a Node.js reference app with a React front end and Express back end that turns a user's ingredient list into a fine-dining dish description, ingredient list and recipe using OpenAI's Chat Completions API. Function calling with a JSON-schema `updateDish` definition makes the model return structured arguments, so the front end can parse the response and pass it straight into React state instead of handling free-form prose. The walkthrough covers the prompt and function settings, the POST endpoint, testing with curl, and deploying to Heroku from GitHub with config vars. Development API costs were under $1, and an Eco dyno is enough for hosting.

Related posts

  • Building with the OpenAI Apps SDK: A Field Guide

    Render mediumAdept

    OpenAI's Apps SDK extends the Model Context Protocol with a widget layer: tools that return structuredContent with `_meta.openai/outputTemplate` metadata get rendered as inline React components in ChatGPT. Lessons from building a movie recommendation app (Express, TypeScript, Postgres, Valkey, Vite-bundled widgets) include keeping MCP tools portable across clients, iterating via an ngrok tunnel, and building a local widget harness with fixtures and a stubbed `window.openai.callTool()`. Opaque `424 Unhandled errors in TaskGroup` failures almost always come from response-shape mismatches, so log payloads and keep reference fixtures. The full chat loop has no built-in telemetry, so add timing instrumentation yourself.

  • Building a GPT Backed by a Heroku-Deployed API

    Heroku Engineering mediumAdept

    A custom OpenAI GPT can be backed by a simple Express API on Heroku that answers natural-language questions about an employee directory. The API makes two Chat Completions calls: one turns the user's question into a PostgreSQL query using the table schema in a system prompt and JSON response format, and a second turns the returned rows into a readable answer, resending the schema because the models keep no memory between requests. The walkthrough covers bearer-token auth, environment configuration, local curl testing, Heroku deployment with Postgres, and configuring the GPT action. It also warns that all data leaves Heroku's trust boundary to reach OpenAI.

  • Making a web app generator with open ML models

    Hugging Face mediumAdept

    A Node.js/Express server can generate web apps from a text prompt by streaming tokens from a code LLM (WizardCoder-15B on Hugging Face Inference Endpoints) straight into the browser as HTML. Prompt tuning does most of the work: terse imperative instructions, pre-seeding the output with `<html><body class=...>`, and requiring TailwindCSS so styles arrive inline without a stylesheet that stalls rendering. Image URLs come from a Stable Diffusion `/image` endpoint that the model is told to call. Alpine.js provides a minimal UI, and DaisyUI's shorthand classes cut token usage compared with verbose Tailwind utility classes.

  • Building a VSCode Chat Extension to Order Lunch

    Neon mediumAdept

    A VS Code Copilot chat participant can order Grubhub food by exposing reverse-engineered Grubhub endpoints as language model tools. Intercepting a real checkout with Chrome DevTools and Postman Interceptor showed that an order takes five calls: create cart, add line, set delivery info, attach payment, and checkout. Each endpoint becomes a JSON-schema tool declared in package.json and implemented with vscode.LanguageModelTool. The main lesson is that raw APIs make poor agent interfaces because they expose sessions and IDs that need extra calls, so they should be wrapped in simplified workflows.

  • ReadMeAI: An AI-powered README Generator for Developers

    Docker mediumAdept

    ReadMeAI, an honorable mention from Docker's AI/ML Hackathon, generates a draft README from an uploaded code file and a short project description. It is a Node.js/Express app: the code and a prompt template go to Google's PaLM API, the Markdown that comes back is converted to HTML with showdown and rendered into an EJS editor view with live preview, and the result downloads as a zip of Markdown and HTML. The walkthrough covers the controller code, the project layout, and building and running the app with Docker.

The quest for software engineering knowledge.

Look:
Layout: