我已经使用dialogflow建立了一个对谷歌助手的动作。我陷入了一种情况,即在对话之间会为用户提供网络链接。单击链接后,他将被定向到网页上载图像。上载图像后我想将他重定向到google action中的同一会话。是否有一种方法可以将用户重定向回相同的session。
您可以在store data across sessions对象中使用conv.user.storage
,只要验证了用户身份(系统可以识别他们或他们的声音),并且没有禁用数据存储。如果您使用的是node.js,它可能看起来像这样:
app.intent('Save Sum', (conv) => {
if (conv.user.verification === 'VERIFIED') {
conv.user.storage.sum = conv.data.sum;
conv.close(`Alright, I'll store that for next time. See you then.`);
} else {
conv.close(`I can't save that right now, but we can add ` +
`new numbers next time!`);
}
});
https://developers.google.com/assistant/identity在整个对话中检索用户信息,即使他正在打开链接,然后回来也可以回来,因为回头用户可以使该人继续您的对话流程。
谢谢