mirror of
https://github.com/langgenius/dify.git
synced 2026-04-30 15:38:08 +08: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:
@ -4,6 +4,7 @@ import type { FlowType } from '@/types/common'
|
||||
import type {
|
||||
ConversationVariableResponse,
|
||||
FetchWorkflowDraftResponse,
|
||||
HumanInputFormData,
|
||||
NodesDefaultConfigsResponse,
|
||||
VarInInspect,
|
||||
} from '@/types/workflow'
|
||||
@ -94,3 +95,30 @@ export const fetchNodeInspectVars = async (flowType: FlowType, flowId: string, n
|
||||
const { items } = (await get(`${getFlowPrefix(flowType)}/${flowId}/workflows/draft/nodes/${nodeId}/variables`)) as { items: VarInInspect[] }
|
||||
return items
|
||||
}
|
||||
|
||||
export const submitHumanInputForm = (token: string, data: {
|
||||
inputs: Record<string, string>
|
||||
action: string
|
||||
}) => {
|
||||
return post(`/form/human_input/${token}`, { body: data })
|
||||
}
|
||||
|
||||
export const fetchHumanInputNodeStepRunForm = (
|
||||
url: string,
|
||||
data: {
|
||||
inputs: Record<string, string>
|
||||
},
|
||||
) => {
|
||||
return post<HumanInputFormData>(`${url}/preview`, { body: data })
|
||||
}
|
||||
|
||||
export const submitHumanInputNodeStepRunForm = (
|
||||
url: string,
|
||||
data: {
|
||||
inputs: Record<string, string> | undefined
|
||||
form_inputs: Record<string, string> | undefined
|
||||
action: string
|
||||
},
|
||||
) => {
|
||||
return post<CommonResponse>(`${url}/run`, { body: data })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user