Merge #28 into develop_web from feature/20251219_zy

feat(web): Add Workflow

* feature/20251219_zy: (1 commits)
  feat(web): Add Workflow

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/28
This commit is contained in:
赵莹
2025-12-22 10:47:23 +08:00
65 changed files with 2843 additions and 31 deletions

View File

@@ -1,8 +1,9 @@
import { request } from '@/utils/request'
import type { Application } from '@/views/ApplicationManagement/types'
import type { ApplicationModalData } from '@/views/ApplicationManagement/types'
import type { Config } from '@/views/ApplicationConfig/types'
import { handleSSE, type SSEMessage } from '@/utils/stream'
import type { QueryParams } from '@/views/Conversation/types'
import type { WorkflowConfig } from '@/views/Workflow/types'
// 应用列表
export const getApplicationListUrl = '/apps'
@@ -13,20 +14,24 @@ export const getApplicationList = (data: Record<string, unknown>) => {
export const getApplicationConfig = (id: string) => {
return request.get(`/apps/${id}/config`)
}
// 获取集群应配置
// 获取集群应配置
export const getMultiAgentConfig = (id: string) => {
return request.get(`/apps/${id}/multi-agent`)
}
// 获取 workflow应用配置
export const getWorkflowConfig = (id: string) => {
return request.get(`/apps/${id}/workflow`)
}
// 应用详情
export const getApplication = (id: string) => {
return request.get(`/apps/${id}`)
}
// 更新应用
export const updateApplication = (id: string, values: Application) => {
export const updateApplication = (id: string, values: ApplicationModalData) => {
return request.put(`/apps/${id}`, values)
}
// 创建应用
export const addApplication = (values: Application) => {
export const addApplication = (values: ApplicationModalData) => {
return request.post('/apps', values)
}
// 保存Agent配置
@@ -37,6 +42,10 @@ export const saveAgentConfig = (app_id: string, values: Config) => {
export const saveMultiAgentConfig = (app_id: string, values: Config) => {
return request.put(`/apps/${app_id}/multi-agent`, values)
}
// 保存workflow配置
export const saveWorkflowConfig = (app_id: string, values: WorkflowConfig) => {
return request.put(`/apps/${app_id}/workflow`, values)
}
// 模型比对试运行
export const runCompare = (app_id: string, values: Record<string, unknown>, onMessage?: (data: SSEMessage[]) => void) => {
return handleSSE(`/apps/${app_id}/draft/run/compare`, values, onMessage)