Skip to content

Commit 8ca5ebe

Browse files
authored
perf: read file node return splited raw texts (#5881)
1 parent 7225ebe commit 8ca5ebe

File tree

2 files changed

+11
-1
lines changed
  • packages

2 files changed

+11
-1
lines changed

packages/global/core/workflow/template/system/readFiles/index.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ export const ReadFilesNode: FlowNodeTemplateType = {
4545
valueType: WorkflowIOValueTypeEnum.string,
4646
type: FlowNodeOutputTypeEnum.static
4747
},
48+
{
49+
id: NodeOutputKeyEnum.rawResponse,
50+
key: NodeOutputKeyEnum.rawResponse,
51+
label: i18nT('workflow:raw_response'),
52+
description: i18nT('workflow:tool_raw_response_description'),
53+
valueType: WorkflowIOValueTypeEnum.arrayObject,
54+
type: FlowNodeOutputTypeEnum.static
55+
},
4856
Output_Template_Error_Message
4957
]
5058
};

packages/service/core/workflow/dispatch/tools/readFiles.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ type Props = ModuleDispatchProps<{
2222
}>;
2323
type Response = DispatchNodeResultType<{
2424
[NodeOutputKeyEnum.text]: string;
25+
[NodeOutputKeyEnum.rawResponse]: ReturnType<typeof formatResponseObject>[];
2526
}>;
2627

2728
const formatResponseObject = ({
@@ -75,7 +76,8 @@ export const dispatchReadFiles = async (props: Props): Promise<Response> => {
7576

7677
return {
7778
data: {
78-
[NodeOutputKeyEnum.text]: text
79+
[NodeOutputKeyEnum.text]: text,
80+
[NodeOutputKeyEnum.rawResponse]: readFilesResult
7981
},
8082
[DispatchNodeResponseKeyEnum.nodeResponse]: {
8183
readFiles: readFilesResult.map((item) => ({

0 commit comments

Comments
 (0)