0

When developing my Alexa skill, Each time I want to change user's screen in my skill (using APL), I return a new APL document. However, this is slow because it must load the document each time.

Is there a better way to do this instead of returning a new document each time?

I have found some info on this but struggle to find an answer in Python. Below is the code I use to return a new document.

datasources = _load_apl_document("recipe_output_data.json")
        if get_supported_interfaces(handler_input).alexa_presentation_apl is not None:
            handler_input.response_builder.add_directive(
                RenderDocumentDirective(
                    token="recipe_output",
                    document=_load_apl_document("recipe_output_APL.json"),
                    datasources=datasources
                )
        )
Adám
  • 6,573
  • 20
  • 37

1 Answers1

0

If you do not want to load the document every time then you can use pager in the apl document. Make a pager container and keep all your screens in items. And on user action do not send the document again and instead send apl command to switch between pages. Refer this for pager and apl commands

Ashish Yadav
  • 154
  • 3