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=42&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 2153 results for "openai"(3865ms)

TeachREADME.md2 matches

@Problewk•Updated 3 weeks ago
9 - Detailed facial features with realistic skin, eyes, and hair
10 - Lifelike animations and expressions
11- AI-powered responses using OpenAI's API
12- Interactive chat interface
13- Educational content delivery
34 - Advanced lighting setup for photorealistic rendering
35 - Facial animation system
36- OpenAI API for AI responses
37- Tailwind CSS for styling

Towniesystem_prompt.txt4 matches

@Ana•Updated 3 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

@Ana•Updated 3 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" },

simple-agentagent.tsx2 matches

@abrinz•Updated 3 weeks ago
1import { anthropic } from "npm:@ai-sdk/anthropic";
2import { openai } from "npm:@ai-sdk/openai";
3import { generateText } from "npm:ai";
4import {
108 try {
109 const { text, toolCalls, toolResults } = await generateText({
110 // model: openai(this.modelName),
111 model: anthropic("claude-3-7-sonnet-20250219"),
112 tools: this.tools,

simple-agentstreamingAgent.tsx2 matches

@abrinz•Updated 3 weeks ago
1import { openai } from "npm:@ai-sdk/openai";
2import { streamText, tool } from "npm:ai";
3import { z } from "npm:zod";
9
10 const result = streamText({
11 model: openai("gpt-4o"),
12 messages,
13 toolChoice: "auto",

aatest-openai.ts11 matches

@msd•Updated 3 weeks ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2
3/**
4 * Simple test to verify OpenAI API key is working
5 */
6export default async function(): Promise<Response> {
7 try {
8 // Check for OpenAI API key
9 const apiKey = Deno.env.get("OPENAI_API_KEY");
10 if (!apiKey) {
11 return new Response(JSON.stringify({
12 error: "OpenAI API key is missing",
13 message: "Please set the OPENAI_API_KEY environment variable in Val Town."
14 }), {
15 status: 500,
18 }
19
20 // Test OpenAI API
21 const openai = new OpenAI();
22 const completion = await openai.chat.completions.create({
23 model: "gpt-3.5-turbo",
24 messages: [
30 return new Response(JSON.stringify({
31 success: true,
32 message: "OpenAI API key is working correctly",
33 response: completion.choices[0].message.content
34 }), {
37 } catch (error) {
38 return new Response(JSON.stringify({
39 error: "OpenAI API test failed",
40 message: error.message || "Unknown error"
41 }), {

aaREADME.md7 matches

@msd•Updated 3 weeks ago
1# AI Course Generator
2
3This Val Town project generates comprehensive course structures from user prompts using OpenAI.
4
5## Features
6
7- Takes a course topic as input and generates a complete course structure
8- Uses OpenAI's GPT-4o model for high-quality content generation
9- Provides a structured output with course title, description, target audience, prerequisites, learning outcomes, modules, and lessons
10- Includes a user-friendly web interface
12## Project Structure
13
14- `/course-generator.ts` - Core logic for generating course structures using OpenAI
15- `/frontend-handler.ts` - HTTP handler that serves the frontend and processes API requests
16- `/frontend/index.html` - Web interface for the course generator
73## Requirements
74
75- OpenAI API key set as an environment variable in Val Town
76
77## Setup Instructions
78
791. In Val Town, go to your account settings
802. Add an environment variable named `OPENAI_API_KEY` with your OpenAI API key
813. Deploy both the course-generator.ts and frontend-handler.ts files with HTTP triggers
82
85If the application isn't generating any responses, check the following:
86
871. **OpenAI API Key**: Make sure you've set the `OPENAI_API_KEY` environment variable in Val Town
882. **Console Logs**: Check the Val Town logs for any error messages
893. **Browser Console**: Open your browser's developer tools to check for any JavaScript errors
904. **API Limits**: If you're using a free OpenAI API key, you might have hit your usage limits

aaindex.html1 match

@msd•Updated 3 weeks ago
84
85 <footer class="text-center mt-10 text-gray-500 text-sm">
86 <p>Powered by Val Town and OpenAI</p>
87 <a href="#" id="viewSource" target="_top" class="text-blue-500 hover:underline">View Source</a>
88 </footer>

aacourse-generator.ts9 matches

@msd•Updated 3 weeks ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2
3// Define types for our course structure
27 */
28export async function generateCourseStructure(prompt: string): Promise<CourseStructure> {
29 // Check for OpenAI API key
30 const apiKey = Deno.env.get("OPENAI_API_KEY");
31 if (!apiKey) {
32 console.error("OpenAI API key is missing. Please set the OPENAI_API_KEY environment variable in Val Town.");
33 throw new Error("OpenAI API key is missing. Please set the OPENAI_API_KEY environment variable in Val Town.");
34 }
35
36 try {
37 const openai = new OpenAI();
38
39 const systemPrompt = `You are an expert curriculum designer. Create a comprehensive course structure based on the user's topic.
69 console.log(`Generating course for prompt: "${prompt}" using model: ${model}`);
70
71 const completion = await openai.chat.completions.create({
72 model: model,
73 messages: [
79
80 if (!completion.choices[0].message.content) {
81 throw new Error("Empty response from OpenAI");
82 }
83
84 console.log("Received response from OpenAI");
85
86 const courseStructure = JSON.parse(completion.choices[0].message.content) as CourseStructure;

sa_pro1README.md2 matches

@pro3•Updated 3 weeks ago
24
25- Built on Val Town using TypeScript
26- Uses OpenAI's API for prompt expansion
27- Responsive design with Twind (Tailwind CSS in JS)
28- Error handling for API failures
32- **Frontend**: HTML, CSS (via Twind), JavaScript
33- **Backend**: TypeScript, Val Town HTTP trigger
34- **AI**: OpenAI GPT models
35- **Error Tracking**: Val Town catch script
36

openai-client1 file match

@cricks_unmixed4u•Updated 3 days ago

openai_enrichment6 file matches

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