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=58&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 1610 results for "openai"(491ms)

adventurousRoseGerbilmain.tsx2 matches

@ajax•Updated 1 month ago
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
12 }
13 const { text: insights } = await generateText({
14 model: openai("gpt-4o-mini"),
15 system: "You are a thoughtful assistant providing insights on user desires.",
16 prompt: "Reflect on the following user request and provide insights: " + body.user_input,

pontificate_on_user_wantsmain.tsx2 matches

@ajax•Updated 1 month ago
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
12 }
13 const { text: insights } = await generateText({
14 model: openai("gpt-4o-mini"),
15 system: "You are a thoughtful analyst providing insights into user desires and needs.",
16 prompt: "Reflect on the following user input and provide insights into the underlying desires or needs: " + body.user_input,

typeanythingmapmain.tsx3 matches

@danny•Updated 1 month ago
375 const { query } = await request.json();
376
377 const { OpenAI } = await import("https://esm.town/v/std/openai");
378 const openai = new OpenAI();
379
380 const response = await openai.chat.completions.create({
381 messages: [
382 {

OpenAIProxymain.tsx3 matches

@harveyfullstack•Updated 1 month ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2
3const openai = new OpenAI();
4const completion = await openai.chat.completions.create({
5 "messages": [
6 { "role": "user", "content": "Say hello in a creative way" },

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.`

translateToEnglishWithOpenAI1 file match

@shlmt•Updated 2 days ago

testOpenAI1 file match

@stevekrouse•Updated 4 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": "*",