mirror of
https://github.com/langgenius/dify.git
synced 2026-02-01 16:41:58 +08:00
api of human input form
This commit is contained in:
parent
114dfe038c
commit
a4049e1ea7
@ -34,6 +34,7 @@ import type {
|
||||
} from '@/models/share'
|
||||
import type { ChatConfig } from '@/app/components/base/chat/types'
|
||||
import type { AccessMode } from '@/models/access-control'
|
||||
import type { FormInputItem, UserAction } from '@/app/components/workflow/nodes/human-input/types'
|
||||
|
||||
function getAction(action: 'get' | 'post' | 'del' | 'patch', isInstalledApp: boolean) {
|
||||
switch (action) {
|
||||
@ -306,3 +307,21 @@ export const getUserCanAccess = (appId: string, isInstalledApp: boolean) => {
|
||||
export const getAppAccessModeByAppCode = (appCode: string) => {
|
||||
return get<{ accessMode: AccessMode }>(`/webapp/access-mode?appCode=${appCode}`)
|
||||
}
|
||||
|
||||
export const getHumanInputForm = (token: string) => {
|
||||
return get<{
|
||||
site: any
|
||||
form_content: string
|
||||
inputs: FormInputItem[]
|
||||
user_actions: UserAction[]
|
||||
timeout: number
|
||||
timeout_unit: 'hour' | 'day'
|
||||
}>(`/api/form/human_input/${token}`)
|
||||
}
|
||||
|
||||
export const submitHumanInputForm = (token: string, data: {
|
||||
inputs: Record<string, any>
|
||||
action: string
|
||||
}) => {
|
||||
return post(`/api/form/human_input/${token}`, { body: data })
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user