diff --git a/packages/components/nodes/tools/CustomTool/CustomTool.ts b/packages/components/nodes/tools/CustomTool/CustomTool.ts index 9ceda9199..6ffcc0e21 100644 --- a/packages/components/nodes/tools/CustomTool/CustomTool.ts +++ b/packages/components/nodes/tools/CustomTool/CustomTool.ts @@ -60,7 +60,7 @@ class CustomTool_Tools implements INode { } } - async init(nodeData: INodeData, _: string, options: ICommonObject): Promise { + async init(nodeData: INodeData, input: string, options: ICommonObject): Promise { const selectedToolId = nodeData.inputs?.selectedTool as string const customToolFunc = nodeData.inputs?.customToolFunc as string @@ -101,7 +101,8 @@ class CustomTool_Tools implements INode { const flow = { chatId: options.chatId, // id is uppercase (I) - chatflowId: options.chatflowid // id is lowercase (i) + chatflowId: options.chatflowid, // id is lowercase (i) + input } let dynamicStructuredTool = new DynamicStructuredTool(obj) diff --git a/packages/ui/src/views/tools/HowToUseFunctionDialog.js b/packages/ui/src/views/tools/HowToUseFunctionDialog.js index 00acef0d2..47ecee89c 100644 --- a/packages/ui/src/views/tools/HowToUseFunctionDialog.js +++ b/packages/ui/src/views/tools/HowToUseFunctionDialog.js @@ -43,6 +43,9 @@ const HowToUseFunctionDialog = ({ show, onCancel }) => {
  • $flow.chatflowId
  • +
  • + $flow.input +
  • diff --git a/packages/ui/src/views/tools/ToolDialog.js b/packages/ui/src/views/tools/ToolDialog.js index b011c07ed..ab6d6aa01 100644 --- a/packages/ui/src/views/tools/ToolDialog.js +++ b/packages/ui/src/views/tools/ToolDialog.js @@ -33,7 +33,7 @@ import { HIDE_CANVAS_DIALOG, SHOW_CANVAS_DIALOG } from 'store/actions' const exampleAPIFunc = `/* * You can use any libraries imported in Flowise * You can use properties specified in Output Schema as variables. Ex: Property = userid, Variable = $userid -* You can get default flow config: $flow.sessionId, $flow.chatId, $flow.chatflowId +* You can get default flow config: $flow.sessionId, $flow.chatId, $flow.chatflowId, $flow.input * You can get custom variables: $vars. * Must return a string value at the end of function */