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=95&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 1636 results for "openai"(581ms)

valreadmegeneratorREADME.md1 match

@prashamtrivedi•Updated 5 months ago
43- **Deno:** The server-side environment.
44- **ValTown SDK:** Integrated to fetch Val details.
45- **OpenAI GPT-4:** To generate natural language README content.
46- **JavaScript Modules (ESM):** For seamless module imports.
47

gpt4o_imagesmain.tsx3 matches

@bao•Updated 5 months ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2
3const openai = new OpenAI();
4const completion = await openai.chat.completions.create({
5 "messages": [
6 {

emojiVectorEmbeddingsmain.tsx5 matches

@maxm•Updated 5 months ago
2import emojis from "npm:emojis-list";
3import * as nodeEmoji from "npm:node-emoji";
4import { OpenAI } from "npm:openai";
5
6// Initialize OpenAI client
7const openai = new OpenAI();
8
9await sqlite.batch([
16// Get embedding for a single emoji
17async function getEmbedding(emoji: string): Promise<number[]> {
18 const result = await openai.embeddings.create({
19 input: emoji,
20 model: "text-embedding-3-small",
82// // Get embedding for a single emoji
83// async function getEmbedding(emoji: string): Promise<number[]> {
84// const result = await openai.embeddings.create({
85// input: emoji,
86// model: "text-embedding-3-small",

SermonGPTAPImain.tsx3 matches

@mjweaver01•Updated 5 months ago
95 // POST stream endpoint
96 if (request.method === "POST" && new URL(request.url).pathname === "/stream") {
97 const { OpenAI } = await import("https://esm.town/v/std/openai");
98 const openai = new OpenAI();
99 const { question } = await request.json();
100
103 const season = getSeason(currentDate);
104
105 const stream = await openai.chat.completions.create({
106 messages: [
107 {

dailyThoughtPromptmain.tsx4 matches

@chrisputnam9•Updated 5 months ago
1// OpenAI provided by val town
2import { OpenAI } from "https://esm.town/v/std/openai";
3// Email provided by val town
4import { email } from "https://esm.town/v/std/email";
28
29 // Now ask the AI to invent something
30 const openai = new OpenAI();
31 const completion = await openai.chat.completions.create({
32 messages: [
33 {

solicitousAmethystMeadowlarkmain.tsx3 matches

@youtubefree•Updated 5 months 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) {

sendSassyEmailmain.tsx4 matches

@transcendr•Updated 5 months ago
1import { email } from "https://esm.town/v/std/email";
2import { OpenAI } from "https://esm.town/v/std/openai";
3
4// Configuration object for customizing the sassy message generation
10 },
11
12 // Prompt configuration for OpenAI
13 prompts: {
14 // Array of different prompt styles to rotate through
32
33export default async function() {
34 const openai = new OpenAI();
35
36 // Randomly select a prompt style
39 ];
40
41 const completion = await openai.chat.completions.create({
42 messages: [
43 {

Ms_Spanglermain.tsx4 matches

@arthrod•Updated 5 months ago
287
288 try {
289 const { OpenAI } = await import("https://esm.town/v/std/openai");
290 const openai = new OpenAI();
291
292 const completion = await openai.chat.completions.create({
293 messages: [
294 {
307 });
308 } catch (error) {
309 console.error("OpenAI error:", error);
310 return c.json({ response: "Neural networks malfunctioning. Try again, human." });
311 }

openai_structured_output_demoREADME.md3 matches

@arthrod•Updated 5 months ago
1# OpenAI Structured Output Demo
2
3Ensure responses follow JSON Schema for structured outputs
5The following demo uses zod to describe and parse the response to JSON.
6
7Learn more in the [OpenAI Structured outputs
8 docs](https://platform.openai.com/docs/guides/structured-outputs/introduction).
9

openai_structured_output_demomain.tsx4 matches

@arthrod•Updated 5 months ago
1import { zodResponseFormat } from "https://esm.sh/openai/helpers/zod";
2import { z } from "https://esm.sh/zod";
3import { OpenAI } from "https://esm.town/v/std/openai";
4
5const openai = new OpenAI();
6
7const CalendarEvent = z.object({
11});
12
13const completion = await openai.beta.chat.completions.parse({
14 model: "gpt-4o-mini",
15 messages: [

translateToEnglishWithOpenAI1 file match

@shlmt•Updated 1 week ago

testOpenAI1 file match

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