treethought / flask-assistant

Framework for Building Virtual Assistants with Dialogflow and python
Apache License 2.0
380 stars 100 forks source link

Support for media responses #126

Closed davidalbertonogueira closed 4 years ago

davidalbertonogueira commented 5 years ago

Hi @treethought ,

I would like to play audio, but the SSML approach :

 '<speak><audio src="https://s3-us-west-1.amazonaws.com/sayspring-prod/media/celtic-open-chime.mp3" /></speak>'

is not working.

Moreover, there's another way to play longer audios (SSML is restricted to files up to 240 seconds), which is using Media responses ( https://developers.google.com/assistant/conversational/responses#df_json_media_response ).

Looking at their json example, it would require adding a "richResponse" in the "payload"-"google" element. Is it feasible to incorporate this in your library?

treethought commented 5 years ago

hi @davidalbertonogueira. yes it is possible to add support for media responses. I am actually currently working on adding them as a response type. Hoping to have them implemented soon.

davidalbertonogueira commented 5 years ago

I implemented two new response classes, one for SSML and other for Media Response. I can share them in a pull request.

lrusak commented 5 years ago

Any updates here? @davidalbertonogueira would you care to push your code to your github repo or make a PR?

davidalbertonogueira commented 4 years ago

@lrusak you can find the class in my repo:

https://github.com/davidalbertonogueira/flask-assistant/commit/b22211882ebb6ea6b561c2fcead38a862802ce63