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=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 1576 results for "openai"(1672ms)

testOpenAI1 file match

@stevekrouse•Updated 19 hours ago

testOpenAI1 file match

@shouser•Updated 2 days ago

stevens-openai5 file matches

@yash_ing•Updated 1 week ago

fetchAndStoreOpenAiUsage22 file matches

@nbbaier•Updated 2 weeks ago

openaiPricing9 file matches

@nbbaier•Updated 2 weeks ago
Project created from val URLs

OpenAI2 file matches

@dmartinez•Updated 3 weeks ago

openaiStreamingDemo2 file matches

@stevekrouse•Updated 1 month ago

openaistreaminghtml2 file matches

@stevekrouse•Updated 1 month ago

OpenAIProxy1 file match

@harveyfullstack•Updated 1 month ago

OpenAI2 file matches

@mjoshimanhar•Updated 2 months ago

growingEmeraldGrasshoppermain.tsx5 matches

@speedadd•Updated 10 hours ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import OpenAI from "https://esm.sh/openai@4.28.4";
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4import React, { useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
423 if (request.method === "POST" && new URL(request.url).pathname === "/chat") {
424 try {
425 const openai = new OpenAI({
426 apiKey:
427 "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",
432 console.log("Received messages:", JSON.stringify(messages, null, 2));
433
434 // Prepare messages for OpenAI API
435 const formattedMessages = [
436 { role: "system", content: CHARACTER_DESCRIPTION },
443 console.log("Formatted messages:", JSON.stringify(formattedMessages, null, 2));
444
445 const completion = await openai.chat.completions.create({
446 messages: formattedMessages,
447 model: "gpt-3.5-turbo",
453 });
454
455 console.log("OpenAI Response:", JSON.stringify(completion.choices[0].message, null, 2));
456
457 return Response.json({

untitled-9126new-file-3797.tsx3 matches

@xiaofei•Updated 18 hours ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2
3export default async function(req: Request): Promise<Response> {
11 });
12 }
13 const openai = new OpenAI();
14
15 try {
28 }
29
30 const stream = await openai.chat.completions.create(body);
31
32 if (!body.stream) {
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": "*",