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/image-url.jpg%20%22Image%20title%22?q=openai&page=109&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 3227 results for "openai"(1683ms)

Townie.cursorrules4 matches

@prayaasUpdated 3 months ago
94Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
95
96### OpenAI
97
98```ts
99import { OpenAI } from "https://esm.town/v/std/openai";
100const openai = new OpenAI();
101const completion = await openai.chat.completions.create({
102 messages: [
103 { role: "user", content: "Say hello in a creative way" },

Townie-2system_prompt.txt4 matches

@dinavinterUpdated 3 months ago
88Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
89
90### OpenAI
91
92```ts
93import { OpenAI } from "https://esm.town/v/std/openai";
94const openai = new OpenAI();
95const completion = await openai.chat.completions.create({
96 messages: [
97 { role: "user", content: "Say hello in a creative way" },

Townie-2.cursorrules4 matches

@dinavinterUpdated 3 months ago
94Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
95
96### OpenAI
97
98```ts
99import { OpenAI } from "https://esm.town/v/std/openai";
100const openai = new OpenAI();
101const completion = await openai.chat.completions.create({
102 messages: [
103 { role: "user", content: "Say hello in a creative way" },

min-md-blogtest.md3 matches

@arfanUpdated 3 months ago
263:::customcard2
264{
265 "link": "https://x.com/OpenAi",
266 "imageSrc": "https://pbs.twimg.com/profile_images/1885410181409820672/ztsaR0JW_400x400.jpg",
267 "title": "OpenAi",
268 "description": "Follow OpenAI on X for updates!",
269 "icon": "simple-icons:x",
270 "width": "w-48",

Townsystem_prompt.txt4 matches

@loadingUpdated 3 months ago
88Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
89
90### OpenAI
91
92```ts
93import { OpenAI } from "https://esm.town/v/std/openai";
94const openai = new OpenAI();
95const completion = await openai.chat.completions.create({
96 messages: [
97 { role: "user", content: "Say hello in a creative way" },

Town.cursorrules4 matches

@loadingUpdated 3 months ago
94Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
95
96### OpenAI
97
98```ts
99import { OpenAI } from "https://esm.town/v/std/openai";
100const openai = new OpenAI();
101const completion = await openai.chat.completions.create({
102 messages: [
103 { role: "user", content: "Say hello in a creative way" },

thirdTimer.cursorrules4 matches

@nbbaierUpdated 3 months ago
94Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
95
96### OpenAI
97
98```ts
99import { OpenAI } from "https://esm.town/v/std/openai";
100const openai = new OpenAI();
101const completion = await openai.chat.completions.create({
102 messages: [
103 { role: "user", content: "Say hello in a creative way" },

voicemessagesvoicenotes.ts3 matches

@michaelwschultzUpdated 3 months ago
1import { type Context, Hono } from "https://esm.sh/hono@3.11.7";
2import { blob } from "https://esm.town/v/std/blob";
3import { OpenAI } from "https://esm.town/v/std/openai";
4import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
5import Groq from "npm:groq-sdk";
16
17const app = new Hono();
18const openai = new OpenAI();
19
20// Get all voice notes (for admin/dashboard)
153async function transcribeAudio(voiceNoteId: string, audioBuffer: ArrayBuffer) {
154 try {
155 // Convert ArrayBuffer to File for OpenAI
156 const audioFile = new File([audioBuffer], "audio.webm", { type: "audio/webm" });
157

voicemessagesREADME.md2 matches

@michaelwschultzUpdated 3 months ago
6
7- 🎙️ Record voice notes directly in the browser
8- 🤖 AI-powered transcription using OpenAI Whisper
9- 🔗 Share voice notes via unique URLs
10- ⏰ Set expiration by max listens or date
53- **Database**: SQLite for voice note metadata
54- **Storage**: Val Town Blob storage for audio files
55- **AI**: OpenAI Whisper for transcription
56- **Frontend**: React with TypeScript
57- **Styling**: TailwindCSS

intentmain.tsx11 matches

@legalUpdated 3 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { OpenAI } from "https://esm.town/v/std/openai";
3import { PDFExtract, PDFExtractOptions } from "npm:pdf.js-extract";
4
173}
174
175async function callOpenAI(
176 openaiInstance: OpenAI,
177 systemPrompt: string,
178 userMessage: string,
182 agentName: string,
183): Promise<object | string> {
184 log.push({ agent: agentName, type: "step", message: `Calling OpenAI model ${model}...` });
185 try {
186 const response = await openaiInstance.chat.completions.create({
187 model: model,
188 messages: [
222 }
223 } catch (error) {
224 console.error(agentName, "OpenAI API call error:", error);
225 let errMsg = "AI communication error.";
226 if (error.message) errMsg += ` Message: ${error.message}`;
1072 <li>**No client-side persistence of documents and analyses**</li>
1073 </ul>
1074 <p>This application uses OpenAI's GPT models for its AI capabilities. Data submitted will be processed by OpenAI.</p>
1075 </div>
1076 \`;
1085
1086export default async function(req: Request) {
1087 const openai = new OpenAI();
1088 const url = new URL(req.url);
1089 const format = url.searchParams.get("format");
1154 const suggPrompt = legalTaskSuggestionSystemPromptTemplate.replace("%%DOCUMENT_TEXT%%", suggText);
1155 const suggAgent = "Task Suggestion AI (LLM1)";
1156 const suggRes = await callOpenAI(
1157 openai,
1158 suggPrompt,
1159 "Generate task suggestions based on the provided document text.",
1303
1304 const analysisAgent = "Legal Analysis AI (LLM2)";
1305 const aiRes = await callOpenAI(openai, finalPrompt, docToAnalyze, "gpt-4o", true, log, analysisAgent);
1306
1307 if (typeof aiRes === "object" && (aiRes as any).error) {

openai-usage1 file match

@nbbaierUpdated 23 hours ago

hello-realtime5 file matches

@jubertioaiUpdated 4 days ago
Sample app for the OpenAI Realtime API
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