Files
dify/web/app/components/workflow/nodes/agent-v2/default.ts
yyhGitHub盐粒 YanliJoelzyssyz123autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>盐粒 Yanli林玮
1b3e8e9943 chore(agent-v2): sync daily changes (#38298)
Signed-off-by: yyh <[email protected]>
Co-authored-by: 盐粒 Yanli <[email protected]>
Co-authored-by: Joel <[email protected]>
Co-authored-by: zyssyz123 <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: 盐粒 Yanli <[email protected]>
Co-authored-by: 林玮 (Jade Lin) <[email protected]>
2026-07-05 08:09:38 +00:00

40 lines
889 B
TypeScript

import type { NodeDefault } from '../../types'
import type { AgentV2NodeType } from './types'
import { BlockEnum } from '../../types'
import { genNodeMetaData } from '../../utils'
import { hasValidAgentBinding } from './types'
const metaData = genNodeMetaData({
sort: 3,
type: BlockEnum.AgentV2,
})
const nodeDefault: NodeDefault<AgentV2NodeType> = {
metaData,
defaultValue: {
agent_binding: {
binding_type: 'inline_agent',
},
agent_node_kind: 'dify_agent',
version: '2',
},
checkValid(payload, t) {
if (!hasValidAgentBinding(payload)) {
return {
isValid: false,
errorMessage: t('errorMsg.fieldRequired', {
ns: 'workflow',
field: t('nodes.agent.roster.label', { ns: 'workflow' }),
}),
}
}
return {
isValid: true,
errorMessage: '',
}
},
}
export default nodeDefault