import HttpAxios from '@/utils/axios'

const base = import.meta.env.VITE_API_HOST
const baseUrl = `${base}/main_new_version.php`

/**
 * Prompt Configuration数据
 */
export const getPromptConfiguration = (params: any, config: any) => {
  return HttpAxios.post(
    `${baseUrl}`,
    {
      action: 'robot',
      ...params
    },
    config
  )
}
/**
 * 保存Prompt Configuration数据
 */
export const SavePromptConfiguration = (params: any, config: any) => {
  return HttpAxios.post(
    `${baseUrl}`,
    {
      action: 'robot',
      operate: 'save',
      ...params
    },
    config
  )
}
/**
 * 编辑返回prompt数据
 */
export const EditPrompt = (params: any, config: any) => {
  return HttpAxios.post(
    `${baseUrl}`,
    {
      action: 'robot',
      operate: 'preview_propmpt_witout_save',
      ...params
    },
    config
  )
}
/**
 * AI测试问题
 */
export const PromptAITest = (params: any, config: any) => {
  return HttpAxios.post(
    `${baseUrl}`,
    {
      action: 'robot',
      operate: 'test_with_ds_claude',
      ...params
    },
    config
  )
}

/**
 * 获取prompt提示器
 */
export const getPrompt = (params: any, config: any) => {
  return HttpAxios.post(
    `${baseUrl}`,
    {
      action: 'robot_chat',
      operate: 'ai_chat_prompt',
      ...params
    },
    config
  )
}

/**
 * ai聊天
 */
export const aiChat = (params: any, config: any) => {
  return HttpAxios.post(
    `${baseUrl}`,
    {
      action: 'robot_chat',
      operate: 'ai_chat',
      ...params
    },
    config
  )
}

/**
 * 暂停ai聊天
 */
export const pauseAiChat = (params: any, config: any) => {
  return HttpAxios.post(
    `${baseUrl}`,
    {
      action: 'robot_chat',
      operate: 'ai_chat_stop',
      ...params
    },
    config
  )
}

/**
 * 评价ai聊天
 */
export const feedbackAiChat = (params: any, config: any) => {
  return HttpAxios.post(
    `${baseUrl}`,
    {
      action: 'robot_chat',
      operate: 'ai_chat_answer_mark',
      ...params
    },
    config
  )
}
