import request from '@/utils/request'

export function listAiProvider() {
  return request({ url: '/knowledge/ai-provider/list', method: 'get' })
}

export function getAiProvider(id) {
  return request({ url: '/knowledge/ai-provider/' + id, method: 'get' })
}

export function addAiProvider(data) {
  return request({ url: '/knowledge/ai-provider', method: 'post', data })
}

export function updateAiProvider(id, data) {
  return request({ url: '/knowledge/ai-provider/' + id, method: 'put', data })
}

export function deleteAiProvider(id) {
  return request({ url: '/knowledge/ai-provider/' + id, method: 'delete' })
}

export function setDefaultAiProvider(id) {
  return request({ url: '/knowledge/ai-provider/' + id + '/set-default', method: 'post' })
}

export function testAiProvider(data) {
  return request({ url: '/knowledge/ai-provider/test', method: 'post', data })
}
