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=96&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 1604 results for "openai"(927ms)

valleBlogV0main.tsx3 matches

@ubixsnow•Updated 5 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),

bedtimeStoryMakerREADME.md2 matches

@dependify•Updated 5 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.

bedtimeStoryMakermain.tsx1 match

@dependify•Updated 5 months ago
19import { generateOpenGraphTags, OpenGraphData } from "https://esm.town/v/dthyresson/generateOpenGraphTags";
20import { ValTownLink } from "https://esm.town/v/dthyresson/viewOnValTownComponent";
21import { chat } from "https://esm.town/v/stevekrouse/openai";
22import * as fal from "npm:@fal-ai/serverless-client";
23

Albertmain.tsx4 matches

@jidun•Updated 5 months ago
287
288 try {
289 const { OpenAI } = await import("https://esm.town/v/std/openai");
290 const openai = new OpenAI();
291
292 const completion = await openai.chat.completions.create({
293 messages: [
294 {
307 });
308 } catch (error) {
309 console.error("OpenAI error:", error);
310 return c.json({ response: "Neural networks malfunctioning. Try again, human." });
311 }

Ms_Spanglermain.tsx4 matches

@jidun•Updated 5 months ago
287
288 try {
289 const { OpenAI } = await import("https://esm.town/v/std/openai");
290 const openai = new OpenAI();
291
292 const completion = await openai.chat.completions.create({
293 messages: [
294 {
307 });
308 } catch (error) {
309 console.error("OpenAI error:", error);
310 return c.json({ response: "Neural networks malfunctioning. Try again, human." });
311 }

multilingualchatroommain.tsx3 matches

@lloydpearsoniv•Updated 5 months ago
498 const url = new URL(request.url);
499 const { blob } = await import("https://esm.town/v/std/blob");
500 const { OpenAI } = await import("https://esm.town/v/std/openai");
501
502 const openai = new OpenAI();
503
504 // Simple rate limiting
537
538 try {
539 const completion = await openai.chat.completions.create({
540 messages: [
541 {

HermesTresmegistusmain.tsx4 matches

@jidun•Updated 5 months ago
287
288 try {
289 const { OpenAI } = await import("https://esm.town/v/std/openai");
290 const openai = new OpenAI();
291
292 const completion = await openai.chat.completions.create({
293 messages: [
294 {
307 });
308 } catch (error) {
309 console.error("OpenAI error:", error);
310 return c.json({ response: "Neural networks malfunctioning. Try again, human." });
311 }

VALLEmain.tsx3 matches

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

VALLEREADME.md1 match

@ubixsnow•Updated 5 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.

webpage_summarizermain.tsx4 matches

@ubixsnow•Updated 5 months ago
104 const webpageText = await webpageResponse.text();
105
106 // Use OpenAI as Claude proxy
107 const { OpenAI } = await import("https://esm.town/v/std/openai");
108 const openai = new OpenAI();
109
110 const completion = await openai.chat.completions.create({
111 messages: [
112 {

translateToEnglishWithOpenAI1 file match

@shlmt•Updated 1 day ago

testOpenAI1 file match

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