简体   繁体   中英

Using Regex to identify Entity on a Google Action Intent

I have this Intent on Google Actions with a couple of utterances:

在此处输入图像描述

and I'm using one of the default system types:

在此处输入图像描述

The Bank Account should always be 8 digits so I was thinking if I could use Regex on Google Actions to identify this exact entity when typed by the user.

If yes, how exactly?

Can I just create an utterance with Regex like this: \d{8}

Should I "highlight" as Parameter just like I did with the two given examples as well?

Thanks,

While this is not visible in the Actions Console, it is something that can be done if you download the project to a local environment using gactions .

You can create a new Type in under custom/types . You will use create RegularExpression Entities .

regularExpression:
    entities:
        # `bankNumber` is your parameter name. It can be custom.
        bankNumber:
            regularExpressions:
                - \d{8} # In the `re2` syntax

Then you'll need to re-upload your project to the Actions Console with gactions push and gactions deploy preview .

Hi @vpego did you find the answer for jovo4? i was having the same issue

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM