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=1&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 3218 results for "openai"(1036ms)

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
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": "*",

consistmain.ts10 matches

@know•Updated 29 mins ago
1// @ts-ignore
2import { OpenAI } from "https://esm.town/v/std/openai?v=4";
3import { Hono } from "npm:hono@4.4.12";
4
104/**
105 * Executes a call to an AI agent with a specified prompt and user content.
106 * @param openai The OpenAI client instance.
107 * @param systemPrompt The system prompt defining the agent's role.
108 * @param userContent The user-provided content for analysis.
110 */
111async function callAgent<T>(
112 openai: OpenAI,
113 systemPrompt: string,
114 userContent: string,
115): Promise<T> {
116 const completion = await openai.chat.completions.create({
117 model: "gpt-4o",
118 messages: [
134 request: AnalysisRequest,
135): Promise<FullAnalysis> {
136 const openai = new OpenAI();
137 let cumulativeContext = "";
138
141 `Supposed Correct Response: """${request.supposed_correct_response}"""\nFinal Answer: """${request.final_answer}"""`;
142 const accuracy = await callAgent<AccuracyReport>(
143 openai,
144 ACCURACY_AGENT_PROMPT,
145 accuracyContext,
153 `Reasoning Steps to Analyze: """${request.reasoning_steps}"""\n\nContext from previous agent:${cumulativeContext}`;
154 const consistency = await callAgent<ConsistencyReport>(
155 openai,
156 CONSISTENCY_AGENT_PROMPT,
157 consistencyContext,
165 `Reasoning Steps to Analyze: """${request.reasoning_steps}"""\n\nContext from previous agents:${cumulativeContext}`;
166 const faithfulness = await callAgent<FaithfulnessReport>(
167 openai,
168 FAITHFULNESS_AGENT_PROMPT,
169 faithfulnessContext,
177 `Original Prompt: """${request.prompt}"""\nReasoning Steps to Analyze: """${request.reasoning_steps}"""\n\nContext from previous agents:${cumulativeContext}`;
178 const authenticity = await callAgent<AuthenticityReport>(
179 openai,
180 AUTHENTICITY_AGENT_PROMPT,
181 authenticityContext,
189 `Please synthesize the following agent reports:\n${cumulativeContext}`;
190 const final_report = await callAgent<FinalReport>(
191 openai,
192 CONTEXT_AGENT_PROMPT,
193 contextAgentContext,

gesturemain.ts3 matches

@know•Updated 14 hours ago
1// @ts-ignore
2import { OpenAI } from "https://esm.town/v/std/openai?v=4";
3// @ts-ignore
4import { blob } from "https://esm.town/v/std/blob?v=11";
405 if (req.method === "POST" && action === "classify") {
406 try {
407 const openai = new OpenAI();
408 const body = await req.json();
409
412 }
413
414 const completion = await openai.chat.completions.create({
415 model: "gpt-4o",
416 messages: [

hello-realtime5 file matches

@jubertioai•Updated 2 days ago
Sample app for the OpenAI Realtime API

openai-gemini1 file match

@ledudu•Updated 1 week ago