From a7f63afaf91a644062c359fcc7f26cffdff6afbc Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期四, 27 二月 2025 15:13:44 +0800 Subject: [PATCH] 停止操作 --- src/api/ai/chat.ts | 86 +++++++++++++++++++++++++++++++++++++++++- 1 files changed, 83 insertions(+), 3 deletions(-) diff --git a/src/api/ai/chat.ts b/src/api/ai/chat.ts index d7a9c9a..7b4d155 100644 --- a/src/api/ai/chat.ts +++ b/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', + }, + }); -- Gitblit v1.9.3