拒绝Google帐户关联后,在重新调用意图期间出现问题 [英] Getting Issue during re-calling the intent after rejecting Google Account linking

本文介绍了拒绝Google帐户关联后,在重新调用意图期间出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是我的聊天机器人结构
意图1(结果):在这里用户将要求结果.它将进行帐户链接,并在其服务器上检查是否通过API注册了电子邮件ID,并显示结果.

app.intent('result', (conv,{date})=>{ 
var userDate =  date;     
var apiUserEmailID=  conv.data.apiUserEmailID;   
var apiUserKey= conv.data.apiUserKey;    
console.log("apiUserKey : "+apiUserKey); 
if (typeof (apiUserKey) == "undefined" || apiUserKey == "" || apiUserKey == null) 
{
 conv.ask(new SignIn('To get your account details'));// Intent that starts the account linking flow.  
}
else
{   
 conv.ask("Welcome to quote generator"+userDate+" Session : "+apiUserKey); 
**//Flow should come here when ask for the next time after Google account linking**
}  
}); 

app.intent('user_Login', (conv, params, signin) => {// Create a Dialogflow intent with the `actions_intent_SIGN_IN` event.  
if (signin.status === 'OK') 
{ 
const payload = conv.user.profile.payload;    
conv.data.apiUserEmailID=payload.email; //Session Creation    
var url = apiPathAJ+'/CheckAccess?uid=payload.email';  
var login_response="",login_Userkey="";    
return getaxiosURL(url).then(response => {  
response.data.map(loginObj=>{    
if(loginObj.Status=="TRUE")
{login_response = "1";
login_Userkey=loginObj.UserKey;}
else     
{login_response = "0";  
login_Userkey="0";}    
}); 
if(login_response=="1")
  {
   conv.data.apiUserKey=login_Userkey;   
   conv.ask("You are a registered User with Our Service. Here is your result *******");
  }
  else 
  { 
    conv.ask("You are not a registered User. Would you like to proceed with the Service registration.");
  }
}).catch (error => {
login_response="2";
console.log("Something is wrong in login_response("+login_response+") !! " + error);   
});

}
else 
  {
    conv.ask(`I won't be able to save your data, but what do you want to do next?`);
  }  
});

下面是对话示例.
用户:我想查看我在2019年6月25日的搜索结果.
ChatBot:.....(它将要求帐户关联)
用户:是
ChatBot:您是我们服务的注册用户.
使用者:我想查看2019年6月25日的结果.

另一个对话示例.
用户:我想查看我在2019年6月25日的搜索结果.
ChatBot:.....(它将要求帐户关联)
用户:否
ChatBot:我将无法保存您的数据,但是接下来您想做什么?
使用者:我想查看2019年6月25日的结果.

在两个对话中,如果用户会问相同的问题(用户的最后评论),或者我们可以说它符合意图(结果),则我将收到此异常,并且对话已存在.

错误:找不到用于意图的Dialogflow IntentHandler:Function处的user_Login-result. (/srv/node_modules/actions-on-google/dist/service/dialogflow/dialogflow.js:141:31)在Generator.next()在(/srv/node_modules/actions-on-google/dist/service/在process._tickDomainCallback(internal/process/next_tick.js:229:7)上的dialogflow/dialogflow.js:19:58)

解决方案

错误消息表明"result-dailyPrediction"意图是在Dialogflow中已匹配的意图,但没有在app.intent('result-dailyPrediction')中注册的处理程序./p>

您应该注册这样一个Intent处理程序,或者弄清楚为什么要使用该Intent并进行更正(如果它不应该存在).

Below is my chatbot structure
Intent 1 (result): Here User will ask for a result. It will do the account linking and check the email id registration on their server whether it is registered or not via API and showing the result.

app.intent('result', (conv,{date})=>{ 
var userDate =  date;     
var apiUserEmailID=  conv.data.apiUserEmailID;   
var apiUserKey= conv.data.apiUserKey;    
console.log("apiUserKey : "+apiUserKey); 
if (typeof (apiUserKey) == "undefined" || apiUserKey == "" || apiUserKey == null) 
{
 conv.ask(new SignIn('To get your account details'));// Intent that starts the account linking flow.  
}
else
{   
 conv.ask("Welcome to quote generator"+userDate+" Session : "+apiUserKey); 
**//Flow should come here when ask for the next time after Google account linking**
}  
}); 

app.intent('user_Login', (conv, params, signin) => {// Create a Dialogflow intent with the `actions_intent_SIGN_IN` event.  
if (signin.status === 'OK') 
{ 
const payload = conv.user.profile.payload;    
conv.data.apiUserEmailID=payload.email; //Session Creation    
var url = apiPathAJ+'/CheckAccess?uid=payload.email';  
var login_response="",login_Userkey="";    
return getaxiosURL(url).then(response => {  
response.data.map(loginObj=>{    
if(loginObj.Status=="TRUE")
{login_response = "1";
login_Userkey=loginObj.UserKey;}
else     
{login_response = "0";  
login_Userkey="0";}    
}); 
if(login_response=="1")
  {
   conv.data.apiUserKey=login_Userkey;   
   conv.ask("You are a registered User with Our Service. Here is your result *******");
  }
  else 
  { 
    conv.ask("You are not a registered User. Would you like to proceed with the Service registration.");
  }
}).catch (error => {
login_response="2";
console.log("Something is wrong in login_response("+login_response+") !! " + error);   
});

}
else 
  {
    conv.ask(`I won't be able to save your data, but what do you want to do next?`);
  }  
});

Below is the conversation example.
User: I want to see my result for 25th June 2019.
ChatBot:.....(It will ask for the account linking)
User: Yes
ChatBot:You are a registered User with Our Service.
User: I want to see my result for 25th June 2019.

Another conversation example.
User: I want to see my result for 25th June 2019.
ChatBot:.....(It will ask for the account linking)
User: No
ChatBot:I won't be able to save your data, but what do you want to do next?
User: I want to see my result for 25th June 2019.

In both the conversation, If user will ask the same question(user's last comment) or we can say it hits the intent (result), i am getting this exception and the conversation is existing.

Error: Dialogflow IntentHandler not found for intent: user_Login-result at Function. (/srv/node_modules/actions-on-google/dist/service/dialogflow/dialogflow.js:141:31) at Generator.next () at fulfilled (/srv/node_modules/actions-on-google/dist/service/dialogflow/dialogflow.js:19:58) at at process._tickDomainCallback (internal/process/next_tick.js:229:7)

解决方案

The error message suggests that the "result-dailyPrediction" Intent is the one that has matched in Dialogflow, but there is no handler registered with app.intent('result-dailyPrediction').

You should either register such an intent handler, or figure out why you're getting to that Intent and correct it (if it shouldn't be there).

这篇关于拒绝Google帐户关联后,在重新调用意图期间出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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