File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
packages/server/src/utils Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -194,7 +194,12 @@ export class SSEStreamer implements IServerSideEventStreamer {
194
194
metadataJson [ 'memoryType' ] = apiResponse . memoryType
195
195
}
196
196
if ( apiResponse . followUpPrompts ) {
197
- metadataJson [ 'followUpPrompts' ] = JSON . parse ( apiResponse . followUpPrompts )
197
+ metadataJson [ 'followUpPrompts' ] =
198
+ typeof apiResponse . followUpPrompts === 'string' ? JSON . parse ( apiResponse . followUpPrompts ) : apiResponse . followUpPrompts
199
+ }
200
+ if ( apiResponse . flowVariables ) {
201
+ metadataJson [ 'flowVariables' ] =
202
+ typeof apiResponse . flowVariables === 'string' ? JSON . parse ( apiResponse . flowVariables ) : apiResponse . flowVariables
198
203
}
199
204
if ( Object . keys ( metadataJson ) . length > 0 ) {
200
205
this . streamCustomEvent ( chatId , 'metadata' , metadataJson )
You can’t perform that action at this time.
0 commit comments