import { apiClient } from './apiClient';

export const settingsService = {
  async getVisionModels() {
    const response = await apiClient.get('/settings/vision-models');
    return response.data;
  },

  async getVisionModel() {
    const response = await apiClient.get('/settings/vision-model');
    return response.data;
  },

  async updateVisionModel(visionModelId: string) {
    const response = await apiClient.put('/settings/vision-model', {
      visionModelId,
    });
    return response.data;
  },

  async getLanguage() {
    const response = await apiClient.get('/settings/language');
    return response.data;
  },

  async updateLanguage(language: string) {
    console.log('=== API Call updateLanguage ===');
    console.log('Requested language:', language);
    console.log('Request URL:', '/settings/language');
    const response = await apiClient.put('/settings/language', {
      language,
    });
    console.log('API Response:', response);
    return response.data;
  },
};