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/$%7Burl%7D?q=openai&page=89&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 2536 results for "openai"(5718ms)

blog-cloneget-old-posts.ts5 matches

@jamiesinclair•Updated 2 months ago
198 },
199 {
200 "title": "An Introduction to OpenAI fine-tuning",
201 "slug": "an-introduction-to-openai-fine-tuning",
202 "link": "/blog/an-introduction-to-openai-fine-tuning",
203 "description": "How to customize OpenAI to your liking",
204 "pubDate": "Fri, 25 Aug 2023 00:00:00 GMT",
205 "author": "Steve Krouse",
417 "slug": "val-town-newsletter-16",
418 "link": "/blog/val-town-newsletter-16",
419 "description": "Our seed round, growing team, Codeium completions, @std/openai, and more",
420 "pubDate": "Mon, 22 Apr 2024 00:00:00 GMT",
421 "author": "Steve Krouse",

blogget-old-posts.ts5 matches

@jamiesinclair•Updated 2 months ago
198 },
199 {
200 "title": "An Introduction to OpenAI fine-tuning",
201 "slug": "an-introduction-to-openai-fine-tuning",
202 "link": "/blog/an-introduction-to-openai-fine-tuning",
203 "description": "How to customize OpenAI to your liking",
204 "pubDate": "Fri, 25 Aug 2023 00:00:00 GMT",
205 "author": "Steve Krouse",
417 "slug": "val-town-newsletter-16",
418 "link": "/blog/val-town-newsletter-16",
419 "description": "Our seed round, growing team, Codeium completions, @std/openai, and more",
420 "pubDate": "Mon, 22 Apr 2024 00:00:00 GMT",
421 "author": "Steve Krouse",

French_Bulldogmain.tsx5 matches

@ynonp•Updated 2 months ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2import { telegramSendMessage } from "https://esm.town/v/vtdocs/telegramSendMessage?v=5";
3import {
15 console.log(`received: ${text}`)
16 if (text) {
17 const response = await translateWithOpenAI(text);
18 console.log(`translated to: ${response}`);
19 ctx.reply(response);
33
34
35async function translateWithOpenAI(text: string) {
36 const openai = new OpenAI();
37 const completion = await openai.chat.completions.create({
38 messages: [
39 {

Mili_Botmain.tsx5 matches

@ynonp•Updated 2 months ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2import { telegramSendMessage } from "https://esm.town/v/vtdocs/telegramSendMessage?v=5";
3import {
15 console.log(`received: ${text}`)
16 if (text) {
17 const response = await translateWithOpenAI(text);
18 console.log(`translated to: ${response}`);
19 ctx.reply(response);
33
34
35async function translateWithOpenAI(text: string) {
36 const openai = new OpenAI();
37 const completion = await openai.chat.completions.create({
38 messages: [
39 {

selectmain.ts16 matches

@salon•Updated 2 months ago
4// SERVER-SIDE LOGIC (TypeScript)
5// =============================================================================
6import { OpenAI } from "https://esm.town/v/std/openai";
7
8// --- Configuration ---
23 maskSrc?: string;
24}
25interface OpenAIResponse {
26 races: RaceInfo[];
27}
105];
106
107// --- OpenAI Generation Function ---
108async function generateRaceDataWithOpenAI(): Promise<RaceInfo[]> {
109 const openai = new OpenAI();
110 const numToRequest = Math.max(1, NUM_CARDS_TO_GENERATE);
111 const prompt =
126Return STRICTLY as a single JSON object: { "races": [ { race1 }, { race2 }, ... ] }. No introductory text or explanations outside the JSON structure.`;
127 try {
128 console.info(`Requesting ${numToRequest} race data generation from OpenAI...`);
129 const completion = await openai.chat.completions.create({
130 model: "gpt-4o",
131 messages: [{ role: "user", content: prompt }],
134 });
135 const rawContent = completion.choices[0]?.message?.content;
136 if (!rawContent) throw new Error("OpenAI returned an empty response message.");
137
138 let parsedJson;
140 parsedJson = JSON.parse(rawContent);
141 } catch (parseError) {
142 console.error("Failed to parse OpenAI JSON response:", parseError);
143 console.error("Raw OpenAI response:", rawContent);
144 throw new Error(`JSON Parsing Error: ${parseError.message}`);
145 }
160 ) {
161 console.warn(
162 `OpenAI response JSON failed validation for ${numToRequest} races:`,
163 JSON.stringify(parsedJson, null, 2),
164 );
165 throw new Error(
166 "OpenAI response JSON structure, count, data types, color format, hint value, or mask URL invalid.",
167 );
168 }
169
170 const generatedData = (parsedJson as OpenAIResponse).races.map(race => ({
171 ...race,
172 borderAnimationHint: race.borderAnimationHint || "none",
173 }));
174 console.info(`Successfully generated and validated ${generatedData.length} races from OpenAI.`);
175 return generatedData;
176 } catch (error) {
177 console.error("Error fetching or processing data from OpenAI:", error);
178 console.warn("Using fallback race data due to the error.");
179 return fallbackRaceData.slice(0, numToRequest).map(race => ({
186// --- Main HTTP Handler (Val Town Entry Point) ---
187export default async function server(request: Request): Promise<Response> {
188 const activeRaceData = await generateRaceDataWithOpenAI();
189
190 const css = `

ArabicChef_Botmain.tsx5 matches

@ynonp•Updated 2 months ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2import { telegramSendMessage } from "https://esm.town/v/vtdocs/telegramSendMessage?v=5";
3import {
15 console.log(`received: ${text}`)
16 if (text) {
17 const response = await translateWithOpenAI(text);
18 console.log(`translated to: ${response}`);
19 ctx.reply(response);
33
34
35async function translateWithOpenAI(text: string) {
36 const openai = new OpenAI();
37 const completion = await openai.chat.completions.create({
38 messages: [
39 {

SpanishPanda_botmain.tsx5 matches

@ynonp•Updated 2 months ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2import { telegramSendMessage } from "https://esm.town/v/vtdocs/telegramSendMessage?v=5";
3import {
15 console.log(`received: ${text}`)
16 if (text) {
17 const response = await translateToSpanishWithOpenAI(text);
18 console.log(`translated to: ${response}`);
19 ctx.reply(response);
33
34
35async function translateToSpanishWithOpenAI(text: string) {
36 const openai = new OpenAI();
37 const completion = await openai.chat.completions.create({
38 messages: [
39 {

mandateagents.ts9 matches

@salon•Updated 2 months ago
3import { AgentContext, AgentInput, AgentOutput } from "https://esm.town/v/salon/mandate/interfaces.ts";
4import { fetch } from "https://esm.town/v/std/fetch";
5import { OpenAI } from "https://esm.town/v/std/openai";
6
7// Summarizer Agent (unchanged, but shown for completeness)
23 }
24
25 const openai = new OpenAI();
26
27 log("INFO", "SummarizerAgent", "Generating summary with OpenAI...");
28 const completion = await openai.chat.completions.create({
29 messages: [
30 {
40
41 if (summary === "Could not generate summary.") {
42 log("WARN", "SummarizerAgent", "OpenAI did not return a valid summary content.");
43 }
44
267 }
268
269 const openai = new OpenAI();
270 log("INFO", "CombinerAgent", "Combining text with OpenAI...");
271 const completion = await openai.chat.completions.create({
272 messages: [
273 {
294
295 if (combined === "Could not combine information.") {
296 log("WARN", "CombinerAgent", "OpenAI did not return valid combined content.");
297 }
298

whatsapp-callbackindex.tsx1 match

@yawnxyz•Updated 2 months ago
177 try {
178 console.log(`[SmartAck] Attempting to generate smart ack for: "${userQuery.substring(0, 50)}..." with ${QUICK_ACK_MODEL}`);
179 const groqResponse = await fetch("https://api.groq.com/openai/v1/chat/completions", {
180 method: "POST",
181 headers: {
GitHub-Release-Notes

GitHub-Release-Notesllm.ts5 matches

@charmaine•Updated 2 months ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2import { CommitWithPR, ReleaseNote } from "../shared/types.ts";
3
4// Initialize OpenAI client
5const openai = new OpenAI();
6
7/**
186`;
187
188 // Call the OpenAI API
189 const completion = await openai.chat.completions.create({
190 model: "gpt-4o",
191 messages: [

openai2 file matches

@wangqiao1234•Updated 1 week ago

openaiproxy2 file matches

@wangqiao1234•Updated 1 week ago
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