mirror of https://github.com/langgenius/dify.git
temp
This commit is contained in:
parent
9b6f580365
commit
128410902c
|
|
@ -89,3 +89,39 @@ export const agentNodeData = (() => {
|
|||
}],
|
||||
}
|
||||
})()
|
||||
|
||||
export const oneStepCircle = (() => {
|
||||
const node = {
|
||||
node_type: BlockEnum.Agent,
|
||||
execution_metadata: {
|
||||
agent_log: [
|
||||
{ id: '1', label: 'Node 1' },
|
||||
{ id: '1', parent_id: '1', label: 'Node 1' },
|
||||
{ id: '1', parent_id: '1', label: 'Node 1' },
|
||||
{ id: '1', parent_id: '1', label: 'Node 1' },
|
||||
{ id: '1', parent_id: '1', label: 'Node 1' },
|
||||
{ id: '1', parent_id: '1', label: 'Node 1' },
|
||||
],
|
||||
},
|
||||
}
|
||||
|
||||
return {
|
||||
in: [node],
|
||||
expect: [{
|
||||
...node,
|
||||
agentLog: [
|
||||
{
|
||||
id: '1',
|
||||
label: 'Node 1',
|
||||
hasCircle: true,
|
||||
},
|
||||
],
|
||||
}],
|
||||
}
|
||||
})()
|
||||
|
||||
export const multiStepsCircle = () => {
|
||||
}
|
||||
|
||||
export const CircleNestCircle = (() => {
|
||||
})()
|
||||
|
|
|
|||
|
|
@ -3,6 +3,10 @@ import type { AgentLogItem, AgentLogItemWithChildren, NodeTracing } from '@/type
|
|||
|
||||
const supportedAgentLogNodes = [BlockEnum.Agent, BlockEnum.Tool]
|
||||
|
||||
const removeCircle = (node: NodeTracing) => {
|
||||
|
||||
}
|
||||
|
||||
const listToTree = (logs: AgentLogItem[]) => {
|
||||
if (!logs || logs.length === 0)
|
||||
return []
|
||||
|
|
@ -24,6 +28,7 @@ const listToTree = (logs: AgentLogItem[]) => {
|
|||
})
|
||||
return tree
|
||||
}
|
||||
|
||||
const format = (list: NodeTracing[]): NodeTracing[] => {
|
||||
const result: NodeTracing[] = list.map((item) => {
|
||||
if (supportedAgentLogNodes.includes(item.node_type) && item.execution_metadata?.agent_log && item.execution_metadata?.agent_log.length > 0)
|
||||
|
|
|
|||
Loading…
Reference in New Issue