94Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
95
96### OpenAI
97
98```ts
99import { OpenAI } from "https://esm.town/v/std/openai";
100const openai = new OpenAI();
101const completion = await openai.chat.completions.create({
102 messages: [
103 { role: "user", content: "Say hello in a creative way" },
1import OpenAI from "npm:openai";
2
3interface PersonEnrichmentRequest {
85Format your response as a structured report. If you cannot find information for any section, please indicate "No information found" for that section.`;
86
87 // Initialize OpenAI client
88 const client = new OpenAI({
89 apiKey: Deno.env.get("OPENAI_API_KEY"),
90 });
91
104
105 if (!content) {
106 throw new Error("No content returned from OpenAI");
107 }
108
100Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
101
102### OpenAI
103```ts
104import { OpenAI } from "https://esm.town/v/std/openai";
105const openai = new OpenAI();
106const completion = await openai.chat.completions.create({
107 messages: [
108 { role: "user", content: "Say hello in a creative way" },
100Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
101
102### OpenAI
103```ts
104import { OpenAI } from "https://esm.town/v/std/openai";
105const openai = new OpenAI();
106const completion = await openai.chat.completions.create({
107 messages: [
108 { role: "user", content: "Say hello in a creative way" },
100Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
101
102### OpenAI
103```ts
104import { OpenAI } from "https://esm.town/v/std/openai";
105const openai = new OpenAI();
106const completion = await openai.chat.completions.create({
107 messages: [
108 { role: "user", content: "Say hello in a creative way" },
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { blob } from "https://esm.town/v/std/blob";
3import { OpenAI } from "https://esm.town/v/std/openai";
4import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
5import {
15
16const app = new Hono();
17const openai = new OpenAI();
18
19// Get all voice notes (for admin/dashboard)
143async function transcribeAudio(voiceNoteId: string, audioBuffer: ArrayBuffer) {
144 try {
145 // Convert ArrayBuffer to File for OpenAI
146 const audioFile = new File([audioBuffer], "audio.webm", { type: "audio/webm" });
147
148 const transcription = await openai.audio.transcriptions.create({
149 file: audioFile,
150 model: "whisper-1",
6
7- 🎙️ Record voice notes directly in the browser
8- 🤖 AI-powered transcription using OpenAI Whisper
9- 🔗 Share voice notes via unique URLs
10- ⏰ Set expiration by max listens or date
53- **Database**: SQLite for voice note metadata
54- **Storage**: Val Town Blob storage for audio files
55- **AI**: OpenAI Whisper for transcription
56- **Frontend**: React with TypeScript
57- **Styling**: TailwindCSS
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { blob } from "https://esm.town/v/std/blob";
3import { OpenAI } from "https://esm.town/v/std/openai";
4import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
5import {
15
16const app = new Hono();
17const openai = new OpenAI();
18
19// Get all voice notes (for admin/dashboard)
143async function transcribeAudio(voiceNoteId: string, audioBuffer: ArrayBuffer) {
144 try {
145 // Convert ArrayBuffer to File for OpenAI
146 const audioFile = new File([audioBuffer], "audio.webm", { type: "audio/webm" });
147
148 const transcription = await openai.audio.transcriptions.create({
149 file: audioFile,
150 model: "whisper-1",
6
7- 🎙️ Record voice notes directly in the browser
8- 🤖 AI-powered transcription using OpenAI Whisper
9- 🔗 Share voice notes via unique URLs
10- ⏰ Set expiration by max listens or date
53- **Database**: SQLite for voice note metadata
54- **Storage**: Val Town Blob storage for audio files
55- **AI**: OpenAI Whisper for transcription
56- **Frontend**: React with TypeScript
57- **Styling**: TailwindCSS
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { blob } from "https://esm.town/v/std/blob";
3import { OpenAI } from "https://esm.town/v/std/openai";
4import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
5import {
15
16const app = new Hono();
17const openai = new OpenAI();
18
19// Get all voice notes (for admin/dashboard)
143async function transcribeAudio(voiceNoteId: string, audioBuffer: ArrayBuffer) {
144 try {
145 // Convert ArrayBuffer to File for OpenAI
146 const audioFile = new File([audioBuffer], "audio.webm", { type: "audio/webm" });
147
148 const transcription = await openai.audio.transcriptions.create({
149 file: audioFile,
150 model: "whisper-1",