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=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 1630 results for "openai"(552ms)

research_agenttest.ts2 matches

@stevekrouse•Updated 2 months ago
1import { openai } from 'npm:@ai-sdk/openai';
2import { generateText, tool } from 'npm:ai';
3import * as mathjs from 'npm:mathjs';
5
6const response = await generateText({
7 model: openai('gpt-4o-2024-08-06', { structuredOutputs: true }),
8 tools: {
9 calculate: tool({

generate_lotr_horoscopemain.tsx2 matches

@ajax•Updated 2 months ago
1import { openai } from "npm:@ai-sdk/openai";
2import { generateText } from "npm:ai";
3
23
24 const { text: reading } = await generateText({
25 model: openai("gpt-4o-mini"),
26 system: "You are a creative writer specializing in Lord of the Rings themed horoscopes.",
27 prompt:

authenticAquamarineMulemain.tsx2 matches

@ajax•Updated 2 months ago
1```typescript
2import { openai } from "npm:@ai-sdk/openai";
3import { generateText } from "npm:ai";
4
32
33 const { text: reading } = await generateText({
34 model: openai("gpt-4o-mini"),
35 system: "You are a Star Trek zodiac reader.",
36 prompt: `Create a thematic reading for a person born under the ${race} race with traits of ${traits.join(', ')}.`

musicalPeachPerchmain.tsx2 matches

@ajax•Updated 2 months ago
1```typescript
2import { openai } from "npm:@ai-sdk/openai";
3import { generateText } from "npm:ai";
4
44
45 const { text: fortune } = await generateText({
46 model: openai("gpt-4o-mini"),
47 system: "You are a Star Trek themed fortune teller.",
48 prompt: `Create a fortune for someone with the traits: ${raceAssignment.traits}.`

HTTP101HTTPguide1 match

@willthereader•Updated 2 months ago
178 <h4>API</h4>
179 <p>An API (Application Programming Interface) is a set of rules and protocols designed to make it easy
180 to communicate. For example OpenAI has an API designed to make it easy for ChatGPT to communicate with
181 many different kinds of softwares. It's very common for front ends to call APIs. You don't literally
182 call an API, you call it's endpoints. There are disadvantages to calling an API like the fact you're

name_a_bad_personmain.tsx2 matches

@ajax•Updated 2 months 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 name generator that creates humorous or fitting names for people based on a given reason for why they are considered bad.",
18 prompt: `Generate a name for a person who is considered bad because: ${reason}. Make it creative and humorous.`,

name_a_car_inspired_by_colormain.tsx2 matches

@ajax•Updated 2 months 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 generates unique car names based on a given color.",
18 prompt: `Create a unique and catchy car name for a car that is ${color}.`,

name_a_bird_after_carsmain.tsx1 match

@ajax•Updated 2 months ago
19
20 const { text } = await generateText({
21 model: openai("gpt-4o-mini"),
22 system: "You are a creative AI that generates bird names based on car models.",
23 prompt: `Generate a random bird name inspired by the following car models: ${carModels.join(", ")}.`

name_an_alligator_based_on_moviemain.tsx2 matches

@ajax•Updated 2 months 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 2 months 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}`,

translateToEnglishWithOpenAI1 file match

@shlmt•Updated 5 days ago

testOpenAI1 file match

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