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/...?q=openai&page=1&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 2315 results for "openai"(2615ms)

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

personal_trmnlmalifold_cron.tsx5 matches

@ramtinalami•Updated 44 mins ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2import { sqlite } from "https://esm.town/v/std/sqlite";
3
5const CACHE_KEY_SUMMARY = "manifold_summary";
6const MANIFOLD_URL = "https://api.manifold.markets/v0/markets?limit=30&sort=last-bet-time";
7const openai = new OpenAI();
8
9/**
10 * Cron handler: fetch raw markets, diff, summarize via OpenAI, store in SQLite
11 * @param {Interval} interval
12 */
54`;
55
56 // 7) Call OpenAI gpt-4o-mini
57 const completion = await openai.chat.completions.create({
58 model: "gpt-4o-mini",
59 messages: [{ role: "user", content: prompt.trim() }],

weather-aimain.tsx6 matches

@helge•Updated 1 hour ago
77}
78
79async function callOpenAI(messages: any[], tools: any[]) {
80 const OPENAI_API_KEY = Deno.env.get("OPENAI_API_KEY");
81
82 const response = await fetch("https://openrouter.ai/api/v1/chat/completions", {
83 method: "POST",
84 headers: {
85 "Authorization": `Bearer ${OPENAI_API_KEY}`,
86 "Content-Type": "application/json",
87 },
88 body: JSON.stringify({
89 model: "openai/gpt-4o",
90 messages,
91 tools,
143 ];
144
145 let completion = await callOpenAI(messages, tools);
146 let weatherData = null;
147 let locationData = null;
175 }
176
177 completion = await callOpenAI(messages, tools);
178
179 if (!completion.choices[0].message.tool_calls) {

OpenAIProxy1 file match

@talkbot•Updated 1 day ago

openai1 file match

@awei82•Updated 3 days ago