How to remove simple response when displaying list card in actions on google for phone surface - dialogflow-es

Hi i'm having facing a problem that i have selected phone surface where returning both simple response and list card.But in display i'm getting both in simulator.How to remove the simple response when using or displaying list card.
This requirement is for both google home mini and assistant in phone.
Here i need to clear that their is no request from user by clicking
list card.It is only meant for display purpose.
whether my way of implementation is wrong or not don't know correct me if i am wrong.But is it possible to remove or any other way to get rid of the simple response?

Keep in mind that you must have at least one SimpleResponse, in addition to any other RichResponses you may send. This SimpleResponse can contain a blank space - but it must exist. (It should, however, probably include more than a blank space.)

Use following code to detect the Surface
const screenAvailable = conv.available.surfaces.capabilities.has('actions.capability.SCREEN_OUTPUT');
If Surface present, only use UI based response.
If Surface is not present, only use simple response.
Test on a real mobile device and home as simulator shows extra information during simulation.

Related

How should i enable textfield before entering text using Blue Prism tool?

I'm inputting text in a texbox which is working fine. But there is an existing watermark in the textbox. The entered text in the textbox is inputted as a watermark, hence clicking on 'Next' button results in an error.
Can somebody help on how to enable textfield before entering text using Blue Prism tool?
Can you sandkey event(like SAPCE key) into that field it may cause the watermark to clear it self?
How do you clear that filed in the first palce?
quoting directly from the browser automation guide which you should've read and consumed before being a developer:
Using a Write stage to write to an HTML element such as a text field
does not always work properly. For example, you might try writing to a
username field, only to see a message appear on the web site saying
something like “Please enter a username”, even though you can see that
the value has been correctly written to the field. This can happen
because the data validation functions used by the web form might be
expecting keystrokes, and the write stage has “fooled” it. To get
around this, you will need to use a Navigate stage to call the Send
Keys Action instead of using a Write stage. Some websites have maximum
character limits imposed on some text fields. Using a Write stage can
sometimes fool the website into allowing too many characters into the
field, because the Write stage “sets” the field value rather than
keying characters into it. This is important to bear in mind because
if a field has been filled with more characters than the website would
usually allow, the website could produce an error when you try to
submit or post the data.
to get around this go ahead and use sendkeys, those are likely the best option to push past this validation tool issue on the website.

Show upper-part of adaptive card

I have this very long "form" using adaptive card. Using CardFactory, the bot framework, based on my understanding, can render the card and my bot can display it for my user to fill in the necessary details.
The end of my form (in which I'll use instead of the word adaptive card), has a submit button for user to click whenever all fields are filled in. And while everything works the way I want it to be, its not really user friendly in a sense that what user sees after showing the form is the bottom part of it. User has to scroll for a bit to go up and see the first part of the form.
My question is: Is there anyway I could help user experience by showing the upper-part/top most part of the form? Is that possible in bot framework?
Like if the bot sends successive messages, does the framework allows to show the first messages first, before the last part. THANK YOU!
PS. I use NodeJS for my bot framework, read the documentation but can't find one that dwells deeply about adaptive cards.
Please see images below:
How do I make the first framework to show the first image before the end part which is in the second image.
Have you looked at the "ShowCard" action? It basically lets you collapse part of your card, and only open it when a user clicks on a button. That way you could possibly group your card into sections and show each one at a time. See here for more.
Another option in future is the new ToggleVisibility action in AdaptiveCards 1.2, but it's only if your client supports 1.2. (e.g. it's only available in Developer Preview for Teams right now (so very likely coming in future, but not available at the moment))

While using azure OCR as a web service, if I know the orientation of text, what param should I use?

I am using Microsoft Azure OCR web service. When I use flag "detectOrientation" as true, sometimes it gives weird result. (Tries to identify vertical text, even though I want it to read horizontal text) So, I want to set my orientation as I know it as "Up". Even if I set "detectOrientation" as false, it returns same result.
Surprisingly, if I use Microsoft demo page, https://azure.microsoft.com/en-in/services/cognitive-services/computer-vision/, it is returning correct result. Might be it is doing some pre/post processing or adding some flags. But, it is not revealing this information. Reported this issue so many times to Microsoft but no reply.
You can't set the orientation manually as the parameter detectOrientation is a boolean (true/false) as stated here
The response from the demo page is not the result of the Computer Vision API's OCR, it is the result of using the Computer Vision API's Recognize Text then Get Recognize Text Operation Result to get the result of the operation.
The response of the OCR includes following:
textAngle
orientation
language
regions
lines
words
boundingBox
text
While the response from the Get Recognize Text Operation Result includes the following:
Status Code
Lines
Words
BoundingBox
Text
If you compare the results of the demo page you'll find that they match the Recognize Text, not the OCR.
Surprisingly, if I use Microsoft demo page,
https://azure.microsoft.com/en-in/services/cognitive-services/computer-vision/,
it is returning correct result.
On the demo page, as stated, they don't use OCR operation of the Web service but the new Recognise Text API operation.
Switch to this one, and your results will be consistent.
And to answer your other question about passing the orientation, no there is no such parameter.
I believe the detect Orientation parameter just detects the orientation of all the text in the image, it is not an actual setting that lets you choose which text to read based on its orientation like you're trying to use it.

Discord bot can't show emote "sometimes"

As a french Gwent player, I built a discord bot (using node.js and discord.js) to show the infos of a card when you name it. It uses some custom emotes to show some part of it.
It worked well for a few weeks, but recently some cards don't show the emotes when called.
I have no clue about what could be wrong. The emotes work if you use it yourself on the channel. Some cards show the emotes, others don't, even if they use the same emotes. And it's always all emotes or none for each card.
I checked different cards from my database : with or without emotes, I can't get any specific element which can explain why some cards can have emotes and why some cannot.
Is there something to know here that can explain this situation ?
Although this a late answer and you may have found an answer to the question but I'm going to post an answer anyways for others.
First in the chat you have to type:
\:custom_emote_here:
so in your case, you want it to show
and the name of it was :number5:, you would type :number5:.
You would get something like this:
(of course, it would say :number5: and the start and the numbers would be different)
You can copy and paste that into your code.
For example:
message.channel.send("<:super_magical:366208548914331659>")
would show this:
Hope this helps!
javascriptdiscorddiscord.jsemote
The developers of Discord have recently changed the way bots work with regards to custom emoji.
Before May 16th, bots could use any custom emoji from any server provided they are used inside rich embeds, as shown in your screenshot.
After that date, bots can use custom emoji from shared servers, but do not have to limit it to rich embeds only.
If you have the bot join all the servers that these custom emoji are being hosted on then it will be able to start using the emotes again.
I know that this question was asked quite a whiles ago but I thought I'd offer a solution I found after recently running into this issue myself for anyone else also facing this problem.
Normally, when you send an emoji in a message or embed via the <:name:id> format, Discord will convert it to a custom emoji. However, there are two cases where it represents all custom emojis in a message in the :name: format as shown in your example.
If one of the custom emojis you are trying to send are no longer active in the server (i.e. you have removed it from the server).
If you are trying to send an animated emoji via the <:name:id> format.
If either of the above two conditions are met, it seems like Discord defaults to converting all emojis in the message to :name: rather than the actual custom emoji.
I fixed it for myself by making sure that all of the emojis currently exist in the server emoji list before sending them. For animated emoji, you should send it via the <:a:name:id> format instead.

How to write text values in masked field?

i need some help related to masked field in web form. Syntax of phone field is (___)___-_____, if i execute this code in ruby shell
browser.text_field(:id => 'txtphone').set '7893457889'
... nothing has been added in the phone field.
then i find this solution in one blog, someone said first unmask this field using this code.
browser.text_field(:id,'txtphone').fire_event("unmask")
then write the above code again.
browser.text_field(:id => 'txtphone').set '7893457889'
but still nothing has happened. kindly help me out...am i doing right or still there is a mistake.
If you could provide some sample of the page HTML it will be easier to give you an answer more likely to work.
Given what you have provided us to work from, we have to go with the normal way that such masked input fields typically work and go from there. Usually pages with this kind of thing are calling a javascript function which is triggered by a specific event. Most often this is an event such as onchange but it may be something like keypress or any other even that happens when a normal user types or pasts text into the cell.
You likely need to experiment with using the '.fire_event' method to fire the proper javascript event, or if that fails entirely making a direct call to execute the proper script
When doing this do not confuse the name of a script such as 'applymask' or somesuch with the javascript event which causes that script to be invoked.
The answers to this question How to find out which JavaScript events fired? include some good information on how to use firebug or the chrome developer tools to figure out what events are being fired when you interact with an object on the browser screen.
Update: instead of responding here to indicate if this answer was of any use the OP reposted their question here Masked Text Box issue and by digging around on the vendor's demo site (since that time he actually had posted some of the HTML when we asked for it) I was able to find a solution using watir-webdriver that worked for him.

Resources