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=12&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 1953 results for "openai"(2777ms)

Townie.cursorrules4 matches

@kenethcosam•Updated 1 week 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" },

DentalAI-POC-LLM3ImportfromOpenAI.tsx2 matches

@Dentalabcs•Updated 1 week ago
1// === Replace these with your real keys/numbers ===
2const openai = new OpenAI({ apiKey: "sk-..." });
3const clinicianPhone = "+1YOURCELLPHONE";
4const twilioNumber = "+1YOURTWILIONUMBER";
10 `A dental patient asked: "${question}". Write 3 short, professional draft responses a dentist could choose from. Keep each under 30 words.`;
11
12 const result = await openai.chat.completions.create({
13 model: "gpt-4",
14 messages: [{ role: "user", content: prompt }],

Twilio--LLMParttwo.tsx2 matches

@Dentalabcs•Updated 1 week ago
1// === Replace these with your real keys/numbers ===
2const openai = new OpenAI({ apiKey: "sk-..." });
3const clinicianPhone = "+1YOURCELLPHONE";
4const twilioNumber = "+1YOURTWILIONUMBER";
9const prompt = `A dental patient asked: "${question}". Write 3 short, professional draft responses a dentist could choose from. Keep each under 30 words.`;
10
11const result = await openai.chat.completions.create({
12model: "gpt-4",
13messages: [{ role: "user", content: prompt }],

critopenai_service.ts11 matches

@join•Updated 1 week ago
1// src/openai_service.ts
2import { LogFunction } from "https://esm.town/v/join/crit/types";
3import { OpenAI } from "https://esm.town/v/std/openai"; // Val Town specific import
4
5/**
6 * Invokes the OpenAI Chat Completion API with specified prompts and parameters.
7 * @param systemPrompt The system message to guide the AI's behavior.
8 * @param userPrompt The user's message or query.
13 * @throws Error if the API call fails critically.
14 */
15export async function invokeOpenAIChatCompletion(
16 systemPrompt: string,
17 userPrompt: string,
22 logger(
23 "AUDIT",
24 "OpenAIService",
25 `Initiating LLM call for task ${taskId}`,
26 { systemPromptLength: systemPrompt.length, userPromptLength: userPrompt.length },
30
31 try {
32 const openAIClient = new OpenAI(); // API key should be configured via environment variables
33
34 const completion = await openAIClient.chat.completions.create({
35 model: "gpt-4o-mini", // Consider making this configurable
36 messages: [
49 logger(
50 "WARN",
51 "OpenAIService",
52 `LLM call for task ${taskId} yielded no content.`,
53 { usageData, finishReason },
60 logger(
61 "INFO",
62 "OpenAIService",
63 `LLM call for task ${taskId} successful.`,
64 { responseLength: responseText.length, usageData, finishReason },
79 logger(
80 "CRITICAL",
81 "OpenAIService",
82 `LLM call for task ${taskId} failed: ${error.message}`,
83 { error: errorDetails },
86 );
87 throw new Error(
88 `OpenAI Service Failure: ${error.message}`
89 + (error.code ? ` (Code: ${error.code}, Status: ${error.status})` : ` (Status: ${error.status})`),
90 );

critai_agent_runner.ts5 matches

@join•Updated 1 week ago
1// src/ai_agent_runner.ts
2import { invokeOpenAIChatCompletion } from "https://esm.town/v/join/crit/openai_service";
3import {
4 BaseIncidentContext,
51 }
52
53 const rawOpenAIResult = await invokeOpenAIChatCompletion(
54 systemPrompt,
55 userPrompt,
58 logger,
59 );
60 if (!rawOpenAIResult) {
61 const msg = `LLM returned no content for task ${taskId}.`;
62 logger("WARN", agentName, msg, {}, masterIncidentId, taskId);
66 let parsedOutput: T_Output;
67 try {
68 parsedOutput = outputSchemaParser(rawOpenAIResult);
69 } catch (parseError: any) {
70 const msg = `Failed to parse LLM output for task ${taskId}. Error: ${parseError.message}`;
73 agentName,
74 msg,
75 { rawResponsePreview: rawOpenAIResult.substring(0, 500) },
76 masterIncidentId,
77 taskId,

con-juanREADME.md1 match

@Downchuck•Updated 1 week ago
24### Analyzer
25
26The analyzer module provides the core functionality for identifying subtle forms of abuse in text. It uses OpenAI's GPT-4o model to analyze text and extract patterns of abuse, manipulation, and problematic language.
27
28Key functions:

con-juanAUTOBOT.md1 match

@Downchuck•Updated 1 week ago
11### Core Components
12
13- **Backend API** (`power-abuse-analyzer.ts`): Analyzes text for subtle abuse patterns using OpenAI's GPT-4o model
14- **Frontend Interface** (`frontend/index.html`): A user-friendly chat interface for interacting with the analyzer
15- **Static File Server** (`static-file-server.ts`): Serves the frontend files

emailSummaryHandler360main.tsx3 matches

@null360up•Updated 1 week ago
2import { email } from "https://esm.town/v/std/email";
3import { extractValInfo } from "https://esm.town/v/stevekrouse/extractValInfo";
4import { OpenAI } from "npm:openai";
5
6function stripHtmlBackticks(html: string): string {
9
10export default async function(e: Email) {
11 const openai = new OpenAI();
12 console.log(`from: ${e.from} to: ${e.to} subject: ${e.subject}, cc: ${e.cc}, bcc: ${e.bcc}`);
13
25 }
26
27 const summary = await openai.chat.completions.create({
28 messages: [
29 {

emailSummaryHandlermain.tsx3 matches

@null360up•Updated 1 week ago
2import { email } from "https://esm.town/v/std/email";
3import { extractValInfo } from "https://esm.town/v/stevekrouse/extractValInfo";
4import { OpenAI } from "npm:openai";
5
6function stripHtmlBackticks(html: string): string {
9
10export default async function(e: Email) {
11 const openai = new OpenAI();
12 console.log(`from: ${e.from} to: ${e.to} subject: ${e.subject}, cc: ${e.cc}, bcc: ${e.bcc}`);
13
25 }
26
27 const summary = await openai.chat.completions.create({
28 messages: [
29 {

qriseREADME.md1 match

@BathSalt1•Updated 1 week ago
47- **Frontend**: React with TypeScript
48- **Visualizations**: Canvas API, SVG animations
49- **AI Simulation**: OpenAI API for entity communication
50- **Data Storage**: Val Town blob storage
51- **Styling**: TailwindCSS with custom neon effects

openaiproxy2 file matches

@skutaans•Updated 3 days ago

token-server1 file match

@kwhinnery_openai•Updated 3 days ago
Mint tokens to use with the OpenAI Realtime API for WebRTC
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