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/image-url.jpg?q=openai&page=165&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 2151 results for "openai"(2702ms)

easyAQIREADME.md1 match

@bcongdon•Updated 10 months ago
126. Uses EPA's ranking to classify the severity of the score (ie "Unhealthy for Sensitive Groups")
13
14It uses blob storage to cache the openai location id for your location string to skip a couple steps for the next time.
15
16## Example usage

tenseRoseTiglonmain.tsx3 matches

@MichaelNollox•Updated 10 months ago
2import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
3
4import { OpenAI } from "https://esm.town/v/std/openai";
5
6const openai = new OpenAI();
7
8const completion = await openai.chat.completions.create({
9 messages: [
10 { role: "user", content: "Say hello in a creative way" },

tenseRoseTiglonREADME.md1 match

@MichaelNollox•Updated 10 months ago
6* Fork this val to your own profile.
7* Make a folder for the temporary vals that get generated, take the ID from the URL, and put it in `tempValsParentFolderId`.
8* If you want to use OpenAI models you need to set the `OPENAI_API_KEY` [env var](https://www.val.town/settings/environment-variables).
9* If you want to use Anthropic models you need to set the `ANTHROPIC_API_KEY` [env var](https://www.val.town/settings/environment-variables).
10* Create a [Val Town API token](https://www.val.town/settings/api), open the browser preview of this val, and use the API token as the password to log in.

VALLEREADME.md1 match

@MichaelNollox•Updated 10 months ago
6* Fork this val to your own profile.
7* Make a folder for the temporary vals that get generated, take the ID from the URL, and put it in `tempValsParentFolderId`.
8* If you want to use OpenAI models you need to set the `OPENAI_API_KEY` [env var](https://www.val.town/settings/environment-variables).
9* If you want to use Anthropic models you need to set the `ANTHROPIC_API_KEY` [env var](https://www.val.town/settings/environment-variables).
10* Create a [Val Town API token](https://www.val.town/settings/api), open the browser preview of this val, and use the API token as the password to log in.

motionlessPurpleBatmain.tsx3 matches

@carts•Updated 10 months ago
1import { OpenAI } from "https://esm.town/v/std/openai?v=4";
2
3const prompt = "Tell me a dad joke. Format the response as JSON with 'setup' and 'punchline' keys.";
6
7export default async function dailyDadJoke(req: Request): Response {
8 const openai = new OpenAI();
9
10 const resp = await openai.chat.completions.create({
11 messages: [
12 { role: "user", content: prompt },

valleBlogV0main.tsx3 matches

@janpaul123•Updated 10 months ago
3import { passwordAuth } from "https://esm.town/v/pomdtr/password_auth?v=84";
4import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken?v=1";
5import { openai } from "npm:@ai-sdk/openai";
6import ValTown from "npm:@valtown/sdk";
7import { streamText } from "npm:ai";
36
37 const stream = await streamText({
38 model: openai("gpt-4o", {
39 baseURL: "https://std-openaiproxy.web.val.run/v1",
40 apiKey: Deno.env.get("valtown"),
41 } as any),

VALLErunmain.tsx2 matches

@janpaul123•Updated 10 months ago
9import { sleep } from "https://esm.town/v/stevekrouse/sleep?v=1";
10import { anthropic } from "npm:@ai-sdk/anthropic";
11import { openai } from "npm:@ai-sdk/openai";
12import ValTown from "npm:@valtown/sdk";
13import { StreamingTextResponse, streamText } from "npm:ai";
1104 let vercelModel;
1105 if (model.includes("gpt")) {
1106 vercelModel = openai(model);
1107 } else {
1108 vercelModel = anthropic(model);

valleGetValsContextWindowmain.tsx4 matches

@janpaul123•Updated 10 months ago
174 },
175 {
176 prompt: "Write a val that uses OpenAI",
177 code: `import { OpenAI } from "https://esm.town/v/std/openai";
178
179 const openai = new OpenAI();
180 const completion = await openai.chat.completions.create({
181 "messages": [
182 { "role": "user", "content": "Say hello in a creative way" },

bedtimeStoryMakerREADME.md2 matches

@dthyresson•Updated 10 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.

askAImain.tsx5 matches

@DFB•Updated 10 months ago
1import { OpenAI } from "https://deno.land/x/openai@v4.54.0/mod.ts";
2
3const apiKey = Deno.env.get("OPENAI_API_KEY");
4const openai = new OpenAI({ apiKey });
5
6export async function askAI(msg: string) {
9 model: "gpt-4o-mini",
10 max_tokens: 3000,
11 } satisfies OpenAI.ChatCompletionCreateParamsNonStreaming;
12
13 const chat = await openai.chat.completions.create(cfg);
14
15 return chat.choices?.[0].message.content;

openai-client1 file match

@cricks_unmixed4u•Updated 3 days ago

openai_enrichment6 file matches

@stevekrouse•Updated 4 days ago
kwhinnery_openai
reconsumeralization
import { OpenAI } from "https://esm.town/v/std/openai"; import { sqlite } from "https://esm.town/v/stevekrouse/sqlite"; /** * Practical Implementation of Collective Content Intelligence * Bridging advanced AI with collaborative content creation */ exp