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=54&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 1607 results for "openai"(827ms)

generate_personality_profilemain.tsx2 matches

@davincidreams•Updated 1 month ago
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
13 const interactionsText = body.interactions.join("\n");
14 const { text: personalityProfile } = await generateText({
15 model: openai("gpt-4o-mini"),
16 system: "You are a personality analyst.",
17 prompt: "Based on the following user interactions, identify patterns and summarize the user's personality traits: " + interactionsText,

honest_feedback_toolmain.tsx3 matches

@davincidreams•Updated 1 month ago
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
15
16 const { text: codeAnalysis } = await generateText({
17 model: openai("gpt-4o-mini"),
18 system: "You are a code quality and complexity analyst.",
19 prompt: `Analyze the following codebase for quality, complexity, and structure: ${codebase}. Include metrics such as the number of files, lines of code, and code complexity.`,
21
22 const { text: skillAssessment } = await generateText({
23 model: openai("gpt-4o-mini"),
24 system: "You are an expert in assessing programming skills.",
25 prompt: `Based on the following questions and answers, estimate the user's skill level and experience: ${questions}. Consider topics like programming languages used, frameworks, and previous projects.`,

generate_haikumain.tsx2 matches

@davincidreams•Updated 1 month ago
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
12 }
13 const { text: haiku } = await generateText({
14 model: openai("gpt-4o-mini"),
15 system: "You are a poet creating haikus.",
16 prompt: `Create a haiku about the following topic: ${body.topic}. The haiku should follow the 5-7-5 syllable structure.`,

logical_fallacy_analyzermain.tsx2 matches

@davincidreams•Updated 1 month ago
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
12 }
13 const { text: analysis } = await generateText({
14 model: openai("gpt-4o-mini"),
15 system: "You are an expert in identifying logical fallacies.",
16 prompt: "Analyze the following text for common logical fallacies such as ad hominem, straw man, slippery slope, etc.: " + body.text,

suggest_animal_dietmain.tsx2 matches

@davincidreams•Updated 1 month ago
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
12 }
13 const { text: dietSuggestion } = await generateText({
14 model: openai("gpt-4o-mini"),
15 system: "You are an expert zoologist.",
16 prompt:

create_a_toolmain.tsx7 matches

@davincidreams•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({

discreetOrangeAntelopemain.tsx7 matches

@davincidreams•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({

harmoniousPlumTapirmain.tsx1 match

@davincidreams•Updated 1 month ago
6 "description": "A sample blah manifest demonstrating various tool types and configurations.",
7 "env": {
8 "OPENAI_API_KEY": "your-openai-api-key-here",
9 },
10 "tools": [

get_country_factmain.tsx2 matches

@ajax•Updated 1 month ago
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
12 }
13 const { text: fact } = await generateText({
14 model: openai("gpt-4o-mini"),
15 system: "You are an expert in world trivia.",
16 prompt: `Provide an interesting and fun fact about the country: ${body.country}.`,

get_recipes_by_countrymain.tsx2 matches

@ajax•Updated 1 month ago
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
13 const countriesList = body.countries.join(", ");
14 const { text: recipes } = await generateText({
15 model: openai("gpt-4o-mini"),
16 system: "You are a culinary expert.",
17 prompt: `Provide a list of popular recipes from the following countries: ${countriesList}.`,

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