Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Sanjay Rohila crazyrohila

🏠
Working from home
View GitHub Profile
View docker-compose.yml
version: '3'
services:
web:
image: httpd
ports:
- "80:80"
links:
- fluentd
logging:
driver: "fluentd"
@crazyrohila
crazyrohila / document1.json
Created Jan 11, 2019
APL Document [Alexa]
View document1.json
{
"type": "APL",
"version": "1.0",
"theme": "dark",
"import": [],
"resources": [],
"styles": {
"headerStyle": {
"values": [{
"color": "#008080",
@crazyrohila
crazyrohila / alexa-ssml-with-polly-voices.json
Created Dec 4, 2018
alexa ssml with polly voices (Lexicons)
View alexa-ssml-with-polly-voices.json
{
"version": "1.0",
"response": {
"outputSpeech": {
"type": "SSML",
"ssml": "<speak>
Well, you can rent a car with my assistant. This is how you can do so:
<voice name='Brian'>Alexa, launch my assistant<voice>
<voice name='Amy'>Hi, welcome to my assistant. How can I help you<voice>
<voice name='Brian'>Rent a car<voice>
@crazyrohila
crazyrohila / alexa-show-reprompt-with-touch-voice.json
Created Dec 4, 2018
alexa show reprompt with touch and voice
View alexa-show-reprompt-with-touch-voice.json
{
"version": "1.0",
"response": {
"outputSpeech": {
"type": "PlainText",
"text": "Yeah, sure. You can claim expenses through Keka."
},
"reprompt": {
"outputSpeech": {
"type": "PlainText",
View alexa-echo-show-response.json
{
"version": "1.0",
"response": {
"outputSpeech": {
"type": "PlainText",
"text": "Hi, I am a virtual assistant, but with a screen."
},
"directives": [
{
"type": "Display.RenderTemplate",
View lex-alexa-blog-lex-renderer-response.json
{
"prompt": "Please select from below options:",
"ui_type": "buttons",
"data": [
{
"label": "Button 1",
"value": "button1"
},
{
"label": "Button 1",
View lex-alexa-alexa-renderer-response.json
{
"version": "1.0",
"response": {
"outputSpeech": {
"type": "PlainText",
"text": "Please select from below options:"
},
"directives": [
{
"type": "Display.RenderTemplate",
View lex-alexa-core-controller-response.json
{
"slots": [],
"prompt": "Please select from below options:",
"ui_type": "picker",
"data": [
{
"label": "Button 1",
"value": "button1"
},
{
View lex-translation-blog.py
import boto3
def translate_text(text, to_lang, from_lang='en'):
if (from_lang == to_lang or not to_lang):
return text
client = boto3.client('translate', region_name='us-east-1')
response = client.translate_text(
Text=text,
SourceLanguageCode=from_lang,
TargetLanguageCode=to_lang
)
View lex-workflow-blog-intent-interface.py
# Intent json structure with slot keys
flow = {
"slots": {}
}
# responseCard values, needs to be sent back to user for selection
slotResponses = {}
# Final fulfillment response
fulfillment_response = "Great Job!"
You can’t perform that action at this time.