Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run//%22Wolf?q=openai&page=7&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=openai

Returns an array of strings in format "username" or "username/projectName"

Found 3230 results for "openai"(1123ms)

hello-realtimeindex.html1 match

@houfeng0923•Updated 5 days ago
4 <meta charset="utf-8" />
5 <meta name="viewport" content="width=device-width, initial-scale=1" />
6 <title>OpenAI Realtime API Voice Agent</title>
7 <style>
8 :root {

hello-realtimeagent.ts2 matches

@houfeng0923•Updated 5 days ago
6const NR_TYPE = "near_field";
7const INSTRUCTIONS = `
8 Greet the user in English, and thank them for trying the new OpenAI Realtime API.
9 Give them a brief summary based on the list below, and then ask if they have any questions.
10 Answer questions using the information below. For questions outside this scope,
23 - higher audio quality
24 - improved handling of alphanumerics (eg, properly understanding credit card and phone numbers)
25 - support for the OpenAI Prompts API
26 - support for MCP-based tools
27 - auto-truncation to reduce context size

carsmain.ts4 matches

@know•Updated 5 days ago
1// @ts-ignore
2import { OpenAI } from "https://esm.town/v/std/openai?v=4";
3
4// --- AI BEHAVIORAL GUIDELINES ---
465 if (req.method === "POST" && action === "getProblem") {
466 try {
467 const openai = new OpenAI();
468 const body = await req.json();
469 const level = typeof body.level === "number" ? body.level : 1;
483 ];
484
485 const completion = await openai.chat.completions.create({
486 model: "gpt-4o",
487 messages: messages,
492 const content = completion.choices[0].message.content;
493 if (!content) {
494 throw new Error("OpenAI returned an empty response.");
495 }
496

untitled-471main.ts5 matches

@know•Updated 5 days ago
2import { z } from "npm:zod@3.23.8";
3// @ts-ignore
4import { OpenAI } from "https://esm.town/v/std/openai?v=4";
5
6// --- Input and Output Schema Definitions ---
16});
17
18// Defines the expected JSON structure from the OpenAI API.
19// This allows us to validate the AI's output before using it.
20const AIResponseSchema = z.object({
44// --- Service Initialization ---
45const app = new Hono();
46const openai = new OpenAI();
47
48// --- API Endpoints ---
66
67 try {
68 // 2. Request structured data from the OpenAI API.
69 const completion = await openai.chat.completions.create({
70 model: "gpt-4o",
71 messages: [

eventsCalendarAGENTS.md4 matches

@roop•Updated 5 days ago
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" },

Therapymain.ts5 matches

@realtime•Updated 5 days ago
1// @ts-ignore
2import { OpenAI } from "https://esm.town/v/std/openai?v=4";
3// @ts-ignore
4import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
433
434const app = new Hono();
435const openai = new OpenAI();
436
437// Helper to get all boundaries from the database
490 }
491
492 const completion = await openai.chat.completions.create({
493 model: "gpt-4o",
494 messages: [
537
538 // 2a. Generate Counselor Response
539 const counselorCompletion = await openai.chat.completions.create({
540 model: "gpt-4o",
541 messages: [
548
549 // 2b. Check with Boundary Guardian
550 const guardCompletion = await openai.chat.completions.create({
551 model: "gpt-4o",
552 messages: [{

Towniesystem_prompt.txt4 matches

@chetanshi•Updated 5 days ago
88Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
89
90### OpenAI
91
92```ts
93import { OpenAI } from "https://esm.town/v/std/openai";
94const openai = new OpenAI();
95const completion = await openai.chat.completions.create({
96 messages: [
97 { role: "user", content: "Say hello in a creative way" },

Townie.cursorrules4 matches

@chetanshi•Updated 5 days ago
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" },

Towniesystem_prompt.txt4 matches

@pcstyle•Updated 5 days ago
88Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
89
90### OpenAI
91
92```ts
93import { OpenAI } from "https://esm.town/v/std/openai";
94const openai = new OpenAI();
95const completion = await openai.chat.completions.create({
96 messages: [
97 { role: "user", content: "Say hello in a creative way" },

Townie.cursorrules4 matches

@pcstyle•Updated 5 days ago
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" },

openai-usage1 file match

@nbbaier•Updated 1 day ago

hello-realtime5 file matches

@jubertioai•Updated 4 days ago
Sample app for the OpenAI Realtime API
reconsumeralization
import { OpenAI } from "https://esm.town/v/std/openai"; import { sqlite } from "https://esm.town/v/stevekrouse/sqlite"; /** * Practical Implementation of Collective Content Intelligence * Bridging advanced AI with collaborative content creation */ exp
kwhinnery_openai