ask_amy.core package

Submodules

ask_amy.core.context module

class ask_amy.core.context.AudioPlayer(request_dict)

Bases: ask_amy.core.object_dictionary.ObjectDictionary

PLAYER_ACTIVITIES = ['IDLE', 'PAUSED', 'PLAYING', 'BUFFER_UNDERRUN', 'FINISHED', 'STOPPED']
offset_in_milliseconds
player_activity
token
class ask_amy.core.context.Context(context_dict)

Bases: ask_amy.core.object_dictionary.ObjectDictionary

audio_player
system
class ask_amy.core.context.System(request_dict)

Bases: ask_amy.core.object_dictionary.ObjectDictionary

api_endpoint
application_id
consent_token
device_id
supported_interfaces
user_access_token
user_id

ask_amy.core.default_dialog module

class ask_amy.core.default_dialog.DefaultDialog(dialog_dict=None)

Bases: ask_amy.core.dialog.Dialog

default_cancel_intent()
default_stop_intent()
handle_default_intent(use_default_message=None)
intent_request()

Executes the method related to the intent sent from Alexa. The methods are mapped in the skill_configuration.json file under the attribute name ‘intent_control’

Returns: Response object

launch_request()
new_session_started()
session_ended_request()

ask_amy.core.default_home_skill module

class ask_amy.core.default_home_skill.DefaultHomeSkill(dialog_dict=None)

Bases: ask_amy.core.object_dictionary.ObjectDictionary

begin(event_dict)
generate_response(name, message_id, payload)
handle_control(event)
handle_discovery(event)
on_off_request(device_id, prop)

ask_amy.core.dialog module

class ask_amy.core.dialog.Dialog(dialog_dict=None)

Bases: ask_amy.core.object_dictionary.ObjectDictionary

application_id
begin(event_dict)
event
execute_method(method_name)
intent_name
reply_dialog
request
session
version

ask_amy.core.directive module

class ask_amy.core.directive.AudioPlayer(audio_dict=None)

Bases: ask_amy.core.object_dictionary.ObjectDictionary

classmethod clear_queue(clear_behavior)
classmethod play(url, offset_in_milliseconds=0, token='0', expected_previous_token=None)
classmethod stop()

ask_amy.core.event module

class ask_amy.core.event.Event(event_dict)

Bases: object

context
request
session
slot_data_to_session_attributes()
version

ask_amy.core.exceptions module

Global exception and warning classes.

exception ask_amy.core.exceptions.ASKAmyError

Bases: Exception

Common base class for all ASK Amy exceptions.

exception ask_amy.core.exceptions.ApplicationIdError

Bases: ask_amy.core.exceptions.ASKAmyError

The application id provided does not match application id for this skill

exception ask_amy.core.exceptions.DialogIntentError

Bases: ask_amy.core.exceptions.ASKAmyError

The Method Name does not map to an Intent in the Dialog section for this skill

exception ask_amy.core.exceptions.FileExistsError

Bases: ask_amy.core.exceptions.ASKAmyError

Code Generator is attempting to write to a file that already exists

exception ask_amy.core.exceptions.IntentControlError

Bases: ask_amy.core.exceptions.ASKAmyError

The Intent Name does not map to an Intent in the IntentControl section for this skill

exception ask_amy.core.exceptions.SessionError

Bases: ask_amy.core.exceptions.ASKAmyError

Error in session

exception ask_amy.core.exceptions.SkillLoadError

Bases: ask_amy.core.exceptions.ASKAmyError

Unable to load, bootstrap and execute the skill

exception ask_amy.core.exceptions.SlotValidatorLoadError

Bases: ask_amy.core.exceptions.ASKAmyError

Unable to load, a custom defined type

ask_amy.core.object_dictionary module

class ask_amy.core.object_dictionary.ObjectDictionary(obj_dict)

Bases: object

get_value_from_dict(path, override_dict=None)

Return a value in a dictionary given a collection of keys that point to the value :param path: a list of keys in the dictionary :param override_dict: a dictionary to be used if provided overriding the base dictionary. (This is often a sub dictionary of the base but it does not need to be :return: None or the value found

json()
logger = <logging.RootLogger object>

ask_amy.core.reply module

class ask_amy.core.reply.Card(card_dict=None)

Bases: ask_amy.core.reply.CommunicationChannel

classmethod simple(title, content, event=None)
classmethod standard(title, content, small_image_url, large_image_url, event=None)
class ask_amy.core.reply.CommunicationChannel(card_dict=None)

Bases: ask_amy.core.object_dictionary.ObjectDictionary

static concat_text_if_list()
static inject_event_data(event)
static process_token(event)
class ask_amy.core.reply.Prompt(card_dict=None)

Bases: ask_amy.core.reply.CommunicationChannel

classmethod ssml(ssml, event=None)
classmethod text(text, event=None)
class ask_amy.core.reply.Reply(card_dict=None)

Bases: ask_amy.core.object_dictionary.ObjectDictionary

static build(event=None)
static build_audio(event=None)
classmethod constr(response, session_attributes=None)
class ask_amy.core.reply.Response(card_dict=None)

Bases: ask_amy.core.object_dictionary.ObjectDictionary

classmethod audio_play(audio_player, out_speech=None, card=None)
classmethod audio_stop(audio_stop, out_speech=None, card=None)
classmethod constr(out_speech, reprompt=None, card=None, should_end_session=True)

ask_amy.core.request module

class ask_amy.core.request.IntentRequest(request_dict)

Bases: ask_amy.core.request.Request

CONFIRMATION_STATUSES = ['NONE', 'CONFIRMED', 'DENIED']
DIALOG_STATES = ['STARTED', 'IN_PROGRESS', 'COMPLETED']
confirmation_status
dialog_state
intent_name
slots
value_for_slot_name(name)
class ask_amy.core.request.LaunchRequest(request_dict)

Bases: ask_amy.core.request.Request

class ask_amy.core.request.Request(request_dict)

Bases: ask_amy.core.object_dictionary.ObjectDictionary

attribute_exists(attribute)
attributes
static factory()
locale
request_id
request_type
timestamp
class ask_amy.core.request.SessionEndedRequest(request_dict)

Bases: ask_amy.core.request.Request

ERROR_TYPES = ['INVALID_RESPONSE', 'DEVICE_COMMUNICATION_ERROR', 'INTERNAL_ERROR']
REASONS = ['USER_INITIATED', 'ERROR', 'EXCEEDED_MAX_REPROMPTS']
error_message
error_type
reason
class ask_amy.core.request.Slot(slot_dict)

Bases: ask_amy.core.object_dictionary.ObjectDictionary

CONFIRMATION = ['NONE', 'CONFIRMED', 'DENIED']
confirmation_status
name
value

ask_amy.core.session module

class ask_amy.core.session.Session(session_dict)

Bases: ask_amy.core.object_dictionary.ObjectDictionary

access_token
application_id
attribute_exists(attribute)
attributes
consent_token
is_new_session
load()
reset_stored_values()
save()
session_id
user_id

ask_amy.core.skill_factory module

class ask_amy.core.skill_factory.SkillFactory

Bases: object

SKILL_CONFIG = 'skill_config.json'
static build()
static load_configuartion(config_file_name=None)
static set_logging_level()

Module contents