output.py
Go to the documentation of this file.
2  result = []
3  for context in contexts:
4  param_list = []
5  temp_str = '\n\t'
6  for parameter in context.parameters:
7  param_list.append("{}: {}".format(
8  parameter, context.parameters[parameter]))
9  temp_str += "Name: {}\n\tParameters:\n\t {}".format(
10  context.name.split('/')[-1], "\n\t".join(param_list))
11  result.append(temp_str)
12  result = "\n".join(result)
13  return result
14 
15 
16 def print_parameters(parameters):
17  param_list = []
18  temp_str = '\n\t'
19  for parameter in parameters:
20  param_list.append("{}: {}\n\t".format(
21  parameter, parameters[parameter]))
22  temp_str += "{}".format("\n\t".join(param_list))
23  return temp_str
24 
25 
26 def print_result(result):
27  output = "DF_CLIENT: Results:\n" \
28  "Query Text: {}\n" \
29  "Detected intent: {} (Confidence: {})\n" \
30  "Contexts: {}\n" \
31  "Fulfillment text: {}\n" \
32  "Action: {}\n" \
33  "Parameters: {}".format(
34  result.query_text,
35  result.intent.display_name,
36  result.intent_detection_confidence,
37  print_context_parameters(result.output_contexts),
38  result.fulfillment_text,
39  result.action,
40  print_parameters(result.parameters))
41  return output
def print_result(result)
Definition: output.py:26
def print_parameters(parameters)
Definition: output.py:16
def print_context_parameters(contexts)
Definition: output.py:1


dialogflow_ros
Author(s): Anas Abou Allaban
autogenerated on Mon Jun 10 2019 13:02:59