-- LLM 服务商配置表
CREATE TABLE IF NOT EXISTS llm_providers (
  code          TEXT PRIMARY KEY,
  name          TEXT NOT NULL,
  icon          TEXT,
  protocol      TEXT DEFAULT 'openai',
  api_key       TEXT,
  base_url      TEXT,
  default_model TEXT,
  models_json   TEXT,
  enabled       INTEGER DEFAULT 0,
  is_active     INTEGER DEFAULT 0,
  updated_at    INTEGER
);

INSERT OR IGNORE INTO llm_providers (code, name, icon, protocol, base_url, default_model, models_json) VALUES
  ('qwen',     '通义千问',  '🔮', 'openai',    'https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions', 'qwen-turbo',                '[{"value":"qwen-turbo","label":"Qwen Turbo"},{"value":"qwen-plus","label":"Qwen Plus"},{"value":"qwen-max","label":"Qwen Max"}]'),
  ('openai',   'OpenAI',   '🤖', 'openai',    'https://api.openai.com/v1/chat/completions',                          'gpt-4o-mini',               '[{"value":"gpt-4o-mini","label":"GPT-4o Mini"},{"value":"gpt-4o","label":"GPT-4o"}]'),
  ('deepseek', 'DeepSeek', '🐋', 'openai',    'https://api.deepseek.com/v1/chat/completions',                        'deepseek-chat',             '[{"value":"deepseek-chat","label":"DeepSeek Chat"},{"value":"deepseek-reasoner","label":"DeepSeek Reasoner"}]'),
  ('moonshot', 'Moonshot', '🌙', 'openai',    'https://api.moonshot.cn/v1/chat/completions',                         'moonshot-v1-8k',            '[{"value":"moonshot-v1-8k","label":"Moonshot 8k"}]'),
  ('claude',   'Claude',   '🎭', 'anthropic', 'https://api.anthropic.com/v1/messages',                               'claude-3-5-haiku-20241022', '[]');
