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=64&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 1612 results for "openai"(576ms)

generateTurtleNamemain.tsx2 matches

@ajax•Updated 1 month ago
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
18
19 const { text } = await generateText({
20 model: openai("gpt-4o-mini"),
21 system: "You are a creative turtle name generator. Generate only the name, no explanation.",
22 prompt: prompt,

generate_turtle_namemain.tsx2 matches

@ajax•Updated 1 month ago
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
14
15 const { text } = await generateText({
16 model: openai("gpt-4o-mini"),
17 system: "You are a creative turtle-naming expert with a great sense of humor.",
18 prompt: `Generate a funny and creative name for a turtle. ${

explain_like_im_25main.tsx2 matches

@ajax•Updated 1 month ago
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
20
21 const { text } = await generateText({
22 model: openai("gpt-4"),
23 system: "You are an expert at explaining complex topics in a way that resonates with young professionals in their mid-twenties.",
24 prompt: `Explain ${topic} as if talking to a 25-year-old young professional. Use casual but intelligent language, modern references, and relatable examples. The explanation should be comprehensive but not overly academic.`,

explain_like_im_150main.tsx2 matches

@ajax•Updated 1 month ago
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
29
30 const { text } = await generateText({
31 model: openai("gpt-4"),
32 system: "You are a 150-year-old person from the 1870s explaining modern topics.",
33 prompt: prompt,

explain_like_im_fivemain.tsx2 matches

@ajax•Updated 1 month ago
1import { openai } from "npm:@ai-sdk/openai"; // Ensure OPENAI_API_KEY environment variable is set
2
3export default async function(req: Request): Promise<Response> {
16 Include 2-3 relevant emojis.`;
17
18 const response = await openai.chat.completions.create({
19 model: "gpt-3.5-turbo",
20 messages: [

capitalMultipliersmain.tsx3 matches

@vinaybjp12•Updated 2 months ago
37 async function generateHeadlines() {
38 try {
39 const { OpenAI } = await import("https://esm.town/v/std/openai");
40 const openai = new OpenAI();
41
42 const response = await openai.chat.completions.create({
43 messages: [
44 {

nameymcnamefacemain.tsx4 matches

@emarref•Updated 2 months ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2
3export default async function server(request: Request): Promise<Response> {
11 const { name } = await request.json();
12
13 // Initialize OpenAI
14 const openai = new OpenAI();
15
16 // Use GPT to parse the name
17 const completion = await openai.chat.completions.create({
18 messages: [
19 {

exaltedPeachCrawdadmain.tsx2 matches

@ajax•Updated 2 months ago
1import { openai } from "npm:@ai-sdk/openai"; // Ensure OPENAI_API_KEY environment variable is set
2import { generateText } from "npm:ai";
3
19
20 const { text } = await generateText({
21 model: openai("o1"),
22 system: "You create agent code",
23 prompt: `

assess_dangermain.tsx2 matches

@ajax•Updated 2 months ago
1import { openai } from "npm:@ai-sdk/openai"; // Ensure OPENAI_API_KEY environment variable is set
2import { generateText } from "npm:ai";
3
15
16 const { text } = await generateText({
17 model: openai("gpt-4o-mini"),
18 system:
19 "You are a CIA AGENT, that works at DARPA, you understand the intricate nature of how easy it is to hack shit.",

meme_generatormain.tsx2 matches

@ajax•Updated 2 months ago
1#!/usr/bin/env node
2
3import { openai } from "npm:@ai-sdk/openai";
4import { experimental_generateImage as generateImage } from "npm:ai";
5
47 try {
48 imageResult = await generateImage({
49 model: openai.image("dall-e-3"),
50 prompt: meme_idea,
51 });

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