export type AIEngineType =
  | "chatgpt"
  | "perplexity"
  | "kimi"
  | "wenxin"
  | "doubao"
  | "deepseek"
  | "qwen"
  | "gemini"
  | "yuanbao";

export interface AIEngineOption {
  value: AIEngineType;
  label: string;
  group: "domestic" | "international";
}

export const AI_ENGINE_OPTIONS: AIEngineOption[] = [
  { value: "chatgpt", label: "ChatGPT", group: "international" },
  { value: "perplexity", label: "Perplexity", group: "international" },
  { value: "gemini", label: "Google Gemini", group: "international" },
  { value: "kimi", label: "Kimi", group: "domestic" },
  { value: "wenxin", label: "文心一言", group: "domestic" },
  { value: "doubao", label: "豆包", group: "domestic" },
  { value: "deepseek", label: "DeepSeek", group: "domestic" },
  { value: "qwen", label: "通义千问", group: "domestic" },
  { value: "yuanbao", label: "腾讯元宝", group: "domestic" },
];

export interface AIQueryResult {
  engine_type: string;
  query: string;
  raw_response: string;
  has_brand_citation: boolean;
  has_competitor_citation: boolean;
  brand_context: string | null;
  competitor_contexts: string[];
  response_time_ms: number;
  timestamp: string;
}

export interface CitationRate {
  total_engines: number;
  brand_citation_count: number;
  brand_citation_rate: number;
  competitor_citation_count: number;
  competitor_citation_rate: number;
}

export interface AIEnginesResponse {
  results: AIQueryResult[];
  citation_rate: CitationRate;
  avg_response_time_ms: number;
}

export interface AIQueryRequest {
  engines: AIEngineType[];
  query: string;
  brand_id: string;
}
