feat(api): 添加中断智能体执行功能并优化代码注释

This commit is contained in:
rd
2025-09-12 15:40:09 +08:00
parent 5dcb381428
commit 21d6f30b55

View File

@ -46,9 +46,7 @@ export const getHeaders = () => {
}; };
}; };
/** // 获取智能体信息
* 获取智能体信息
*/
export const getAgentData = async () => { export const getAgentData = async () => {
const { data } = await axios.get(`${BASE_PYTHON_URL}/api/agent/info`, { const { data } = await axios.get(`${BASE_PYTHON_URL}/api/agent/info`, {
headers: getHeaders(), headers: getHeaders(),
@ -56,12 +54,19 @@ export const getAgentData = async () => {
return data; return data;
}; };
/** // 生成会话id
* 生成会话id
*/
export const createSession = async () => { export const createSession = async () => {
const { data } = await axios.get(`${BASE_PYTHON_URL}/api/agent/create_session`, { const { data } = await axios.get(`${BASE_PYTHON_URL}/api/agent/create_session`, {
headers: getHeaders(), headers: getHeaders(),
}); });
return data; return data;
}; };
// 中断智能体执行
export const stopAgentTask = async (params = {}) => {
const { data } = await axios.get(`${BASE_PYTHON_URL}/api/agent/stop-task`, {
headers: getHeaders(),
params,
});
return data;
};