"use client"; import { useEffect, useState } from "react"; import Link from "next/link"; import { ResultSummary } from "@/types"; function formatDuration(seconds: number): string { const mins = Math.floor(seconds / 60); const secs = Math.floor(seconds % 60); return `${mins}:${secs.toString().padStart(2, "0")}`; } function formatDate(isoString: string): string { const date = new Date(isoString); return date.toLocaleDateString("en-US", { year: "numeric", month: "short", day: "numeric", hour: "2-digit", minute: "2-digit", }); } const PROVIDER_COLORS: Record = { deepgram: "bg-blue-500/20 text-blue-300", "deepgram-flux": "bg-green-500/20 text-green-300", speechmatics: "bg-purple-500/20 text-purple-300", }; export default function Home() { const [results, setResults] = useState([]); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); useEffect(() => { async function fetchResults() { try { const response = await fetch("/api/results"); if (!response.ok) { throw new Error("Failed to fetch results"); } const data = await response.json(); setResults(data); } catch (err) { setError(err instanceof Error ? err.message : "Unknown error"); } finally { setLoading(false); } } fetchResults(); }, []); return (

STT Event Visualizer

Visualize captured WebSocket events from STT providers

{loading && (
)} {error && (
{error}
)} {!loading && !error && results.length === 0 && (

No results found

Run the event capture script to generate results:

python -m evals.stt.event_capture audio/multi_speaker.m4a --provider deepgram
)} {!loading && !error && results.length > 0 && (
{results.map((result) => (
{result.audio_file} {result.provider}
{formatDate(result.created_at)}
{formatDuration(result.duration)}
{result.event_count} events
{result.keyterms && result.keyterms.length > 0 && (
{result.keyterms.map((term, index) => ( {term} ))}
)}
))}
)}
); }