wujingjing
2025-02-27 a7f63afaf91a644062c359fcc7f26cffdff6afbc
src/api/ai/chat.ts
@@ -259,7 +259,7 @@
 * @description 流式大模型对话
 * @param {FormData} params
 **/
export const questionStreamByPost = (params, callback: (chunkRes) => void) =>
export const questionStreamByPost = (params, callback: (chunkRes) => void, extraData: any = {}) =>
   streamReq(
      {
         url: `/chat/question_stream`,
@@ -269,10 +269,28 @@
         headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
         },
         ...extraData,
      },
      callback
   );
/**
 * @description 流式大模型对话
 * @param {FormData} params
 **/
export const agentStreamByPost = (params, callback: (chunkRes) => void, extraData: any = {}) =>
   streamReq(
      {
         url: `/chat/agent_stream`,
         method: 'post',
         data: params,
         params: {},
         headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
         },
         ...extraData,
      },
      callback
   );
/**
 * @summary AI大模型对话
 */
@@ -299,7 +317,7 @@
      },
   });
};
//修改对话分组列表标题
export const setHistoryGroupTitle = async (params, req: any = request) => {
   return req({
      url: 'history/set_history_group_title',
@@ -332,6 +350,18 @@
      },
   });
};
export const querySimilarityScenePrompt = async (params, req: any = request) => {
   return req({
      url: 'scene/query_similarity_scene_prompt',
      method: 'POST',
      data: params,
      headers: {
         'Content-Type': 'application/x-www-form-urlencoded',
      },
   });
};
export const getMetricsNames = async (req: any = request) => {
   return req({
      url: 'chat/get_metrics_names',
@@ -461,3 +491,53 @@
      },
   });
};
/**
 * @description 将当前对话历史分享
 * @param {FormData} params
 **/
export const shareChatHistoryByPost = (params) =>
   request({
      url: `/chat/share_chat_history`,
      method: 'post',
      params: params,
      headers: {
         'Content-Type': 'application/x-www-form-urlencoded',
      },
   });
/**
 * @description 查询异步结果
 * @param {FormData} params
 **/
export const shareAsyncQueryByPost = (params) =>
   request({
      url: `/chat/share_async_query`,
      method: 'post',
      params: params,
      headers: {
         'Content-Type': 'application/x-www-form-urlencoded',
      },
   });
/**
 * @description 将当前对话历史分享
 * @param {FormData} params
 **/
export const getShareChatJsonByPost = (params) =>
   request({
      url: `/chat/get_share_chat_json`,
      method: 'post',
      params: params,
      headers: {
         'Content-Type': 'application/x-www-form-urlencoded',
      },
   });
export const question_stream_reply = (params) =>
   request({
      url: `/chat/question_stream_reply`,
      method: 'post',
      params: params,
      headers: {
         'Content-Type': 'application/x-www-form-urlencoded',
      },
   });