google-cloud-dialogflow 0.2.3 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +2 -0
  3. data/AUTHENTICATION.md +199 -0
  4. data/README.md +2 -2
  5. data/lib/google/cloud/dialogflow.rb +21 -14
  6. data/lib/google/cloud/dialogflow/v2.rb +21 -14
  7. data/lib/google/cloud/dialogflow/v2/agent_pb.rb +1 -0
  8. data/lib/google/cloud/dialogflow/v2/agent_services_pb.rb +14 -14
  9. data/lib/google/cloud/dialogflow/v2/agents_client.rb +56 -36
  10. data/lib/google/cloud/dialogflow/v2/audio_config_pb.rb +51 -0
  11. data/lib/google/cloud/dialogflow/v2/context_pb.rb +1 -0
  12. data/lib/google/cloud/dialogflow/v2/context_services_pb.rb +7 -3
  13. data/lib/google/cloud/dialogflow/v2/contexts_client.rb +48 -26
  14. data/lib/google/cloud/dialogflow/v2/credentials.rb +3 -2
  15. data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/agent.rb +31 -26
  16. data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/audio_config.rb +120 -0
  17. data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/context.rb +8 -4
  18. data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/entity_type.rb +74 -56
  19. data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/intent.rb +78 -44
  20. data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/session.rb +111 -37
  21. data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/session_entity_type.rb +11 -5
  22. data/lib/google/cloud/dialogflow/v2/doc/google/longrunning/operations.rb +2 -44
  23. data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/any.rb +3 -2
  24. data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/empty.rb +1 -1
  25. data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/field_mask.rb +19 -27
  26. data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/struct.rb +1 -1
  27. data/lib/google/cloud/dialogflow/v2/doc/google/rpc/status.rb +18 -15
  28. data/lib/google/cloud/dialogflow/v2/doc/google/type/latlng.rb +1 -35
  29. data/lib/google/cloud/dialogflow/v2/entity_type_pb.rb +1 -0
  30. data/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb +12 -14
  31. data/lib/google/cloud/dialogflow/v2/entity_types_client.rb +104 -69
  32. data/lib/google/cloud/dialogflow/v2/intent_pb.rb +2 -0
  33. data/lib/google/cloud/dialogflow/v2/intent_services_pb.rb +6 -4
  34. data/lib/google/cloud/dialogflow/v2/intents_client.rb +73 -45
  35. data/lib/google/cloud/dialogflow/v2/session_entity_type_pb.rb +1 -0
  36. data/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb +7 -2
  37. data/lib/google/cloud/dialogflow/v2/session_entity_types_client.rb +28 -8
  38. data/lib/google/cloud/dialogflow/v2/session_pb.rb +23 -0
  39. data/lib/google/cloud/dialogflow/v2/session_services_pb.rb +2 -1
  40. data/lib/google/cloud/dialogflow/v2/sessions_client.rb +15 -3
  41. data/lib/google/cloud/dialogflow/v2/webhook_pb.rb +2 -1
  42. metadata +28 -6
@@ -1,4 +1,4 @@
1
- # Copyright 2018 Google LLC
1
+ # Copyright 2019 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -22,20 +22,23 @@ module Google
22
22
  # action is an extraction of a user command or sentence semantics.
23
23
  # @!attribute [rw] name
24
24
  # @return [String]
25
- # Required for all methods except `create` (`create` populates the name
26
- # automatically.
27
25
  # The unique identifier of this intent.
26
+ # Required for {Google::Cloud::Dialogflow::V2::Intents::UpdateIntent Intents::UpdateIntent} and {Google::Cloud::Dialogflow::V2::Intents::BatchUpdateIntents Intents::BatchUpdateIntents}
27
+ # methods.
28
28
  # Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
29
29
  # @!attribute [rw] display_name
30
30
  # @return [String]
31
31
  # Required. The name of this intent.
32
32
  # @!attribute [rw] webhook_state
33
33
  # @return [Google::Cloud::Dialogflow::V2::Intent::WebhookState]
34
- # Required. Indicates whether webhooks are enabled for the intent.
34
+ # Optional. Indicates whether webhooks are enabled for the intent.
35
35
  # @!attribute [rw] priority
36
36
  # @return [Integer]
37
37
  # Optional. The priority of this intent. Higher numbers represent higher
38
- # priorities. Zero or negative numbers mean that the intent is disabled.
38
+ # priorities. If this is zero or unspecified, we use the default
39
+ # priority 500000.
40
+ #
41
+ # Negative numbers mean that the intent is disabled.
39
42
  # @!attribute [rw] is_fallback
40
43
  # @return [true, false]
41
44
  # Optional. Indicates whether this is a fallback intent.
@@ -57,11 +60,12 @@ module Google
57
60
  # be present in the active user session for an event to trigger this intent.
58
61
  # @!attribute [rw] training_phrases
59
62
  # @return [Array<Google::Cloud::Dialogflow::V2::Intent::TrainingPhrase>]
60
- # Optional. The collection of examples/templates that the agent is
63
+ # Optional. The collection of examples that the agent is
61
64
  # trained on.
62
65
  # @!attribute [rw] action
63
66
  # @return [String]
64
67
  # Optional. The name of the action associated with the intent.
68
+ # Note: The action name must not contain whitespaces.
65
69
  # @!attribute [rw] output_contexts
66
70
  # @return [Array<Google::Cloud::Dialogflow::V2::Context>]
67
71
  # Optional. The collection of contexts that are activated when the intent
@@ -86,57 +90,78 @@ module Google
86
90
  # taken from among the messages assigned to the DEFAULT_PLATFORM.
87
91
  # @!attribute [rw] root_followup_intent_name
88
92
  # @return [String]
89
- # The unique identifier of the root intent in the chain of followup intents.
90
- # It identifies the correct followup intents chain for this intent.
93
+ # Read-only. The unique identifier of the root intent in the chain of
94
+ # followup intents. It identifies the correct followup intents chain for
95
+ # this intent. We populate this field only in the output.
96
+ #
91
97
  # Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
92
98
  # @!attribute [rw] parent_followup_intent_name
93
99
  # @return [String]
94
- # The unique identifier of the parent intent in the chain of followup
95
- # intents.
100
+ # Read-only after creation. The unique identifier of the parent intent in the
101
+ # chain of followup intents. You can set this field when creating an intent,
102
+ # for example with {CreateIntent} or {BatchUpdateIntents}, in order to
103
+ # make this intent a followup intent.
104
+ #
96
105
  # It identifies the parent followup intent.
97
106
  # Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
98
107
  # @!attribute [rw] followup_intent_info
99
108
  # @return [Array<Google::Cloud::Dialogflow::V2::Intent::FollowupIntentInfo>]
100
- # Optional. Collection of information about all followup intents that have
101
- # name of this intent as a root_name.
109
+ # Read-only. Information about all followup intents that have this intent as
110
+ # a direct or indirect parent. We populate this field only in the output.
102
111
  class Intent
103
- # Represents an example or template that the agent is trained on.
112
+ # Represents an example that the agent is trained on.
104
113
  # @!attribute [rw] name
105
114
  # @return [String]
106
- # Required. The unique identifier of this training phrase.
115
+ # Output only. The unique identifier of this training phrase.
107
116
  # @!attribute [rw] type
108
117
  # @return [Google::Cloud::Dialogflow::V2::Intent::TrainingPhrase::Type]
109
118
  # Required. The type of the training phrase.
110
119
  # @!attribute [rw] parts
111
120
  # @return [Array<Google::Cloud::Dialogflow::V2::Intent::TrainingPhrase::Part>]
112
- # Required. The collection of training phrase parts (can be annotated).
113
- # Fields: `entity_type`, `alias` and `user_defined` should be populated
114
- # only for the annotated parts of the training phrase.
121
+ # Required. The ordered list of training phrase parts.
122
+ # The parts are concatenated in order to form the training phrase.
123
+ #
124
+ # Note: The API does not automatically annotate training phrases like the
125
+ # Dialogflow Console does.
126
+ #
127
+ # Note: Do not forget to include whitespace at part boundaries,
128
+ # so the training phrase is well formatted when the parts are concatenated.
129
+ #
130
+ # If the training phrase does not need to be annotated with parameters,
131
+ # you just need a single part with only the {Google::Cloud::Dialogflow::V2::Intent::TrainingPhrase::Part#text Part#text} field set.
132
+ #
133
+ # If you want to annotate the training phrase, you must create multiple
134
+ # parts, where the fields of each part are populated in one of two ways:
135
+ #
136
+ # * `Part.text` is set to a part of the phrase that has no parameters.
137
+ # * `Part.text` is set to a part of the phrase that you want to annotate,
138
+ # and the `entity_type`, `alias`, and `user_defined` fields are all
139
+ # set.
115
140
  # @!attribute [rw] times_added_count
116
141
  # @return [Integer]
117
- # Optional. Indicates how many times this example or template was added to
142
+ # Optional. Indicates how many times this example was added to
118
143
  # the intent. Each time a developer adds an existing sample by editing an
119
144
  # intent or training, this counter is increased.
120
145
  class TrainingPhrase
121
146
  # Represents a part of a training phrase.
122
147
  # @!attribute [rw] text
123
148
  # @return [String]
124
- # Required. The text corresponding to the example or template,
125
- # if there are no annotations. For
126
- # annotated examples, it is the text for one of the example's parts.
149
+ # Required. The text for this part.
127
150
  # @!attribute [rw] entity_type
128
151
  # @return [String]
129
- # Optional. The entity type name prefixed with `@`. This field is
130
- # required for the annotated part of the text and applies only to
131
- # examples.
152
+ # Optional. The entity type name prefixed with `@`.
153
+ # This field is required for annotated parts of the training phrase.
132
154
  # @!attribute [rw] alias
133
155
  # @return [String]
134
156
  # Optional. The parameter name for the value extracted from the
135
157
  # annotated part of the example.
158
+ # This field is required for annotated parts of the training phrase.
136
159
  # @!attribute [rw] user_defined
137
160
  # @return [true, false]
138
- # Optional. Indicates whether the text was manually annotated by the
139
- # developer.
161
+ # Optional. Indicates whether the text was manually annotated.
162
+ # This field is set to true when the Dialogflow Console is used to
163
+ # manually annotate the part. When creating an annotated part with the
164
+ # API, you must set this to true.
140
165
  class Part; end
141
166
 
142
167
  # Represents different types of training phrases.
@@ -150,6 +175,10 @@ module Google
150
175
 
151
176
  # Templates are not annotated with entity types, but they can contain
152
177
  # @-prefixed entity type names as substrings.
178
+ # Template mode has been deprecated. Example mode is the only supported
179
+ # way to create new training phrases. If you have existing training
180
+ # phrases that you've created in template mode, those will continue to
181
+ # work.
153
182
  TEMPLATE = 2
154
183
  end
155
184
  end
@@ -520,7 +549,7 @@ module Google
520
549
  # Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
521
550
  # @!attribute [rw] parent_followup_intent_name
522
551
  # @return [String]
523
- # The unique identifier of the followup intent parent.
552
+ # The unique identifier of the followup intent's parent.
524
553
  # Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
525
554
  class FollowupIntentInfo; end
526
555
 
@@ -547,9 +576,10 @@ module Google
547
576
  # @return [String]
548
577
  # Optional. The language to list training phrases, parameters and rich
549
578
  # messages for. If not specified, the agent's default language is used.
550
- # [More than a dozen
551
- # languages](https://dialogflow.com/docs/reference/language) are supported.
552
- # Note: languages must be enabled in the agent before they can be used.
579
+ # [Many
580
+ # languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language)
581
+ # are supported. Note: languages must be enabled in the agent before they can
582
+ # be used.
553
583
  # @!attribute [rw] intent_view
554
584
  # @return [Google::Cloud::Dialogflow::V2::IntentView]
555
585
  # Optional. The resource view to apply to the returned intent.
@@ -582,9 +612,10 @@ module Google
582
612
  # @return [String]
583
613
  # Optional. The language to retrieve training phrases, parameters and rich
584
614
  # messages for. If not specified, the agent's default language is used.
585
- # [More than a dozen
586
- # languages](https://dialogflow.com/docs/reference/language) are supported.
587
- # Note: languages must be enabled in the agent, before they can be used.
615
+ # [Many
616
+ # languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language)
617
+ # are supported. Note: languages must be enabled in the agent before they can
618
+ # be used.
588
619
  # @!attribute [rw] intent_view
589
620
  # @return [Google::Cloud::Dialogflow::V2::IntentView]
590
621
  # Optional. The resource view to apply to the returned intent.
@@ -602,9 +633,10 @@ module Google
602
633
  # @return [String]
603
634
  # Optional. The language of training phrases, parameters and rich messages
604
635
  # defined in `intent`. If not specified, the agent's default language is
605
- # used. [More than a dozen
606
- # languages](https://dialogflow.com/docs/reference/language) are supported.
607
- # Note: languages must be enabled in the agent, before they can be used.
636
+ # used. [Many
637
+ # languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language)
638
+ # are supported. Note: languages must be enabled in the agent before they can
639
+ # be used.
608
640
  # @!attribute [rw] intent_view
609
641
  # @return [Google::Cloud::Dialogflow::V2::IntentView]
610
642
  # Optional. The resource view to apply to the returned intent.
@@ -614,14 +646,14 @@ module Google
614
646
  # @!attribute [rw] intent
615
647
  # @return [Google::Cloud::Dialogflow::V2::Intent]
616
648
  # Required. The intent to update.
617
- # Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
618
649
  # @!attribute [rw] language_code
619
650
  # @return [String]
620
651
  # Optional. The language of training phrases, parameters and rich messages
621
652
  # defined in `intent`. If not specified, the agent's default language is
622
- # used. [More than a dozen
623
- # languages](https://dialogflow.com/docs/reference/language) are supported.
624
- # Note: languages must be enabled in the agent, before they can be used.
653
+ # used. [Many
654
+ # languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language)
655
+ # are supported. Note: languages must be enabled in the agent before they can
656
+ # be used.
625
657
  # @!attribute [rw] update_mask
626
658
  # @return [Google::Protobuf::FieldMask]
627
659
  # Optional. The mask to control which fields get updated.
@@ -633,7 +665,8 @@ module Google
633
665
  # The request message for {Google::Cloud::Dialogflow::V2::Intents::DeleteIntent Intents::DeleteIntent}.
634
666
  # @!attribute [rw] name
635
667
  # @return [String]
636
- # Required. The name of the intent to delete.
668
+ # Required. The name of the intent to delete. If this intent has direct or
669
+ # indirect followup intents, we also delete them.
637
670
  # Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
638
671
  class DeleteIntentRequest; end
639
672
 
@@ -654,9 +687,10 @@ module Google
654
687
  # @return [String]
655
688
  # Optional. The language of training phrases, parameters and rich messages
656
689
  # defined in `intents`. If not specified, the agent's default language is
657
- # used. [More than a dozen
658
- # languages](https://dialogflow.com/docs/reference/language) are supported.
659
- # Note: languages must be enabled in the agent, before they can be used.
690
+ # used. [Many
691
+ # languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language)
692
+ # are supported. Note: languages must be enabled in the agent before they can
693
+ # be used.
660
694
  # @!attribute [rw] update_mask
661
695
  # @return [Google::Protobuf::FieldMask]
662
696
  # Optional. The mask to control which fields get updated.
@@ -1,4 +1,4 @@
1
- # Copyright 2018 Google LLC
1
+ # Copyright 2019 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -38,6 +38,11 @@ module Google
38
38
  # 2. a conversational query in the form of text, or
39
39
  #
40
40
  # 3. an event that specifies which intent to trigger.
41
+ # @!attribute [rw] output_audio_config
42
+ # @return [Google::Cloud::Dialogflow::V2::OutputAudioConfig]
43
+ # Optional. Instructs the speech synthesizer how to generate the output
44
+ # audio. If this field is not set and agent-level speech synthesizer is not
45
+ # configured, no output audio is generated.
41
46
  # @!attribute [rw] input_audio
42
47
  # @return [String]
43
48
  # Optional. The natural language speech audio to be processed. This field
@@ -52,11 +57,22 @@ module Google
52
57
  # locate a response in the training example set or for reporting issues.
53
58
  # @!attribute [rw] query_result
54
59
  # @return [Google::Cloud::Dialogflow::V2::QueryResult]
55
- # The results of the conversational query or event processing.
60
+ # The selected results of the conversational query or event processing.
61
+ # See `alternative_query_results` for additional potential results.
56
62
  # @!attribute [rw] webhook_status
57
63
  # @return [Google::Rpc::Status]
58
- # Specifies the status of the webhook request. `webhook_status`
59
- # is never populated in webhook requests.
64
+ # Specifies the status of the webhook request.
65
+ # @!attribute [rw] output_audio
66
+ # @return [String]
67
+ # The audio data bytes encoded as specified in the request.
68
+ # Note: The output audio is generated based on the values of default platform
69
+ # text responses found in the `query_result.fulfillment_messages` field. If
70
+ # multiple default text responses exist, they will be concatenated when
71
+ # generating audio. If no default platform text responses exist, the
72
+ # generated audio content will be empty.
73
+ # @!attribute [rw] output_audio_config
74
+ # @return [Google::Cloud::Dialogflow::V2::OutputAudioConfig]
75
+ # The config used by the speech synthesizer to generate the output audio.
60
76
  class DetectIntentResponse; end
61
77
 
62
78
  # Represents the parameters of the conversational query.
@@ -79,13 +95,17 @@ module Google
79
95
  # before the new ones are activated.
80
96
  # @!attribute [rw] session_entity_types
81
97
  # @return [Array<Google::Cloud::Dialogflow::V2::SessionEntityType>]
82
- # Optional. The collection of session entity types to replace or extend
83
- # developer entities with for this query only. The entity synonyms apply
84
- # to all languages.
98
+ # Optional. Additional session entity types to replace or extend developer
99
+ # entity types with. The entity synonyms apply to all languages and persist
100
+ # for the session of this query.
85
101
  # @!attribute [rw] payload
86
102
  # @return [Google::Protobuf::Struct]
87
103
  # Optional. This field can be used to pass custom data into the webhook
88
104
  # associated with the agent. Arbitrary JSON objects are supported.
105
+ # @!attribute [rw] sentiment_analysis_request_config
106
+ # @return [Google::Cloud::Dialogflow::V2::SentimentAnalysisRequestConfig]
107
+ # Optional. Configures the type of sentiment analysis to perform. If not
108
+ # provided, sentiment analysis is not performed.
89
109
  class QueryParameters; end
90
110
 
91
111
  # Represents the query input. It can contain either:
@@ -120,7 +140,8 @@ module Google
120
140
  # @!attribute [rw] language_code
121
141
  # @return [String]
122
142
  # The language that was triggered during intent detection.
123
- # See [Language Support](https://dialogflow.com/docs/reference/language)
143
+ # See [Language
144
+ # Support](https://cloud.google.com/dialogflow-enterprise/docs/reference/language)
124
145
  # for a list of the currently supported language codes.
125
146
  # @!attribute [rw] speech_recognition_confidence
126
147
  # @return [Float]
@@ -129,10 +150,10 @@ module Google
129
150
  # correct. The default of 0.0 is a sentinel value indicating that confidence
130
151
  # was not set.
131
152
  #
132
- # You should not rely on this field as it isn't guaranteed to be accurate, or
133
- # even set. In particular this field isn't set in Webhook calls and for
134
- # StreamingDetectIntent since the streaming endpoint has separate confidence
135
- # estimates per portion of the audio in StreamingRecognitionResult.
153
+ # This field is not guaranteed to be accurate or set. In particular this
154
+ # field isn't set for StreamingDetectIntent since the streaming endpoint has
155
+ # separate confidence estimates per portion of the audio in
156
+ # StreamingRecognitionResult.
136
157
  # @!attribute [rw] action
137
158
  # @return [String]
138
159
  # The action name from the matched intent.
@@ -149,6 +170,7 @@ module Google
149
170
  # @!attribute [rw] fulfillment_text
150
171
  # @return [String]
151
172
  # The text to be pronounced to the user or shown on the screen.
173
+ # Note: This is a legacy field, `fulfillment_messages` should be preferred.
152
174
  # @!attribute [rw] fulfillment_messages
153
175
  # @return [Array<Google::Cloud::Dialogflow::V2::Intent::Message>]
154
176
  # The collection of rich messages to present to the user.
@@ -175,10 +197,17 @@ module Google
175
197
  # @return [Float]
176
198
  # The intent detection confidence. Values range from 0.0
177
199
  # (completely uncertain) to 1.0 (completely certain).
200
+ # If there are `multiple knowledge_answers` messages, this value is set to
201
+ # the greatest `knowledgeAnswers.match_confidence` value in the list.
178
202
  # @!attribute [rw] diagnostic_info
179
203
  # @return [Google::Protobuf::Struct]
180
- # The free-form diagnostic info. For example, this field
181
- # could contain webhook call latency.
204
+ # The free-form diagnostic info. For example, this field could contain
205
+ # webhook call latency. The string keys of the Struct's fields map can change
206
+ # without notice.
207
+ # @!attribute [rw] sentiment_analysis_result
208
+ # @return [Google::Cloud::Dialogflow::V2::SentimentAnalysisResult]
209
+ # The sentiment analysis result, which depends on the
210
+ # `sentiment_analysis_request_config` specified in the request.
182
211
  class QueryResult; end
183
212
 
184
213
  # The top-level message sent by the client to the
@@ -197,7 +226,7 @@ module Google
197
226
  # Required. The name of the session the query is sent to.
198
227
  # Format of the session name:
199
228
  # `projects/<Project ID>/agent/sessions/<Session ID>`. It’s up to the API
200
- # caller to choose an appropriate <Session ID>. It can be a random number or
229
+ # caller to choose an appropriate `Session ID`. It can be a random number or
201
230
  # some type of user identifier (preferably hashed). The length of the session
202
231
  # ID must not exceed 36 characters.
203
232
  # @!attribute [rw] query_params
@@ -223,6 +252,11 @@ module Google
223
252
  # client should close the stream and start a new request with a new stream as
224
253
  # needed.
225
254
  # This setting is ignored when `query_input` is a piece of text or an event.
255
+ # @!attribute [rw] output_audio_config
256
+ # @return [Google::Cloud::Dialogflow::V2::OutputAudioConfig]
257
+ # Optional. Instructs the speech synthesizer how to generate the output
258
+ # audio. If this field is not set and agent-level speech synthesizer is not
259
+ # configured, no output audio is generated.
226
260
  # @!attribute [rw] input_audio
227
261
  # @return [String]
228
262
  # Optional. The input audio content to be recognized. Must be sent if
@@ -255,6 +289,14 @@ module Google
255
289
  # @!attribute [rw] webhook_status
256
290
  # @return [Google::Rpc::Status]
257
291
  # Specifies the status of the webhook request.
292
+ # @!attribute [rw] output_audio
293
+ # @return [String]
294
+ # The audio data bytes encoded as specified in the request.
295
+ # @!attribute [rw] output_audio_config
296
+ # @return [Google::Cloud::Dialogflow::V2::OutputAudioConfig]
297
+ # Instructs the speech synthesizer how to generate the output audio. This
298
+ # field is populated from the agent-level speech synthesizer configuration,
299
+ # if enabled.
258
300
  class StreamingDetectIntentResponse; end
259
301
 
260
302
  # Contains a speech recognition result corresponding to a portion of the audio
@@ -276,7 +318,7 @@ module Google
276
318
  #
277
319
  # 6. transcript: " that is"
278
320
  #
279
- # 7. recognition_event_type: `RECOGNITION_EVENT_END_OF_SINGLE_UTTERANCE`
321
+ # 7. message_type: `MESSAGE_TYPE_END_OF_SINGLE_UTTERANCE`
280
322
  #
281
323
  # 8. transcript: " that is the question"
282
324
  # is_final: true
@@ -289,21 +331,20 @@ module Google
289
331
  #
290
332
  # * for `MESSAGE_TYPE_TRANSCRIPT`: `transcript` and possibly `is_final`.
291
333
  #
292
- # * for `MESSAGE_TYPE_END_OF_SINGLE_UTTERANCE`: only `event_type`.
334
+ # * for `MESSAGE_TYPE_END_OF_SINGLE_UTTERANCE`: only `message_type`.
293
335
  # @!attribute [rw] message_type
294
336
  # @return [Google::Cloud::Dialogflow::V2::StreamingRecognitionResult::MessageType]
295
337
  # Type of the result message.
296
338
  # @!attribute [rw] transcript
297
339
  # @return [String]
298
340
  # Transcript text representing the words that the user spoke.
299
- # Populated if and only if `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
341
+ # Populated if and only if `message_type` = `MESSAGE_TYPE_TRANSCRIPT`.
300
342
  # @!attribute [rw] is_final
301
343
  # @return [true, false]
302
- # The default of 0.0 is a sentinel value indicating `confidence` was not set.
303
344
  # If `false`, the `StreamingRecognitionResult` represents an
304
345
  # interim result that may change. If `true`, the recognizer will not return
305
346
  # any further hypotheses about this piece of the audio. May only be populated
306
- # for `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
347
+ # for `message_type` = `MESSAGE_TYPE_TRANSCRIPT`.
307
348
  # @!attribute [rw] confidence
308
349
  # @return [Float]
309
350
  # The Speech confidence between 0.0 and 1.0 for the current portion of audio.
@@ -340,20 +381,24 @@ module Google
340
381
  # @!attribute [rw] sample_rate_hertz
341
382
  # @return [Integer]
342
383
  # Required. Sample rate (in Hertz) of the audio content sent in the query.
343
- # Refer to [Cloud Speech API documentation](https://cloud.google.com/speech/docs/basics) for more
344
- # details.
384
+ # Refer to
385
+ # [Cloud Speech API
386
+ # documentation](https://cloud.google.com/speech-to-text/docs/basics) for
387
+ # more details.
345
388
  # @!attribute [rw] language_code
346
389
  # @return [String]
347
390
  # Required. The language of the supplied audio. Dialogflow does not do
348
391
  # translations. See [Language
349
- # Support](https://dialogflow.com/docs/languages) for a list of the
350
- # currently supported language codes. Note that queries in the same session
351
- # do not necessarily need to specify the same language.
392
+ # Support](https://cloud.google.com/dialogflow-enterprise/docs/reference/language)
393
+ # for a list of the currently supported language codes. Note that queries in
394
+ # the same session do not necessarily need to specify the same language.
352
395
  # @!attribute [rw] phrase_hints
353
396
  # @return [Array<String>]
354
397
  # Optional. The collection of phrase hints which are used to boost accuracy
355
398
  # of speech recognition.
356
- # Refer to [Cloud Speech API documentation](https://cloud.google.com/speech/docs/basics#phrase-hints)
399
+ # Refer to
400
+ # [Cloud Speech API
401
+ # documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints)
357
402
  # for more details.
358
403
  class InputAudioConfig; end
359
404
 
@@ -361,20 +406,20 @@ module Google
361
406
  # @!attribute [rw] text
362
407
  # @return [String]
363
408
  # Required. The UTF-8 encoded natural language text to be processed.
364
- # Text length must not exceed 256 bytes.
409
+ # Text length must not exceed 256 characters.
365
410
  # @!attribute [rw] language_code
366
411
  # @return [String]
367
412
  # Required. The language of this conversational query. See [Language
368
- # Support](https://dialogflow.com/docs/languages) for a list of the
369
- # currently supported language codes. Note that queries in the same session
370
- # do not necessarily need to specify the same language.
413
+ # Support](https://cloud.google.com/dialogflow-enterprise/docs/reference/language)
414
+ # for a list of the currently supported language codes. Note that queries in
415
+ # the same session do not necessarily need to specify the same language.
371
416
  class TextInput; end
372
417
 
373
418
  # Events allow for matching intents by event name instead of the natural
374
- # language input. For instance, input `<event: { name: welcome_event”,
375
- # parameters: { name: Sam } }>` can trigger a personalized welcome response.
419
+ # language input. For instance, input `<event: { name: "welcome_event",
420
+ # parameters: { name: "Sam" } }>` can trigger a personalized welcome response.
376
421
  # The parameter `name` may be used by the agent in the response:
377
- # `“Hello #welcome_event.name! What can I do for you today?”`.
422
+ # `"Hello #welcome_event.name! What can I do for you today?"`.
378
423
  # @!attribute [rw] name
379
424
  # @return [String]
380
425
  # Required. The unique identifier of the event.
@@ -384,13 +429,42 @@ module Google
384
429
  # @!attribute [rw] language_code
385
430
  # @return [String]
386
431
  # Required. The language of this query. See [Language
387
- # Support](https://dialogflow.com/docs/languages) for a list of the
388
- # currently supported language codes. Note that queries in the same session
389
- # do not necessarily need to specify the same language.
432
+ # Support](https://cloud.google.com/dialogflow-enterprise/docs/reference/language)
433
+ # for a list of the currently supported language codes. Note that queries in
434
+ # the same session do not necessarily need to specify the same language.
390
435
  class EventInput; end
391
436
 
437
+ # Configures the types of sentiment analysis to perform.
438
+ # @!attribute [rw] analyze_query_text_sentiment
439
+ # @return [true, false]
440
+ # Optional. Instructs the service to perform sentiment analysis on
441
+ # `query_text`. If not provided, sentiment analysis is not performed on
442
+ # `query_text`.
443
+ class SentimentAnalysisRequestConfig; end
444
+
445
+ # The result of sentiment analysis as configured by
446
+ # `sentiment_analysis_request_config`.
447
+ # @!attribute [rw] query_text_sentiment
448
+ # @return [Google::Cloud::Dialogflow::V2::Sentiment]
449
+ # The sentiment analysis result for `query_text`.
450
+ class SentimentAnalysisResult; end
451
+
452
+ # The sentiment, such as positive/negative feeling or association, for a unit
453
+ # of analysis, such as the query text.
454
+ # @!attribute [rw] score
455
+ # @return [Float]
456
+ # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive
457
+ # sentiment).
458
+ # @!attribute [rw] magnitude
459
+ # @return [Float]
460
+ # A non-negative number in the [0, +inf) range, which represents the absolute
461
+ # magnitude of sentiment, regardless of score (positive or negative).
462
+ class Sentiment; end
463
+
392
464
  # Audio encoding of the audio content sent in the conversational query request.
393
- # Refer to the [Cloud Speech API documentation](https://cloud.google.com/speech/docs/basics) for more
465
+ # Refer to the
466
+ # [Cloud Speech API
467
+ # documentation](https://cloud.google.com/speech-to-text/docs/basics) for more
394
468
  # details.
395
469
  module AudioEncoding
396
470
  # Not specified.