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=43&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 2154 results for "openai"(2067ms)

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

sa_pro1prompt-expander.ts4 matches

@pro3•Updated 3 weeks ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2
3// Initialize OpenAI client
4const openai = new OpenAI();
5
6// HTML template for the prompt expander interface
177
178 try {
179 const completion = await openai.chat.completions.create({
180 model: "gpt-4o-mini", // Using a smaller model for cost efficiency
181 messages: [

sa_proREADME.md3 matches

@pro3•Updated 3 weeks ago
7- Expands even single-word prompts into rich, detailed content
8- Simple, clean user interface with example suggestions
9- Real-time prompt expansion using OpenAI's API
10- Responsive design that works on mobile and desktop
11- Error handling and loading states
22- Built with vanilla HTML, CSS, and JavaScript
23- Uses Twind for styling (Tailwind CSS in JS)
24- Powered by OpenAI's GPT models via Val Town's standard library
25- Enhanced system prompt specifically designed to handle very short inputs
26- Implements error handling and loading states for better UX
46## Notes
47
48This application uses the OpenAI API which requires an API key. Make sure your Val Town account has an OpenAI API key configured in the environment variables.

sa_proprompt-expander.ts3 matches

@pro3•Updated 3 weeks ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2
3export default async function (req: Request): Promise<Response> {
24 }
25
26 const openai = new OpenAI();
27 const completion = await openai.chat.completions.create({
28 messages: [
29 {

sa_pro3README.md7 matches

@pro3•Updated 3 weeks ago
1# Creative Prompt Generator
2
3A simple web application that generates creative prompts for various categories using OpenAI.
4
5## Features
15 - Small-to-Big Progression
16- Clean, responsive UI using TailwindCSS
17- Powered by OpenAI's GPT models
18
19## How It Works
211. Select a prompt category from the dropdown menu
222. Click "Generate Prompt"
233. The application will use OpenAI to create a unique, creative prompt based on your selection
244. Use the generated prompt for your creative projects!
25
37
38- Built as an HTTP-triggered Val in Val Town
39- Uses OpenAI's API to generate prompts
40- Frontend styled with TailwindCSS
41- Handles both GET and POST requests in a single endpoint
46To use this application, you need to:
47
481. Set up an OpenAI API key as an environment variable in Val Town
492. Deploy the Val with HTTP trigger enabled
50
51## Environment Variables
52
53- `OPENAI_API_KEY`: Your OpenAI API key for generating prompts
54
55## Customization
57You can easily extend this application by:
58- Adding more prompt categories in the `PROMPT_CATEGORIES` object
59- Adjusting the OpenAI parameters (temperature, max tokens, etc.)
60- Customizing the UI styling

sa_pro3prompt-generator.ts6 matches

@pro3•Updated 3 weeks ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2import { parseProject } from "https://esm.town/v/std/utils@85-main/index.ts";
3
4// Initialize OpenAI client
5const openai = new OpenAI();
6
7// Prompt categories with descriptions
71}
72
73// Generate a prompt using OpenAI
74async function generatePrompt(category: string): Promise<string> {
75 try {
78 // Special handling for small-to-big progression prompts
79 if (category === "smallToBig") {
80 const completion = await openai.chat.completions.create({
81 model: "gpt-4o-mini",
82 messages: [
98
99 // Standard prompt generation for other categories
100 const completion = await openai.chat.completions.create({
101 model: "gpt-4o-mini",
102 messages: [
requests-in-space

requests-in-spaceend.tsx4 matches

@shouser•Updated 3 weeks ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2const openai = new OpenAI();
3
4export default async function(req: Request): Promise<Response> {
17 console.log("Message:", decodeURIComponent(message));
18
19 // Make the OpenAI API call
20 const completion = await openai.chat.completions.create({
21 messages: [
22 {

Towniesystem_prompt.txt4 matches

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

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

stockApptypes.ts1 match

@prashamtrivedi•Updated 3 weeks ago
170}
171
172export type AIProvider = 'openai' | 'gemini';

openai-client1 file match

@cricks_unmixed4u•Updated 3 days ago

openai_enrichment6 file matches

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