import {deleteAction, deleteAction1, getAction, postAction} from "./manage";

// 知识库列表
export const listPage = (params) => getAction(`/api/dataset/${params.pageNum}/${params.pageSize}`);
// 新增知识库
export const addDataset = (params) => postAction(`/api/dataset`, params);
// 删除知识库
export const deleteDataset = (params) => deleteAction(`/api/dataset`, params);
// 知识库详情
export const documentDetail = (documentId) => getAction(`/api/dataset/${documentId}/document`);
// 知识库文件详情
export const documentFileDetail = (params) => getAction(`/api/dataset/${params.documentId}/document/${params.fileId}/paragraph`);
// 新增知识库文件
export const addDocument = (params) => postAction(`/api/dataset/${params.id}/document`, params);
// 删除知识库文件
export const documentFileDelete = (params) => deleteAction1(`/api/dataset/${params.documentId}/document/${params.fileId}`, params);
// 创建会话id
export const chatOpen = (params) => postAction(`/api/application/chat_workflow/open`, params);
// 获取会话记录
export const getChatRecord = (params) => getAction(`/api/application/f3acba96-0504-11ef-9c5a-0242ac110006/chat`, params);
// 根据会话id获取具体的对话记录
export const getChatRecordByChatId = (params) => getAction(`/api/application/f3acba96-0504-11ef-9c5a-0242ac110006/chat/${params.chatId}/chat_record/`);
// 根据文档ID获取参考段落信息
export const getChatDatasetQuote = (params) => getAction(`/api/dataset/${params.datasetId}/hit_test`,params);
//文心大模型
export const wenxinModel = (params) => postAction(`/wenxinApi/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions_pro`, params);

export default {
  listPage,
  getChatRecord,
  getChatRecordByChatId,
  addDataset,
  documentDetail,
  documentFileDetail,
  documentFileDelete,
  deleteDataset,
  addDocument,
  chatOpen,
  getChatDatasetQuote,
  wenxinModel,

}
