ability to use flow.input within custom tool
This commit is contained in:
parent
6306904cfc
commit
5a76076ce4
|
|
@ -60,7 +60,7 @@ class CustomTool_Tools implements INode {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
async init(nodeData: INodeData, input: string, options: ICommonObject): Promise<any> {
|
||||||
const selectedToolId = nodeData.inputs?.selectedTool as string
|
const selectedToolId = nodeData.inputs?.selectedTool as string
|
||||||
const customToolFunc = nodeData.inputs?.customToolFunc as string
|
const customToolFunc = nodeData.inputs?.customToolFunc as string
|
||||||
|
|
||||||
|
|
@ -101,7 +101,8 @@ class CustomTool_Tools implements INode {
|
||||||
|
|
||||||
const flow = {
|
const flow = {
|
||||||
chatId: options.chatId, // id is uppercase (I)
|
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)
|
let dynamicStructuredTool = new DynamicStructuredTool(obj)
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,9 @@ const HowToUseFunctionDialog = ({ show, onCancel }) => {
|
||||||
<li>
|
<li>
|
||||||
<code>$flow.chatflowId</code>
|
<code>$flow.chatflowId</code>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<code>$flow.input</code>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li style={{ marginTop: 10 }}>
|
<li style={{ marginTop: 10 }}>
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ import { HIDE_CANVAS_DIALOG, SHOW_CANVAS_DIALOG } from 'store/actions'
|
||||||
const exampleAPIFunc = `/*
|
const exampleAPIFunc = `/*
|
||||||
* You can use any libraries imported in Flowise
|
* 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 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.<variable-name>
|
* You can get custom variables: $vars.<variable-name>
|
||||||
* Must return a string value at the end of function
|
* Must return a string value at the end of function
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue