feat: split top navbar to align with chat/content panels, fix Gemini API key
- Top bar left section (320px) = logo + project name, aligns with chat panel - Top bar right section = Build|Market|Assist pills + tool icons (Preview, Tasks, Code, Design, Backend) + avatar - Read GOOGLE_API_KEY inside POST handler (not top-level) to ensure env is resolved at request time Made-with: Cursor
This commit is contained in:
@@ -3,9 +3,7 @@ import { getServerSession } from 'next-auth';
|
||||
import { authOptions } from '@/lib/auth/authOptions';
|
||||
import { query } from '@/lib/db-postgres';
|
||||
|
||||
const GOOGLE_API_KEY = process.env.GOOGLE_API_KEY ?? '';
|
||||
const MODEL = process.env.GEMINI_MODEL ?? 'gemini-2.0-flash-exp';
|
||||
const STREAM_URL = `https://generativelanguage.googleapis.com/v1beta/models/${MODEL}:streamGenerateContent?key=${GOOGLE_API_KEY}&alt=sse`;
|
||||
const MODEL = process.env.GEMINI_MODEL ?? 'gemini-2.0-flash';
|
||||
|
||||
function buildSystemPrompt(projectData: Record<string, unknown>): string {
|
||||
const name = (projectData.name as string) ?? 'this project';
|
||||
@@ -57,6 +55,9 @@ export async function POST(
|
||||
return new Response('Unauthorized', { status: 401 });
|
||||
}
|
||||
|
||||
const GOOGLE_API_KEY = process.env.GOOGLE_API_KEY ?? '';
|
||||
const STREAM_URL = `https://generativelanguage.googleapis.com/v1beta/models/${MODEL}:streamGenerateContent?key=${GOOGLE_API_KEY}&alt=sse`;
|
||||
|
||||
if (!GOOGLE_API_KEY) {
|
||||
return new Response('GOOGLE_API_KEY not configured', { status: 500 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user