2025-05-09 16:35:09 +08:00
|
|
|
import type { InputVar, InputVarType } from '@/app/components/workflow/types'
|
2025-05-07 18:09:38 +08:00
|
|
|
import type { DSLImportMode, DSLImportStatus } from './app'
|
2025-05-14 10:48:54 +08:00
|
|
|
import type { ChunkingMode, DatasetPermission, IconInfo } from './datasets'
|
2025-05-07 18:09:38 +08:00
|
|
|
import type { Dependency } from '@/app/components/plugins/types'
|
2025-05-14 10:48:54 +08:00
|
|
|
import type { AppIconSelection } from '@/app/components/base/app-icon-picker'
|
2025-05-07 11:30:13 +08:00
|
|
|
|
|
|
|
export type PipelineTemplateListParams = {
|
|
|
|
type: 'built-in' | 'customized'
|
|
|
|
}
|
|
|
|
|
2025-05-14 10:48:54 +08:00
|
|
|
export type PipelineTemplate = {
|
2025-05-07 11:30:13 +08:00
|
|
|
id: string
|
|
|
|
name: string
|
|
|
|
icon_info: IconInfo
|
|
|
|
description: string
|
|
|
|
position: number
|
|
|
|
doc_form: ChunkingMode
|
|
|
|
}
|
|
|
|
|
|
|
|
export type PipelineTemplateListResponse = {
|
2025-05-14 10:48:54 +08:00
|
|
|
pipelines: PipelineTemplate[]
|
2025-05-07 11:30:13 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export type PipelineTemplateByIdResponse = {
|
|
|
|
name: string
|
|
|
|
icon_info: IconInfo
|
|
|
|
description: string
|
2025-05-07 18:09:38 +08:00
|
|
|
author: string // todo: TBD
|
|
|
|
structure: string // todo: TBD
|
2025-05-07 11:30:13 +08:00
|
|
|
export_data: string
|
|
|
|
}
|
|
|
|
|
2025-05-14 10:48:54 +08:00
|
|
|
export type CreateFormData = {
|
|
|
|
name: string
|
|
|
|
appIcon: AppIconSelection
|
|
|
|
description: string
|
|
|
|
permission: DatasetPermission
|
|
|
|
selectedMemberIDs: string[]
|
|
|
|
}
|
|
|
|
|
2025-05-07 14:29:01 +08:00
|
|
|
export type UpdatePipelineInfoRequest = {
|
|
|
|
pipeline_id: string
|
2025-05-07 11:30:13 +08:00
|
|
|
name: string
|
|
|
|
icon_info: IconInfo
|
|
|
|
description: string
|
|
|
|
}
|
|
|
|
|
2025-05-07 14:29:01 +08:00
|
|
|
export type UpdatePipelineInfoResponse = {
|
|
|
|
pipeline_id: string
|
|
|
|
name: string
|
|
|
|
icon_info: IconInfo
|
|
|
|
description: string
|
|
|
|
position: number
|
|
|
|
}
|
|
|
|
|
|
|
|
export type DeletePipelineResponse = {
|
|
|
|
code: number
|
|
|
|
}
|
|
|
|
|
2025-05-14 14:49:01 +08:00
|
|
|
export type ExportPipelineDSLRequest = {
|
|
|
|
pipeline_id: string
|
|
|
|
include_secret?: boolean
|
|
|
|
}
|
|
|
|
|
2025-05-07 11:30:13 +08:00
|
|
|
export type ExportPipelineDSLResponse = {
|
|
|
|
data: string
|
|
|
|
}
|
2025-05-07 18:09:38 +08:00
|
|
|
|
|
|
|
export type ImportPipelineDSLRequest = {
|
|
|
|
mode: DSLImportMode
|
2025-05-14 14:49:01 +08:00
|
|
|
yaml_content?: string
|
|
|
|
yaml_url?: string
|
|
|
|
pipeline_id?: string
|
2025-05-07 18:09:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export type ImportPipelineDSLResponse = {
|
|
|
|
id: string
|
|
|
|
status: DSLImportStatus
|
2025-05-14 14:49:01 +08:00
|
|
|
pipeline_id: string
|
|
|
|
current_dsl_version: string
|
|
|
|
imported_dsl_version: string
|
|
|
|
error: string
|
|
|
|
leaked_dependencies: Dependency[]
|
|
|
|
}
|
|
|
|
|
|
|
|
export type ImportPipelineDSLConfirmRequest = {
|
|
|
|
import_id: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export type ImportPipelineDSLConfirmResponse = {
|
|
|
|
id: string
|
|
|
|
status: DSLImportStatus
|
|
|
|
pipeline_id: string
|
|
|
|
current_dsl_version: string
|
|
|
|
imported_dsl_version: string
|
2025-05-07 18:09:38 +08:00
|
|
|
error: string
|
2025-05-14 14:49:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export type PipelineCheckDependenciesResponse = {
|
2025-05-07 18:09:38 +08:00
|
|
|
leaked_dependencies: Dependency[]
|
|
|
|
}
|
2025-05-08 18:29:49 +08:00
|
|
|
|
|
|
|
export type Variables = {
|
|
|
|
type: InputVarType
|
|
|
|
label: string
|
|
|
|
description: string
|
|
|
|
variable: string
|
|
|
|
max_length: number
|
|
|
|
required: boolean
|
|
|
|
options?: string[]
|
2025-05-09 12:56:57 +08:00
|
|
|
default: string | number | boolean
|
2025-05-08 18:29:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export type PipelineProcessingParamsResponse = {
|
|
|
|
variables: Variables[]
|
|
|
|
}
|
2025-05-09 16:35:09 +08:00
|
|
|
|
|
|
|
export type RAGPipelineVariable = InputVar
|
|
|
|
|
|
|
|
export type RAGPipelineVariables = Array<{
|
|
|
|
nodeId: string
|
|
|
|
variables: RAGPipelineVariable[]
|
|
|
|
}>
|