-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add tool params node & tool params add array type (#2824)
* add tool params node * add tool params enum * node response * tool add array type params * fix tool params * fix * fix * fix
- Loading branch information
1 parent
f2749cb
commit 1599d14
Showing
26 changed files
with
437 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
packages/global/core/workflow/template/system/toolParams.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { FlowNodeTypeEnum } from '../../node/constant'; | ||
import { FlowNodeTemplateType } from '../../type/node'; | ||
import { FlowNodeTemplateTypeEnum } from '../../constants'; | ||
import { getHandleConfig } from '../utils'; | ||
import { i18nT } from '../../../../../web/i18n/utils'; | ||
|
||
export const ToolParamsNode: FlowNodeTemplateType = { | ||
id: FlowNodeTypeEnum.toolParams, | ||
templateType: FlowNodeTemplateTypeEnum.ai, | ||
flowNodeType: FlowNodeTypeEnum.toolParams, | ||
sourceHandle: getHandleConfig(true, true, true, true), | ||
targetHandle: getHandleConfig(true, true, true, true), | ||
avatar: 'core/workflow/template/toolParams', | ||
name: i18nT('workflow:tool_params_config'), | ||
intro: i18nT('workflow:intro_tool_params_config'), | ||
version: '4811', | ||
isTool: true, | ||
inputs: [], | ||
outputs: [] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
packages/service/core/workflow/dispatch/agent/runTool/toolParams.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { DispatchNodeResponseKeyEnum } from '@fastgpt/global/core/workflow/runtime/constants'; | ||
import type { ModuleDispatchProps } from '@fastgpt/global/core/workflow/runtime/type'; | ||
import { DispatchNodeResultType } from '@fastgpt/global/core/workflow/runtime/type'; | ||
|
||
export type Props = ModuleDispatchProps<{}>; | ||
export type Response = DispatchNodeResultType<{}>; | ||
|
||
export const dispatchToolParams = (props: Props): Response => { | ||
const { params } = props; | ||
|
||
return { | ||
...params, | ||
[DispatchNodeResponseKeyEnum.nodeResponse]: { | ||
toolParamsResult: params | ||
} | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
packages/web/components/common/Icon/icons/core/workflow/template/toolParams.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.