File tree Expand file tree Collapse file tree 1 file changed +20
-9
lines changed
Expand file tree Collapse file tree 1 file changed +20
-9
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,19 @@ const sanitizeTool = (Tool) => {
1919 }
2020}
2121
22+ const CHATFLOW_FIELDS_TO_PRESERVE = [
23+ 'chatbotConfig' ,
24+ 'category' ,
25+ 'speechToText' ,
26+ 'textToSpeech' ,
27+ 'followUpPrompts' ,
28+ 'apiConfig' ,
29+ 'analytic' ,
30+ 'isPublic' ,
31+ 'apikeyid' ,
32+ 'mcpServerConfig'
33+ ]
34+
2235const sanitizeChatflow = ( ChatFlow ) => {
2336 try {
2437 return ChatFlow . map ( ( chatFlow ) => {
@@ -29,15 +42,13 @@ const sanitizeChatflow = (ChatFlow) => {
2942 flowData : stringify ( sanitizeFlowData ) ,
3043 type : chatFlow . type
3144 }
32- if ( chatFlow . chatbotConfig ) sanitized . chatbotConfig = chatFlow . chatbotConfig
33- if ( chatFlow . category ) sanitized . category = chatFlow . category
34- if ( chatFlow . speechToText ) sanitized . speechToText = chatFlow . speechToText
35- if ( chatFlow . textToSpeech ) sanitized . textToSpeech = chatFlow . textToSpeech
36- if ( chatFlow . followUpPrompts ) sanitized . followUpPrompts = chatFlow . followUpPrompts
37- if ( chatFlow . apiConfig ) sanitized . apiConfig = chatFlow . apiConfig
38- if ( chatFlow . analytic ) sanitized . analytic = chatFlow . analytic
39- if ( chatFlow . isPublic !== undefined ) sanitized . isPublic = chatFlow . isPublic
40- if ( chatFlow . apikeyid ) sanitized . apikeyid = chatFlow . apikeyid
45+
46+ CHATFLOW_FIELDS_TO_PRESERVE . forEach ( ( field ) => {
47+ if ( chatFlow [ field ] != null ) {
48+ sanitized [ field ] = chatFlow [ field ]
49+ }
50+ } )
51+
4152 return sanitized
4253 } )
4354 } catch ( error ) {
You can’t perform that action at this time.
0 commit comments