Feat: Constructing query parameter options for the Retrieval operator #3221 (#8152)

### What problem does this PR solve?

Feat: Constructing query parameter options for the Retrieval operator
#3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-06-10 10:49:41 +08:00
committed by GitHub
parent 9c6c6c51e0
commit 08f2223a6a
7 changed files with 73 additions and 23 deletions

View File

@ -57,7 +57,7 @@ export function ButtonEdge({
if (previousGraphPath.length > 0 && previousLatestElement) {
graphPath = [previousLatestElement, ...graphPath];
}
return graphPath;
return Array.isArray(graphPath) ? graphPath : [];
}, [flowDetail.dsl?.path]);
const highlightStyle = useMemo(() => {

View File

@ -2,7 +2,9 @@ import { useTheme } from '@/components/theme-provider';
import { IAgentNode } from '@/interfaces/database/flow';
import { Handle, NodeProps, Position } from '@xyflow/react';
import classNames from 'classnames';
import { memo } from 'react';
import { memo, useMemo } from 'react';
import { Operator } from '../../constant';
import useGraphStore from '../../store';
import { LeftHandleStyle, RightHandleStyle } from './handle-icon';
import styles from './index.less';
import NodeHeader from './node-header';
@ -14,6 +16,15 @@ function InnerAgentNode({
selected,
}: NodeProps<IAgentNode>) {
const { theme } = useTheme();
const getNode = useGraphStore((state) => state.getNode);
const edges = useGraphStore((state) => state.edges);
const isNotParentAgent = useMemo(() => {
const edge = edges.find((x) => x.target === id);
const label = getNode(edge?.source)?.data.label;
return label !== Operator.Agent;
}, [edges, getNode, id]);
return (
<section
className={classNames(
@ -24,22 +35,26 @@ function InnerAgentNode({
},
)}
>
<Handle
id="c"
type="source"
position={Position.Left}
isConnectable={isConnectable}
className={styles.handle}
style={LeftHandleStyle}
></Handle>
<Handle
type="source"
position={Position.Right}
isConnectable={isConnectable}
className={styles.handle}
id="b"
style={RightHandleStyle}
></Handle>
{isNotParentAgent && (
<>
<Handle
id="c"
type="source"
position={Position.Left}
isConnectable={isConnectable}
className={styles.handle}
style={LeftHandleStyle}
></Handle>
<Handle
type="source"
position={Position.Right}
isConnectable={isConnectable}
className={styles.handle}
id="b"
style={RightHandleStyle}
></Handle>
</>
)}
<Handle
type="target"
position={Position.Top}