From 1dffd4194a0bd3ab8415853427c598a7441764a9 Mon Sep 17 00:00:00 2001 From: jingrow Date: Wed, 5 Nov 2025 01:48:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=80=E4=BA=9B=E6=9C=AA?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=9A=84=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jingrow/frontend/src/shared/api/agents.ts | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/apps/jingrow/frontend/src/shared/api/agents.ts b/apps/jingrow/frontend/src/shared/api/agents.ts index 3740294..f4b9e49 100644 --- a/apps/jingrow/frontend/src/shared/api/agents.ts +++ b/apps/jingrow/frontend/src/shared/api/agents.ts @@ -1,10 +1,10 @@ import axios from 'axios' -import type { AIAgent, AgentExecutionResult } from '../types' -import { deleteRecords, createRecord, updateRecord, getFieldSelectOptions, getRecord } from './common' +import type { AIAgent } from '../types' +import { getRecord } from './common' // 重新导出类型,供其他模块使用 -export type { AIAgent, AgentExecutionResult } +export type { AIAgent } // 统一使用相对路径,通过 Vite 代理转发到后端 @@ -73,23 +73,4 @@ export const updateAgentApi = async (name: string, data: Partial): Prom console.error("Error in updateAgentApi:", error) throw new Error(error.response?.data?.message || error.message || '更新AI Agent失败') } -} - -// 创建智能体(使用通用函数) -export const createAgent = async (data: Record): Promise<{ success: boolean; data?: any; message?: string }> => { - return createRecord('Local Ai Agent', data) -} - -// 更新智能体(使用通用函数) -export const updateAgent = async (name: string, data: Record): Promise<{ success: boolean; data?: any; message?: string }> => { - return updateRecord('Local Ai Agent', name, data) -} - -// 删除智能体(支持批量删除) -export const deleteAgents = async (names: string[]): Promise<{ success: boolean; message?: string }> => { - return deleteRecords('Local Ai Agent', names) -} - -// 获取智能体选项(参考节点实现) -export const getAgentStatusOptions = () => getFieldSelectOptions('Local Ai Agent', 'status') -export const getAgentTriggerModeOptions = () => getFieldSelectOptions('Local Ai Agent', 'trigger_mode') \ No newline at end of file +} \ No newline at end of file