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
)
)