What could cause a custom fallback intent to not be triggered? - dialogflow-es

I have made a custom fallback intent with an input context "Con-Ser-Klacht-channelKeuzeInput". But when I test my agent, the default fallback intent is triggered even though "Con-Ser-Klacht-channelKeuzeInput" is active.
I thought that more specific intents (i.e. more input contexts) have priority over less specific ones. So what could cause this behaviour?
I have already checked for typos, but the active context is identical to the input context of the custom fallback.
Here are the relevant intents:
2.2.16.02.05-X-Con-Ser-Klacht-Input
input contexts: Con-Ser-Klacht-channelKeuze, Con-Ser-Klacht-Input
output contexts: (3) Con-Ser-Klacht-channelKeuze, (3) Con-Ser-Klacht-channelKeuzeInput, (0) Con-Ser-Klacht-Input
2.2.16.02.04-X-Con-Ser-Klacht-Fallback
input contexts: Con-Ser-Klacht-channelKeuzeInput
output contexts: (3) Con-Ser-Klacht-channelKeuze, (3) Con-Ser-Klacht-channelKeuzeInput , (3) Con-Ser-Klacht-Input
Screenshot of DF Console

I figured it out. The default fallback also had an input context that was active (gl-consument). Since both fallbacks had just one input context, the custom one did not have priority over the default one.

Related

Ensure one thing, and then another one if first is false

I have an interface with a list of users and a possibility to add a new one. I want to assert that this user is new (i.e. its email is not already used). So I should check that we have no message pop-up.
checkMailIsNotUsed: () =>
Task.where('#actor checks mail present message is absent',
Ensure.that(UsersList.messageArea, not(isVisible()))),
However this message area could be visible but not with the error messsage I don't expect. So I am looking for, in case above ensure fails, a way to ensure that the text does not include 'already exists'.
Ensure.that(Text.of(UsersList.messageArea), includes('already exists'))),
However if the first 'ensure' is false, everything stops. There is no 'or' or equivalent at the Ensure level. I need to do the second Ensure if first one fails.
How could I do that ?
Thanks in advance.

FIXED -- Voice prompt for Measurement concept from Library capsule does not work for Bixby runtime version 6

I have a very simple action where it takes a single parameter of type measurement.Length. if user does not provide the value for this parameter i want to prompt user for missing value.
To do this i designed my action like below
action (AddDistance) {
description (adding exercise)
type(Search)
collect {
input (distance){
type (measurement.Length)
min (Required) max (One)
}
}
output (Result)
}
I have added a NL training [g:Result] add distance of (2 km)[v:measurement.Length] which learned perfectly and giving this utterance works fine.
Now if i give the utterance like "add distance" the Bixby does not prompt for the missing input value instead give error with description
TypeError: Cannot read property 'display' of undefined1000Cannot read property 'display' of undefinedTypeError: Cannot read property 'display' of undefined at
What should i do show prompt for this concept measurement.Lenght from Library capsule.
N.b. voice prompt works on runtime version 5 with no issue.
This is an important change, for runtime-version above 5, in order to use default dialog (which is true in many library capsules), developer needs to include the following override in capsule.bxb.
runtime-version (6) {
overrides {
no-fallback-dialog-in-views (false)
}
}
The original bug cause the JS error has been fixed, but override is required to render library dialog.
Library capsules already got input-view and voice training handled. From your last capsule, change distance to Required in action model, and add following training missing distance.
The input-view would be triggered, and let's use voice-input
It runs fine to result-view, and confirmed on debugger
BTW, to replace the default "I need ..." message, add a dialog model as this
dialog (Elicitation) {
match: measurement.Length
template("How far would you like to run")
}

Return to the last active context on an questionnaire Bot on Dialogflow

I built a questionnaire bot on DialogFlow and I force a sequence using contexts. My output is the next intent and the input to set the current context.
The thing is that as it has several Yes and No questions I had to set lifespan as 1 to many of them. So the bot won't get confused. The side effect of this is when it goes to the fallback intent for any reason, no matter how many tries it gives, it won't understand what the user says as there is no active contexts anymore.
I'm already using fulfillment to set some conditional flows based in specific answers and to record and read data in Firebase.
Is there a way to retrieve the last active context so I can force the last context until having a valid input?
This bot will be running in Google Assistant interface.
tks!
There is no such thing as "last active context", since multiple Contexts may be active at once.
It sounds like, rather than having Contexts with a lifespan of 1, you want your Contexts to have a longer lifespan (in case they trigger an Intent that doesn't answer the question) so they can return to the path you want to ask them about.
To address the issue of multiple Intents that accept "yes" or "no", but are only valid in a particular Context, you can make a context inactive by setting its lifespan to 0 as part of an Outgoing Context or in the fulfillment for the Yes/No Intent that handles that Context.
As Prisoner mentioned there is not "Last active context" feature within action on google, but if you work with 1 lifespan context there is a trick that you can use to see which contexts were from the previous intents.
If you work with context lifespans of 1, you can look into your context collection and look for any context which has a lifespan of undefined. These are output contexts set by your previous intent. In the below example I cycle through my contexts, take their name by looking for a common identiefier "_" and use the name to reset the expired context back to 1 using their previous parameters.
const contextIdentifier = "_"
const contextLifeSpan = 1;
Object.values(conv.contexts.input).filter(c => !c.lifespan).forEach((context) => {
const start = context.name.lastIndexOf(contextIdentifier);
const end = context.name.length;
const contextName = context.name.slice(start, end);
conv.contexts.set(contextName, contextLifeSpan, context.parameters);
});
return conv;

Clear session or session variables on Bixby

Is there a way to specify that a session should be ended, or to clear out the memory of previous actions? In my testing (simulator only) I'm seeing a couple cases where Bixby is remembering a previous entry that isn't relevant anymore.
Example utterances
remove wet diaper
wet diaper
In this case there's 2 possible enums that can be said. "actionType" that is optional, in this case "remove" and "statType", in this case "wet diaper".
What is happening is on the second phrase it's caching the actionType. So, the second phrase my JavaScript still receives the "remove" even though it's not included.
I haven't tried this on an actual device (only the simulator) so it's possible this is just a simulation quirk.
This is kind of related to this question. There was a follow-up comment that the OP asked related to session management.
How does Bixby retain data from a previous NL input?
So, if you read that link. Is there a way I can signal to bixby that the conversation is over, or at least to not remember previous entries for the action?
One way would be to use the transient feature. Here is more information
For example, alter your input type so it doesn't carry over across executions.
name (ActionType) {
features {
transient
}
}
make sure all input types are NL friendly. name/enum concepts are meant for NL and you can attach vocabulary to them.
I used to have a similar issue like yours, in my case, my problem was related to the type of the 'requires' property inside the input-group declared in my action.model.bxb.
You need to handle by separate this two input cases in diferent action.model.bxb files:
In one of them you might have something like (model 1):
input-group(removeWeaper){
requires (OneOrMoreOf)
collect{
input (ActionType) {
type (Type)
min (Optional)
}
input (StatType) {
type (Type)
min (Optional)
}
}
Here, Bixby Will know that at least one of these properties will be apear in your input and will be waiting for an input with that structure.
In the other file you might have (model 2):
input-group(Weaper){
requires (OneOf)
collect{
input (StatType) {
type (Type)
min (Optional)
}
}
Here, Bixby will be waiting to catch an input that contains only one of the indicated values in you input.
(model 1) This could be ok only if you run 'wet diaper' by first time, also when you try again and run 'remove wet diaper' it might work, the problem is when you run again 'wet diaper' because Bixby Stores you previous approach including "remove". i'm not sure if there is something to clear the stored values, but, here is when (model 2) will help you to catch only the input 'wet diaper' as a different statement.
I share you this work around as my own experience, and i hope this could help you solving or getting another perspective of how you could handle or solve your problem.

Spring Integration:Is there a way to aggregate from "all" messages in a channel?

I want to write a batch which reads website access log files(csv file)from a path every day and do some analysis using spring integration.
this is the simplified version of the input csv file.
srcIp1,t1,path1
srcIp2,t2,path2
srcIp1,t3,path2
srcIp1,t4,path1
The access number per source ip and path is to be calculated after some filtering logic.
I made a input channel whose payload is the parsed log line,and a filter is applied,and finally an aggregator to calculate the final result.
The problem is what should be the right group release stragety,the default release stragety(SequenceSizeReleaseStrategy) does not work.
Also any of other spring integraion out of box release
strategies(ExpressionEvaluatingReleaseStrategy,
MessageCountReleaseStrategy, MethodInvokingReleaseStrategy,
SequenceSizeReleaseStrategy, TimeoutCountSequenceSizeReleaseStrategy)
does not seem to fit my needs.
Or Spring integration assumed that a channel carries a message stream where there is no concept of "ending of message" and is not suitalbe for my problem here ?
You can write a custom ReleaseStrategy if you have some way to tell when the group is complete. It is consulted each time a message is added to the group.
Or, you can use a group-timeout to release a partial group after some time when no messages arrived.

Resources