Adds a strip_ssml() function to the response module, which can be used to
clean up a rendered speech response with SSML tags before displaying
it to the user in the Google Assistant app.
Changes the default behavior of the display_text attribute of the
_Response class. Currently this defaults to None, which leads Google to
display the 'speech' text on GUI surfaces. This is suboptimal, as that
speech response might contain SSML tags, which are currently shown to the
user. This change sets the display_text explicitly to the same text as
the speech response, but with the SSML tags stripped.
Current users of this class don't have to change anything, they just get
the added benefit of not having to worry about SSML tags.
Also adds two small unittests for the strip_ssml() function.
Turns out this isn't necessary because Google does strip the tags automatically, it just didn't work in my case because I was using a XML special character (&).
Adds a strip_ssml() function to the response module, which can be used to clean up a rendered speech response with SSML tags before displaying it to the user in the Google Assistant app.
Changes the default behavior of the display_text attribute of the _Response class. Currently this defaults to None, which leads Google to display the 'speech' text on GUI surfaces. This is suboptimal, as that speech response might contain SSML tags, which are currently shown to the user. This change sets the display_text explicitly to the same text as the speech response, but with the SSML tags stripped.
Current users of this class don't have to change anything, they just get the added benefit of not having to worry about SSML tags.
Also adds two small unittests for the strip_ssml() function.