mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 15:00:57 +03:00
Bugfix/stream custom tool return direct (#3003)
stream custom tool return direct
This commit is contained in:
@@ -18,7 +18,7 @@ class CustomTool_Tools implements INode {
|
||||
constructor() {
|
||||
this.label = 'Custom Tool'
|
||||
this.name = 'customTool'
|
||||
this.version = 1.0
|
||||
this.version = 2.0
|
||||
this.type = 'CustomTool'
|
||||
this.icon = 'customtool.svg'
|
||||
this.category = 'Tools'
|
||||
@@ -29,6 +29,13 @@ class CustomTool_Tools implements INode {
|
||||
name: 'selectedTool',
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listTools'
|
||||
},
|
||||
{
|
||||
label: 'Return Direct',
|
||||
name: 'returnDirect',
|
||||
description: 'Return the output of the tool directly to the user',
|
||||
type: 'boolean',
|
||||
optional: true
|
||||
}
|
||||
]
|
||||
this.baseClasses = [this.type, 'Tool', ...getBaseClasses(DynamicStructuredTool)]
|
||||
@@ -66,6 +73,7 @@ class CustomTool_Tools implements INode {
|
||||
const customToolName = nodeData.inputs?.customToolName as string
|
||||
const customToolDesc = nodeData.inputs?.customToolDesc as string
|
||||
const customToolSchema = nodeData.inputs?.customToolSchema as string
|
||||
const customToolReturnDirect = nodeData.inputs?.returnDirect as boolean
|
||||
|
||||
const appDataSource = options.appDataSource as DataSource
|
||||
const databaseEntities = options.databaseEntities as IDatabaseEntity
|
||||
@@ -97,6 +105,7 @@ class CustomTool_Tools implements INode {
|
||||
let dynamicStructuredTool = new DynamicStructuredTool(obj)
|
||||
dynamicStructuredTool.setVariables(variables)
|
||||
dynamicStructuredTool.setFlowObject(flow)
|
||||
dynamicStructuredTool.returnDirect = customToolReturnDirect
|
||||
|
||||
return dynamicStructuredTool
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user