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/$%7Bsuccess?q=openai&page=16&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 1576 results for "openai"(1038ms)

researchAgentemailHandler2 matches

@abeperl•Updated 2 weeks ago
2import process from "node:process";
3import { marked } from "npm:marked";
4import { OpenAI } from "npm:openai";
5
6function pm(...lines: string[]): string {
16 );
17
18 const client = new OpenAI({ apiKey: process.env.PERPLEXITY_API_KEY, baseURL: "https://api.perplexity.ai" });
19 const response = await client.chat.completions.create({
20 model: "sonar",

stevensDemo.cursorrules4 matches

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

stevensDemo.cursorrules4 matches

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

stevensDemo.cursorrules4 matches

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

researchAgentemailHandler2 matches

@gigmx•Updated 2 weeks ago
2import process from "node:process";
3import { marked } from "npm:marked";
4import { OpenAI } from "npm:openai";
5
6function pm(...lines: string[]): string {
16 );
17
18 const client = new OpenAI({ apiKey: process.env.PERPLEXITY_API_KEY, baseURL: "https://api.perplexity.ai" });
19 const response = await client.chat.completions.create({
20 model: "sonar",

stevensDemo.cursorrules4 matches

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

stevensDemo.cursorrules4 matches

@garyj•Updated 2 weeks ago
100Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
101
102### OpenAI
103```ts
104import { OpenAI } from "https://esm.town/v/std/openai";
105const openai = new OpenAI();
106const completion = await openai.chat.completions.create({
107 messages: [
108 { role: "user", content: "Say hello in a creative way" },
142 }
143
144 // Dynamically import OpenAI
145 const { OpenAI } = await import("https://esm.town/v/std/openai");
146
147 // Initialize OpenAI for potential AI processing
148 const openai = new OpenAI();
149
150 // Process and potentially trigger AI agent
151 const aiResponse = await openai.chat.completions.create({
152 messages: [
153 {

messageReceiverAppmain.tsx3 matches

@bgtgtgfgvbtgvgb•Updated 2 weeks ago
159export default async function server(request: Request): Promise<Response> {
160 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
161 const { OpenAI } = await import("https://esm.town/v/std/openai");
162
163 const KEY = "messageReceiverApp";
249 // Process with AI if destinations exist
250 if (aiDestinations.rows.length > 0) {
251 const openai = new OpenAI();
252
253 for (const destination of aiDestinations.rows) {
254 try {
255 const aiResponse = await openai.chat.completions.create({
256 messages: [{
257 role: "user",

dazzlingCoffeeOctopusmain.tsx3 matches

@bgtgtgfgvbtgvgb•Updated 2 weeks ago
152export default async function server(request: Request): Promise<Response> {
153 if (request.method === 'POST' && new URL(request.url).pathname === '/chat') {
154 const { OpenAI } = await import("https://esm.town/v/std/openai");
155 const openai = new OpenAI();
156
157 const body = await request.json();
159
160 try {
161 const completion = await openai.chat.completions.create({
162 messages: messages,
163 model: "gpt-4o-mini",

testOpenAI1 file match

@stevekrouse•Updated 15 hours ago

testOpenAI1 file match

@shouser•Updated 2 days 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": "*",