mirror of
https://github.com/langgenius/dify.git
synced 2025-12-27 01:52:29 +00:00
feat: Enhance InputFieldDialog and workflow hooks to handle ragPipelineVariables
This commit is contained in:
parent
5bb02c79cc
commit
4c30d1c1eb
@ -95,6 +95,8 @@ const InputFieldDialog = ({
|
||||
{
|
||||
datasourceKeys.map((key) => {
|
||||
const inputFields = inputFieldsMap[key] || []
|
||||
if (!inputFields.length)
|
||||
return null
|
||||
return (
|
||||
<FieldList
|
||||
LabelRightContent={<Datasource title={datasourceTitleMap[key]} />}
|
||||
@ -107,13 +109,15 @@ const InputFieldDialog = ({
|
||||
})
|
||||
}
|
||||
{/* Shared Inputs */}
|
||||
<FieldList
|
||||
LabelRightContent={<SharedInputs />}
|
||||
inputFields={inputFieldsMap.shared || []}
|
||||
readonly={readonly}
|
||||
labelClassName='pt-1 pb-2'
|
||||
handleInputFieldsChange={updateInputFields.bind(null, '')}
|
||||
/>
|
||||
{inputFieldsMap.shared?.length > 0 && (
|
||||
<FieldList
|
||||
LabelRightContent={<SharedInputs />}
|
||||
inputFields={inputFieldsMap.shared}
|
||||
readonly={readonly}
|
||||
labelClassName='pt-1 pb-2'
|
||||
handleInputFieldsChange={updateInputFields.bind(null, '')}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
<FooterTip />
|
||||
</div>
|
||||
|
||||
@ -24,6 +24,7 @@ export const useNodesSyncDraft = () => {
|
||||
pipelineId,
|
||||
environmentVariables,
|
||||
syncWorkflowDraftHash,
|
||||
ragPipelineVariables,
|
||||
} = workflowStore.getState()
|
||||
|
||||
if (pipelineId) {
|
||||
@ -58,6 +59,7 @@ export const useNodesSyncDraft = () => {
|
||||
},
|
||||
},
|
||||
environment_variables: environmentVariables,
|
||||
rag_pipeline_variables: ragPipelineVariables,
|
||||
hash: syncWorkflowDraftHash,
|
||||
},
|
||||
}
|
||||
|
||||
@ -38,6 +38,7 @@ export const usePipelineInit = () => {
|
||||
setSyncWorkflowDraftHash,
|
||||
setDraftUpdatedAt,
|
||||
setToolPublished,
|
||||
setRagPipelineVariables,
|
||||
} = workflowStore.getState()
|
||||
try {
|
||||
const res = await fetchWorkflowDraft(`/rag/pipeline/${datasetId}/workflows/draft`)
|
||||
@ -50,6 +51,7 @@ export const usePipelineInit = () => {
|
||||
}, {} as Record<string, string>))
|
||||
setEnvironmentVariables(res.environment_variables?.map(env => env.value_type === 'secret' ? { ...env, value: '[__HIDDEN__]' } : env) || [])
|
||||
setSyncWorkflowDraftHash(res.hash)
|
||||
setRagPipelineVariables?.(res.rag_pipeline_variables || [])
|
||||
setIsLoading(false)
|
||||
}
|
||||
catch (error: any) {
|
||||
|
||||
@ -2,6 +2,7 @@ import type { Viewport } from 'reactflow'
|
||||
import type { BlockEnum, ConversationVariable, Edge, EnvironmentVariable, Node } from '@/app/components/workflow/types'
|
||||
import type { TransferMethod } from '@/types/app'
|
||||
import type { ErrorHandleTypeEnum } from '@/app/components/workflow/nodes/_base/components/error-handle/types'
|
||||
import type { RAGPipelineVariables } from '@/models/pipeline'
|
||||
|
||||
export type AgentLogItem = {
|
||||
node_execution_id: string,
|
||||
@ -120,6 +121,7 @@ export type FetchWorkflowDraftResponse = {
|
||||
tool_published: boolean
|
||||
environment_variables?: EnvironmentVariable[]
|
||||
conversation_variables?: ConversationVariable[]
|
||||
rag_pipeline_variables?: RAGPipelineVariables
|
||||
version: string
|
||||
marked_name: string
|
||||
marked_comment: string
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user