import api from './index';

export interface AIReport {
  id: string;
  title: string;
  content: string;
  status: string;
  alert_count: number;
  created_at: string;
}

export const getAIConfig = () => api.get('/ai/config');
export const updateAIConfig = (data: any) => api.post('/ai/config', data);
export const testAIConnection = (data: { ai_api_url: string; ai_api_key: string; ai_model: string }) => api.post('/ai/config/test', data);
export const getRemoteModels = (data: { ai_api_url: string; ai_api_key: string }) => api.post('/ai/config/models', data);
export const generateAIReport = () => api.post('/ai/generate-report');
export const getAIReports = (params: any) => api.get('/ai/reports', { params });
export const getAIReportDetail = (id: string) => api.get<any, AIReport>(`/ai/reports/${id}`);
