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/image-url.jpg%20%22Image%20title%22?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 1632 results for "openai"(716ms)

groqAudioChatchat.ts1 match

@dcm31โ€ขUpdated 1 month ago
20 console.log("๐Ÿ”ต Sending request to Groq API");
21 const start = Date.now();
22 const response = await fetch("https://api.groq.com/openai/v1/chat/completions", {
23 method: "POST",
24 headers: {

groqAudioChataudio.ts1 match

@dcm31โ€ขUpdated 1 month ago
63 console.log("๐ŸŽค Sending request to Groq Whisper API");
64 const start = Date.now();
65 const response = await fetch("https://api.groq.com/openai/v1/audio/transcriptions", {
66 method: "POST",
67 headers: {

extractRecipeAImain.tsx3 matches

@Skeyeโ€ขUpdated 1 month ago
198
199 app.post("/extract-recipe", async (c) => {
200 const { OpenAI } = await import("https://esm.town/v/std/openai");
201 const openai = new OpenAI();
202
203 const formData = await c.req.formData();
224
225 try {
226 const response = await openai.chat.completions.create({
227 model: "gpt-4o",
228 messages: [

chatGPTClonemain.tsx4 matches

@Bam031272โ€ขUpdated 1 month ago
124 if (request.method === 'POST' && new URL(request.url).pathname === '/chat') {
125 try {
126 const { OpenAI } = await import("https://esm.town/v/std/openai");
127 const openai = new OpenAI();
128
129 const body = await request.json();
130 const completion = await openai.chat.completions.create({
131 messages: body.messages.map((msg: Message) => ({
132 role: msg.role,
143 });
144 } catch (error) {
145 console.error('OpenAI Error:', error);
146 return new Response(JSON.stringify({
147 message: 'Sorry, I encountered an error processing your request.'

gentleRoseGalliformmain.tsx3 matches

@dcm31โ€ขUpdated 1 month ago
67 console.log("๐ŸŽค Sending request to Groq Whisper API");
68 const start = Date.now();
69 const response = await fetch("https://api.groq.com/openai/v1/audio/transcriptions", {
70 method: "POST",
71 headers: {
157 console.log("๐Ÿ”ต Sending request to Groq API");
158 const start = Date.now();
159 const response = await fetch("https://api.groq.com/openai/v1/chat/completions", {
160 method: "POST",
161 headers: {
213 console.log("๐Ÿ”Š Sending request to Groq Speech API");
214 const start = Date.now();
215 const response = await fetch("https://api.groq.com/openai/v1/audio/speech", {
216 method: "POST",
217 headers: {

groqAudioChatgroqAudioChat3 matches

@dcm31โ€ขUpdated 1 month ago
68 console.log("๐ŸŽค Sending request to Groq Whisper API");
69 const start = Date.now();
70 const response = await fetch("https://api.groq.com/openai/v1/audio/transcriptions", {
71 method: "POST",
72 headers: {
158 console.log("๐Ÿ”ต Sending request to Groq API");
159 const start = Date.now();
160 const response = await fetch("https://api.groq.com/openai/v1/chat/completions", {
161 method: "POST",
162 headers: {
214 console.log("๐Ÿ”Š Sending request to Groq Speech API");
215 const start = Date.now();
216 const response = await fetch("https://api.groq.com/openai/v1/audio/speech", {
217 method: "POST",
218 headers: {

groqAudioChat_migratedmain.tsx3 matches

@dcm31โ€ขUpdated 1 month ago
68 console.log("๐ŸŽค Sending request to Groq Whisper API");
69 const start = Date.now();
70 const response = await fetch("https://api.groq.com/openai/v1/audio/transcriptions", {
71 method: "POST",
72 headers: {
158 console.log("๐Ÿ”ต Sending request to Groq API");
159 const start = Date.now();
160 const response = await fetch("https://api.groq.com/openai/v1/chat/completions", {
161 method: "POST",
162 headers: {
214 console.log("๐Ÿ”Š Sending request to Groq Speech API");
215 const start = Date.now();
216 const response = await fetch("https://api.groq.com/openai/v1/audio/speech", {
217 method: "POST",
218 headers: {

groqAudioChatmain.tsx3 matches

@yawnxyzโ€ขUpdated 1 month ago
68 console.log("๐ŸŽค Sending request to Groq Whisper API");
69 const start = Date.now();
70 const response = await fetch("https://api.groq.com/openai/v1/audio/transcriptions", {
71 method: "POST",
72 headers: {
158 console.log("๐Ÿ”ต Sending request to Groq API");
159 const start = Date.now();
160 const response = await fetch("https://api.groq.com/openai/v1/chat/completions", {
161 method: "POST",
162 headers: {
214 console.log("๐Ÿ”Š Sending request to Groq Speech API");
215 const start = Date.now();
216 const response = await fetch("https://api.groq.com/openai/v1/audio/speech", {
217 method: "POST",
218 headers: {

groqAudioWordLevelmain.tsx1 match

@yawnxyzโ€ขUpdated 1 month ago
37
38 // Call Groq API
39 const response = await fetch("https://api.groq.com/openai/v1/audio/transcriptions", {
40 method: "POST",
41 headers: {

OpenTowniesystem_prompt.txt4 matches

@arfanโ€ขUpdated 1 month ago
137Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
138
139### OpenAI
140```ts
141import { OpenAI } from "https://esm.town/v/std/openai";
142const openai = new OpenAI();
143const completion = await openai.chat.completions.create({
144 messages: [
145 { role: "user", content: "Say hello in a creative way" },

translateToEnglishWithOpenAI1 file match

@shlmtโ€ขUpdated 6 days ago

testOpenAI1 file match

@stevekrouseโ€ขUpdated 1 week 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": "*",