8 {
9 "title": "What is the base url / path for Groq API?",
10 "content": "The base path for Groq's OpenAI-compatible API is `https://api.groq.com/openai/v1`. For example, the chat completions endpoint is `https://api.groq.com/openai/v1/chat/completions`.\n\nReview the full API documentation here: `https://console.groq.com/docs/overview`"
11 },
12 {
124 {
125 "title": "What models are available on Groq?",
126 "content": "To see available models on GroqCloud, you can programmatically check by sending a request to our models endpoint for a JSON list of all models or visit our [API documentation](https://console.groq.com/docs/models):\n\n```python\nimport requests\nimport os\n\napi_key = os.environ.get(\"GROQ_API_KEY\")\nurl = \"https://api.groq.com/openai/v1/models\"\n\nheaders = {\n \"Authorization\": f\"Bearer {api_key}\",\n \"Content-Type\": \"application/json\"\n}\n\nresponse = requests.get(url, headers=headers)\n\nprint(response.json())\n```"
127 },
128 {
140 {
141 "title": "What is GroqCloud?",
142 "content": "GroqCloud is Groq's cloud-based AI inference platform providing easy access ultra-fast inference to open-source AI models through API endpoints with OpenAI compatibility."
143 },
144 {
4// --- Imports ---
5import { blob } from "https://esm.town/v/std/blob"; // Val.town Blob Storage :contentReference[oaicite:14]{index=14}
6import OpenAI from "npm:openai"; // Official OpenAI SDK (works in Deno via npm:) :contentReference[oaicite:15]{index=15}
7
8// --- Types ---
72 )
73 : undefined);
74const OPENAI_API_KEY = Deno.env.get("OPENAI_API_KEY");
75const OPENAI_MODEL = Deno.env.get("OPENAI_MODEL") ?? "gpt-5";
76const ORG_EMAIL_DOMAIN = (Deno.env.get("ORG_EMAIL_DOMAIN") ?? "wingspan.app")
77 .toLowerCase();
82const LOOKBACK_HOURS = 48;
83const TRANSCRIPT_BATCH = 30; // callIds per /transcript request (safe batch size)
84const MAX_OPENAI_INPUT_CHARS = 120_000; // guard rails per call extraction
85
86// Color cycle for the bottom bar (Vestaboard char codes)
118
119 // 3) Build diarized text & extract quotes per call
120 const openai = new OpenAI({ apiKey: OPENAI_API_KEY });
121 const extracted: Quote[] = [];
122
140 { name: undefined, domain: undefined };
141
142 const quotes = await extractQuotes(openai, diarized, {
143 accountName: account?.name,
144 accountDomain: account?.domain,
323
324 // Truncate to protect token usage
325 if (buf.length > MAX_OPENAI_INPUT_CHARS) {
326 buf = buf.slice(0, MAX_OPENAI_INPUT_CHARS) + "\n[TRUNCATED]\n";
327 }
328 return buf;
352}
353
354// -------------------- OpenAI extraction --------------------
355
356async function extractQuotes(
357 openai: OpenAI,
358 diarized: string,
359 ctx: {
464`;
465
466 const r = await openai.responses.create({
467 model: OPENAI_MODEL,
468 input,
469 // Force structured JSON output
679 );
680 }
681 if (!OPENAI_API_KEY) throw new Error("Set OPENAI_API_KEY.");
682 if (!VESTABOARD_RW_KEY) throw new Error("Set VESTABOARD_RW_KEY.");
683}
1import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
2import { OpenAI } from "https://esm.town/v/std/openai";
3
4const TABLE_NAME = 'kilo_code_mentions';
18 if (mentions.length === 0) return "No mentions to analyze.";
19
20 const openai = new OpenAI();
21 const summary = mentions.map(m => ({
22 title: m.title,
28 }));
29
30 const completion = await openai.chat.completions.create({
31 messages: [{
32 role: "user",
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" },
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" },
44 name: 'Open in ChatGPT',
45 icon: '🔮',
46 url: `https://chat.openai.com/?q=${encodeURIComponent(promptText)}`,
47 },
48 {
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" },
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" },
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" },
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" },