SangramMCP
Posts: 57
Joined: Wed Jul 26, 2017 7:41 pm

Context Switching Issue

Fri May 18, 2018 3:48 pm

I have two dialogs
1.
public class TestDialog:Dialog
{


internal static class Cons
{
public const string YesNo = "confirm-detail";
public const string ShareDetail = "share-detail";
}


[Expression("@cab {late} for users")]
[Expression("need to {wait} for @cab")]
[Expression("we were {waiting} for @cab")]
[Expression("we were {waited} for @cab")]
[Entity("CabLateIssue")]
[Intent(Name = "issue_intent")]
public void CabLateIssue(Context context, Result result)
{
context.Add(Cons.YesNo);
result.SendResponse("Would you like to share more details?");
}

[Expression("@cab is not {ontime} today")]
[Entity("TurnUp")]
public void CabRefuseForTurnUp(Context context, Result result)
{


context.Add(Cons.YesNo);
result.SendResponse("Would you like to share more details?");

}

[Expression("@negative-context")]
[Context(Cons.YesNo)]
[Intent(Name = "no_intent")]
public void IntentThree(Context context, Result result)
{
context.Remove(Cons.YesNo);
result.SendResponse("As you wish. We have logged your message.");
}

[Expression("@positive-context")]
[Context(Cons.YesNo)]
[Intent(Name = "yes_intent")]
public void IntentTwo(Context context, Result result)
{
context.Remove(Cons.YesNo);
context.Add(Cons.ShareDetail);
result.SendResponse("Please go ahead type your concern in detail.");
}

[Expression("@sys.text")]
[Context(Cons.ShareDetail)]
[Intent(Name = "share_intent")]
public void ShareDetail(Context context, Result result)
{
context.Remove(Cons.ShareDetail);
var detail = result.Entities.OfType("sys.text");//Returns normalized value without punctuation marks.
result.SendResponse($"Your response: {result.Request.Text}");//Use Request to fetch original user message.
}



}

2.

[Expression("@cab did {not} {wait} for me")]
[Expression("@cab is {not} ready to come to {pick up} point")]
[Expression("@cab is {not} ready to come to {pick-up} point")]
[Expression("@cab is {not} ready to come to {pickup} point")]
[Expression("@cab {refuse} to come to {pick up} point")]
[Expression("@cab {refuse} to come to {pick-up} point")]
[Expression("@cab {refuse} to come to {pick up} point")]
[Expression("@cab {refuses} to come to {pickup} point")]
[Expression("@cab {refuses} to come to {pick up} point")]
[Expression("@cab {refuses} to come to {pick-up} point")]
[Expression("@cab {refused} to come to {pick up} point")]
[Expression("@cab {refused} to come to {pick-up} point")]
[Expression("@cab {refused} to come to {pickup} point")]
[Expression("@cab {refusing} to come to {pick up} point")]
[Expression("@cab {refusing} to come to {pick-up} point")]
[Expression("@cab {refusing} to come to {pickup} point")]
[Expression("@cab {hesitate} to come to {pick up} point")]
[Expression("@cab {hesitate} to come to {pick-up} point")]
[Expression("@cab {hesitate} to come to {pickup} point")]
[Expression("@cab {hesitates} to come to {pick up} point")]
[Expression("@cab {hesitates} to come to {pick-up} point")]
[Expression("@cab {hesitates} to come to {pickup} point")]
[Expression("@cab {hesitating} to come to {pick up} point")]
[Expression("@cab {hesitating} to come to {pick-up} point")]
[Expression("@cab {hesitating} to come to {pickup} point")]

[Entity("hesitate")]
[Entity("pickup")]
public void CabRefusePickup(Context context, Result result)
{


var response = new Response
{
Text = "Hey! I am in transport dialog",
Format = ResponseFormat.Html
};

result.SendResponse(response);


}

And the output:
Hi IBNE MASSUD, how can I help you today?
cab is late for the user
Would you like to share more details?
yes
Please go ahead type your concern in detail.
cab did not come to pickup point
Hey! I am in transport dialog

As per normal behavior: the response should be: "Your response: cab did not come to pickup point"
But it is out from the context. How to resolve this issue.

User avatar
Sreejith
Help & Support
Posts: 20
Joined: Sat Apr 06, 2013 6:16 pm

Re: Context Switching Issue

Mon May 21, 2018 8:06 am

this is not a feature request (as you posted it in Features and Suggestions section)....I have posted solutions here
If your experiment needs statistics, you ought to have done a better experiment - Ernest Rutherford

Return to “Feature Request and Suggestions”

Who is online

Users browsing this forum: No registered users and 1 guest