creating_your_own_custom_skill_for_alexa
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
creating_your_own_custom_skill_for_alexa [2016/12/30 11:27] – blakehament | creating_your_own_custom_skill_for_alexa [2017/04/04 09:00] (current) – blakehament | ||
---|---|---|---|
Line 2: | Line 2: | ||
- | **Author:** Blake Hament | + | **Author: |
**Date:** 12/30/16 \\ | **Date:** 12/30/16 \\ | ||
**Keywords: | **Keywords: | ||
Line 63: | Line 63: | ||
if (event[' | if (event[' | ||
#Change to application id listed under your alexa skill in the developer portal | #Change to application id listed under your alexa skill in the developer portal | ||
- | " | + | " |
raise ValueError(" | raise ValueError(" | ||
Line 71: | Line 71: | ||
intent = intent_request[" | intent = intent_request[" | ||
intent_name = intent_request[" | intent_name = intent_request[" | ||
- | if intent_name == " | + | if intent_name == "__<fc #ff0000>GetCurrentPrice</ |
- | return get_current_price(intent) | + | return |
- | elif intent_name == " | + | elif intent_name == "__<fc #ffa500>GetHigh</ |
- | return get_high(intent) | + | return |
- | elif intent_name == " | + | elif intent_name == "__<fc #fa8072>GetLow</ |
- | return get_low(intent) | + | return |
elif intent_name == " | elif intent_name == " | ||
return get_welcome_response() | return get_welcome_response() | ||
Line 84: | Line 84: | ||
raise ValueError(" | raise ValueError(" | ||
- | Replace or delete the functions | + | Replace or delete the <fc # |
- | Look for references to " | + | Look for references to "<fc #ff0000>Stocker</fc>" and change to the name of your custom skill |
def handle_session_end_request(): | def handle_session_end_request(): | ||
- | card_title = " | + | card_title = "<fc #ff0000>Stocker</fc>" |
- | speech_output = "Im sorry dave. Im afraid I cant do that." | + | speech_output = "I' |
should_end_session = True | should_end_session = True | ||
return build_response({}, | return build_response({}, | ||
- | Edit the dialogue so that it suits your user interface needs | + | Edit the <fc #4682b4>dialogue</ |
def get_welcome_response(): | def get_welcome_response(): | ||
#Response to user invoking stock app without parameters/ | #Response to user invoking stock app without parameters/ | ||
session_attributes = {} | session_attributes = {} | ||
- | card_title = " | + | card_title = "<fc #ff0000>Stocker</fc>" |
- | speech_output = " | + | speech_output = " |
- | "You can ask me for current stock prices, or " \ | + | "<fc #4682b4>You can ask me for current stock prices, or</ |
- | "ask me about stock highs and lows." | + | "<fc #4682b4>ask me about stock highs and lows.</fc>" |
- | reprompt_text = " | + | reprompt_text = " |
- | "for example Apple stock price." | + | "for example |
should_end_session = False | should_end_session = False | ||
return build_response(session_attributes, | return build_response(session_attributes, | ||
Line 113: | Line 113: | ||
===== Final Words ===== | ===== Final Words ===== | ||
- | Often it is easier to adapt working code to a new purpose than to write a script from scratch. This method may leave the user lacking important functionality if the code is repurposed for a drastically different skill, so check the resources on the Amazon web developers portal before taking starting an ambitious project. | + | Often it is easier to adapt working code to a new purpose than to write a script from scratch. This method may leave the user lacking important functionality if the code is repurposed for a drastically different skill, so check the resources on the Amazon web developers |
creating_your_own_custom_skill_for_alexa.txt · Last modified: 2017/04/04 09:00 by blakehament