perf: read file node return splited raw texts (#5881)

This commit is contained in:
Finley Ge
2025-11-07 14:20:34 +08:00
committed by GitHub
parent 7225ebec01
commit 8ca5ebecd4
2 changed files with 11 additions and 1 deletions

View File

@@ -45,6 +45,14 @@ export const ReadFilesNode: FlowNodeTemplateType = {
valueType: WorkflowIOValueTypeEnum.string,
type: FlowNodeOutputTypeEnum.static
},
{
id: NodeOutputKeyEnum.rawResponse,
key: NodeOutputKeyEnum.rawResponse,
label: i18nT('workflow:raw_response'),
description: i18nT('workflow:tool_raw_response_description'),
valueType: WorkflowIOValueTypeEnum.arrayObject,
type: FlowNodeOutputTypeEnum.static
},
Output_Template_Error_Message
]
};

View File

@@ -22,6 +22,7 @@ type Props = ModuleDispatchProps<{
}>;
type Response = DispatchNodeResultType<{
[NodeOutputKeyEnum.text]: string;
[NodeOutputKeyEnum.rawResponse]: ReturnType<typeof formatResponseObject>[];
}>;
const formatResponseObject = ({
@@ -75,7 +76,8 @@ export const dispatchReadFiles = async (props: Props): Promise<Response> => {
return {
data: {
[NodeOutputKeyEnum.text]: text
[NodeOutputKeyEnum.text]: text,
[NodeOutputKeyEnum.rawResponse]: readFilesResult
},
[DispatchNodeResponseKeyEnum.nodeResponse]: {
readFiles: readFilesResult.map((item) => ({