Merge #68 into develop_web from feature/20251219_zy
feat(web): workflow’s Editor Variable support Tag * feature/20251219_zy: (4 commits) feat(web): add tool management fix(web): get the parent domain name adaptation IP fix(web): Conversation add initialValue feat(web): workflow’s Editor Variable support Tag Signed-off-by: zhaoying <zhaoying@redbearai.com> Merged-by: zhaoying <zhaoying@redbearai.com> CR-link: https://codeup.aliyun.com/redbearai/python/redbear-mem-open/change/68
This commit is contained in:
31
web/src/api/tools.ts
Normal file
31
web/src/api/tools.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { request } from '@/utils/request'
|
||||
import type { Query, CustomToolItem, ExecuteData, MCPToolItem, InnerToolItem } from '@/views/ToolManagement/types'
|
||||
|
||||
// 工具列表
|
||||
export const getTools = (data: Query) => {
|
||||
return request.get('/tools', data)
|
||||
}
|
||||
// 创建MCP工具
|
||||
export const addTool = (values: MCPToolItem | CustomToolItem) => {
|
||||
return request.post('/tools', values)
|
||||
}
|
||||
// 更新工具
|
||||
export const updateTool = (tool_id: string, data: MCPToolItem | InnerToolItem | CustomToolItem) => {
|
||||
return request.put(`/tools/${tool_id}`, data)
|
||||
}
|
||||
// 删除工具
|
||||
export const deleteTool = (tool_id: string) => {
|
||||
return request.delete(`/tools/${tool_id}`)
|
||||
}
|
||||
// MCP 测试连接
|
||||
export const testConnection = (tool_id: string) => {
|
||||
return request.post(`/tools/${tool_id}/test`)
|
||||
}
|
||||
// 工具测试
|
||||
export const execute = (data: ExecuteData) => {
|
||||
return request.post(`/tools/execution/execute`, data)
|
||||
}
|
||||
export const parseSchema = (data: Record<string, any>) => {
|
||||
return request.post(`/tools/parse_schema`, data)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user