mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Delete MCP server #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -56,6 +56,12 @@ import {
|
||||
getNodeDragHandle,
|
||||
} from '../utils';
|
||||
|
||||
function isBottomSubAgent(type: string, position: Position) {
|
||||
return (
|
||||
(type === Operator.Agent && position === Position.Bottom) ||
|
||||
type === Operator.Tool
|
||||
);
|
||||
}
|
||||
export const useInitializeOperatorParams = () => {
|
||||
const llmId = useFetchModelId();
|
||||
|
||||
@ -114,8 +120,17 @@ export const useInitializeOperatorParams = () => {
|
||||
}, [llmId]);
|
||||
|
||||
const initializeOperatorParams = useCallback(
|
||||
(operatorName: Operator) => {
|
||||
return initialFormValuesMap[operatorName];
|
||||
(operatorName: Operator, position: Position) => {
|
||||
const initialValues = initialFormValuesMap[operatorName];
|
||||
if (isBottomSubAgent(operatorName, position)) {
|
||||
return {
|
||||
...initialValues,
|
||||
description: 'This is an agent for a specific task.',
|
||||
user_prompt: 'This is the order you need to send to the agent.',
|
||||
};
|
||||
}
|
||||
|
||||
return initialValues;
|
||||
},
|
||||
[initialFormValuesMap],
|
||||
);
|
||||
@ -235,13 +250,6 @@ function useAddToolNode() {
|
||||
return { addToolNode };
|
||||
}
|
||||
|
||||
function isBottomSubAgent(type: string, position: Position) {
|
||||
return (
|
||||
(type === Operator.Agent && position === Position.Bottom) ||
|
||||
type === Operator.Tool
|
||||
);
|
||||
}
|
||||
|
||||
function useResizeIterationNode() {
|
||||
const { getNode, nodes, updateNode } = useGraphStore((state) => state);
|
||||
|
||||
@ -324,7 +332,7 @@ export function useAddNode(reactFlowInstance?: ReactFlowInstance<any, any>) {
|
||||
getNodeName(type),
|
||||
nodes,
|
||||
),
|
||||
form: initializeOperatorParams(type as Operator),
|
||||
form: initializeOperatorParams(type as Operator, params.position),
|
||||
},
|
||||
sourcePosition: Position.Right,
|
||||
targetPosition: Position.Left,
|
||||
|
||||
Reference in New Issue
Block a user