Feat: Add tool nodes and tool drop-down menu #3221 (#8335)

### What problem does this PR solve?

Feat: Add tool nodes and tool drop-down menu #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-06-18 12:36:44 +08:00
committed by GitHub
parent 6ce282d462
commit 371f61972d
8 changed files with 453 additions and 2 deletions

View File

@ -21,7 +21,8 @@ import { AgentInstanceContext } from '../../context';
import { INextOperatorForm } from '../../interface';
import { Output } from '../components/output';
import { PromptEditor } from '../components/prompt-editor';
import { useValues } from './use-values';
import { ToolPopover } from './tool-popover';
import { useToolOptions, useValues } from './use-values';
import { useWatchFormChange } from './use-watch-change';
const FormSchema = z.object({
@ -66,6 +67,8 @@ const AgentForm = ({ node }: INextOperatorForm) => {
const { addCanvasNode } = useContext(AgentInstanceContext);
const toolOptions = useToolOptions();
return (
<Form {...form}>
<form
@ -110,6 +113,9 @@ const AgentForm = ({ node }: INextOperatorForm) => {
)}
/>
</FormContainer>
<ToolPopover>
<BlockButton>Add Tool</BlockButton>
</ToolPopover>
<BlockButton
onClick={addCanvasNode(Operator.Agent, {
nodeId: node?.id,