mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-11 20:06:54 +08:00
feat: llm support jinja fe (#4260)
This commit is contained in:
@@ -26,6 +26,7 @@ const Panel: FC<NodePanelProps<TemplateTransformNodeType>> = ({
|
||||
const {
|
||||
readOnly,
|
||||
inputs,
|
||||
availableVars,
|
||||
handleVarListChange,
|
||||
handleVarNameChange,
|
||||
handleAddVariable,
|
||||
@@ -65,7 +66,7 @@ const Panel: FC<NodePanelProps<TemplateTransformNodeType>> = ({
|
||||
</Field>
|
||||
<Split />
|
||||
<CodeEditor
|
||||
nodeId={id}
|
||||
availableVars={availableVars}
|
||||
varList={inputs.variables}
|
||||
onAddVar={handleAddVariable}
|
||||
isInNode
|
||||
|
||||
@@ -10,6 +10,7 @@ import useOneStepRun from '@/app/components/workflow/nodes/_base/hooks/use-one-s
|
||||
import {
|
||||
useNodesReadOnly,
|
||||
} from '@/app/components/workflow/hooks'
|
||||
import useAvailableVarList from '@/app/components/workflow/nodes/_base/hooks/use-available-var-list'
|
||||
|
||||
const useConfig = (id: string, payload: TemplateTransformNodeType) => {
|
||||
const { nodesReadOnly: readOnly } = useNodesReadOnly()
|
||||
@@ -22,6 +23,11 @@ const useConfig = (id: string, payload: TemplateTransformNodeType) => {
|
||||
inputsRef.current = newPayload
|
||||
}, [doSetInputs])
|
||||
|
||||
const { availableVars } = useAvailableVarList(id, {
|
||||
onlyLeafNodeVar: false,
|
||||
filterVar: () => true,
|
||||
})
|
||||
|
||||
const { handleAddVariable: handleAddEmptyVariable } = useVarList<TemplateTransformNodeType>({
|
||||
inputs,
|
||||
setInputs,
|
||||
@@ -108,6 +114,7 @@ const useConfig = (id: string, payload: TemplateTransformNodeType) => {
|
||||
return {
|
||||
readOnly,
|
||||
inputs,
|
||||
availableVars,
|
||||
handleVarListChange,
|
||||
handleVarNameChange,
|
||||
handleAddVariable,
|
||||
|
||||
Reference in New Issue
Block a user