import OpenAI from 'openai';
import dotenv from 'dotenv';

dotenv.config();

// --- DEEPSEEK CONFIGURATION (PASIFİZE EDİLDİ) ---
// const apiKey = process.env.DEEPSEEK_API_KEY;
// if (!apiKey) {
//   console.warn('WARNING: DEEPSEEK_API_KEY is missing from environment variables.');
// }
// export const openai = new OpenAI({
//   baseURL: 'https://api.deepseek.com/v1',
//   apiKey: apiKey || 'dummy-key',
// });
// ----------------------------------------------

// --- MİZAN (RUNPOD) CONFIGURATION ---
// Gerçek adresi kod içinde sabit tutmuyoruz (bkz. lib/aiConfig.ts) — sadece env'den okunuyor.
const runpodBaseUrl = process.env.RUNPOD_API_BASE_URL ? `${process.env.RUNPOD_API_BASE_URL}/v1` : undefined;
const runpodApiKey = process.env.RUNPOD_API_KEY || 'dummy-key';

export const openai = runpodBaseUrl
  ? new OpenAI({ baseURL: runpodBaseUrl, apiKey: runpodApiKey })
  : null;
// ------------------------------------
