// src/seeders/001-llm-providers.js
// LLM 프로바이더 시드 데이터

const { v4: uuidv4 } = require('uuid');

module.exports = {
  up: async (queryInterface, Sequelize) => {
    const now = new Date();

    await queryInterface.bulkInsert('llm_providers', [
      {
        id: uuidv4(),
        name: 'gemini',
        display_name: 'Google Gemini',
        endpoint: null, // SDK 사용
        api_key: process.env.GEMINI_API_KEY || '',
        model_name: 'gemini-2.0-flash',
        priority: 1,
        max_tokens: 8192,
        temperature: 0.7,
        timeout_ms: 60000,
        cost_per_1k_input_tokens: 0.00025,
        cost_per_1k_output_tokens: 0.001,
        is_active: true,
        is_healthy: true,
        config: JSON.stringify({}),
        created_at: now,
        updated_at: now,
      },
      {
        id: uuidv4(),
        name: 'openai',
        display_name: 'OpenAI GPT',
        endpoint: 'https://api.openai.com/v1/chat/completions',
        api_key: process.env.OPENAI_API_KEY || '',
        model_name: 'gpt-4o-mini',
        priority: 2,
        max_tokens: 4096,
        temperature: 0.7,
        timeout_ms: 60000,
        cost_per_1k_input_tokens: 0.00015,
        cost_per_1k_output_tokens: 0.0006,
        is_active: true,
        is_healthy: true,
        config: JSON.stringify({}),
        created_at: now,
        updated_at: now,
      },
      {
        id: uuidv4(),
        name: 'claude',
        display_name: 'Anthropic Claude',
        endpoint: 'https://api.anthropic.com/v1/messages',
        api_key: process.env.CLAUDE_API_KEY || '',
        model_name: 'claude-3-haiku-20240307',
        priority: 3,
        max_tokens: 4096,
        temperature: 0.7,
        timeout_ms: 60000,
        cost_per_1k_input_tokens: 0.00025,
        cost_per_1k_output_tokens: 0.00125,
        is_active: true,
        is_healthy: true,
        config: JSON.stringify({}),
        created_at: now,
        updated_at: now,
      },
    ]);
  },

  down: async (queryInterface, Sequelize) => {
    await queryInterface.bulkDelete('llm_providers', null, {});
  },
};
