agent node

This commit is contained in:
JzoNg
2025-06-11 22:47:31 +08:00
parent 8af635459a
commit e3fcee124a
7 changed files with 232 additions and 185 deletions

View File

@ -27,6 +27,7 @@ import type { QuestionClassifierNodeType } from '../nodes/question-classifier/ty
import type { IfElseNodeType } from '../nodes/if-else/types'
import { branchNameCorrect } from '../nodes/if-else/utils'
import type { IterationNodeType } from '../nodes/iteration/types'
import type { AgentNodeType } from '../nodes/agent/types'
import type { LoopNodeType } from '../nodes/loop/types'
import type { ToolNodeType } from '../nodes/tool/types'
import {
@ -304,6 +305,13 @@ export const initialNodes = (originNodes: Node[], originEdges: Edge[]) => {
}
}
if (node.data.type === BlockEnum.Agent && !(node as Node<AgentNodeType>).data.version) {
// TODO: formatting legacy agent node data
// (node as Node<ToolNodeType>).data.version = '2'
// const toolData = (node as Node<AgentNodeType>).data.agent_parameters?.tool
// const multipleTools = (node as Node<AgentNodeType>).data.agent_parameters?.multiple_tools
}
return node
})
}