Merge branch 'master' into add-product-upload-page

This commit is contained in:
2025-02-23 15:40:54 -05:00
parent 3f16413769
commit f628774267
47 changed files with 4674 additions and 3199 deletions

View File

@@ -3,11 +3,20 @@ const router = express.Router();
const OpenAI = require('openai');
const fs = require('fs').promises;
const path = require('path');
const dotenv = require('dotenv');
// Ensure environment variables are loaded
dotenv.config({ path: path.join(__dirname, '../../.env') });
// Initialize OpenAI client
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY
});
if (!process.env.OPENAI_API_KEY) {
console.error('Warning: OPENAI_API_KEY is not set in environment variables');
}
// Cache configuration
const CACHE_TTL = 60 * 60 * 1000; // 1 hour in milliseconds