File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5151 </ div >
5252
5353 < div class = "form-row" >
54- < label for = "node-input-assistantid " > < i class = "fa fa-tag" > </ i > Assitant ID</ label >
55- < input type = "text" id = "node-input-assistantid " placeholder = "Assistant ID" >
54+ < label for = "node-input-assistant_id " > < i class = "fa fa-tag" > </ i > Assitant ID</ label >
55+ < input type = "text" id = "node-input-assistant_id " placeholder = "Assistant ID" >
5656 </ div >
5757
5858 < div class = "form-row" >
8585 < label for = "node-input-multisession" style = "width: 70%;" > Multiple Sessions</ label >
8686 </ div >
8787
88-
8988 < div class = "form-tips" id = "assistantv2-form-tips" >
90- < strong > Note:</ strong > When using multiple sessions, < code > msg.params.session</ code >
91- must be set. < br >
89+ < strong > Note:</ strong > When using multiple sessions, and < code > msg.params.session</ code >
90+ is not set then a new session id is generated. < br >
9291 See info box for details.
9392 </ div >
9493</ script >
164163 name : { value : '' } ,
165164 'default-endpoint' : { value : true } ,
166165 'service-endpoint' : { value : 'https://gateway.watsonplatform.net/assistant/api' } ,
167- assitantid : { value : '' } ,
166+ assistant_id : { value : '' } ,
168167 debug : { value : false } ,
169168 restart : { value : false } ,
170169 returncontext : { value : true } ,
Original file line number Diff line number Diff line change @@ -77,12 +77,22 @@ module.exports = function(RED) {
7777 return Promise . resolve ( ) ;
7878 }
7979
80+ function idCheck ( msg , config ) {
81+ if ( ! config . assistant_id && ! ( msg . params && msg . params . assistant_id ) ) {
82+ return Promise . reject ( 'Missing assistant_id. Check node documentation.' ) ;
83+ }
84+ return Promise . resolve ( ) ;
85+ }
86+
8087 this . on ( 'input' , function ( msg ) {
8188 node . status ( { } ) ;
8289
8390 var creds = setCredentials ( msg ) ;
8491
8592 credentialCheck ( creds . username , creds . password , creds . apikey )
93+ . then ( function ( ) {
94+ return idCheck ( msg , config ) ;
95+ } )
8696 . then ( function ( ) {
8797 msg . payload = 'No functionality yet' ;
8898 return Promise . resolve ( ) ;
You can’t perform that action at this time.
0 commit comments