SSML MalformedRequest error in Google Assistant intent response - dialogflow-es

I'm using a Dialogflow agent to feed an Assistant Action. I receive an error when I attempt to customize an intent's response output using SSML.
I have a simple response for "Google Assistant" (in addition to the default)
Using plain text is fine and the text-to-speech works. However, if I try to customize the output I receive a Malformed Request error when I test the action in the simulator.
<speak>Hey just testing out some SSML
<break time="3000ms">
Trying to get <emphasis level="moderate">emphasis</emphasis> and break to work.
</speak>
produces:
expected_inputs[0].input_prompt.rich_initial_prompt.items[0].simple_response: 'ssml' could not be parsed.
Can anyone point to what might be wrong?
Oddly, the text is spoken correctly even with the XML content instead of "reading" the code. However, the break, emphasis, etc don't seem to be applied
Here's what comes back in the Response JSON
"simpleResponse": {
"ssml": "<speak>Hey just testing out some SSML\n<break time=\"500ms\">\nTrying to get <emphasis level=\"moderate\">emphasis</emphasis> and break to work.\n</speak>"
}

Well, I feel like an idiot. I solved the problem. I missed the self-closing slash on the <break> tag.
I had <break> and it needed to be <break />. Word to the wise, The Assistant XML parser is strict!

Related

Is there a way to hyperlink bot responses sent through Dialogflow Messenger?

I am trying to have links hyperlinked in my bot's response text but I can't seem to get it to work, and I can't find any resources online about it. The messages would be sent through Dialogflow Messenger.
I tried markdown hyperlinks and html anchor tags.
I think response text use a hyperlink tag as a pure text.
The another way is to write tag in accordion response.

Using the Alexa Skills node SDK to display a full screen image on Echo Show

I'm using the Alexa Node SDK to build my application which is hosted on AWS Lambda. When using an Echo Show (or any display-enabled device), I'd like the screen to update with a full-screen image when Alexa responds with audio.
I'm able to do this with the "Standard Card" -- but the image is very small and appears to the right of the spoken text.
Is there any way to remove the text and display the image full screen?
Sample code:
return handlerInput.responseBuilder
.speak('my text')
.withStandardCard('my title', 'my text', 'https://myimage-sm.jpg', 'https://myimage-lg.jpg')
.reprompt('my title', 'my text')
.addElicitSlotDirective('slotname')
.getResponse();
To be clear, I've also tried adding a template with addRenderTemplateDirective, but this throws an error, as Alexa allows only one directive per slot.
No other directives are allowed to be specified with a Dialog directive. The following Dialog Directives were returned: [Display.RenderTemplate]
You can try my project here which uses APL behind the curtains to render the card wit a full background. BTW, the limitation is not one directive per slot, the limitation is that you can't use any dialog related directive with other directives, for example render template directives or APL directives. So if you're going to do dialog management forget about sending display rendering directives for the time being.

DialogFlow: 'Add Response' not working in Web Demo

As you can see from the image below, putting two separate 'text response' buttons gives me a two line response.
However, I only get either one of the responses (at random) when I use the Web Demo integration. Either 'Hi, welcome!' or 'How may I help?'
Anyone got any ideas why? Thanks!
Not sure where my image link went... anyway read a few Google forums that said this isn't possible. Solved the problem by just pressing space until it went onto a new line.
When you are in Default responses tab, then it gives two options: Text response, custom payload
You should select Google assistant tab before clicking the add response button. Thus You can see all options about responses.

Chrome extension won't allow get request

I'm trying to create my first chrome extension. Basically I have a simple html page and some javascript that im using to allow users to enter some data, the script will format it correctly and then output it:
<form>
MAC ADDRESS: <input type="text" id="mac" name="macAddress" maxlength="17" >
<button onclick="convert(); return false;">Convert</button>
</form>
Javascript:
function convert() {
var mac = document.getElementById('mac').value; //get string
var mac2 = mac.replace(/\:|-/g,""); //remove colons and dashes
//
//add fullstops after every 4th character, appart from last character.
//
mac2 = mac2.replace(/(.{4})(?!$)/g , '$1.');
//output string
document.getElementById("outputDiv").innerHTML= mac2;
};
My problem is that while this works fine as a normal web page, the get method, to the same page, is not working when I tried to implement it as an extension.
I've followed the tutorials on google's site and the extension is showing up but it doesn't seem to be able to handle get requests. I've tried modifying the manifest file using different suggestions I found on here but still no success.
Theres nothing in the console when I try to debug it (something briefly flickers up when I submit the get request but it doesn't stay up long enough to see what the issue is).
I'd really appreciate it if someone could point me in the right direction with this!
Due to the Content Security Policy applied to extensions:
Inline JavaScript will not be executed. This restriction bans both inline blocks and inline event handlers (e.g. ).
[...]
The inline event handler definitions must be rewritten in terms of addEventListener and extracted into popup.js.
For more info atake a look at the docs.

Embedding a youtube video in a mobile site works, but 'Domains protocols and ports must match' error is jamming browser

I am trying to dynamically embed a youtube video into a mobile web page by injecting the following code via jQuery.
$("#tagetId").append("http://www.youtube.com/embed/oHg5SJYRHA0' frameborder='0'>");
I am testing this on chrome ios and the video does render correctly however some part of the web page seems to think the video hasn't rendered and every half second or so I get a new instance of the following error.
Unsafe JavaScript attempt to access frame with URL http://mydomain.html from frame with URL http://www.youtube.com/embed/oHg5SJYRHA0. Domains, protocols and ports must match.
This seems to really jam up the browser and causes the the load event call back function (i.d. 'first line of code') to trigger over and over.
$('iframe').load(function(){
//first line of code
$(this).load(function(){
//second line of code
})
});
Is there a better way to do this. Can any one explain what I'm doing wrong?
This fixed it:
<iframe scrolling='no' class='youtube-player' style='height:200px;width:100%' src='https://www.youtube.com/embed/oHg5SJYRHA0?html5=1' frameborder='0'></iframe>
Not sure what you were doing with
$("#tagetId").append("http://www.youtube.com/embed/oHg5SJYRHA0' frameborder='0'>");
but that looks like malformed HTML being appended.
Maybe you just didn't append the whole iframe tag?

Resources