[Docs] Jovo Response Object


Learn more about the Jovo $response object.

Learn more about the Request & Response Lifecycle here.

This is a companion discussion topic for the original entry at https://www.jovo.tech/docs/requests-responses/response


I’d like to be able to manipulate the $response object or the $output object to set shouldEndSession to false when using tell. Essentially, I want to be able to say something back to the user before I move on to another intent handler. How should I go about this?


You have a few options:



this.$output.Alexa.shouldEndSession = true


app.middleware('response').use((handleRequest) => {
   handleRequest.$response.response.shouldEndSession = true;


For GoogleConv this:

is the same?


I recommend using the SpeechBuilder for this. You can add a string in one intent handler, and then add another one in the next one. Learn more here: https://www.jovo.tech/docs/output/speechbuilder


No, shouldEndSession is an Alexa-specific property. this.tell() does the same, or you can set the next scene to actions.scene.END_CONVERSATION explicitly



Ok, so if I don’t want the conversation to end after the tell in Google I have to use the setNextScene?


No. you would use ask.


Sometimes I’m in a situation where I want to say something to the user but I don’t need an answer back, is there anything else that I can use?


yes, tell

There’s no way to keep the session open without prompting the user.


Ok, thanks


I’ve ended up using @jan’s idea of using the speech builder. I add some text in one intent, then forward to another, add some more stuff and then call .tell or .ask.