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/$%7Bsuccess?q=openai&page=23&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 1578 results for "openai"(1343ms)

promptEvolvermain.tsx8 matches

@toowiredโ€ขUpdated 2 weeks ago
6
7// โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€” Val.town/Backend Imports โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€” //
8import { OpenAI } from "https://esm.town/v/std/openai"; // For backend API call
9import { html } from "https://esm.town/v/stevekrouse/html"; // For serving HTML
10
444async function runImprovementPipeline(
445 originalText: string,
446 openai: OpenAI,
447): Promise<{ improvedText: string; coreIntentSummary: string }> {
448 console.log("Pipeline Step 1: Starting Intent Extraction for text length:", originalText.length);
450 try {
451 const intentPrompt = createIntentExtractionPrompt(originalText);
452 const intentCompletion = await openai.chat.completions.create({
453 model: AI_MODEL,
454 messages: [{ role: "user", content: intentPrompt }],
467 let improvedText = originalText;
468 try {
469 const mainCompletion = await openai.chat.completions.create({
470 model: AI_MODEL,
471 messages: [{ role: "user", content: mainImprovementPrompt }],
488export default async function server(req: Request): Promise<Response> {
489 const url = new URL(req.url);
490 const apiKey = Deno.env.get("OPENAI_API_KEY");
491
492 if (!apiKey) {
493 // ... (API key error handling remains the same) ...
494 const errorMsg = "Server configuration error: OPENAI_API_KEY secret not set.";
495 console.error(errorMsg);
496 if (req.method === "POST") return Response.json({ error: errorMsg }, { status: 500 });
497 return html(`<html><body><h1>Configuration Error</h1><p>${errorMsg}</p></body></html>`, { status: 500 });
498 }
499 const openai = new OpenAI({ apiKey: apiKey });
500
501 // --- API Endpoint (POST) ---
508
509 // Run the pipeline
510 const { improvedText, coreIntentSummary } = await runImprovementPipeline(text, openai);
511
512 // Return results

stevensDemo.cursorrules4 matches

@nicnzlโ€ขUpdated 2 weeks ago
100Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
101
102### OpenAI
103```ts
104import { OpenAI } from "https://esm.town/v/std/openai";
105const openai = new OpenAI();
106const completion = await openai.chat.completions.create({
107 messages: [
108 { role: "user", content: "Say hello in a creative way" },

stevensDemo.cursorrules4 matches

@arrawatiaโ€ขUpdated 2 weeks ago
100Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
101
102### OpenAI
103```ts
104import { OpenAI } from "https://esm.town/v/std/openai";
105const openai = new OpenAI();
106const completion = await openai.chat.completions.create({
107 messages: [
108 { role: "user", content: "Say hello in a creative way" },

stickfigure-stevensDemo.cursorrules4 matches

@stickfigureโ€ขUpdated 2 weeks ago
100Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
101
102### OpenAI
103```ts
104import { OpenAI } from "https://esm.town/v/std/openai";
105const openai = new OpenAI();
106const completion = await openai.chat.completions.create({
107 messages: [
108 { role: "user", content: "Say hello in a creative way" },

Wills-AI-Assistant.cursorrules4 matches

@willochoโ€ขUpdated 2 weeks ago
100Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
101
102### OpenAI
103```ts
104import { OpenAI } from "https://esm.town/v/std/openai";
105const openai = new OpenAI();
106const completion = await openai.chat.completions.create({
107 messages: [
108 { role: "user", content: "Say hello in a creative way" },

fortuitousSalmonFoxmain.tsx2 matches

@Luchydraโ€ขUpdated 2 weeks ago
6import React from "https://esm.sh/react@18.2.0";
7import { blob } from "https://esm.town/v/std/blob";
8import { OpenAI } from "https://esm.town/v/std/openai";
9import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
10
305export default async function server(request: Request): Promise<Response> {
306 const KEY = "fortuitousSalmonFox";
307 const openai = new OpenAI();
308 const url = new URL(request.url);
309

Girlswithjuicemain.tsx2 matches

@Luchydraโ€ขUpdated 2 weeks ago
6import React from "https://esm.sh/react@18.2.0";
7import { blob } from "https://esm.town/v/std/blob";
8import { OpenAI } from "https://esm.town/v/std/openai";
9import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
10
305export default async function server(request: Request): Promise<Response> {
306 const KEY = "Girlswithjuice";
307 const openai = new OpenAI();
308 const url = new URL(request.url);
309

lustrousApricotParakeetmain.tsx2 matches

@Luchydraโ€ขUpdated 2 weeks ago
6import React from "https://esm.sh/react@18.2.0";
7import { blob } from "https://esm.town/v/std/blob";
8import { OpenAI } from "https://esm.town/v/std/openai";
9import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
10
305export default async function server(request: Request): Promise<Response> {
306 const KEY = "lustrousApricotParakeet";
307 const openai = new OpenAI();
308 const url = new URL(request.url);
309

ValTownBlogget-old-posts.ts5 matches

@wolfโ€ขUpdated 2 weeks 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",

habitTrackerAppmain.tsx3 matches

@shouserโ€ขUpdated 2 weeks ago
19async function generateMotivation(userProgress) {
20 try {
21 const { OpenAI } = await import("https://esm.town/v/std/openai");
22 const openai = new OpenAI();
23
24 const motivationPrompt = `Generate a highly personalized, inspiring message for someone who has ${userProgress.totalHabits} habits, ${userProgress.completedHabits} completed habits, and an average streak of ${userProgress.averageStreak} days. Make it motivational and specific.`;
25
26 const response = await openai.chat.completions.create({
27 model: "gpt-4o-mini",
28 messages: [{ role: "user", content: motivationPrompt }],

testOpenAI1 file match

@stevekrouseโ€ขUpdated 1 day ago

testOpenAI1 file match

@shouserโ€ข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": "*",