Skip to content

Commit 14791cb

Browse files
committed
feat: Variable aggregation
1 parent 55dc3a6 commit 14791cb

File tree

13 files changed

+84
-4
lines changed

13 files changed

+84
-4
lines changed

apps/application/sql/list_application_user.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ from (select application."id"::text, application."name",
1414
application.icon
1515
from application
1616
left join "user" on user_id = "user".id
17-
where application."id" in (select target
17+
where application."id"::text in (select target
1818
from workspace_user_resource_permission ${workspace_user_resource_permission_query_set}
1919
and 'VIEW' = any (permission_list))) temp
2020
${application_query_set}

apps/folders/serializers/folder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,4 +308,4 @@ def get_folder_tree(self,
308308

309309
TreeSerializer = get_folder_tree_serializer(self.data.get('source')) # noqa
310310
serializer = TreeSerializer(nodes, many=True)
311-
return serializer.data # 这是可序列化的字典
311+
return [d for d in serializer.data if d.get('id') == d.get('workspace_id')] # 这是可序列化的字典

apps/knowledge/sql/list_knowledge_user.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ FROM (SELECT "temp_knowledge".id::text, "temp_knowledge".name,
2222
"document_temp".document_count
2323
FROM (SELECT knowledge.*
2424
FROM knowledge knowledge ${knowledge_custom_sql}
25-
AND id in (select target
25+
AND id::text in (select target
2626
from workspace_user_resource_permission ${workspace_user_resource_permission_query_set}
2727
and 'VIEW' = any (permission_list))) temp_knowledge
2828
LEFT JOIN (SELECT "count"("id") AS document_count, "sum"("char_length") "char_length", knowledge_id

apps/tools/sql/list_tool_user.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ FROM (SELECT tool."id"::text,
2020
tool."is_active"
2121
FROM (SELECT tool.*
2222
FROM tool tool ${tool_query_set}
23-
AND tool.id IN (SELECT target
23+
AND tool.id::text IN (SELECT target
2424
FROM workspace_user_resource_permission
2525
${workspace_user_resource_permission_query_set}
2626
AND 'VIEW' = ANY (permission_list))) AS tool
Lines changed: 12 additions & 0 deletions
Loading

ui/src/enums/application.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export enum WorkflowType {
3434
LoopContinueNode = 'loop-continue-node',
3535
LoopBreakNode = 'loop-break-node',
3636
VariableSplittingNode = 'variable-splitting-node',
37+
VariableAggregationNode = 'variable-aggregation-node',
3738
VideoUnderstandNode = 'video-understand-node',
3839
ParameterExtractionNode = 'parameter-extraction-node',
3940
}

ui/src/locales/lang/en-US/views/application-workflow.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,10 @@ You are a master of problem optimization, adept at accurately inferring user int
259259
text: 'Update the value of the global variable',
260260
assign: 'Set Value',
261261
},
262+
variableAggregationNode: {
263+
label: 'Variable Aggregation',
264+
text: 'Perform aggregation processing on the outputs of multiple branches',
265+
},
262266
mcpNode: {
263267
label: 'MCP Node',
264268
text: 'Call external MCP services to process data',

ui/src/locales/lang/zh-CN/views/application-workflow.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,10 @@ export default {
261261
requiredMessage: '请选择图片',
262262
},
263263
},
264+
variableAggregationNode: {
265+
label: '变量聚合',
266+
text: '对多个分支的输出进行聚合处理',
267+
},
264268
variableAssignNode: {
265269
label: '变量赋值',
266270
text: '更新全局变量的值',

ui/src/locales/lang/zh-Hant/views/application-workflow.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,10 @@ export default {
259259
text: '更新全域變數的值',
260260
assign: '賦值',
261261
},
262+
variableAggregationNode: {
263+
label: '變量聚合',
264+
text: '對多個分支的輸出進行聚合處理',
265+
},
262266
mcpNode: {
263267
label: 'MCP 調用',
264268
text: '通過SSE/Streamable HTTP方式執行MCP服務中的工具',

ui/src/workflow/common/data.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,17 @@ export const videoUnderstandNode = {
333333
},
334334
},
335335
}
336+
export const variableAggregationNode = {
337+
type: WorkflowType.VariableAggregationNode,
338+
text: t('views.applicationWorkflow.nodes.variableAggregationNode.text'),
339+
label: t('views.applicationWorkflow.nodes.variableAggregationNode.label'),
340+
height: 252,
341+
properties: {
342+
stepName: t('views.applicationWorkflow.nodes.variableAggregationNode.label'),
343+
config: {},
344+
},
345+
}
346+
336347

337348
export const variableAssignNode = {
338349
type: WorkflowType.VariableAssignNode,
@@ -626,6 +637,8 @@ export const menuNodes = [
626637
list: [conditionNode, formNode, variableAssignNode, replyNode, loopNode],
627638
},
628639
{
640+
label: t('views.applicationWorkflow.nodes.classify.dataProcessing', '数据处理'),
641+
list: [variableSplittingNode, parameterExtractionNode, variableAggregationNode],
629642
label: t('views.applicationWorkflow.nodes.classify.dataProcessing'),
630643
list: [variableSplittingNode, parameterExtractionNode],
631644
},
@@ -767,6 +780,7 @@ export const nodeDict: any = {
767780
[WorkflowType.VariableSplittingNode]: variableSplittingNode,
768781
[WorkflowType.VideoUnderstandNode]: videoUnderstandNode,
769782
[WorkflowType.ParameterExtractionNode]: parameterExtractionNode,
783+
[WorkflowType.VariableAggregationNode]: variableAggregationNode,
770784
}
771785

772786
export function isWorkFlow(type: string | undefined) {

0 commit comments

Comments
 (0)