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=36&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 2147 results for "openai"(789ms)

internshipapi.ts4 matches

@brigiallen•Updated 2 weeks ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { OpenAI } from "https://esm.town/v/std/openai";
3import { getAllTools, getToolsByCategory, getToolById, searchTools } from "../database/queries";
4import { AITool, SearchRequest, ToolCategory } from "../../shared/types";
5
6const api = new Hono();
7const openai = new OpenAI();
8
9// Get all tools
65 const allTools = await getAllTools();
66
67 // Use OpenAI to analyze the query and recommend tools
68 const aiResponse = await openai.chat.completions.create({
69 model: "gpt-4o-mini",
70 messages: [

internshipREADME.md1 match

@brigiallen•Updated 2 weeks ago
46- Frontend: React with Tailwind CSS
47- Backend: Hono API framework
48- AI: OpenAI for query understanding and tool recommendations
49- Database: SQLite for tool information storage

SmartQuizmain.tsx4 matches

@slinfo•Updated 2 weeks ago
2import React, { useState, useEffect, useCallback } from "https://esm.sh/react@18.2.0";
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4import { OpenAI } from "https://esm.town/v/std/openai";
5
6// Enhanced subjects with more detailed metadata
394
395export default async function server(request: Request): Promise<Response> {
396 const { OpenAI } = await import("https://esm.town/v/std/openai");
397 const openai = new OpenAI();
398
399 if (request.method === 'POST') {
402 if (request.url.includes('/generate-question')) {
403 try {
404 const completion = await openai.chat.completions.create({
405 messages: [
406 {

Twilionew-file-5038.tsx3 matches

@Dentalabcs•Updated 2 weeks ago
3 const incomingMsg = formData.get("Body")?.toString();
4
5 // Send the SMS text to OpenAI
6 const response = await fetch("https://api.openai.com/v1/chat/completions", {
7 method: "POST",
8 headers: {
9 Authorization: `Bearer ${Deno.env.get("OPENAI_API_KEY")}`,
10 "Content-Type": "application/json",
11 },

Towniesystem_prompt.txt4 matches

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

@juancgarza•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" },

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

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