-
Notifications
You must be signed in to change notification settings - Fork 366
Support for Progressive Responses #250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 6 commits
9712b05
c5aa0d3
7286515
e7778bb
cf1e27d
fbd4924
4a7bd02
7c99a1e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,5 +26,6 @@ | |
| confirm_intent, | ||
| buy, | ||
| upsell, | ||
| refund | ||
| refund, | ||
| progressive_response | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -440,6 +440,25 @@ def clear_queue(self, stop=False): | |
|
|
||
| self._response['directives'].append(directive) | ||
| return self | ||
|
|
||
| def progressive_response(speech:str): | ||
| """Causes Alexa to speak before your skill sends its full response.""" | ||
| response = { | ||
| "header":{ | ||
| "requestId":"amzn1.echo-api.request.xxxxxxx" | ||
| }, | ||
| "directive":{ | ||
| "type":"VoicePlayer.Speak", | ||
| "speech":"This text is spoken while your skill processes the full response." | ||
| } | ||
| } | ||
| response['header']['requestId'] = context.System.apiAccessToken | ||
|
||
| response['directive']['speech'] = request.requestId | ||
|
|
||
|
|
||
| headers = {"Authorization":'Bearer '+authToken, "Content-Type":"application/json"} | ||
| r = requests.post("https://api.amazonalexa.com/v1/directives", headers=headers, json=response) | ||
|
||
| return r.status_code | ||
|
|
||
|
|
||
| def _copyattr(src, dest, attr, convert=None): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't hardcode request Id