feat: Improve UI layout and navigation
- Increase logo size (48x48 desktop, 56x56 mobile) for better visibility - Add logo as favicon - Add logo to mobile header - Move user menu to navigation bars (sidebar on desktop, bottom bar on mobile) - Fix desktop chat layout - container structure prevents voice controls cutoff - Fix mobile bottom bar - use icon-only ActionIcons instead of truncated text buttons - Hide Create Node/New Conversation buttons on mobile to save header space - Make fixed header and voice controls work properly with containers 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
18
lib/ai.ts
18
lib/ai.ts
@@ -1,17 +1,25 @@
|
||||
import { GoogleGenerativeAI } from '@google/generative-ai';
|
||||
|
||||
const genAI = new GoogleGenerativeAI(process.env.GOOGLE_API_KEY!);
|
||||
// Validate required environment variables
|
||||
if (!process.env.GOOGLE_GENERATIVE_AI_API_KEY) {
|
||||
throw new Error('GOOGLE_GENERATIVE_AI_API_KEY environment variable is required');
|
||||
}
|
||||
|
||||
if (!process.env.GOOGLE_EMBEDDING_MODEL) {
|
||||
throw new Error('GOOGLE_EMBEDDING_MODEL environment variable is required (e.g., gemini-embedding-001)');
|
||||
}
|
||||
|
||||
const genAI = new GoogleGenerativeAI(process.env.GOOGLE_GENERATIVE_AI_API_KEY);
|
||||
|
||||
const embeddingModel = genAI.getGenerativeModel({
|
||||
model: 'text-embedding-004',
|
||||
model: process.env.GOOGLE_EMBEDDING_MODEL,
|
||||
});
|
||||
|
||||
/**
|
||||
* Generates a vector embedding for a given text using Google's text-embedding-004 model.
|
||||
* The output is a 768-dimension vector (not 1536 as originally specified).
|
||||
* Generates a vector embedding for a given text using the configured Google embedding model.
|
||||
*
|
||||
* @param text - The text to embed
|
||||
* @returns A 768-dimension vector (Array<number>)
|
||||
* @returns A vector embedding (dimension depends on model)
|
||||
*/
|
||||
export async function generateEmbedding(text: string): Promise<number[]> {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user