Compare commits

...
Author SHA1 Message Date
Chris Tate e6d4ac7a4f fix 2026-01-16 22:35:28 -06:00
Chris Tate 91873fb271 update env var name 2026-01-16 22:28:59 -06:00
Chris Tate 833f056324 fix lint 2026-01-16 22:18:10 -06:00
Chris Tate 34c793396b update examples 2026-01-16 22:15:45 -06:00
Chris Tate eda8cde9b2 make model configurable 2026-01-16 22:13:59 -06:00
8 changed files with 23 additions and 9 deletions
+7 -2
View File
@@ -1,4 +1,9 @@
# AI Gateway API Key (required for /api/generate endpoint)
# Uses Vercel AI Gateway - automatically authenticated when deployed on Vercel
# Vercel AI Gateway
# Automatically authenticated when deployed on Vercel
# For local development, get your key from https://vercel.com/ai-gateway
AI_GATEWAY_API_KEY=
# AI Model Configuration
# Override the default model used for UI generation
# Default: anthropic/claude-haiku-4.5
AI_GATEWAY_MODEL=anthropic/claude-haiku-4.5
+2 -1
View File
@@ -78,6 +78,7 @@ EXAMPLE (Blog with responsive grid):
Generate JSONL:`;
const MAX_PROMPT_LENGTH = 140;
const DEFAULT_MODEL = "anthropic/claude-haiku-4.5";
export async function POST(req: Request) {
const { prompt } = await req.json();
@@ -85,7 +86,7 @@ export async function POST(req: Request) {
const sanitizedPrompt = String(prompt || "").slice(0, MAX_PROMPT_LENGTH);
const result = streamText({
model: "anthropic/claude-opus-4.5",
model: process.env.AI_GATEWAY_MODEL || DEFAULT_MODEL,
system: SYSTEM_PROMPT,
prompt: sanitizedPrompt,
temperature: 0.7,
+1 -1
View File
@@ -33,7 +33,7 @@ export async function POST(req: Request) {
: '';
const result = streamText({
model: 'anthropic/claude-opus-4.5',
model: 'anthropic/claude-haiku-4.5',
system: systemPrompt + contextPrompt,
prompt,
});
+1 -1
View File
@@ -100,7 +100,7 @@ export async function POST(req: Request) {
const systemPrompt = generateCatalogPrompt(catalog);
const result = streamText({
model: 'anthropic/claude-opus-4.5',
model: 'anthropic/claude-haiku-4.5',
system: systemPrompt,
prompt,
});
+1 -1
View File
@@ -79,7 +79,7 @@ function App() {
const { prompt } = await req.json();
const result = streamText({
model: 'anthropic/claude-opus-4.5',
model: 'anthropic/claude-haiku-4.5',
system: generateCatalogPrompt(catalog),
prompt,
});
+7 -2
View File
@@ -1,4 +1,9 @@
# AI Gateway API Key (required for /api/generate endpoint)
# Uses Vercel AI Gateway - automatically authenticated when deployed on Vercel
# Vercel AI Gateway
# Automatically authenticated when deployed on Vercel
# For local development, get your key from https://vercel.com/ai-gateway
AI_GATEWAY_API_KEY=
# AI Model Configuration
# Override the default model used for dashboard generation
# Default: anthropic/claude-haiku-4.5
AI_GATEWAY_MODEL=anthropic/claude-haiku-4.5
+3 -1
View File
@@ -58,6 +58,8 @@ EXAMPLE - Revenue Dashboard:
Generate JSONL patches now:`;
const DEFAULT_MODEL = "anthropic/claude-haiku-4.5";
export async function POST(req: Request) {
const { prompt, context } = await req.json();
@@ -69,7 +71,7 @@ export async function POST(req: Request) {
}
const result = streamText({
model: "anthropic/claude-opus-4.5",
model: process.env.AI_GATEWAY_MODEL || DEFAULT_MODEL,
system: SYSTEM_PROMPT,
prompt: fullPrompt,
temperature: 0.7,
+1
View File
@@ -1,6 +1,7 @@
{
"$schema": "https://turborepo.dev/schema.json",
"ui": "tui",
"globalEnv": ["AI_GATEWAY_MODEL"],
"tasks": {
"build": {
"dependsOn": ["^build"],