名称和电子邮件实体的响应为空 [英] Null response for name and email entities

查看:81
本文介绍了名称和电子邮件实体的响应为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在文本响应中尝试了内置变量 user方法, $ user.name $ user.email API.AI的代码,以问候用户并显示email-Id。是否有任何内置变量名用户?

I tried inbuilt variable "user" methods, $user.name and $user.email in text response of API.AI, to greet user and show email-Id. Is there any inbuilt variable name user?

示例(使用Gmail注册用户)

Example(User sign-up with Gmail),

Response-Code, I had tried in API.AI's text-response dialog box:
Hi, $user.firstname
This is your $user.email

Expected:
User: Hi!
My-Assistant-App: Hi, Varun.
User: Show my email-id
My-Assistant-App: This is your ******@gmail.com

Output, I am getting in the My-Assistant-App:
User: Hi!
My-Assistant-app: Hi, $user.firstname 
User: Show my email-id
My-Assistant-App: This is your $user.email


推荐答案

自从提出原始问题以来,现在有多种方法可以获取此信息-

Since the original question was asked, there are now ways to get this information - with some caveats.

您现在可以使用Google登录助手来获取个人资料信息,例如其Google ID和姓名。如果他们已在个人资料中允许其电子邮件地址,则该地址也将包括在内。

You can now use Google Sign In for Assistant to get profile information such as their Google ID and Name. If they have permitted their email address in the profile, this is included as well.

如果您使用的是Google行动库,则 conv.user中//://developers.google.com/actions/identity/google-sign-in#handle_data_access_requests rel = nofollow noreferrer>这将可用。 .profile.payload 。如果未设置,则可以使用登录帮助器进行请求请求。

If you are using the actions-on-google library, this will be available in your Intent Handler in conv.user.profile.payload. If that isn't set, you can request it by using the Sign-In Helper to request it.

如果您使用的是 multivocal ,您可以根据需要设置 User / IsAuthenticated ,该信息将在环境中的 User / Profile

If you are using multivocal, you can set User/IsAuthenticated as a requirement and the information will be available in the environment under User/Profile.

在任何一种情况下,用户都必须授予您第一次获取信息的权限。之后,此信息应可用于所有后续请求。

In either case, the user will have to grant you permission to get the information the first time. After that, this information should be available for all subsequent requests.

这篇关于名称和电子邮件实体的响应为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆