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/$1?q=openai&page=37&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 2151 results for "openai"(829ms)

Towniesystem_prompt.txt4 matches

@mickydzi•Updated 2 weeks ago
88Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
89
90### OpenAI
91
92```ts
93import { OpenAI } from "https://esm.town/v/std/openai";
94const openai = new OpenAI();
95const completion = await openai.chat.completions.create({
96 messages: [
97 { role: "user", content: "Say hello in a creative way" },

Townie.cursorrules4 matches

@mickydzi•Updated 2 weeks ago
94Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
95
96### OpenAI
97
98```ts
99import { OpenAI } from "https://esm.town/v/std/openai";
100const openai = new OpenAI();
101const completion = await openai.chat.completions.create({
102 messages: [
103 { role: "user", content: "Say hello in a creative way" },

GPUNIONai-service.ts12 matches

@gpunion07•Updated 2 weeks ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2import { Video, ClipSuggestion, KeyframeInfo, TranscriptSegment } from '../../shared/types.ts';
3
4// Initialize OpenAI client
5const openai = new OpenAI();
6
7/**
25
26 // In a real implementation, we would analyze the actual video content
27 // For this demo, we'll simulate video analysis using OpenAI
28
29 // First, check if we have transcript data
70async function simulateTranscriptGeneration(video: Video): Promise<TranscriptSegment[]> {
71 // In a real implementation, we would use a speech-to-text service
72 // For this demo, we'll generate a fake transcript using OpenAI
73
74 const prompt = `Generate a realistic transcript for a ${video.duration || 300} second video titled "${video.title}".
78Format the response as a JSON array of objects with 'start', 'end', and 'text' properties.`;
79
80 const completion = await openai.chat.completions.create({
81 model: "gpt-4o-mini",
82 messages: [{ role: "user", content: prompt }],
114): Promise<KeyframeInfo[]> {
115 // In a real implementation, we would analyze video frames and audio
116 // For this demo, we'll use OpenAI to identify potential key moments from the transcript
117
118 const transcriptText = transcript.map(segment => segment.text).join(" ");
129Format the response as a JSON array of objects with 'time', 'confidence', and 'description' properties.`;
130
131 const completion = await openai.chat.completions.create({
132 model: "gpt-4o-mini",
133 messages: [{ role: "user", content: prompt }],
254): Promise<string> {
255 // In a real implementation, we would use more sophisticated NLP
256 // For this demo, we'll use OpenAI to generate a title
257
258 const transcriptText = relevantTranscript.map(segment => segment.text).join(" ");
267The title should be attention-grabbing and optimized for social media engagement.`;
268
269 const completion = await openai.chat.completions.create({
270 model: "gpt-4o-mini",
271 messages: [{ role: "user", content: prompt }],
286): Promise<string> {
287 // In a real implementation, we would use more sophisticated NLP
288 // For this demo, we'll use OpenAI to generate a description
289
290 const transcriptText = relevantTranscript.map(segment => segment.text).join(" ");
301Include relevant hashtags if appropriate.`;
302
303 const completion = await openai.chat.completions.create({
304 model: "gpt-4o-mini",
305 messages: [{ role: "user", content: prompt }],

GPUNIONREADME.md1 match

@gpunion07•Updated 2 weeks ago
36- **Backend**: Hono (API framework)
37- **Database**: SQLite
38- **AI Services**: OpenAI for content analysis, external video processing APIs
39- **Authentication**: JWT-based auth system
40- **Storage**: Val Town blob storage for metadata, external storage for video files

untitled-9908nlp.ts6 matches

@Mayuri•Updated 2 weeks ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2import { Resume, JobRequirement, ResumeScore } from "../shared/types.ts";
3
4// Initialize OpenAI client
5const openai = new OpenAI();
6
7/**
28 `;
29
30 const response = await openai.chat.completions.create({
31 model: "gpt-4o-mini",
32 messages: [{ role: "user", content: prompt }],
48
49/**
50 * Calculate similarity score between two texts using OpenAI embeddings
51 */
52export async function calculateSimilarity(text1: string, text2: string): Promise<number> {
53 const response = await openai.embeddings.create({
54 model: "text-embedding-3-small",
55 input: [text1, text2],

untitled-9908README.md1 match

@Mayuri•Updated 2 weeks ago
15- **Frontend**: HTML, CSS (Tailwind), and TypeScript with React
16- **Database**: SQLite for storing resumes and job requirements
17- **NLP/ML**: OpenAI embeddings for semantic matching
18
19## Project Structure

openai_api_project_PaulineREADME.md3 matches

@Paulineseemann•Updated 2 weeks ago
1# Small subset of OpenAI API
2
3>![WARNING]
9
10```bash
11curl 'https://www.val.town/v/YOUR_USER_NAME/openai_api' \
12 -H 'Content-Type: application/json' \
13 -X POST \
26
27```js
28const response = await fetch('https://www.val.town/v/YOUR_USER_NAME/openai_api', {
29 method: 'POST',
30 headers: {

openai_api_project_Paulinemain.ts6 matches

@Paulineseemann•Updated 2 weeks ago
1import Ajv from "https://esm.sh/ajv@8.13.0";
2import { OpenAI } from "https://esm.town/v/std/openai";
3
4const openai = new OpenAI();
5const sharedHeaders = {
6 "Access-Control-Allow-Origin": "*",
62 </head>
63 <body>
64 <h1>Small subset of OpenAI API</h1>
65
66 <blockquote>
75
76
77 <pre><code>curl 'https://www.val.town/v/YOUR_USER_NAME/openai_api'
78 -H 'Content-Type: application/json'
79 -X POST
89 <p>or in JS</p>
90
91 <pre><code>const response = await fetch('https://www.val.town/v/YOUR_USER_NAME/openai_api', {
92 method: 'POST',
93 headers: {
145 }
146
147 const completion = await openai.chat.completions.create({
148 ...body,
149 model: "gpt-3.5-turbo",

Towniesystem_prompt.txt4 matches

@kousun12•Updated 2 weeks ago
88Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
89
90### OpenAI
91
92```ts
93import { OpenAI } from "https://esm.town/v/std/openai";
94const openai = new OpenAI();
95const completion = await openai.chat.completions.create({
96 messages: [
97 { role: "user", content: "Say hello in a creative way" },

Townie.cursorrules4 matches

@kousun12•Updated 2 weeks ago
94Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
95
96### OpenAI
97
98```ts
99import { OpenAI } from "https://esm.town/v/std/openai";
100const openai = new OpenAI();
101const completion = await openai.chat.completions.create({
102 messages: [
103 { role: "user", content: "Say hello in a creative way" },

openai-client1 file match

@cricks_unmixed4u•Updated 3 days ago

openai_enrichment6 file matches

@stevekrouse•Updated 4 days ago
kwhinnery_openai
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