add aiplugintools

This commit is contained in:
Henry
2023-04-17 20:26:57 +01:00
parent 7631f651ab
commit ed81dc228f
5 changed files with 88 additions and 17 deletions
+6 -2
View File
@@ -38,7 +38,7 @@ import useConfirm from 'hooks/useConfirm'
import { IconX } from '@tabler/icons'
// utils
import { getUniqueNodeId, initNode, getEdgeLabelName } from 'utils/genericHelper'
import { getUniqueNodeId, initNode, getEdgeLabelName, rearrangeToolsOrdering } from 'utils/genericHelper'
import useNotifier from 'utils/useNotifier'
const nodeTypes = { customNode: CanvasNode }
@@ -110,7 +110,11 @@ const Canvas = () => {
const inputAnchor = node.data.inputAnchors.find((ancr) => ancr.name === targetInput)
if (inputAnchor && inputAnchor.list) {
const newValues = node.data.inputs[targetInput] || []
newValues.push(`{{${sourceNodeId}.data.instance}}`)
if (targetInput === 'tools') {
rearrangeToolsOrdering(newValues, sourceNodeId)
} else {
newValues.push(`{{${sourceNodeId}.data.instance}}`)
}
value = newValues
} else {
value = `{{${sourceNodeId}.data.instance}}`