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/%22$%7Bconfig.siteUrl%7D/admin.http/%22https:/buy.stripe.com/test_fZe6rigkxdR9aze289//%22$%7Bad.imageUrl%7D/%22?q=openai&page=1&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 3239 results for "openai"(8117ms)

last-login-demo-1README.md1 match

@stevekrouse•Updated 25 mins ago
40- ✅ Chat message display with user/assistant styling
41- ✅ Message input with textarea and send button
42- ✅ OpenAI API integration (GPT-4o-mini)
43- ✅ Real-time message updates
44- ✅ Loading states and typing indicators

last-login-demo-1index.ts7 matches

@stevekrouse•Updated 27 mins ago
3import { sqlite } from "https://esm.town/v/stevekrouse/sqlite/main.tsx";
4import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";
5import { OpenAI } from "https://esm.town/v/std/openai";
6
7const app = new Hono();
8const openai = new OpenAI();
9
10// Unwrap Hono errors to see original error details
177});
178
179// Send a message and get OpenAI response
180app.post("/api/threads/:threadId/messages", async (c) => {
181 const email = c.req.header('X-LastLogin-Email');
214 );
215
216 // Prepare messages for OpenAI (limit to last 20 messages to avoid token limits)
217 const messages = messageHistory.slice(-20).map(msg => ({
218 role: msg.role as 'user' | 'assistant',
220 }));
221
222 // Get OpenAI response
223 const completion = await openai.chat.completions.create({
224 model: "gpt-4o-mini",
225 messages: messages,
231
232 if (!assistantResponse) {
233 throw new Error("No response from OpenAI");
234 }
235

tasca_chatmain.ts3 matches

@bluemax•Updated 4 hours ago
1import { PresidentDocs } from "./nonprofitDocs";
2import { OpenAI } from "https://esm.town/v/std/openai";
3
4const openai = new OpenAI();
5
6export default async function (req: Request): Promise<Response> {
19 // { role: "user", content: "Say hello in a creative way" },
20
21 const completion = await openai.chat.completions.create({
22 messages: [
23 { role: "system", content: systemPrompt },

gatemain.ts3 matches

@know•Updated 5 hours ago
1import { nanoid } from "https://deno.land/x/nanoid@v3.0.0/mod.ts";
2import { blob } from "https://esm.town/v/std/blob?v=11";
3import { OpenAI } from "https://esm.town/v/std/openai?v=4";
4
5const AUDIT_DEPTH_INTERVAL = 2;
40
41// --- BACKEND LOGIC ---
42const openai = new OpenAI();
43
44async function callAI(
47): Promise<Prerequisite[]> {
48 try {
49 const completion = await openai.chat.completions.create({
50 model: "gpt-4o",
51 messages: [

h6-system_prompt.txt4 matches

@werewolf006•Updated 6 hours 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" },

h6-.cursorrules4 matches

@werewolf006•Updated 6 hours 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

@werewolf006•Updated 6 hours 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

@werewolf006•Updated 6 hours 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" },

untitled-8620main.ts3 matches

@know•Updated 6 hours ago
1// @ts-ignore
2import { OpenAI } from "https://esm.town/v/std/openai?v=4";
3// @ts-ignore
4import { blob } from "https://esm.town/v/std/blob?v=11";
109const MAX_DEPTH = 4;
110const AUDIT_DEPTH_INTERVAL = 2; // Trigger auditor every 2 levels.
111const openai = new OpenAI();
112
113/**
116async function callAI(fact: string, prompt: string): Promise<Prerequisite[]> {
117 try {
118 const completion = await openai.chat.completions.create({
119 model: "gpt-4o",
120 messages: [

untitled-8620main.ts3 matches

@realtime•Updated 6 hours ago
1// @ts-ignore
2import { OpenAI } from "https://esm.town/v/std/openai?v=4";
3// @ts-ignore
4import { blob } from "https://esm.town/v/std/blob?v=11";
57// --- CORE AI & TREE LOGIC ---
58const MAX_DEPTH = 4;
59const openai = new OpenAI();
60
61async function callAI(fact: string, prompt: string): Promise<Prerequisite[]> {
62 try {
63 const completion = await openai.chat.completions.create({
64 model: "gpt-4o",
65 messages: [

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