Skip to content

Instantly share code, notes, and snippets.

View crazyrohila's full-sized avatar
🏠
Working from home

Sanjay Rohila crazyrohila

🏠
Working from home
View GitHub Profile
@crazyrohila
crazyrohila / docker-compose.yml
Created February 7, 2020 08:34
Fluent-ES-Kibaba-Logs
version: '3'
services:
web:
image: httpd
ports:
- "80:80"
links:
- fluentd
logging:
driver: "fluentd"
@crazyrohila
crazyrohila / document1.json
Created January 11, 2019 09:31
APL Document [Alexa]
{
"type": "APL",
"version": "1.0",
"theme": "dark",
"import": [],
"resources": [],
"styles": {
"headerStyle": {
"values": [{
"color": "#008080",
@crazyrohila
crazyrohila / alexa-ssml-with-polly-voices.json
Created December 4, 2018 22:25
alexa ssml with polly voices (Lexicons)
{
"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 December 4, 2018 22:09
alexa show reprompt with touch and voice
{
"version": "1.0",
"response": {
"outputSpeech": {
"type": "PlainText",
"text": "Yeah, sure. You can claim expenses through Keka."
},
"reprompt": {
"outputSpeech": {
"type": "PlainText",
@crazyrohila
crazyrohila / alexa-echo-show-response.json
Last active December 5, 2018 08:22
alexa-echo-show-response
{
"version": "1.0",
"response": {
"outputSpeech": {
"type": "PlainText",
"text": "Hi, I am a virtual assistant, but with a screen."
},
"directives": [
{
"type": "Display.RenderTemplate",
@crazyrohila
crazyrohila / lex-alexa-blog-lex-renderer-response.json
Created December 4, 2018 21:48
lex-alexa-blog-lex-renderer-response
{
"prompt": "Please select from below options:",
"ui_type": "buttons",
"data": [
{
"label": "Button 1",
"value": "button1"
},
{
"label": "Button 1",
@crazyrohila
crazyrohila / lex-alexa-alexa-renderer-response.json
Created December 4, 2018 21:47
lex-alexa-alexa-renderer-response
{
"version": "1.0",
"response": {
"outputSpeech": {
"type": "PlainText",
"text": "Please select from below options:"
},
"directives": [
{
"type": "Display.RenderTemplate",
@crazyrohila
crazyrohila / lex-alexa-core-controller-response.json
Created December 4, 2018 21:45
lex-alexa-core-controller-response
{
"slots": [],
"prompt": "Please select from below options:",
"ui_type": "picker",
"data": [
{
"label": "Button 1",
"value": "button1"
},
{
@crazyrohila
crazyrohila / lex-translation-blog.py
Created December 4, 2018 21:34
lex-translation-blog
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
)
@crazyrohila
crazyrohila / lex-workflow-blog-intent-interface.py
Created December 4, 2018 21:30
lex-workflow-blog-intent-interface
# 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!"