zhangxiao
2024-09-26 fa482274a588e97784c10099e45d030664aa4ceb
src/api/agentSession.ts
@@ -38,6 +38,21 @@
  );
}
export function updateAgentConversation(data) {
  return axios.post(
    '/api/v1/canvas/update_agent_conversation',
    data
  );
}
export function updateSeniorAgentConversation(data) {
  return axios.post(
    '/api/v1/advanced-agent/update_agent_conversation',
    data
  );
}
// 获取会话详情
export function getAgentSessionDetailsApi(id: string) {
  return axios.get(
@@ -58,4 +73,56 @@
    '/api/v1/canvas/reset',
    data
  );
}
}
//高级agent会话
export function agentConversationSetApi(data) {
  return axios.post(
    '/api/v1/advanced-agent/conversation-set',
    data
  );
}
//高级会话下载
export function agentConverDownloadApi(data) {
  return axios.post(
    '/api/v1/advanced-agent/download',
    data
  );
}
export const downloadFile = ({
  url,
  filename,
  target,
}: {
  url: string;
  filename?: string;
  target?: string;
}) => {
  const downloadElement = document.createElement('a');
  downloadElement.style.display = 'none';
  downloadElement.href = url;
  if (target) {
    downloadElement.target = '_blank';
  }
  downloadElement.rel = 'noopener noreferrer';
  if (filename) {
    downloadElement.download = filename;
  }
  document.body.appendChild(downloadElement);
  downloadElement.click();
  document.body.removeChild(downloadElement);
};
//多文件上传/api/v1/advanced-agent/upload
export function agentUploadApi(params) {
  const config = {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      // token: token,
    },
  };
  return axios.post('/api/v1/advanced-agent/upload', params, config);
}