amazon web services - Fetch the slot value used for a previous intent(method) and use it in current method? -
i working on building alexa skill requirement fetch value previous slot..
user: alexa,create appointment alexa: please state subject appointment user : subject {subject} alexa: on day? user : {day} alexa : appointment has been created {subject} on {day} final method should fetch values previous slots(subject , date) , create appointment. far i'm able fetch slot value current intent...but fetch slot value previous intent , use in current method.
*example
protected speechletresponse method1(intent intent,session session)throws exception{ speechletresponse response=null; map<string, slot> slots = intent.getslots(); slot example = slots.get(sampleslot); string value=example.getvalue().tostring(); string output="something"; response = speechletresponsehelper.getspeechletresponse(output, reprompt, true); return response; } protected speechletresponse method2(intent intent,session session)throws exception{ speechletresponse response=null; ****how fetch slot value used method1 , use in method2? **** response = speechletresponsehelper.getspeechletresponse(xxxx, reprompt, true); return response; } is possible?if how can it?
thanks , regards
i believe should able use session.setattribute() , session.getattribute() mentioned here - https://github.com/amzn/alexa-skills-kit-java/blob/master/src/com/amazon/speech/speechlet/session.java
Comments
Post a Comment