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?q=openai&page=128&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 1603 results for "openai"(1668ms)

resumeRecsmain.tsx1 match

@iamseeley•Updated 11 months ago
9 }
10
11 const endpoint = 'https://api.openai.com/v1/chat/completions';
12 const model = 'gpt-4';
13

whiteSnailmain.tsx3 matches

@ylno•Updated 11 months ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2
3const openai = new OpenAI();
4
5const completion = await openai.chat.completions.create({
6 messages: [
7 { role: "user", content: "Tell a story" },

translatormain.tsx8 matches

@stevekrouse•Updated 11 months ago
3import { Hono } from "npm:hono@3";
4import { html } from "npm:hono@3/html";
5import { OpenAI } from "npm:openai";
6
7const app = new Hono();
8const openai = new OpenAI(Deno.env.get("OPENAI_API_KEY_VOICE"));
9
10class TranscriptionService {
11 async transcribeAudio(audioFile) {
12 try {
13 const transcription = await openai.audio.transcriptions.create({
14 file: audioFile,
15 model: "whisper-1",
19 return transcription;
20 } catch (error) {
21 console.error("OpenAI API error:", error);
22 throw error;
23 }
405
406 try {
407 const response = await openai.chat.completions.create({
408 model: "gpt-3.5-turbo",
409 messages: [
423 return c.text(translation);
424 } catch (error) {
425 console.error("OpenAI API error:", error);
426 return c.text("Error occurred during translation", 500);
427 }
438
439 try {
440 const mp3 = await openai.audio.speech.create({
441 model: "tts-1",
442 voice: voice,
450 });
451 } catch (error) {
452 console.error("OpenAI API error:", error);
453 return c.text("Error occurred during speech generation", 500);
454 }

translatorREADME.md1 match

@stevekrouse•Updated 11 months ago
3The app is set up so you can easily have a conversation between two people. The app will translate between the two selected languages, in each voice, as the speakers talk.
4
5Add your OpenAI API Key, and make sure to open in a separate window for Mic to work.
6
7Migrated from folder: Archive/translator

valwritermain.tsx5 matches

@stevekrouse•Updated 11 months ago
3import { basicAuth } from "https://esm.town/v/pomdtr/basicAuth?v=62";
4import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
5import { chat } from "https://esm.town/v/stevekrouse/openai";
6import cronstrue from "npm:cronstrue";
7import { Hono } from "npm:hono@3";
117 await email({ subject: "Subject line", text: "Body of message" });
118
119 // OpenAI
120 import { OpenAI } from "https://esm.town/v/std/openai";
121 const openai = new OpenAI();
122 const completion = await openai.chat.completions.create({
123 messages: [
124 { role: "user", content: "Say hello in a creative way" },

blobImagesmain.tsx1 match

@jdan•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

blobImagesmain.tsx1 match

@stevekrouse•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

emojiGuessrmain.tsx1 match

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

gpt4o_emojimain.tsx1 match

@jdan•Updated 11 months ago
1import { chat } from "https://esm.town/v/stevekrouse/openai?v=19";
2
3export async function getGPT4oEmoji(url) {

homelessREADME.md1 match

@cameronpak•Updated 11 months ago
8
9## Why a [ChatGPT Assistant](https://chatg.pt/homeless-help)?
10- OpenAI announced on May 13, 2024 that free users will soon be able to "discover and use GPTs and the GPT Store ([OpenAI](https://openai.com/index/gpt-4o-and-more-tools-to-chatgpt-free/))"
11- There's a larger number of people experiencing homelessness who own a phone than what I imagined.
12- ChatGPT allows for a simple interface, even with voice chat (a more natural way to navigate the tool), to find resources to help those experiencing homelessness. And, it's fast!

translateToEnglishWithOpenAI1 file match

@shlmt•Updated 1 day ago

testOpenAI1 file match

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