Commit bb7373e 1 parent cd4c659 commit bb7373e Copy full SHA for bb7373e
File tree 1 file changed +9
-0
lines changed
packages/components/nodes/tools/CustomTool
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,9 @@ class CustomTool_Tools implements INode {
63
63
async init ( nodeData : INodeData , _ : string , options : ICommonObject ) : Promise < any > {
64
64
const selectedToolId = nodeData . inputs ?. selectedTool as string
65
65
const customToolFunc = nodeData . inputs ?. customToolFunc as string
66
+ const customToolName = nodeData . inputs ?. customToolName as string
67
+ const customToolDesc = nodeData . inputs ?. customToolDesc as string
68
+ const customToolSchema = nodeData . inputs ?. customToolSchema as string
66
69
67
70
const appDataSource = options . appDataSource as DataSource
68
71
const databaseEntities = options . databaseEntities as IDatabaseEntity
@@ -80,6 +83,12 @@ class CustomTool_Tools implements INode {
80
83
code : tool . func
81
84
}
82
85
if ( customToolFunc ) obj . code = customToolFunc
86
+ if ( customToolName ) obj . name = customToolName
87
+ if ( customToolDesc ) obj . description = customToolDesc
88
+ if ( customToolSchema ) {
89
+ const zodSchemaFunction = new Function ( 'z' , `return ${ customToolSchema } ` )
90
+ obj . schema = zodSchemaFunction ( z )
91
+ }
83
92
84
93
const variables = await getVars ( appDataSource , databaseEntities , nodeData )
85
94
You can’t perform that action at this time.
0 commit comments