mirror of
https://github.com/labring/FastGPT.git
synced 2025-11-28 01:04:42 +08:00
perf: read file node return splited raw texts (#5881)
This commit is contained in:
@@ -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
|
||||
]
|
||||
};
|
||||
|
||||
@@ -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) => ({
|
||||
|
||||
Reference in New Issue
Block a user