mirror of
https://github.com/langgenius/dify.git
synced 2026-02-24 18:05:11 +00:00
feat: Human Input Node (#32060)
The frontend and backend implementation for the human input node. Co-authored-by: twwu <twwu@dify.ai> Co-authored-by: JzoNg <jzongcode@gmail.com> Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com> Co-authored-by: zhsama <torvalds@linux.do>
This commit is contained in:
@@ -2,6 +2,7 @@ import type { RefObject } from 'react'
|
||||
import type { Viewport } from 'reactflow'
|
||||
import type { BeforeRunFormProps } from '@/app/components/workflow/nodes/_base/components/before-run-form'
|
||||
import type { ErrorHandleTypeEnum } from '@/app/components/workflow/nodes/_base/components/error-handle/types'
|
||||
import type { FormInputItem, UserAction } from '@/app/components/workflow/nodes/human-input/types'
|
||||
import type { SpecialResultPanelProps } from '@/app/components/workflow/run/special-result-panel'
|
||||
import type { BlockEnum, CommonNodeType, ConversationVariable, Edge, EnvironmentVariable, InputVar, Node, ValueSelector, Variable, VarType } from '@/app/components/workflow/types'
|
||||
import type { RAGPipelineVariables } from '@/models/pipeline'
|
||||
@@ -165,6 +166,20 @@ export type WorkflowStartedResponse = {
|
||||
workflow_id: string
|
||||
created_at: number
|
||||
}
|
||||
conversation_id?: string // only in chatflow
|
||||
message_id?: string // only in chatflow
|
||||
}
|
||||
|
||||
export type WorkflowPausedResponse = {
|
||||
task_id: string
|
||||
workflow_run_id: string
|
||||
event: string
|
||||
data: {
|
||||
outputs: any // todo: remove any
|
||||
paused_nodes: string[]
|
||||
reasons: any[] // todo: remove any
|
||||
workflow_run_id: string
|
||||
}
|
||||
}
|
||||
|
||||
export type WorkflowFinishedResponse = {
|
||||
@@ -298,6 +313,54 @@ export type AgentLogResponse = {
|
||||
data: AgentLogItemWithChildren
|
||||
}
|
||||
|
||||
export type HumanInputFormData = {
|
||||
form_id: string
|
||||
node_id: string
|
||||
node_title: string
|
||||
form_content: string
|
||||
inputs: FormInputItem[]
|
||||
actions: UserAction[]
|
||||
form_token: string
|
||||
resolved_default_values: Record<string, string>
|
||||
display_in_ui: boolean
|
||||
expiration_time: number
|
||||
}
|
||||
|
||||
export type HumanInputRequiredResponse = {
|
||||
task_id: string
|
||||
workflow_run_id: string
|
||||
event: string
|
||||
data: HumanInputFormData
|
||||
}
|
||||
|
||||
export type HumanInputFilledFormData = {
|
||||
node_id: string
|
||||
node_title: string
|
||||
rendered_content: string
|
||||
action_id: string
|
||||
action_text: string
|
||||
}
|
||||
|
||||
export type HumanInputFormFilledResponse = {
|
||||
task_id: string
|
||||
workflow_run_id: string
|
||||
event: string
|
||||
data: HumanInputFilledFormData
|
||||
}
|
||||
|
||||
export type HumanInputFormTimeoutData = {
|
||||
node_id: string
|
||||
node_title: string
|
||||
expiration_time: number
|
||||
}
|
||||
|
||||
export type HumanInputFormTimeoutResponse = {
|
||||
task_id: string
|
||||
workflow_run_id: string
|
||||
event: string
|
||||
data: HumanInputFormTimeoutData
|
||||
}
|
||||
|
||||
export type WorkflowRunHistory = {
|
||||
id: string
|
||||
version: string
|
||||
|
||||
Reference in New Issue
Block a user