1215 <a href="?q=function" className="example-link">function</a>
1216 <a href="?q=discord" className="example-link">discord</a>
1217 <a href="?q=openai" className="example-link">openai</a>
1218 <a href="?q=react" className="example-link">react</a>
1219 </div>
1360 <a href="?q=function" className="example-link">function</a>
1361 <a href="?q=discord" className="example-link">discord</a>
1362 <a href="?q=openai" className="example-link">openai</a>
1363 <a href="?q=react" className="example-link">react</a>
1364 </div>
1215 <a href="?q=function" className="example-link">function</a>
1216 <a href="?q=discord" className="example-link">discord</a>
1217 <a href="?q=openai" className="example-link">openai</a>
1218 <a href="?q=react" className="example-link">react</a>
1219 </div>
1360 <a href="?q=function" className="example-link">function</a>
1361 <a href="?q=discord" className="example-link">discord</a>
1362 <a href="?q=openai" className="example-link">openai</a>
1363 <a href="?q=react" className="example-link">react</a>
1364 </div>
1215 <a href="?q=function" className="example-link">function</a>
1216 <a href="?q=discord" className="example-link">discord</a>
1217 <a href="?q=openai" className="example-link">openai</a>
1218 <a href="?q=react" className="example-link">react</a>
1219 </div>
1360 <a href="?q=function" className="example-link">function</a>
1361 <a href="?q=discord" className="example-link">discord</a>
1362 <a href="?q=openai" className="example-link">openai</a>
1363 <a href="?q=react" className="example-link">react</a>
1364 </div>
54Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
55
56### OpenAI
57
58```ts
59import { OpenAI } from "https://esm.town/v/std/openai";
60const openai = new OpenAI();
61const completion = await openai.chat.completions.create({
62 messages: [
63 { role: "user", content: "Say hello in a creative way" },
49Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
50
51### OpenAI
52
53```ts
54import { OpenAI } from "https://esm.town/v/std/openai";
55const openai = new OpenAI();
56const completion = await openai.chat.completions.create({
57 messages: [
58 { role: "user", content: "Say hello in a creative way" },
1- [ ] Get OpenTownie or Gemini or Claude or OpenAI to synthesize the core of these patterns into a prompt we can use to make more ReactRouter apps, such as...
2- [ ] Convert this or into the basic react router guest book (and preserve this forum app in another project?)
3- [ ] To what extent can these patterns be packaged up into a Val Town Router project? Would be neat to get the version pinning thing all centralized, can this as-a-library be that centralized place?
28## Other todos
29
30- [ ] Get OpenTownie or Gemini or Claude or OpenAI to synthesize the core of these patterns into a prompt we can use to make more ReactRouter apps, such as...
31- [ ] Convert this or into the basic react router guest book (and preserve this forum app in another project?)
32- [ ] To what extent can these patterns be packaged up into a Val Town Router project? Would be neat to get the version pinning thing all centralized, can this as-a-library be that centralized place?
1import OpenAI from "npm:openai";
2import { getDistance } from "https://esm.sh/geolib@3.3.4";
3const API_ROOT =
4 "https://esm.town/v/wolf/fixItWand/backend/workorders/locations";
5
6const openai = new OpenAI();
7
8export interface Site {
176
177 // Use GPT-4o-mini to find the best match
178 const chatResponse = await openai.chat.completions.create({
179 model: "gpt-4o-mini",
180 messages: [
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 OpenAI from "npm:openai";
2import { search } from "./locations/mod.ts";
3
4const openai = new OpenAI();
5
6/**
31 const audioFile = new File([audioBlob], "a.mp3", { type: "audio/mp3" });
32
33 const transcription = await openai.audio.transcriptions.create({
34 file: audioFile,
35 model: "whisper-1",
38
39 // Detect possible location references in the transcription
40 const locationDetectionResponse = await openai.chat.completions.create({
41 model: "gpt-4o-mini",
42 messages: [
72 }
73
74 const chatResponse = await openai.chat.completions.create({
75 model: "gpt-4o",
76 messages: [
127`;
128
129 const subjectResponse = await openai.chat.completions.create({
130 model: "gpt-4o-mini",
131 messages: [