kevin-mitchell / alexa-app

Set of classes to make creating Amazon Alexa Skills Kit (ASK) applications easier with Laravel and Lumen
MIT License
97 stars 47 forks source link

Suggestion: have AlexaResponse end the session by default #12

Closed colinodell closed 8 years ago

colinodell commented 8 years ago

I experienced "strange" behavior when trying to implement Alexa::say() in my controller per the README. After reading out the response text, Alexa would:

I eventually determined this happened because the session was not closed - I didn't call $request->endSession() after creating the response. This was not obvious to me.

IMO, AlexaResponse should provide the simplest usage by default and allow you to enable extra features like cards, reprompts, etc. by simply making additional calls or setting additional parameters. This does seem to be the case for everything except whether the session is kept open.

For example, if I want Alexa to simply say something aloud, Alexa::say('Hello World') should just work. Needing to add ->endSession() adds unnecessary complexity for this simple case.

On the other hand, if I do want to keep the session open, I'd perceive this as being more complex and would therefore expect the need to call ->endSession(false) to "enable" this extra functionality.

I'd therefore like to propose changing the default value of $shouldSessionEnd to true.

(Hopefully I'm making sense, even if you disagree haha)

develpr commented 8 years ago

I actually find myself most of the time responding with a statement as apposed to prompting for additional info. I appreciate the thought that this should be as simple as possible, and I think it makes sense to end by default... if there was a larger user base I might take a poll or something, but as it stands I'm going to merge this :).

totally off topic: hello fellow magento developer

colinodell commented 8 years ago

totally off topic: hello fellow magento developer

hehe :)

I tend to do more Symfony than Magento lately. This is my first foray into Laravel and so far I'm really liking it!