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/$%7Bart_info.art.src%7D?q=openai&page=60&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 1626 results for "openai"(587ms)

chatGPTVoiceModeClonemain.tsx3 matches

@HTKhan18•Updated 1 month ago
170export default async function server(request: Request): Promise<Response> {
171 const { blob } = await import("https://esm.town/v/std/blob");
172 const { OpenAI } = await import("https://esm.town/v/std/openai");
173 const openai = new OpenAI();
174
175 // Clear conversation endpoint
201 const combinedMessages = [...previousContext, ...messages].slice(-20);
202
203 const completion = await openai.chat.completions.create({
204 messages: combinedMessages,
205 model: "gpt-4o-mini",

create_a_toolmain.tsx7 matches

@ajax•Updated 1 month ago
1import { openai } from "npm:@ai-sdk/openai";
2import ValTown from "npm:@valtown/sdk";
3import { generateObject, generateText } from "npm:ai";
70 const generateImplStart = Date.now();
71 const { text: implementation } = await generateText({
72 model: openai("gpt-4o"),
73 system: `
74# VALTOWN HTTP Cloud Function Generator Prompt
965. **AI API Integration (if applicable)**:
97 - If the toolDescription indicates that creative enrichment or additional processing via AI is needed, integrate an AI API call into the function.
98 - Import { openai } from "npm:@ai-sdk/openai" and { generateText } from "npm:ai".
99 - Use the model "gpt-4o-mini".
100 - Construct a detailed, context-appropriate prompt for the AI call and integrate its response into the function’s output.
122
123---typescript
124import { openai } from "npm:@ai-sdk/openai";
125import { generateText } from "npm:ai";
126
135 }
136 const { text: analysis } = await generateText({
137 model: openai("gpt-4o-mini"),
138 system: "You are a creative code analyst.",
139 prompt: "Analyze the following recent changes in the code: " + body.recent_changes,
233
234 const { object: manifestoConfig } = await generateObject({
235 model: openai("gpt-4o"),
236 schema: z.object({
237 manifestoConfigPureJson: z.string(),
293
294 const { object: updatedManifestoConfigTypescript } = await generateObject({
295 model: openai("gpt-4o"),
296 system: promptForUpdatedManifest,
297 schema: z.object({

chuck_norris_respondermain.tsx2 matches

@ajax•Updated 1 month ago
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
13 }
14 const { text: chuckResponse } = await generateText({
15 model: openai("gpt-4o-mini"),
16 system: "You are Chuck Norris, known for humorous and exaggerated responses.",
17 prompt: `Create a funny and morbid response as if Chuck Norris were reacting to the situation: ${situation}, involving the user: ${user_name}.`,

chuck_norris_responsemain.tsx1 match

@ajax•Updated 1 month ago
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3

ai_parody_yesterdaymain.tsx2 matches

@ajax•Updated 1 month ago
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
13 const theme = body.theme;
14 const { text: parodyLyrics } = await generateText({
15 model: openai("gpt-4o-mini"),
16 system: "You are a creative songwriter.",
17 prompt: `Create a parody of the song 'Yesterday' by The Beatles. The parody should maintain the original melody and structure but incorporate the following theme: ${theme}.`,

name_new_town_australiamain.tsx2 matches

@ajax•Updated 1 month ago
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
21
22 const { text: townName } = await generateText({
23 model: openai("gpt-4o-mini"),
24 system: "You are an AI that generates unique town names in Australia.",
25 prompt: `Generate a unique town name based on the theme: ${selectedTheme}. Consider Australian geography, culture, and history.`

ninja_turtle_namermain.tsx1 match

@ajax•Updated 1 month ago
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3

sedatePurpleReindeermain.tsx2 matches

@ajax•Updated 1 month ago
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
12 }
13 const { text: creativeIdeas } = await generateText({
14 model: openai("gpt-4o-mini"),
15 system: "You are an expert in generating creative Twitch integration ideas.",
16 prompt: "Based on the following inspiration, generate a list of innovative Twitch integration ideas: " + body.userInput,

astuteScarletSnipemain.tsx2 matches

@ajax•Updated 1 month ago
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
12 }
13 const { text: ideasList } = await generateText({
14 model: openai("gpt-4o-mini"),
15 system: "You are a creative assistant specialized in generating innovative Twitch integration ideas.",
16 prompt: "Based on the following inspiration, generate a list of creative Twitch integration ideas: " + body.userInput,

rousingSalmonGamefowlmain.tsx2 matches

@ajax•Updated 1 month ago
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
12 }
13 const { text: ideas } = await generateText({
14 model: openai("gpt-4o-mini"),
15 system: "You are a creative Twitch integration idea generator.",
16 prompt: "Based on the following inspiration, brainstorm creative Twitch integration concepts: " + body.userInput,

translateToEnglishWithOpenAI1 file match

@shlmt•Updated 4 days ago

testOpenAI1 file match

@stevekrouse•Updated 6 days ago
lost1991
import { OpenAI } from "https://esm.town/v/std/openai"; export default async function(req: Request): Promise<Response> { if (req.method === "OPTIONS") { return new Response(null, { headers: { "Access-Control-Allow-Origin": "*",