From ac3e452a01dce538bbe63f9c694081bf16e47439 Mon Sep 17 00:00:00 2001 From: Franklin Nunez <69214580+b-loved-dreamer@users.noreply.github.com> Date: Tue, 25 May 2021 15:02:51 -0700 Subject: [PATCH] samples: updated legacy field in detectintenttexts (#572) --- .../main/java/com/example/dialogflow/DetectIntentTexts.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dialogflow/snippets/src/main/java/com/example/dialogflow/DetectIntentTexts.java b/dialogflow/snippets/src/main/java/com/example/dialogflow/DetectIntentTexts.java index 89d21562313..0eb5b415bdb 100644 --- a/dialogflow/snippets/src/main/java/com/example/dialogflow/DetectIntentTexts.java +++ b/dialogflow/snippets/src/main/java/com/example/dialogflow/DetectIntentTexts.java @@ -63,7 +63,11 @@ public static Map detectIntentTexts( System.out.format( "Detected Intent: %s (confidence: %f)\n", queryResult.getIntent().getDisplayName(), queryResult.getIntentDetectionConfidence()); - System.out.format("Fulfillment Text: '%s'\n", queryResult.getFulfillmentText()); + System.out.format( + "Fulfillment Text: '%s'\n", + queryResult.getFulfillmentMessagesCount() > 0 + ? queryResult.getFulfillmentMessages(0).getText() + : "Triggered Default Fallback Intent"); queryResults.put(text, queryResult); }