MCPcopy Index your code
hub / github.com/FlowiseAI/Flowise / streamMetadataEvent

Method streamMetadataEvent

packages/server/src/utils/SSEStreamer.ts:289–320  ·  view source on GitHub ↗
(chatId: string, apiResponse: any)

Source from the content-addressed store, hash-verified

287 }
288
289 streamMetadataEvent(chatId: string, apiResponse: any) {
290 const metadataJson: any = {}
291 if (apiResponse.chatId) {
292 metadataJson['chatId'] = apiResponse.chatId
293 }
294 if (apiResponse.chatMessageId) {
295 metadataJson['chatMessageId'] = apiResponse.chatMessageId
296 }
297 if (apiResponse.question) {
298 metadataJson['question'] = apiResponse.question
299 }
300 if (apiResponse.sessionId) {
301 metadataJson['sessionId'] = apiResponse.sessionId
302 }
303 if (apiResponse.memoryType) {
304 metadataJson['memoryType'] = apiResponse.memoryType
305 }
306 if (apiResponse.followUpPrompts) {
307 metadataJson['followUpPrompts'] =
308 typeof apiResponse.followUpPrompts === 'string' ? JSON.parse(apiResponse.followUpPrompts) : apiResponse.followUpPrompts
309 }
310 if (apiResponse.flowVariables) {
311 metadataJson['flowVariables'] =
312 typeof apiResponse.flowVariables === 'string' ? JSON.parse(apiResponse.flowVariables) : apiResponse.flowVariables
313 }
314 if (apiResponse.action) {
315 metadataJson['action'] = typeof apiResponse.action === 'string' ? JSON.parse(apiResponse.action) : apiResponse.action
316 }
317 if (Object.keys(metadataJson).length > 0) {
318 this.streamCustomEvent(chatId, 'metadata', metadataJson)
319 }
320 }
321
322 streamUsageMetadataEvent(chatId: string, data: any): void {
323 const clientResponse = {

Callers 4

createPredictionFunction · 0.45
abortTextToSpeechFunction · 0.45
createWebhookFunction · 0.45

Calls 2

streamCustomEventMethod · 0.95
parseMethod · 0.65

Tested by

no test coverage detected