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=54&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 2160 results for "openai"(2101ms)

SpanishPanda_botmain.tsx5 matches

@ynonp•Updated 4 weeks ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2import { telegramSendMessage } from "https://esm.town/v/vtdocs/telegramSendMessage?v=5";
3import {
15 console.log(`received: ${text}`)
16 if (text) {
17 const response = await translateToSpanishWithOpenAI(text);
18 console.log(`translated to: ${response}`);
19 ctx.reply(response);
33
34
35async function translateToSpanishWithOpenAI(text: string) {
36 const openai = new OpenAI();
37 const completion = await openai.chat.completions.create({
38 messages: [
39 {

mandateagents.ts9 matches

@salon•Updated 1 month ago
3import { AgentContext, AgentInput, AgentOutput } from "https://esm.town/v/salon/mandate/interfaces.ts";
4import { fetch } from "https://esm.town/v/std/fetch";
5import { OpenAI } from "https://esm.town/v/std/openai";
6
7// Summarizer Agent (unchanged, but shown for completeness)
23 }
24
25 const openai = new OpenAI();
26
27 log("INFO", "SummarizerAgent", "Generating summary with OpenAI...");
28 const completion = await openai.chat.completions.create({
29 messages: [
30 {
40
41 if (summary === "Could not generate summary.") {
42 log("WARN", "SummarizerAgent", "OpenAI did not return a valid summary content.");
43 }
44
267 }
268
269 const openai = new OpenAI();
270 log("INFO", "CombinerAgent", "Combining text with OpenAI...");
271 const completion = await openai.chat.completions.create({
272 messages: [
273 {
294
295 if (combined === "Could not combine information.") {
296 log("WARN", "CombinerAgent", "OpenAI did not return valid combined content.");
297 }
298

whatsapp-callbackindex.tsx1 match

@yawnxyz•Updated 1 month ago
177 try {
178 console.log(`[SmartAck] Attempting to generate smart ack for: "${userQuery.substring(0, 50)}..." with ${QUICK_ACK_MODEL}`);
179 const groqResponse = await fetch("https://api.groq.com/openai/v1/chat/completions", {
180 method: "POST",
181 headers: {
GitHub-Release-Notes

GitHub-Release-Notesllm.ts5 matches

@charmaine•Updated 1 month ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2import { CommitWithPR, ReleaseNote } from "../shared/types.ts";
3
4// Initialize OpenAI client
5const openai = new OpenAI();
6
7/**
186`;
187
188 // Call the OpenAI API
189 const completion = await openai.chat.completions.create({
190 model: "gpt-4o",
191 messages: [

Towniesystem_prompt.txt4 matches

@jxnblk•Updated 1 month 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" },

CareerCoach20DaymodelSelection.ts6 matches

@prashamtrivedi•Updated 1 month ago
1import {OpenAI} from "https://esm.town/v/std/openai"
2
3const openai = new OpenAI()
4
5/**
20 }
21
22 // Evaluate content complexity using OpenAI
23 const evaluation = await evaluateWithAI(content)
24
41
42/**
43 * Evaluates content complexity using OpenAI
44 * @param content The content to be analyzed
45 * @returns Object with complexity and reasoning_required assessments
67
68 try {
69 const response = await openai.chat.completions.create({
70 model: "gpt-4o",
71 messages: [
101 const {model, reasoning_efforts} = modelConfig
102
103 const response = await openai.chat.completions.create({
104 model: model,
105 messages: [

Towniesystem_prompt.txt4 matches

@pomdtr•Updated 1 month 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" },

CareerCoach20Dayinitialization.ts1 match

@prashamtrivedi•Updated 1 month ago
63 status: "pending",
64 priority: 1,
65 notes: "Highlight your experience with AWS Lambda, OpenAI, and TypeScript"
66 },
67 {

slackbolt.tsx7 matches

@dinavinter•Updated 1 month ago
47app.event("app_mention", async ({ event, say }) => {
48 try {
49 const { OpenAI } = await import("https://esm.town/v/std/openai");
50 const openai = new OpenAI();
51 const prompt = event.text.replace(/<@[A-Z0-9]+>/g, "").trim();
52
53 const completion = await openai.chat.completions.create({
54 messages: [
55 { role: "system", content: "You are a helpful assistant in a Slack channel." },
139 <html>
140 <head>
141 <title>Slack Bot with OpenAI</title>
142 <style>
143 body {
155 </head>
156 <body>
157 <h1>Slack Bot with OpenAI</h1>
158 <p>This is a Slack bot that uses OpenAI to generate responses. To use this bot:</p>
159 <ol>
160 <li>Add the bot to your Slack workspace</li>
161 <li>Mention the bot in a channel it's been invited to</li>
162 <li>The bot will use OpenAI to generate a response to your message</li>
163 </ol>
164 <p>For more information, check out the <a href="${
GitHub-Release-Notes

GitHub-Release-NotesREADME.md2 matches

@charmaine•Updated 1 month ago
6
7- `github.ts` - GitHub API integration for fetching commits and PR data
8- `llm.ts` - OpenAI integration for generating release notes
9- `types.ts` - Type definitions for the backend
10
50### POST /api/generate-notes
51
52Generates user-facing release notes from commit and PR data using OpenAI.
53
54**Request Body:**

openai-client1 file match

@cricks_unmixed4u•Updated 4 days ago

openai_enrichment6 file matches

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