Search

3,298 results found for โ€œopenaiโ€ (1710ms)

Code
3,203

join/new/main.tsx
3 matches
// @ts-ignore
import { OpenAI } from "https://esm.town/v/std/openai?v=4";
// --- AI BEHAVIORAL GUIDELINES ---
async function generateNoiseShaderCode() {
try {
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
model: "gpt-4o",
messages: [
{
"title": "What is the base url / path for Groq API?",
"content": "The base path for Groq's OpenAI-compatible API is `https://api.groq.com/openai
},
{
{
"title": "What models are available on Groq?",
viron.get(\"GROQ_API_KEY\")\nurl = \"https://api.groq.com/openai/v1/models\"\n\nheaders = {\n
},
{
{
"title": "What is GroqCloud?",
rence to open-source AI models through API endpoints with OpenAI compatibility."
},
{
// --- Imports ---
import { blob } from "https://esm.town/v/std/blob"; // Val.town Blob Storage :contentReference[o
import OpenAI from "npm:openai"; // Official OpenAI SDK (works in Deno via npm:) :contentReferen
// --- Types ---
)
: undefined);
const OPENAI_API_KEY = Deno.env.get("OPENAI_API_KEY");
const OPENAI_MODEL = Deno.env.get("OPENAI_MODEL") ?? "gpt-5";
const ORG_EMAIL_DOMAIN = (Deno.env.get("ORG_EMAIL_DOMAIN") ?? "wingspan.app")
.toLowerCase();
const LOOKBACK_HOURS = 48;
const TRANSCRIPT_BATCH = 30; // callIds per /transcript request (safe batch size)
const MAX_OPENAI_INPUT_CHARS = 120_000; // guard rails per call extraction
// Color cycle for the bottom bar (Vestaboard char codes)
// 3) Build diarized text & extract quotes per call
const openai = new OpenAI({ apiKey: OPENAI_API_KEY });
const extracted: Quote[] = [];
{ name: undefined, domain: undefined };
const quotes = await extractQuotes(openai, diarized, {
accountName: account?.name,
accountDomain: account?.domain,
// Truncate to protect token usage
if (buf.length > MAX_OPENAI_INPUT_CHARS) {
buf = buf.slice(0, MAX_OPENAI_INPUT_CHARS) + "\n[TRUNCATED]\n";
}
return buf;
}
// -------------------- OpenAI extraction --------------------
async function extractQuotes(
openai: OpenAI,
diarized: string,
ctx: {
`;
const r = await openai.responses.create({
model: OPENAI_MODEL,
input,
// Force structured JSON output
);
}
if (!OPENAI_API_KEY) throw new Error("Set OPENAI_API_KEY.");
if (!VESTABOARD_RW_KEY) throw new Error("Set VESTABOARD_RW_KEY.");
}
import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
import { OpenAI } from "https://esm.town/v/std/openai";
const TABLE_NAME = 'kilo_code_mentions';
if (mentions.length === 0) return "No mentions to analyze.";
const openai = new OpenAI();
const summary = mentions.map(m => ({
title: m.title,
}));
const completion = await openai.chat.completions.create({
messages: [{
role: "user",
Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to cre
### OpenAI
```ts
import { OpenAI } from "https://esm.town/v/std/openai";
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
messages: [
{ role: "user", content: "Say hello in a creative way" },
Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to cre
### OpenAI
```ts
import { OpenAI } from "https://esm.town/v/std/openai";
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
messages: [
{ role: "user", content: "Say hello in a creative way" },
name: 'Open in ChatGPT',
icon: '๐Ÿ”ฎ',
url: `https://chat.openai.com/?q=${encodeURIComponent(promptText)}`,
},
{
Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to cre
### OpenAI
```ts
import { OpenAI } from "https://esm.town/v/std/openai";
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
messages: [
{ role: "user", content: "Say hello in a creative way" },
Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to cre
### OpenAI
```ts
import { OpenAI } from "https://esm.town/v/std/openai";
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
messages: [
{ role: "user", content: "Say hello in a creative way" },
Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to cre
### OpenAI
```ts
import { OpenAI } from "https://esm.town/v/std/openai";
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
messages: [
{ role: "user", content: "Say hello in a creative way" },
โ€ฆ
51
โ€ฆ
Next