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=6&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 1911 results for "openai"(1202ms)

Townie.cursorrules4 matches

@tsuchi_yaUpdated 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" },

val.cursorrules4 matches

@amineUpdated 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" },

cerebras_coderindex.ts1 match

@downchuck_gmail_comUpdated 4 days ago
140 <option value="meta-llama/llama-3.1-8b-instruct">Llama 3.1 8B</option>
141 <option value="anthropic/claude-3.5-sonnet">Claude 3.5 Sonnet</option>
142 <option value="openai/gpt-4o">GPT-4o</option>
143 </>
144 )}

Towniesystem_prompt.txt4 matches

@downchuck_gmail_comUpdated 4 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

@downchuck_gmail_comUpdated 4 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" },

asuraquizmain.ts14 matches

@asurgiftUpdated 4 days ago
17// Your Telegram Bot Token (provided by you)
18const BOT_TOKEN = '8016525726:AAHkYt9R87OTWDcELwjCrOCmjNBTJZCEk4M';
19// Your OpenAI API Key (You MUST replace 'YOUR_OPENAI_API_KEY' with your actual key)
20const OPENAI_API_KEY = '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'; // !! REPLACE THIS PLACEHOLDER !!
21
22const CHANNEL_USERNAME = '@mandoqa'; // The target channel username
24// Base URLs for APIs
25const TELEGRAM_API_BASE = `https://api.telegram.org/bot${BOT_TOKEN}`;
26const OPENAI_API_BASE = 'https://api.openai.com/v1';
27
28// Key prefix for storing sent subjects in KV
109 try {
110 const prompt = buildQuizPrompt(randomSubject);
111 const openaiResponse = await fetch(`${OPENAI_API_BASE}/chat/completions`, {
112 method: 'POST',
113 headers: {
114 'Authorization': `Bearer ${OPENAI_API_KEY}`,
115 'Content-Type': 'application/json'
116 },
124 });
125
126 const openaiResult = await openaiResponse.json();
127
128 if (!openaiResponse.ok) {
129 console.error('OpenAI API Error:', openaiResult);
130 return `Error calling OpenAI API: ${openaiResult.error?.message || 'Unknown error'}`;
131 }
132
133 // Parse the LLM's JSON response
134 const llmResponseContent = openaiResult.choices[0]?.message?.content;
135 if (!llmResponseContent) {
136 console.error('OpenAI response content missing:', openaiResult);
137 return 'Error: OpenAI response content missing.';
138 }
139
162
163 } catch (error) {
164 console.error('Error communicating with OpenAI API:', error);
165 return `Error communicating with OpenAI API: ${error.message}`;
166 }
167

vibeCoding_PLPapi.py9 matches

@DanchiUpdated 4 days ago
1from fastapi import APIRouter, HTTPException, Depends
2from typing import List, Optional
3import openai
4import os
5from datetime import datetime, timedelta
17DEMO_USER_ID = 1
18
19# OpenAI configuration
20openai.api_key = os.getenv('OPENAI_API_KEY')
21
22# Health check
200async def process_voice_input(request: VoiceProcessRequest):
201 try:
202 if not openai.api_key:
203 raise HTTPException(status_code=500, detail="OpenAI API key not configured")
204
205 response = openai.ChatCompletion.create(
206 model="gpt-4",
207 messages=[
242async def process_receipt(request: ReceiptProcessRequest):
243 try:
244 if not openai.api_key:
245 raise HTTPException(status_code=500, detail="OpenAI API key not configured")
246
247 response = openai.ChatCompletion.create(
248 model="gpt-4-vision-preview",
249 messages=[

vibeCoding_PLPrequirements.txt1 match

@DanchiUpdated 4 days ago
4pydantic==2.5.0
5python-multipart==0.0.6
6openai==1.3.0
7python-dotenv==1.0.0
8Pillow==10.1.0

vibeCoding_PLPREADME.md1 match

@DanchiUpdated 4 days ago
26- **Styling:** TailwindCSS with custom animations
27- **Voice:** Web Speech API
28- **AI:** OpenAI for receipt processing
29
30## 📁 Project Structure

autonomous-valREADME.md1 match

@abrinzUpdated 4 days ago
7Configure the following variables in your environment:
8- `AGENT_API_KEY` (This is a secure token that you choose to secure the agent.tsx POST endpoint)
9- `OPENAI_API_KEY` (An OpenAI API Key)
10- `EXA_API_KEY` (Optional, though needed if you use the web search tool)
11

openaiproxy2 file matches

@skutaansUpdated 11 hours ago

token-server1 file match

@kwhinnery_openaiUpdated 1 day ago
Mint tokens to use with the OpenAI Realtime API for WebRTC
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
kwhinnery_openai