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=51&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 1606 results for "openai"(919ms)

Sparkmain.tsx5 matches

@Tade•Updated 1 month ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2
3// Telegram Bot Token - you would replace this with your actual bot token
5const TELEGRAM_API_URL = `https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}`;
6
7// OpenAI for generating research insights
8const openai = new OpenAI();
9
10// Helper function to send Telegram message
27async function processResearchRequest(text: string) {
28 try {
29 const completion = await openai.chat.completions.create({
30 messages: [
31 {
44 return completion.choices[0].message.content || "I couldn't generate a response.";
45 } catch (error) {
46 console.error("OpenAI Error:", error);
47 return "Sorry, there was an error processing your research request.";
48 }

AIContentHashtagsGeneratormain.tsx3 matches

@amrhucien•Updated 1 month ago
125 if (request.method === "POST") {
126 try {
127 const { OpenAI } = await import("https://esm.town/v/std/openai");
128 const openai = new OpenAI();
129
130 const { topic } = await request.json();
131
132 const completion = await openai.chat.completions.create({
133 messages: [
134 {

daringPlumOctopusmain.tsx3 matches

@amrhucien•Updated 1 month ago
125 if (request.method === "POST") {
126 try {
127 const { OpenAI } = await import("https://esm.town/v/std/openai");
128 const openai = new OpenAI();
129
130 const { topic } = await request.json();
131
132 const completion = await openai.chat.completions.create({
133 messages: [
134 {

content_idea_hashtag_generatormain.tsx3 matches

@amrhucien•Updated 1 month ago
125 if (request.method === "POST") {
126 try {
127 const { OpenAI } = await import("https://esm.town/v/std/openai");
128 const openai = new OpenAI();
129
130 const { topic } = await request.json();
131
132 const completion = await openai.chat.completions.create({
133 messages: [
134 {

simpleSearchPagemain.tsx3 matches

@kamorudeenalo•Updated 1 month ago
136export default async function server(request: Request): Promise<Response> {
137 if (request.method === "POST") {
138 const { OpenAI } = await import("https://esm.town/v/std/openai");
139 const openai = new OpenAI();
140
141 try {
142 const { query } = await request.json();
143
144 const completion = await openai.chat.completions.create({
145 messages: [
146 {

My_Schedulermain.tsx3 matches

@shirahh•Updated 1 month ago
96export default async function server(request: Request): Promise<Response> {
97 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
98 const { OpenAI } = await import("https://esm.town/v/std/openai");
99 const openai = new OpenAI();
100
101 const KEY = "My_Scheduler";
135 const taskList = tasks.rows.map(t => `${t.task} (${t.duration} mins, ${t.priority} priority)`).join(", ");
136
137 const suggestion = await openai.chat.completions.create({
138 messages: [
139 {

greatTealTiglonmain.tsx3 matches

@Anuoluwapo•Updated 1 month ago
1import { email } from "https://esm.town/v/std/email";
2import { OpenAI } from "https://esm.town/v/std/openai";
3import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
4
47
48export default async function (e: Email) {
49 const openai = new OpenAI();
50
51 // Ensure we have text content to analyze
72 try {
73 // Use GPT to draft an intelligent reply
74 const completion = await openai.chat.completions.create({
75 messages: [
76 {

C_smain.tsx3 matches

@abas•Updated 1 month ago
67
68 try {
69 const { OpenAI } = await import("https://esm.town/v/std/openai");
70 const openai = new OpenAI();
71
72 const systemPrompt = `
93 `;
94
95 const aiCompletion = await openai.chat.completions.create({
96 messages: [
97 { role: "system", content: systemPrompt },

memorySampleSummarymain.tsx1 match

@wangllm•Updated 1 month ago
4 const builder = await getMemoryBuilder({
5 type: "summary",
6 provider: "openai",
7 });
8 const memory = await builder();

tenaciousPeachHornetmain.tsx3 matches

@Argu•Updated 1 month ago
82
83 try {
84 const { OpenAI } = await import("https://esm.town/v/std/openai");
85 const openai = new OpenAI();
86
87 const completion = await openai.chat.completions.create({
88 messages: messages,
89 model: "gpt-4o-mini",

translateToEnglishWithOpenAI1 file match

@shlmt•Updated 2 days ago

testOpenAI1 file match

@stevekrouse•Updated 4 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": "*",