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/image-url.jpg%20%22Image%20title%22?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 3227 results for "openai"(1916ms)

untitled-471main.ts5 matches

@know•Updated 4 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 4 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 4 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" },

github-action-caseddeployment-webhook.ts3 matches

@tnm•Updated 5 days ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2import { email } from "https://esm.town/v/std/email";
3
150 deploymentRequest: string;
151}): Promise<string> {
152 const openai = new OpenAI();
153
154 const prompt =
164The poem should be 12-16 lines, use elevated but accessible language, and blend DevOps terminology with natural imagery. Think of code as seeds, deployments as harvests, servers as fertile soil, and developers as gardeners tending the digital earth.`;
165
166 const completion = await openai.chat.completions.create({
167 messages: [
168 { role: "user", content: prompt },

croneAGENTS.md4 matches

@jrmann100•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" },

YapTrapadmin.ts8 matches

@lantholin•Updated 5 days ago
452 }
453
454 // Test OpenAI directly
455 const { OpenAI } = await import("https://esm.town/v/std/openai");
456 const openai = new OpenAI();
457
458 const completion = await openai.chat.completions.create({
459 messages: [
460 {
476 input: message,
477 response: response,
478 provider: 'openai',
479 model: 'gpt-4o-mini',
480 tokensUsed: completion.usage?.total_tokens || 0
730
731 // Use AI engine directly
732 const { OpenAI } = await import("https://esm.town/v/std/openai");
733 const openai = new OpenAI();
734
735 const completion = await openai.chat.completions.create({
736 messages: [
737 { role: "system", content: `You are ${persona.name}, a ${persona.role} in a software team. ${persona.communicationStyle}` },

openai-usage1 file match

@nbbaier•Updated 21 hours ago

hello-realtime5 file matches

@jubertioai•Updated 3 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