Course ES
← back to chapter

Meeting notes

Paste an audio URL of a meeting or voice note and get a one-line summary plus

Showcase — Meeting notes

Paste an audio URL of a meeting or voice note and get a one-line summary plus action items. It's the shape of most real audio features: speech to text, then a text model does the thinking. OpenAI does it in two steps (transcribe, then summarize); Gemini understands audio natively and does it in one call — both land in the same place.

Run

bash bootstrap-secrets.sh              # reads ../../../../.env, writes secrets/
docker compose up --build              # default: PROVIDER=openai

Open http://localhost:3000. Gemini: PROVIDER=gemini docker compose up --build.

What's where

  • backend/ai_openai.py — transcribe, then summarize with a chat model.
  • backend/ai_gemini.py — one multimodal call: audio in, summary out.
  • frontend/app/page.tsx — URL box + summary and transcript.

Stop

docker compose down

Run locally

Download the project as a ZIP and run it with Docker. Brings up a FastAPI backend + Next.js frontend on localhost:3000.

Download meeting-notes.zip

unzip meeting-notes.zip
cd meeting-notes
bash bootstrap-secrets.sh   # one-time: pulls API keys into ./secrets
docker compose up --build   # default provider: openai
# or:  PROVIDER=gemini docker compose up --build

Type some input, pick a provider, and run the same code shown in Source against the live API. Sign-in required.


  

The same modules the Run button hits. The whole project (frontend, Dockerfile, compose) is in the ZIP under README.

backend/ai_openai.py

"""Showcase 3 (OpenAI): audio to meeting notes.

Two steps chained: transcribe the audio, then summarize the transcript into a
one-line recap plus action items. This is the shape of most real audio features
— speech to text, then an ordinary text model does the thinking on the words.
"""
import urllib.request

from openai import OpenAI

_client = OpenAI()

_STT_MODEL = "gpt-4o-mini-transcribe"
_CHAT_MODEL = "gpt-5.4-nano"


def run(audio_url: str) -> str:
    url = audio_url.strip()
    if not url.startswith("http"):
        return "Paste a public audio URL (http/https) of a meeting or voice note."
    data = urllib.request.urlopen(urllib.request.Request(url, headers={"User-Agent": "Mozilla/5.0"})).read()
    name = url.split("/")[-1].split("?")[0] or "audio.mp3"
    transcript = _client.audio.transcriptions.create(model=_STT_MODEL, file=(name, data)).text

    summary = _client.responses.create(
        model=_CHAT_MODEL,
        instructions=(
            "Summarize this meeting transcript: first one sentence of overall "
            "summary, then a bulleted list of action items with an owner in "
            "parentheses if one is named. Be concise."
        ),
        input=[{"role": "user", "content": transcript}],
    )
    return f"{summary.output_text}\n\n---\nTranscript:\n{transcript}"

backend/ai_gemini.py

"""Showcase 3 (Gemini): audio to meeting notes.

Gemini understands audio natively, so this is ONE call: hand it the audio and
ask for the summary directly. (OpenAI does it in two steps — transcribe, then
summarize — which is the more common pattern; both land in the same place.)
"""
import os
import urllib.request

from google import genai
from google.genai import types

_client = genai.Client(api_key=os.environ["GEMINI_API_KEY"])

_MODEL = "gemini-3.1-flash-lite"

_MIME = {"mp3": "audio/mpeg", "wav": "audio/wav", "m4a": "audio/mp4", "ogg": "audio/ogg", "flac": "audio/flac"}


def _mime(url: str) -> str:
    ext = url.lower().split("?")[0].rsplit(".", 1)[-1]
    return _MIME.get(ext, "audio/mpeg")


def run(audio_url: str) -> str:
    url = audio_url.strip()
    if not url.startswith("http"):
        return "Paste a public audio URL (http/https) of a meeting or voice note."
    data = urllib.request.urlopen(urllib.request.Request(url, headers={"User-Agent": "Mozilla/5.0"})).read()
    response = _client.models.generate_content(
        model=_MODEL,
        contents=[
            types.Part.from_bytes(data=data, mime_type=_mime(url)),
            "Summarize this meeting audio: first one sentence of overall summary, "
            "then a bulleted list of action items with an owner in parentheses if "
            "one is named. Be concise.",
        ],
    )
    return response.text or ""

Project files

  • .gitignore
  • README.es.md
  • README.md
  • backend/Dockerfile
  • backend/ai_gemini.py
  • backend/ai_openai.py
  • backend/main.py
  • backend/requirements.txt
  • bootstrap-secrets.sh
  • docker-compose.yml
  • frontend/Dockerfile
  • frontend/app/layout.tsx
  • frontend/app/page.tsx
  • frontend/next.config.ts
  • frontend/package.json
  • frontend/tsconfig.json