import axios from 'axios'; import { ClassificationResponse, BatchClassificationResponse, CategorySuggestionResponse, ValidationRequest, ValidationResponse, ImprovementRequest, ImprovementResponse, ModelInfoResponse, HealthResponse } from '../types/api'; const API_BASE_URL = 'http://localhost:8000'; const api = axios.create({ baseURL: API_BASE_URL, headers: { 'Content-Type': 'application/json', }, }); export const healthCheck = async (): Promise => { const response = await api.get('/health'); return response.data; }; export const getModelInfo = async (): Promise => { const response = await api.get('/model-info'); return response.data; }; export const classifyText = async (text: string, categories?: string[]): Promise => { const response = await api.post('/classify', { text, categories, }); return response.data; }; export const classifyBatch = async (texts: string[], categories?: string[]): Promise => { const response = await api.post('/classify-batch', { texts, categories, }); return response.data; }; export const suggestCategories = async (texts: string[]): Promise => { const response = await api.post('/suggest-categories', texts); return response.data; }; export const validateClassifications = async (request: ValidationRequest): Promise => { const response = await api.post('/validate', request); return response.data; }; export const improveClassification = async (request: ImprovementRequest): Promise => { const response = await api.post('/improve-classification', request); return response.data; };