mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 01:18:05 +08:00
Feat/plugins (#12547)
Co-authored-by: AkaraChen <akarachen@outlook.com> Co-authored-by: Yi <yxiaoisme@gmail.com> Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: JzoNg <jzongcode@gmail.com> Co-authored-by: twwu <twwu@dify.ai> Co-authored-by: kurokobo <kuro664@gmail.com> Co-authored-by: Hiroshi Fujita <fujita-h@users.noreply.github.com>
This commit is contained in:
@ -25,14 +25,14 @@ export enum ProviderType {
|
||||
}
|
||||
|
||||
export enum AppType {
|
||||
'chat' = 'chat',
|
||||
'completion' = 'completion',
|
||||
chat = 'chat',
|
||||
completion = 'completion',
|
||||
}
|
||||
|
||||
export enum ModelModeType {
|
||||
'chat' = 'chat',
|
||||
'completion' = 'completion',
|
||||
'unset' = '',
|
||||
chat = 'chat',
|
||||
completion = 'completion',
|
||||
unset = '',
|
||||
}
|
||||
|
||||
export enum RETRIEVE_TYPE {
|
||||
@ -110,9 +110,9 @@ export type ParagraphTypeFormItem = {
|
||||
export type UserInputFormItem = {
|
||||
'text-input': TextTypeFormItem
|
||||
} | {
|
||||
'select': SelectTypeFormItem
|
||||
select: SelectTypeFormItem
|
||||
} | {
|
||||
'paragraph': TextTypeFormItem
|
||||
paragraph: TextTypeFormItem
|
||||
}
|
||||
|
||||
export type AgentTool = {
|
||||
@ -351,6 +351,13 @@ export type App = {
|
||||
/** api site url */
|
||||
api_base_url: string
|
||||
tags: Tag[]
|
||||
workflow?: {
|
||||
id: string
|
||||
created_at: number
|
||||
created_by?: string
|
||||
updated_at: number
|
||||
updated_by?: string
|
||||
}
|
||||
}
|
||||
|
||||
export type AppSSO = {
|
||||
|
||||
@ -24,6 +24,7 @@ export type SystemFeatures = {
|
||||
sso_enforced_for_web: boolean
|
||||
sso_enforced_for_web_protocol: SSOProtocol | ''
|
||||
enable_web_sso_switch_component: boolean
|
||||
enable_marketplace: boolean
|
||||
enable_email_code_login: boolean
|
||||
enable_email_password_login: boolean
|
||||
enable_social_oauth_login: boolean
|
||||
@ -39,6 +40,7 @@ export const defaultSystemFeatures: SystemFeatures = {
|
||||
sso_enforced_for_web: false,
|
||||
sso_enforced_for_web_protocol: '',
|
||||
enable_web_sso_switch_component: false,
|
||||
enable_marketplace: false,
|
||||
enable_email_code_login: false,
|
||||
enable_email_password_login: false,
|
||||
enable_social_oauth_login: false,
|
||||
|
||||
@ -3,11 +3,33 @@ import type { BlockEnum, ConversationVariable, Edge, EnvironmentVariable, Node }
|
||||
import type { TransferMethod } from '@/types/app'
|
||||
import type { ErrorHandleTypeEnum } from '@/app/components/workflow/nodes/_base/components/error-handle/types'
|
||||
|
||||
export type AgentLogItem = {
|
||||
node_execution_id: string,
|
||||
id: string,
|
||||
node_id: string,
|
||||
parent_id?: string,
|
||||
label: string,
|
||||
data: object, // debug data
|
||||
error?: string,
|
||||
status: string,
|
||||
metadata?: {
|
||||
elapsed_time?: number
|
||||
provider?: string
|
||||
icon?: string
|
||||
},
|
||||
}
|
||||
|
||||
export type AgentLogItemWithChildren = AgentLogItem & {
|
||||
hasCircle?: boolean
|
||||
children: AgentLogItemWithChildren[]
|
||||
}
|
||||
|
||||
export type NodeTracing = {
|
||||
id: string
|
||||
index: number
|
||||
predecessor_node_id: string
|
||||
node_id: string
|
||||
iteration_id?: string
|
||||
node_type: BlockEnum
|
||||
title: string
|
||||
inputs: any
|
||||
@ -30,6 +52,11 @@ export type NodeTracing = {
|
||||
parallel_mode_run_id?: string
|
||||
iteration_duration_map?: IterationDurationMap
|
||||
error_strategy?: ErrorHandleTypeEnum
|
||||
agent_log?: AgentLogItem[]
|
||||
tool_info?: {
|
||||
agent_strategy?: string
|
||||
icon?: string
|
||||
}
|
||||
}
|
||||
metadata: {
|
||||
iterator_length: number
|
||||
@ -47,11 +74,18 @@ export type NodeTracing = {
|
||||
expand?: boolean // for UI
|
||||
details?: NodeTracing[][] // iteration detail
|
||||
retryDetail?: NodeTracing[] // retry detail
|
||||
retry_index?: number
|
||||
parallelDetail?: { // parallel detail. if is in parallel, this field will be set
|
||||
isParallelStartNode?: boolean
|
||||
parallelTitle?: string
|
||||
branchTitle?: string
|
||||
children?: NodeTracing[]
|
||||
}
|
||||
parallel_id?: string
|
||||
parallel_start_node_id?: string
|
||||
parent_parallel_id?: string
|
||||
parent_parallel_start_node_id?: string
|
||||
retry_index?: number
|
||||
agentLog?: AgentLogItemWithChildren[] // agent log
|
||||
}
|
||||
|
||||
export type FetchWorkflowDraftResponse = {
|
||||
@ -128,18 +162,7 @@ export type NodeStartedResponse = {
|
||||
task_id: string
|
||||
workflow_run_id: string
|
||||
event: string
|
||||
data: {
|
||||
id: string
|
||||
node_id: string
|
||||
iteration_id?: string
|
||||
parallel_run_id?: string
|
||||
node_type: string
|
||||
index: number
|
||||
predecessor_node_id?: string
|
||||
inputs: any
|
||||
created_at: number
|
||||
extras?: any
|
||||
}
|
||||
data: NodeTracing
|
||||
}
|
||||
|
||||
export type FileResponse = {
|
||||
@ -157,120 +180,42 @@ export type NodeFinishedResponse = {
|
||||
task_id: string
|
||||
workflow_run_id: string
|
||||
event: string
|
||||
data: {
|
||||
id: string
|
||||
node_id: string
|
||||
iteration_id?: string
|
||||
node_type: string
|
||||
index: number
|
||||
predecessor_node_id?: string
|
||||
inputs: any
|
||||
process_data: any
|
||||
outputs: any
|
||||
status: string
|
||||
error: string
|
||||
elapsed_time: number
|
||||
execution_metadata: {
|
||||
total_tokens: number
|
||||
total_price: number
|
||||
currency: string
|
||||
parallel_id?: string
|
||||
parallel_start_node_id?: string
|
||||
iteration_index?: number
|
||||
iteration_id?: string
|
||||
parallel_mode_run_id: string
|
||||
error_strategy?: ErrorHandleTypeEnum
|
||||
}
|
||||
created_at: number
|
||||
files?: FileResponse[]
|
||||
retry_index?: number
|
||||
}
|
||||
data: NodeTracing
|
||||
}
|
||||
|
||||
export type IterationStartedResponse = {
|
||||
task_id: string
|
||||
workflow_run_id: string
|
||||
event: string
|
||||
data: {
|
||||
id: string
|
||||
node_id: string
|
||||
metadata: {
|
||||
iterator_length: number
|
||||
iteration_id: string
|
||||
iteration_index: number
|
||||
}
|
||||
created_at: number
|
||||
extras?: any
|
||||
}
|
||||
data: NodeTracing
|
||||
}
|
||||
|
||||
export type IterationNextResponse = {
|
||||
task_id: string
|
||||
workflow_run_id: string
|
||||
event: string
|
||||
data: {
|
||||
id: string
|
||||
node_id: string
|
||||
index: number
|
||||
output: any
|
||||
extras?: any
|
||||
created_at: number
|
||||
parallel_mode_run_id: string
|
||||
execution_metadata: {
|
||||
parallel_id?: string
|
||||
iteration_index: number
|
||||
parallel_mode_run_id?: string
|
||||
}
|
||||
duration?: number
|
||||
}
|
||||
data: NodeTracing
|
||||
}
|
||||
|
||||
export type IterationFinishedResponse = {
|
||||
task_id: string
|
||||
workflow_run_id: string
|
||||
event: string
|
||||
data: {
|
||||
id: string
|
||||
node_id: string
|
||||
outputs: any
|
||||
extras?: any
|
||||
status: string
|
||||
created_at: number
|
||||
error: string
|
||||
execution_metadata: {
|
||||
parallel_id?: string
|
||||
}
|
||||
}
|
||||
data: NodeTracing
|
||||
}
|
||||
|
||||
export type ParallelBranchStartedResponse = {
|
||||
task_id: string
|
||||
workflow_run_id: string
|
||||
event: string
|
||||
data: {
|
||||
parallel_id: string
|
||||
parallel_start_node_id: string
|
||||
parent_parallel_id: string
|
||||
parent_parallel_start_node_id: string
|
||||
iteration_id?: string
|
||||
created_at: number
|
||||
}
|
||||
data: NodeTracing
|
||||
}
|
||||
|
||||
export type ParallelBranchFinishedResponse = {
|
||||
task_id: string
|
||||
workflow_run_id: string
|
||||
event: string
|
||||
data: {
|
||||
parallel_id: string
|
||||
parallel_start_node_id: string
|
||||
parent_parallel_id: string
|
||||
parent_parallel_start_node_id: string
|
||||
iteration_id?: string
|
||||
status: string
|
||||
created_at: number
|
||||
error: string
|
||||
}
|
||||
data: NodeTracing
|
||||
}
|
||||
|
||||
export type TextChunkResponse = {
|
||||
@ -291,6 +236,12 @@ export type TextReplaceResponse = {
|
||||
}
|
||||
}
|
||||
|
||||
export type AgentLogResponse = {
|
||||
task_id: string
|
||||
event: string
|
||||
data: AgentLogItemWithChildren
|
||||
}
|
||||
|
||||
export type WorkflowRunHistory = {
|
||||
id: string
|
||||
sequence_number: number
|
||||
|
||||
Reference in New Issue
Block a user