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/$%7Bsuccess?q=openai&page=57&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 3218 results for "openai"(2799ms)

rss

rssfeeds.json1 match

@artivilla•Updated 1 month ago
13 ["programming", "AI"]
14 ],
15 ["https://openai.com/news/rss.xml", ["AI"]],
16 [
17 "https://raw.githubusercontent.com/Olshansk/rss-feeds/main/feeds/feed_anthropic_news.xml",

silomain.tsx6 matches

@join•Updated 1 month ago
1// @ts-ignore
2import { OpenAI } from "https://esm.town/v/std/openai?v=4";
3
4// --- AI BEHAVIORAL GUIDELINES & PROMPTS ---
703 const url = new URL(req.url);
704 const action = url.searchParams.get("action");
705 const openai = new OpenAI();
706
707 if (req.method === "GET") {
717 case "startGame": {
718 const { archetypes } = body;
719 const completion = await openai.chat.completions.create({
720 model: "gpt-4o",
721 messages: [
743 }
744
745 const completion = await openai.chat.completions.create({
746 model: "gpt-4o",
747 messages: [
762 case "evaluateGuess": {
763 const { guess, targetGuest } = body;
764 const completion = await openai.chat.completions.create({
765 model: "gpt-4o",
766 messages: [
781 case "parseCommand": {
782 const { command, availableActions } = body;
783 const completion = await openai.chat.completions.create({
784 model: "gpt-4o",
785 messages: [

untitled-8111emailParser.ts5 matches

@wolf•Updated 1 month ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2
3interface Email {
116
117/**
118 * Extract order information from email using OpenAI
119 */
120async function extractOrderInfo(email: Email): Promise<OrderInfo> {
121 const openai = new OpenAI();
122
123 // Combine text and HTML content, preferring text
183
184 try {
185 const completion = await openai.chat.completions.create({
186 messages: [
187 { role: "system", content: "You are a precise email parser that extracts order information and returns only valid JSON." },
195 const response = completion.choices[0]?.message?.content?.trim();
196 if (!response) {
197 throw new Error("No response from OpenAI");
198 }
199

dronesmain.tsx3 matches

@join•Updated 1 month ago
1// @ts-ignore
2import { OpenAI } from "https://esm.town/v/std/openai?v=4";
3
4// --- AI BEHAVIORAL GUIDELINES ---
722 if (req.method === "POST" && action === "deconflict") {
723 try {
724 const openai = new OpenAI();
725 const { droneA, droneB } = await req.json();
726
731 const userMessage = `Resolve conflict. Drone A: ${JSON.stringify(droneA)}. Drone B: ${JSON.stringify(droneB)}.`;
732
733 const completion = await openai.chat.completions.create({
734 model: "gpt-4o",
735 messages: [

stevensDemo.cursorrules4 matches

@yudhise•Updated 1 month ago
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" },

fivemain.tsx3 matches

@join•Updated 1 month ago
1// @ts-ignore
2import { OpenAI } from "https://esm.town/v/std/openai?v=4";
3
4// --- AI BEHAVIORAL GUIDELINES ---
315 if (req.method === "POST") {
316 try {
317 const openai = new OpenAI();
318 const body = await req.json();
319 const prompt = body.prompt;
331 ];
332
333 const completion = await openai.chat.completions.create({
334 model: "gpt-4o",
335 messages: messages,

funmain.tsx3 matches

@join•Updated 1 month ago
4import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
5// @ts-ignore
6import { OpenAI } from "https://esm.town/v/std/openai?v=4";
7
8// --- TYPE DEFINITIONS ---
343
344app.post("/submit", async (c) => {
345 const openai = new OpenAI();
346 const body = await c.req.json();
347 const { text, style } = body;
355
356 try {
357 const completion = await openai.chat.completions.create({
358 model: "gpt-4o",
359 messages: [

jealous-textmain.tsx3 matches

@join•Updated 1 month ago
1// @ts-ignore
2import { OpenAI } from "https://esm.town/v/std/openai?v=4";
3
4// --- AI BEHAVIORAL GUIDELINES ---
364 if (req.method === "POST" && action === "getPhrase") {
365 try {
366 const openai = new OpenAI();
367 const body = await req.json();
368 const theme = body.theme;
375 }
376
377 const completion = await openai.chat.completions.create({
378 model: "gpt-4o",
379 messages: [

horiz-shinemain.tsx12 matches

@join•Updated 1 month ago
4import { Hono } from "npm:hono@4.4.12";
5import type { Context } from "npm:hono@4.4.12";
6import { OpenAI } from "npm:openai@4.52.7";
7
8// --- TYPE DEFINITIONS ---
470 if (!industry) return c.json({ error: "Industry is a required field." }, 400);
471 try {
472 const openai = new OpenAI();
473 const completion = await openai.chat.completions.create({
474 model: "gpt-4o",
475 messages: [{ role: "system", content: DYNAMIC_LIST_GENERATOR_PROMPT }, {
491 if (!occupation) return c.json({ error: "Occupation is a required field." }, 400);
492 try {
493 const openai = new OpenAI();
494 const completion = await openai.chat.completions.create({
495 model: "gpt-4o",
496 messages: [{ role: "system", content: DYNAMIC_LIST_GENERATOR_PROMPT }, {
513 const userInput = `Occupation: ${occupation_title}, Task: ${task}`;
514 try {
515 const openai = new OpenAI();
516 const completion = await openai.chat.completions.create({
517 model: "gpt-4o",
518 messages: [{ role: "system", content: PROMPT_REFINER_SYSTEM_PROMPT }, { role: "user", content: userInput }],
531 if (!refined_prompt) return c.json({ error: "refined_prompt is required" }, 400);
532 try {
533 const openai = new OpenAI();
534 const completion = await openai.chat.completions.create({
535 model: "gpt-4o",
536 messages: [{ role: "system", content: INPUT_EXTRACTOR_SYSTEM_PROMPT }, {
559
560 try {
561 const openai = new OpenAI();
562 const agentCompletion = await openai.chat.completions.create({
563 model: "gpt-4o",
564 messages: [{ role: "system", content: finalUserPrompt }, {
570 if (!agentOutput) throw new Error("The agent returned no content.");
571
572 const htmlCompletion = await openai.chat.completions.create({
573 model: "gpt-4o",
574 messages: [{ role: "system", content: HTML_FORMATTER_SYSTEM_PROMPT }, { role: "user", content: agentOutput }],

type3dmain.tsx3 matches

@join•Updated 1 month ago
1// @ts-ignore
2import { OpenAI } from "https://esm.town/v/std/openai?v=4";
3
4// --- AI BEHAVIORAL GUIDELINES ---
509 if (req.method === "POST") {
510 try {
511 const openai = new OpenAI();
512 const { message, history, persona } = await req.json();
513
523 ];
524
525 const completion = await openai.chat.completions.create({
526 model: "gpt-4o",
527 messages: messages,

hello-realtime5 file matches

@jubertioai•Updated 3 days ago
Sample app for the OpenAI Realtime API

openai-gemini1 file match

@ledudu•Updated 1 week ago
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