In my first Dialogflow project, there are certain points where I've got to send some response and move on to another intent (which also sends text) directly after that.
I tried using a webhook to send that message and make a FollowupEventInput with the code below.
final SessionName sessionName = SessionName.parse(webhookRequest.getSession());
final WebhookResponse.Builder builder = WebhookResponse.newBuilder()
.addFulfillmentMessages(
Intent.Message.newBuilder().setText(Intent.Message.Text.newBuilder()
.addText("This is the text I want to send.")
.build()))
.addOutputContexts(
Context.newBuilder().setName(ContextName.of(sessionName.getProject(), sessionName.getSession(), "Oilchange-haventchecked-followup").toString()
).setLifespanCount(1)
.build())
.setFollowupEventInput(EventInput.newBuilder().setName("StandstillQuestion").setLanguageCode("en"));
return builder.build();
}
The expected result would be:
bot: This is the text I want to send.
bot: This is the text from the next intent
The result I got:
bot: This is the text from the next intent
After that, I researched what the problem was and came upon this stackoverlow question where basically the same was asked (but in Python). There wasn't a suitable answer to the question. So I decided to ask it again.
How would I solve this?
I cannot simply add the text from the one intent to the other, because there's multiple intents that have to direct to that second one.