I'm using dialogflow-fulfillment to implement the backend of my service based on dialogflow. There's a point where I use the method agent.setFollowupEvent(targetIntent)
, the targetIntent
requires a context to be matchable, let's call it targetContext
.
I can't tell exactly when it stopped working (a week? month maybe?), but it worked and right now it's not working (and I don't think I've changed anything that could explain it). The targetIntent
fulfillment never get called and I can see in the dialogflow console that it's because the request triggered by setFollowupEvent
doesn't match any intent.
If I remove the requirement of the targetContext
from the targetIntent
, it works.
I think I'm setting the context correctly:
agent.context.set(targetContext, null, null);
agent.setFollowupEvent(targetIntent);
Inspecting the body of the response that dialogflow-fulfillment is sending to dialogflow I see:
{
"outputContexts": [{ "name": "projects/<myprojectid>/agent/sessions/<mysessionid>/contexts/<targetContext>" }],
"followupEventInput": { "name": "<targetIntent>", "languageCode": "it" }
}
The context is there, and I think is correct. Any clues? The only thing I can think of is that we changed the agent type from free to enterprise.