Skip to content

Commit

Permalink
samples: updated legacy field in detect intent samples (#575)
Browse files Browse the repository at this point in the history
  • Loading branch information
b-loved-dreamer authored and Shabirmean committed Nov 15, 2022
1 parent f600a8c commit acfccd6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ public static Map<String, QueryResult> detectIntentWithLocation(
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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ public static Map<String, QueryResult> detectIntentSentimentAnalysis(
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");
System.out.format(
"Sentiment Score: '%s'\n",
queryResult.getSentimentAnalysisResult().getQueryTextSentiment().getScore());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ public static Map<String, QueryResult> detectIntentWithTexttoSpeech(
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);
}
Expand Down

0 comments on commit acfccd6

Please sign in to comment.