Coder Social home page Coder Social logo

Comments (10)

richtier avatar richtier commented on September 28, 2024

@mushfiq what changes are needed to inform AVS that the device supports templates? I suspect it needs to be alerted to the fact the device has a screen.

from alexa-voice-service-client.

mushfiq avatar mushfiq commented on September 28, 2024

@richtier As of my understanding thats actually independent of the client.
AVS checks whether the display card option is enabled or not (in product settings) and when thats enabled, AVS sends TemplateRuntime as part of response directives.

from alexa-voice-service-client.

richtier avatar richtier commented on September 28, 2024

Great. If it's that simple then we should be able to simply check `directive.name == 'RenderTemplate'. Can you test that and let me know.

from alexa-voice-service-client.

richtier avatar richtier commented on September 28, 2024
for directive in alexa_client.send_audio_file(f):
    if directive.name in ['Speak', 'Play']:
        ...
    elif directive.name == 'RenderTemplate':
        print(directive.directive)  # do something with directive template data

from alexa-voice-service-client.

mushfiq avatar mushfiq commented on September 28, 2024

@richtier I will check it and let you know soon.

from alexa-voice-service-client.

richtier avatar richtier commented on September 28, 2024

@mushfiq ping :)

from alexa-voice-service-client.

mushfiq avatar mushfiq commented on September 28, 2024

Hi @richtier below is my findings:

elif directive.name == 'RenderTemplate':
        print(directive.directive)  # do something with directive template data

Does not work out of the box.
As the avs_client implementation looks only for octet-stream and it filters out other content type. To overcome that, the current (tested on 1.0.1) implementation needs to be adjusted.

BTW, sorry for late feedback :)

from alexa-voice-service-client.

richtier avatar richtier commented on September 28, 2024

@mushfiq thanks I will add this feature soon.

How did you test it? I will aim to use your method for testing the new feature

from alexa-voice-service-client.

mushfiq avatar mushfiq commented on September 28, 2024

@richtier as prerequisite the display card options should be enabled from the product settings.

AVS does not provide RenderTemplate out of the box, for some queries it has template data for some it does not. For testing, I had to try out different queries (generally for asking for a place would return a template).
I am also planning to implement it (but not sure when exactly I will be done with that). If I can finish soon, I will submit a PR.

from alexa-voice-service-client.

mushfiq avatar mushfiq commented on September 28, 2024

Hi @richtier I tried the latest version of the client and now RenderTemplate directive is being returned via the client. I am closing this issue. The RenderTemplate payload can be accessed like below:

directive.directive.get("payload")

from alexa-voice-service-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.