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/$1?q=openai&page=49&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 2159 results for "openai"(1601ms)

beeGPTfrontend.html1 match

@armadillomike•Updated 3 weeks ago
359 <footer class="bg-yellow-500 text-black p-3 text-center text-sm">
360 <p>
361 BeeGPT - Powered by OpenAI | <a
362 href="https://val.town"
363 target="_top"

beeGPTindex.tsx15 matches

@armadillomike•Updated 3 weeks ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2import { readFile } from "https://esm.town/v/std/utils@85-main/index.ts";
3
4// Initialize OpenAI client
5const openai = new OpenAI();
6
7// Bee-themed personality prompt
62 }
63
64 // Call OpenAI with bee persona
65 const completion = await openai.chat.completions.create({
66 model: "gpt-4o-mini",
67 messages: [
110 try {
111 // Generate image using DALL-E
112 const response = await openai.images.generate({
113 model: "dall-e-3",
114 prompt: enhancedPrompt,
119 });
120
121 console.log("OpenAI response:", JSON.stringify(response));
122
123 const imageUrl = response.data[0]?.url;
124
125 if (!imageUrl) {
126 throw new Error("No image URL returned from OpenAI");
127 }
128
136 },
137 );
138 } catch (openaiError) {
139 console.error("OpenAI API Error:", openaiError);
140
141 // Check if it's a content policy violation
142 if (openaiError.message && openaiError.message.includes("content policy")) {
143 return new Response(
144 JSON.stringify({
145 error: "Your image request was rejected due to content policy. Please try a different prompt.",
146 details: openaiError.message,
147 }),
148 {
154
155 // Check if it's a rate limit error
156 if (openaiError.message && openaiError.message.includes("rate limit")) {
157 return new Response(
158 JSON.stringify({
159 error: "Rate limit exceeded. Please try again later.",
160 details: openaiError.message,
161 }),
162 {
167 }
168
169 throw openaiError; // Re-throw for general error handling
170 }
171 } catch (error) {

beeAiindex.ts15 matches

@armadillomike•Updated 3 weeks ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2import { readFile } from "https://esm.town/v/std/utils@85-main/index.ts";
3
4// Initialize OpenAI client
5const openai = new OpenAI();
6
7// Bee-themed personality prompt
62 }
63
64 // Call OpenAI with bee persona
65 const completion = await openai.chat.completions.create({
66 model: "gpt-4o-mini",
67 messages: [
110 try {
111 // Generate image using DALL-E
112 const response = await openai.images.generate({
113 model: "dall-e-3",
114 prompt: enhancedPrompt,
119 });
120
121 console.log("OpenAI response:", JSON.stringify(response));
122
123 const imageUrl = response.data[0]?.url;
124
125 if (!imageUrl) {
126 throw new Error("No image URL returned from OpenAI");
127 }
128
136 },
137 );
138 } catch (openaiError) {
139 console.error("OpenAI API Error:", openaiError);
140
141 // Check if it's a content policy violation
142 if (openaiError.message && openaiError.message.includes("content policy")) {
143 return new Response(
144 JSON.stringify({
145 error: "Your image request was rejected due to content policy. Please try a different prompt.",
146 details: openaiError.message,
147 }),
148 {
154
155 // Check if it's a rate limit error
156 if (openaiError.message && openaiError.message.includes("rate limit")) {
157 return new Response(
158 JSON.stringify({
159 error: "Rate limit exceeded. Please try again later.",
160 details: openaiError.message,
161 }),
162 {
167 }
168
169 throw openaiError; // Re-throw for general error handling
170 }
171 } catch (error) {

Bee_AIindex.tsx3 matches

@quartex•Updated 3 weeks ago
236export default async function server(request: Request): Promise<Response> {
237 if (request.method === "POST") {
238 const { OpenAI } = await import("https://esm.town/v/std/openai");
239 const openai = new OpenAI();
240
241 const { question } = await request.json();
242
243 const completion = await openai.chat.completions.create({
244 messages: [
245 {

AkashREADME.md1 match

@Akashashn•Updated 3 weeks ago
7- `index.ts` - Main API entry point with Hono framework (HTTP trigger)
8- `database.ts` - SQLite database operations for storing resumes and job requirements
9- `parser.ts` - Resume parsing logic using OpenAI's GPT models
10- `scorer.ts` - Candidate scoring algorithms and feedback generation
11

Akashscorer.ts3 matches

@Akashashn•Updated 3 weeks ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2import type { Resume, JobRequirement, ScoringResult, ParsedResumeData } from "../shared/types";
3import { calculateSimilarity } from "../shared/utils";
4
5const openai = new OpenAI();
6
7/**
197 `;
198
199 const completion = await openai.chat.completions.create({
200 messages: [{ role: "user", content: prompt }],
201 model: "gpt-4o-mini",

Akashparser.ts7 matches

@Akashashn•Updated 3 weeks ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2import type { ParsedResumeData } from "../shared/types";
3
4const openai = new OpenAI();
5
6/**
7 * Parses resume text using OpenAI to extract structured information
8 */
9export async function parseResume(resumeText: string): Promise<ParsedResumeData> {
48 `;
49
50 const completion = await openai.chat.completions.create({
51 messages: [{ role: "user", content: prompt }],
52 model: "gpt-4o-mini",
57 const content = completion.choices[0]?.message?.content;
58 if (!content) {
59 throw new Error("Failed to get a response from OpenAI");
60 }
61
104 `;
105
106 const completion = await openai.chat.completions.create({
107 messages: [{ role: "user", content: prompt }],
108 model: "gpt-4o-mini",
113 const content = completion.choices[0]?.message?.content;
114 if (!content) {
115 throw new Error("Failed to get a response from OpenAI");
116 }
117

AkashREADME.md2 matches

@Akashashn•Updated 3 weeks ago
5## Features
6
7- Resume text analysis using OpenAI's GPT models
8- Keyword extraction and skills matching
9- Candidate scoring and ranking
40## Technologies Used
41
42- OpenAI API for natural language processing
43- SQLite for data storage
44- Hono for backend API

untitled-2444index.ts10 matches

@all•Updated 3 weeks ago
6import { SyntaxHighlighter } from "./components/SyntaxHighlighter.ts";
7import { DebugConsole } from "./components/DebugConsole.ts";
8import { OpenAIConnector } from "../shared/OpenAIConnector.ts";
9import { ThemeManager } from "./components/ThemeManager.ts";
10import { ConfettiManager } from "./components/ConfettiManager.ts";
18 const syntaxHighlighter = new SyntaxHighlighter();
19 const debugConsole = new DebugConsole();
20 const openAIConnector = new OpenAIConnector();
21 const themeManager = new ThemeManager();
22 const confettiManager = new ConfettiManager();
27
28 // Set up all event handlers
29 setupFormHandling(tokenizer, scriptEditor, syntaxHighlighter, openAIConnector, confettiManager, textFormatter);
30 setupTokenCounter(tokenizer);
31 setupTemplateSelector(templateManager);
32 setupAdvancedOptions(openAIConnector, debugConsole);
33 setupResultActions(scriptEditor, textFormatter);
34 setupHistoryModal(historyManager, scriptEditor);
51 scriptEditor: ScriptEditor,
52 syntaxHighlighter: SyntaxHighlighter,
53 openAIConnector: OpenAIConnector,
54 confettiManager: ConfettiManager,
55 textFormatter: TextFormatter
144 const apiKeyInput = document.getElementById("apiKey") as HTMLInputElement;
145 if (apiKeyInput && apiKeyInput.value && localStorage.getItem("useDirectApi") === "true") {
146 // Process directly with OpenAI API
147 const prompt = createPromptForScriptType(
148 text,
153 );
154
155 const response = await openAIConnector.createChatCompletion({
156 model,
157 messages: [{ role: "user", content: prompt }],
314
315// Set up advanced options
316function setupAdvancedOptions(openAIConnector: OpenAIConnector, debugConsole: DebugConsole) {
317 const advancedOptionsBtn = document.getElementById("advancedOptionsBtn") as HTMLButtonElement;
318 const advancedOptions = document.getElementById("advancedOptions") as HTMLDivElement;
350
351 if (!apiKey.startsWith("sk-")) {
352 alert("Invalid API key format. OpenAI API keys start with 'sk-'");
353 return;
354 }
356 try {
357 // Set the API key in the connector
358 openAIConnector.setApiKey(apiKey);
359
360 // Store the preference (but not the key itself)

untitled-2444index.html2 matches

@all•Updated 3 weeks ago
318 <div class="md:col-span-3">
319 <div class="flex items-center justify-between">
320 <label for="apiKey" class="block text-sm font-medium text-gray-700 dark:text-gray-300">OpenAI API Key (Optional)</label>
321 <span class="text-xs text-gray-500 dark:text-gray-400">Direct API connection</span>
322 </div>
649
650 <footer class="mt-8 text-center text-sm text-gray-500 dark:text-gray-400">
651 <p>Powered by OpenAI GPT-4 • <a href="#" id="viewSourceLink" target="_top" class="text-indigo-600 dark:text-indigo-400 hover:underline">View Source</a></p>
652 </footer>
653 </div>

openai-client1 file match

@cricks_unmixed4u•Updated 3 days ago

openai_enrichment6 file matches

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