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=63&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"(528ms)

name_an_alligator_based_on_moviemain.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 AI that names alligators based on movie descriptions.",
18 prompt: `Based on the following movie description, suggest a creative and fitting name for an alligator: ${movieDescription}`,

wholesomeJadeCardinalmain.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 assistant that generates unique and catchy movie names based on a given movie description.",
18 prompt: `Generate a list of creative and catchy movie names based on the following description: ${movieDescription}`,

empatheticCrimsonAlligatormain.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-4o-mini"),
23 system: "You are a creative assistant that generates unique names inspired by movie titles.",
24 prompt: `Create a unique name inspired by the movie title "${movieTitle}". Include a brief explanation of how the name relates to the movie's characters or themes.`,

generate_movie_inspired_namemain.tsx3 matches

@ajax•Updated 1 month ago
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
46
47 const { text } = await generateText({
48 model: openai("gpt-4o-mini"),
49 system: "You are a creative assistant generating unique names inspired by movies.",
50 prompt,
57
58 const { text } = await generateText({
59 model: openai("gpt-4o-mini"),
60 system: "You are a creative assistant generating unique names inspired by movies.",
61 prompt,

movieButterflyNamermain.tsx1 match

@ajax•Updated 1 month ago
1import { generateText } from "npm:ai";
2import { openai } from "npm:@ai-sdk/openai";
3
4export default async function movieButterflyNamer(

healthChatbotmain.tsx3 matches

@sganta048•Updated 1 month ago
78export default async function server(request: Request): Promise<Response> {
79 if (request.method === "POST" && new URL(request.url).pathname === "/chat") {
80 const { OpenAI } = await import("https://esm.town/v/std/openai");
81 const openai = new OpenAI();
82
83 const body = await request.json();
98
99 try {
100 const completion = await openai.chat.completions.create({
101 messages: [
102 { role: "system", content: systemPrompt },

healthChatbotREADME.md1 match

@sganta048•Updated 1 month ago
20- **Frontend:** HTML, CSS, JavaScript
21- **Backend:** Python (Flask or FastAPI)
22- **AI Model:** OpenAI API / Custom NLP Model
23- **Deployment:** Vercel / Streamlit / Hugging Face Spaces
24

weatherBotmain.tsx7 matches

@charmaine•Updated 1 month ago
2import { latLngOfCity } from "https://esm.town/v/jdan/latLngOfCity";
3import { weatherOfLatLon } from "https://esm.town/v/jdan/weatherOfLatLon";
4import { OpenAI } from "https://esm.town/v/std/openai?v=4";
5
6const openai = new OpenAI();
7
8const toolbox = {
9 "latLngOfCity": {
10 openAiTool: {
11 type: "function",
12 function: {
33 },
34 "weatherOfLatLon": {
35 openAiTool: {
36 type: "function",
37 function: {
60 },
61 "fetchWebpage": {
62 openAiTool: {
63 type: "function",
64 function: {
82};
83
84const tools = Object.values(toolbox).map(({ openAiTool }) => openAiTool);
85const transcript = [
86 {
100
101async function runConversation() {
102 const response = await openai.chat.completions.create({
103 messages: transcript,
104 tools,

weatherGPTmain.tsx3 matches

@charmaine•Updated 1 month ago
1import { email } from "https://esm.town/v/std/email?v=11";
2import { OpenAI } from "npm:openai";
3
4let location = "brooklyn ny";
8).then(r => r.json());
9
10const openai = new OpenAI();
11let chatCompletion = await openai.chat.completions.create({
12 messages: [{
13 role: "user",

toolmain.tsx7 matches

@data•Updated 1 month ago
294
295export default async function server(request: Request): Promise<Response> {
296 const { OpenAI } = await import("https://esm.town/v/std/openai");
297 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
298
328 };
329
330 const openai = new OpenAI();
331 const KEY = extractKey(new URL(import.meta.url));
332 const SCHEMA_VERSION = 4; // Increment schema version for cache support
517
518 // Call AgentA to create the tool definition
519 const agentACompletion = await openai.chat.completions.create({
520 model: "gpt-4o-mini",
521 response_format: { type: "json_object" },
580 `;
581
582 const agentBCompletion = await openai.chat.completions.create({
583 model: "gpt-4o-mini",
584 response_format: { type: "json_object" },
651 });
652
653 // Use AgentB (a separate OpenAI instance) to process the tool request
654 const agentBPrompt = `
655 You are AgentB, a specialized tool agent designed to process specific information requests.
670 `;
671
672 const agentBCompletion = await openai.chat.completions.create({
673 model: "gpt-4o-mini",
674 response_format: { type: "json_object" },
775 `;
776
777 const agentACompletion = await openai.chat.completions.create({
778 model: "gpt-4o-mini",
779 response_format: { type: "json_object" },

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