Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion document/content/docs/self-host/upgrading/4-14/4149.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,13 @@ CODE_SANDBOX_TOKEN=代码运行沙盒的凭证
8. 修复工作流预览模式下,重新打开预览弹窗,会丢失表单输入内容。
9. 修复订阅套餐自定义字段未生效
10. login接口,存在异步 session 问题,会出现报错日志。
11. 系统工具集不显示版本
12. 修复判断器 arrayAny 类型无判断条件可选
13. 修复视频音频自定义文件类型流程开始无文件链接变量
14. 用户输入框消息不转义成 markdown 格式
15. 修复 AgentV2 部分上下文拼接错误。

## 代码优化

1. 商业版开发时,monorepo 指向不同 react 导致需重装包。
1. 商业版开发时,monorepo 指向不同 react 导致需重装包。

4 changes: 4 additions & 0 deletions packages/global/core/workflow/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ export enum NodeInputKeyEnum {

// loop
loopInputArray = 'loopInputArray',
batchParallelConcurrency = 'batchParallelConcurrency',
batchParallelRetryTimes = 'batchParallelRetryTimes',
childrenNodeIdList = 'childrenNodeIdList',
nodeWidth = 'nodeWidth',
nodeHeight = 'nodeHeight',
Expand Down Expand Up @@ -307,6 +309,8 @@ export enum NodeOutputKeyEnum {

// loop
loopArray = 'loopArray',
batchRawResult = 'batchRawResult',
batchStatus = 'batchStatus',
// loop start
loopStartInput = 'loopStartInput',
loopStartIndex = 'loopStartIndex',
Expand Down
1 change: 1 addition & 0 deletions packages/global/core/workflow/node/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export enum FlowNodeTypeEnum {
readFiles = 'readFiles',
userSelect = 'userSelect',
loop = 'loop',
batch = 'batch',
loopStart = 'loopStart',
loopEnd = 'loopEnd',
formInput = 'formInput',
Expand Down
6 changes: 6 additions & 0 deletions packages/global/core/workflow/runtime/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,12 @@ export type DispatchNodeResponseType = {
loopResult?: any[];
loopInput?: any[];
loopDetail?: ChatHistoryItemResType[];
// batch
batchInput?: any[];
batchResult?: any[];
batchRawResult?: any[];
batchStatus?: 'success' | 'failed' | 'partial_success';
batchDetail?: ChatHistoryItemResType[];
// loop start
loopInputValue?: any;
// loop end
Expand Down
4 changes: 3 additions & 1 deletion packages/global/core/workflow/template/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { FormInputNode } from './system/interactive/formInput';
import { UserSelectNode } from './system/interactive/userSelect';
import { LafModule } from './system/laf';
import { LoopNode } from './system/loop/loop';
import { BatchNode } from './system/loop/batch';
import { LoopEndNode } from './system/loop/loopEnd';
import { LoopStartNode } from './system/loop/loopStart';
import { ReadFilesNode } from './system/readFiles';
Expand Down Expand Up @@ -55,7 +56,8 @@ const systemNodes: FlowNodeTemplateType[] = [
IfElseNode,
VariableUpdateNode,
CodeNode,
LoopNode
LoopNode,
BatchNode
];
/* app flow module templates */
export const appSystemModuleTemplates: FlowNodeTemplateType[] = [
Expand Down
96 changes: 96 additions & 0 deletions packages/global/core/workflow/template/system/loop/batch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import {
FlowNodeInputTypeEnum,
FlowNodeOutputTypeEnum,
FlowNodeTypeEnum
} from '../../../node/constant';
import { type FlowNodeTemplateType } from '../../../type/node';
import {
FlowNodeTemplateTypeEnum,
NodeInputKeyEnum,
NodeOutputKeyEnum,
WorkflowIOValueTypeEnum
} from '../../../constants';
import { i18nT } from '../../../../../../web/i18n/utils';
import {
Input_Template_Children_Node_List,
Input_Template_LOOP_NODE_OFFSET,
Input_Template_Node_Height,
Input_Template_Node_Width
} from '../../input';

export const BatchNode: FlowNodeTemplateType = {
id: FlowNodeTypeEnum.batch,
templateType: FlowNodeTemplateTypeEnum.tools,
flowNodeType: FlowNodeTypeEnum.batch,
showSourceHandle: true,
showTargetHandle: true,
avatar: 'core/workflow/template/loop',
avatarLinear: 'core/workflow/template/loopLinear',
colorSchema: 'violetDeep',
name: i18nT('workflow:batch'),
intro: i18nT('workflow:intro_batch'),
showStatus: true,
inputs: [
{
key: NodeInputKeyEnum.loopInputArray,
renderTypeList: [FlowNodeInputTypeEnum.reference],
valueType: WorkflowIOValueTypeEnum.arrayAny,
required: true,
label: i18nT('workflow:loop_input_array'),
value: []
},
{
key: NodeInputKeyEnum.batchParallelConcurrency,
renderTypeList: [FlowNodeInputTypeEnum.numberInput, FlowNodeInputTypeEnum.reference],
selectedTypeIndex: 0,
valueType: WorkflowIOValueTypeEnum.number,
required: true,
label: i18nT('workflow:batch_parallel_concurrency'),
min: 1,
max: 10,
value: 5
},
{
key: NodeInputKeyEnum.batchParallelRetryTimes,
renderTypeList: [FlowNodeInputTypeEnum.numberInput],
valueType: WorkflowIOValueTypeEnum.number,
required: true,
label: i18nT('workflow:batch_parallel_retry_times'),
min: 0,
max: 5,
value: 3
},
Input_Template_Children_Node_List,
Input_Template_Node_Width,
Input_Template_Node_Height,
Input_Template_LOOP_NODE_OFFSET
],
outputs: [
{
id: NodeOutputKeyEnum.loopArray,
key: NodeOutputKeyEnum.loopArray,
label: i18nT('workflow:batch_result_success'),
description: i18nT('workflow:batch_result_success_tip'),
type: FlowNodeOutputTypeEnum.static,
valueType: WorkflowIOValueTypeEnum.arrayAny
},
{
id: NodeOutputKeyEnum.batchRawResult,
key: NodeOutputKeyEnum.batchRawResult,
label: i18nT('workflow:batch_result_raw'),
description: i18nT('workflow:batch_result_raw_tip'),
required: true,
type: FlowNodeOutputTypeEnum.static,
valueType: WorkflowIOValueTypeEnum.arrayObject
},
{
id: NodeOutputKeyEnum.batchStatus,
key: NodeOutputKeyEnum.batchStatus,
label: i18nT('workflow:batch_status'),
description: i18nT('workflow:batch_status_tip'),
required: true,
type: FlowNodeOutputTypeEnum.static,
valueType: WorkflowIOValueTypeEnum.string
}
]
};
3 changes: 2 additions & 1 deletion packages/global/core/workflow/template/system/loop/loop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ export const LoopNode: FlowNodeTemplateType = {
id: FlowNodeTypeEnum.loop,
templateType: FlowNodeTemplateTypeEnum.tools,
flowNodeType: FlowNodeTypeEnum.loop,
abandon: true,
showSourceHandle: true,
showTargetHandle: true,
avatar: 'core/workflow/template/loop',
avatarLinear: 'core/workflow/template/loopLinear',
colorSchema: 'violetDeep',
name: i18nT('workflow:loop'),
name: i18nT('workflow:loop_deprecated'),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个不用改,反正不能加新的了

intro: i18nT('workflow:intro_loop'),
showStatus: true,
courseUrl: '/docs/introduction/guide/dashboard/workflow/loop/',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ export const LoopEndNode: FlowNodeTemplateType = {
avatarLinear: 'core/workflow/template/loopEndLinear',
colorSchema: 'violetDeep',
name: i18nT('workflow:loop_end'),
intro: i18nT('workflow:loop_end_intro'),
showStatus: false,
inputs: [
{
key: NodeInputKeyEnum.loopEndInput,
renderTypeList: [FlowNodeInputTypeEnum.reference],
valueType: WorkflowIOValueTypeEnum.any,
label: '',
label: i18nT('workflow:loop_end_intro'),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个也不用改?

required: true,
value: []
}
Expand Down
Loading
Loading