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=124&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 1594 results for "openai"(2014ms)

openaistreaminghtmlREADME.md1 match

@stevekrouse•Updated 11 months ago
1
2
3Migrated from folder: Archive/openaistreaminghtml

openaiStreamingDemoREADME.md1 match

@stevekrouse•Updated 11 months ago
1null
2
3Migrated from folder: Archive/openaiStreamingDemo

valTownChatGPTREADME.md1 match

@maxm•Updated 11 months ago
1# ChatGPT Implemented in Val Town
2
3Demonstrated how to use assistants and threads with the OpenAI SDK and how to stream the response with Server-Sent Events.
4
5<p align=center>

openAIStreamingREADME.md2 matches

@maxm•Updated 11 months ago
1# OpenAI Streaming - Assistant and Threads
2
3An example of using OpenAI to stream back a chat with an assistant. This example sends two messages to the assistant and streams back the responses when they come in.
4
5Example response:

imageDownSizermain.tsx1 match

@yawnxyz•Updated 11 months ago
4import { fileToDataURL } from "https://esm.town/v/stevekrouse/fileToDataURL";
5import { modifyImage } from "https://esm.town/v/stevekrouse/modifyImage";
6import { chat } from "https://esm.town/v/stevekrouse/openai";
7import { Hono } from "npm:hono@3";
8

OpenAIUsageREADME.md3 matches

@std•Updated 11 months ago
1# OpenAI Proxy Metrics
2
3We write openAI usage data to a `openai_usage` sqlite table. This script val is imported into the openai proxy. Use this val to run administrative scripts: https://www.val.town/v/std/OpenAIUsageScript
4
5Migrated from folder: openai/OpenAIUsage

templateModalTestmain.tsx1 match

@iamseeley•Updated 11 months ago
109 <path stroke-linecap="round" stroke-linejoin="round" d="M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 0 1-.825-.242m9.345-8.334a2.126 2.126 0 0 0-.476-.095 48.64 48.64 0 0 0-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0 0 11.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"></path>
110 </svg>
111 <div class="font-semibold group-hover:text-black">OpenAI chat completion</div>
112 </button>
113 <button class="group bg-gray-50 border-gray-300 flex items-center gap-2 overflow-hidden rounded border p-3 text-left transition-colors hover:border-blue-500 hover:shadow-md">

safeMessageBoardmain.tsx1 match

@jahabeebs•Updated 11 months ago
106 // checkManualProfanityList is optional and defaults to false; it checks for the words in lang.ts (if under 50 words) before hitting the AI model. Note that this affects performance.
107 checkManualProfanityList: false,
108 // provider defaults to "google-perspective-api" (Google's Perspective API); it can also be "openai" (OpenAI Moderation API) or "google-natural-language-api" (Google's Natural Language API)
109 provider: "google-perspective-api",
110 };

tanLadybugmain.tsx1 match

@stevekrouse•Updated 11 months ago
107 // checkManualProfanityList is optional and defaults to false; it checks for the words in lang.ts (if under 50 words) before hitting the AI model. Note that this affects performance.
108 checkManualProfanityList: false,
109 // provider defaults to "google-perspective-api" (Google's Perspective API); it can also be "openai" (OpenAI Moderation API) or "google-natural-language-api" (Google's Natural Language API)
110 provider: "google-perspective-api",
111 };

embeddingsSearchExamplemain.tsx3 matches

@yawnxyz•Updated 11 months ago
1import { embed, embedMany } from "npm:ai";
2import { openai } from "npm:@ai-sdk/openai";
3import lunr from "https://cdn.skypack.dev/lunr";
4
8 console.log(`Getting embedding for: ${text}`);
9 const { embedding } = await embed({
10 model: openai.embedding('text-embedding-3-small'),
11 value: text,
12 });
19 console.log(`Getting embeddings for texts: ${texts}`);
20 const { embeddings } = await embedMany({
21 model: openai.embedding('text-embedding-3-small'),
22 values: texts,
23 });

translateToEnglishWithOpenAI1 file match

@shlmt•Updated 15 hours ago

testOpenAI1 file match

@stevekrouse•Updated 2 days ago
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": "*",