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=82&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 1623 results for "openai"(534ms)

Touristmain.tsx2 matches

@vawogbemi•Updated 3 months ago
181 const { messages, location } = await request.json();
182
183 const { OpenAI } = await import("https://esm.sh/openai");
184 const client = new OpenAI({
185 apiKey: Deno.env.get("CEREBRAS_API_KEY"),
186 baseURL: "https://api.cerebras.ai/v1",

AlwaysHere_migratedmain.tsx2 matches

@varun1352•Updated 3 months ago
309
310 // Cerebras LLM for response generation
311 const { OpenAI } = await import("https://esm.sh/openai");
312 const llmClient = new OpenAI({
313 apiKey: Deno.env.get("CEREBRAS_API_KEY"),
314 baseURL: "https://api.cerebras.ai/v1",

TouristREADME.md2 matches

@vawogbemi•Updated 3 months ago
35Use Cerebras for AI on the backend like so:
36
37const { OpenAI } = await import("https://esm.sh/openai");
38const client = new OpenAI({
39 apiKey: Deno.env.get("CEREBRAS_API_KEY"),
40 baseURL: "https://api.cerebras.ai/v1"

bedtimeStoryMakermain.tsx1 match

@tmcw•Updated 3 months ago
15import { generateOpenGraphTags, OpenGraphData } from "https://esm.town/v/dthyresson/generateOpenGraphTags"
16import { ValTownLink } from "https://esm.town/v/dthyresson/viewOnValTownComponent"
17import { chat } from "https://esm.town/v/stevekrouse/openai"
18import * as fal from "npm:@fal-ai/serverless-client"
19

bedtimeStoryMakerREADME.md2 matches

@tmcw•Updated 3 months ago
13* and activity (befriends aliens, goes to the doctor, rides a rollercoaster, bakes a cake for friends)
14
15It uses OpenAI to write a children's bedtime story
16
17* title
21for a "fantastical story about a green whale who rides the bus" or the "spooky story about the tomato fox who explores a cave".
22
23Then using the summary, OpenAI geenrates another prompt to describe the instructions to geneate a childrens story book image.
24
25That's sent to Fal to generate an image.

cerebrasTemplateREADME.md2 matches

@rootvertex•Updated 3 months ago
35Use Cerebras for AI on the backend like so:
36
37const { OpenAI } = await import("https://esm.sh/openai");
38const client = new OpenAI({
39 apiKey: Deno.env.get("CEREBRAS_API_KEY"),
40 baseURL: "https://api.cerebras.ai/v1"

cerebrasTemplatemain.tsx2 matches

@rootvertex•Updated 3 months ago
83 const { messages } = await request.json();
84
85 const { OpenAI } = await import("https://esm.sh/openai");
86 // Cerebras Inference
87 // Very important: do not change this
88 // Keep these comments so we remember not to change this
89 const client = new OpenAI({
90 apiKey: Deno.env.get("CEREBRAS_API_KEY"),
91 baseURL: "https://api.cerebras.ai/v1",

Code_Debuggermain.tsx2 matches

@sakshamkapoor2911•Updated 3 months ago
210 const stackOverflowResults = await searchStackOverflow(lastUserMessage);
211
212 const { OpenAI } = await import("https://esm.sh/openai");
213 const client = new OpenAI({
214 apiKey: Deno.env.get("CEREBRAS_API_KEY"),
215 baseURL: "https://api.cerebras.ai/v1",

Code_DebuggerREADME.md2 matches

@sakshamkapoor2911•Updated 3 months ago
35Use Cerebras for AI on the backend like so:
36
37const { OpenAI } = await import("https://esm.sh/openai");
38const client = new OpenAI({
39 apiKey: Deno.env.get("CEREBRAS_API_KEY"),
40 baseURL: "https://api.cerebras.ai/v1"

textToGeneratemain.tsx4 matches

@KALPESHPATEL•Updated 3 months ago
230 const { prompt, mode } = await c.req.json();
231
232 const { OpenAI } = await import("https://esm.town/v/std/openai");
233 const openai = new OpenAI();
234
235 if (mode === "image") {
236 const response = await openai.images.generate({
237 model: "dall-e-3",
238 prompt: prompt,
244 return c.json({ imageUrl });
245 } else {
246 const response = await openai.chat.completions.create({
247 messages: [{ role: "user", content: prompt }],
248 model: "gpt-4o-mini",

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": "*",