// 数据集相关
import { request } from '@/utils/request/index.ts';

// ?数据集
export const reasonDatasetListApi = async () => {
  return request({
    url: '/performance/datasets',
    method: 'GET',
  })
}

// 测试集
// export const testDatasetListApi = async () => {
//   return request({
//     url: '/config/test_datasets',
//     method: 'GET',
//   })
// }

// // 训练集
// export const trainDatasetListApi = async () => {
//   return request({
//     url: '/config/train_datasets',
//     method: 'GET',
//   })
// }

// 数据集
export const datasetListApi = async (params: Record<string, any>) => {
  return request({
    url: '/data/exported_data',
    method: 'GET',
    params: params
  })
}

// 更新数据集
export const updateDatasetApi = async (params: Record<string, any>) => {
  return request({
    url: '/data/exported_data',
    method: 'PUT',
    data: params
  })
}

// 删除数据集
export const deleteDatasetApi = async (id: number | string) => {
return request({
    url: `/data/exported_data/${id}`,
    method: 'DELETE',
  })
}

// 下载数据集
export const downloadApi = async (params: Record<string, any>) => {
  return request({
    url: `/data/exported_data/${params.id}`,
    method: 'GET',
    getRaw: true,
    params: params
  })
}
