@@ -42,27 +42,27 @@ export const getWorkflowResponseWrite = ({
|
||||
|
||||
if (!res || res.closed || !useStreamResponse) return;
|
||||
|
||||
const detailEvent = [
|
||||
SseResponseEventEnum.error,
|
||||
SseResponseEventEnum.flowNodeStatus,
|
||||
SseResponseEventEnum.flowResponses,
|
||||
SseResponseEventEnum.interactive,
|
||||
SseResponseEventEnum.toolCall,
|
||||
SseResponseEventEnum.toolParams,
|
||||
SseResponseEventEnum.toolResponse,
|
||||
SseResponseEventEnum.updateVariables
|
||||
];
|
||||
// Forbid show detail
|
||||
const detailEvent: Record<string, 1> = {
|
||||
[SseResponseEventEnum.error]: 1,
|
||||
[SseResponseEventEnum.flowNodeStatus]: 1,
|
||||
[SseResponseEventEnum.flowResponses]: 1,
|
||||
[SseResponseEventEnum.interactive]: 1,
|
||||
[SseResponseEventEnum.toolCall]: 1,
|
||||
[SseResponseEventEnum.toolParams]: 1,
|
||||
[SseResponseEventEnum.toolResponse]: 1,
|
||||
[SseResponseEventEnum.updateVariables]: 1
|
||||
};
|
||||
if (!detail && detailEvent[event]) return;
|
||||
|
||||
if (!detail && detailEvent.includes(event)) return;
|
||||
|
||||
if (
|
||||
!showNodeStatus &&
|
||||
(event === SseResponseEventEnum.flowNodeStatus ||
|
||||
event === SseResponseEventEnum.toolCall ||
|
||||
event === SseResponseEventEnum.toolParams ||
|
||||
event === SseResponseEventEnum.toolResponse)
|
||||
)
|
||||
return;
|
||||
// Forbid show running status
|
||||
const statusEvent: Record<string, 1> = {
|
||||
[SseResponseEventEnum.flowNodeStatus]: 1,
|
||||
[SseResponseEventEnum.toolCall]: 1,
|
||||
[SseResponseEventEnum.toolParams]: 1,
|
||||
[SseResponseEventEnum.toolResponse]: 1
|
||||
};
|
||||
if (!showNodeStatus && statusEvent[event]) return;
|
||||
|
||||
responseWrite({
|
||||
res,
|
||||
|
||||
Reference in New Issue
Block a user