Townie.cursorrules4 matches
94Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
9596### OpenAI
9798```ts
99import { OpenAI } from "https://esm.town/v/std/openai";
100const openai = new OpenAI();
101const completion = await openai.chat.completions.create({
102messages: [
103{ role: "user", content: "Say hello in a creative way" },
val.cursorrules4 matches
94Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
9596### OpenAI
9798```ts
99import { OpenAI } from "https://esm.town/v/std/openai";
100const openai = new OpenAI();
101const completion = await openai.chat.completions.create({
102messages: [
103{ role: "user", content: "Say hello in a creative way" },
cerebras_coderindex.ts1 match
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
88Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
8990### OpenAI
9192```ts
93import { OpenAI } from "https://esm.town/v/std/openai";
94const openai = new OpenAI();
95const completion = await openai.chat.completions.create({
96messages: [
97{ role: "user", content: "Say hello in a creative way" },
Townie.cursorrules4 matches
94Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
9596### OpenAI
9798```ts
99import { OpenAI } from "https://esm.town/v/std/openai";
100const openai = new OpenAI();
101const completion = await openai.chat.completions.create({
102messages: [
103{ role: "user", content: "Say hello in a creative way" },
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 !!
2122const 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';
2728// Key prefix for storing sent subjects in KV
109try {
110const prompt = buildQuizPrompt(randomSubject);
111const openaiResponse = await fetch(`${OPENAI_API_BASE}/chat/completions`, {
112method: 'POST',
113headers: {
114'Authorization': `Bearer ${OPENAI_API_KEY}`,
115'Content-Type': 'application/json'
116},
124});
125126const openaiResult = await openaiResponse.json();
127128if (!openaiResponse.ok) {
129console.error('OpenAI API Error:', openaiResult);
130return `Error calling OpenAI API: ${openaiResult.error?.message || 'Unknown error'}`;
131}
132133// Parse the LLM's JSON response
134const llmResponseContent = openaiResult.choices[0]?.message?.content;
135if (!llmResponseContent) {
136console.error('OpenAI response content missing:', openaiResult);
137return 'Error: OpenAI response content missing.';
138}
139162163} catch (error) {
164console.error('Error communicating with OpenAI API:', error);
165return `Error communicating with OpenAI API: ${error.message}`;
166}
167
vibeCoding_PLPapi.py9 matches
1from fastapi import APIRouter, HTTPException, Depends
2from typing import List, Optional
3import openai
4import os
5from datetime import datetime, timedelta
17DEMO_USER_ID = 1
1819# OpenAI configuration
20openai.api_key = os.getenv('OPENAI_API_KEY')
2122# Health check
200async def process_voice_input(request: VoiceProcessRequest):
201try:
202if not openai.api_key:
203raise HTTPException(status_code=500, detail="OpenAI API key not configured")
204
205response = openai.ChatCompletion.create(
206model="gpt-4",
207messages=[
242async def process_receipt(request: ReceiptProcessRequest):
243try:
244if not openai.api_key:
245raise HTTPException(status_code=500, detail="OpenAI API key not configured")
246
247response = openai.ChatCompletion.create(
248model="gpt-4-vision-preview",
249messages=[
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
26- **Styling:** TailwindCSS with custom animations
27- **Voice:** Web Speech API
28- **AI:** OpenAI for receipt processing
2930## 📁 Project Structure
autonomous-valREADME.md1 match
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