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/$%7BsvgDataUrl%7D?q=openai&page=4&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 2237 results for "openai"(3749ms)

townie-126system_prompt.txt4 matches

@dinavinter•Updated 2 days 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-126.cursorrules4 matches

@dinavinter•Updated 2 days 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" },

talentflowmain.tsx4 matches

@legal•Updated 2 days ago
680// --- SERVER-SIDE LOGIC ---
681export default async function(req: Request) {
682 const { OpenAI } = await import("https://esm.town/v/std/openai");
683 const { PDFExtract } = await import("npm:pdf.js-extract");
684
694 const action = url.searchParams.get("action");
695 const sourceUrl = import.meta.url.replace("esm.town", "val.town");
696 const openai = new OpenAI();
697 const MAX_TEXT_ANALYZE = 30000;
698
722 agentName: string,
723 ): Promise<object> {
724 log.push({ agent: agentName, type: "step", message: `Calling OpenAI gpt-4o...` });
725 try {
726 const response = await openai.chat.completions.create({
727 model: "gpt-4o",
728 messages: [{ role: "system", content: systemPrompt }, { role: "user", content: userMessage }],

Recruitmain.tsx4 matches

@svc•Updated 2 days ago
852
853export default async function(req: Request) {
854 const { OpenAI } = await import("https://esm.town/v/std/openai");
855 const { PDFExtract } = await import("npm:pdf.js-extract");
856
866 const action = url.searchParams.get("action");
867 const sourceUrl = import.meta.url.replace("esm.town", "val.town");
868 const openai = new OpenAI();
869 const MAX_TEXT_SUGGEST = 20000;
870 const MAX_TEXT_ANALYZE = 30000;
895 agentName: string,
896 ): Promise<object> {
897 log.push({ agent: agentName, type: "step", message: `Calling OpenAI gpt-4o...` });
898 try {
899 const response = await openai.chat.completions.create({
900 model: "gpt-4o",
901 messages: [{ role: "system", content: systemPrompt }, { role: "user", content: userMessage }],

stevensDemo.cursorrules4 matches

@iabreufilho•Updated 2 days 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

@jeffvincent•Updated 2 days 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

@kvrt•Updated 2 days 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" },
Plantfo

Plantfoindex.ts8 matches

@Llad•Updated 2 days ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { OpenAI } from "https://esm.town/v/std/openai";
3import { readFile } from "https://esm.town/v/std/utils/index.ts";
4import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
20});
21
22// Initialize OpenAI
23const openai = new OpenAI();
24
25// Initialize cache on startup with error handling
87 }
88
89 console.log(`Fetching fresh data from OpenAI for: "${plantName}"`);
90 // If not cached, fetch from OpenAI
91 const prompt = `Please provide detailed information about the plant "${plantName}" in the following JSON format. Be specific and accurate:
92
104Only return the JSON object, no additional text.`;
105
106 const completion = await openai.chat.completions.create({
107 messages: [
108 { role: "user", content: prompt }
116
117 if (!responseText) {
118 return c.json({ error: "No response from OpenAI" }, 500);
119 }
120
128 }
129
130 // Parse the JSON response from OpenAI
131 const plantInfo: PlantInfo = JSON.parse(cleanedResponse);
132

Towniesystem_prompt.txt4 matches

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

@bipin0005•Updated 3 days 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 1 week ago

openai_enrichment6 file matches

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