From 21d6f30b55abf4537e941fb259dd84d5923b756e Mon Sep 17 00:00:00 2001 From: rd <1344903914@qq.com> Date: Fri, 12 Sep 2025 15:40:09 +0800 Subject: [PATCH] =?UTF-8?q?feat(api):=20=E6=B7=BB=E5=8A=A0=E4=B8=AD?= =?UTF-8?q?=E6=96=AD=E6=99=BA=E8=83=BD=E4=BD=93=E6=89=A7=E8=A1=8C=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=B9=B6=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/all/chat.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/api/all/chat.ts b/src/api/all/chat.ts index 0e502a0..d81c85e 100644 --- a/src/api/all/chat.ts +++ b/src/api/all/chat.ts @@ -46,9 +46,7 @@ export const getHeaders = () => { }; }; -/** - * 获取智能体信息 - */ +// 获取智能体信息 export const getAgentData = async () => { const { data } = await axios.get(`${BASE_PYTHON_URL}/api/agent/info`, { headers: getHeaders(), @@ -56,12 +54,19 @@ export const getAgentData = async () => { return data; }; -/** - * 生成会话id - */ +// 生成会话id export const createSession = async () => { const { data } = await axios.get(`${BASE_PYTHON_URL}/api/agent/create_session`, { headers: getHeaders(), }); return data; }; + +// 中断智能体执行 +export const stopAgentTask = async (params = {}) => { + const { data } = await axios.get(`${BASE_PYTHON_URL}/api/agent/stop-task`, { + headers: getHeaders(), + params, + }); + return data; +};