google-cloud-dialogflow-v2 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +201 -0
  5. data/README.md +24 -0
  6. data/lib/google-cloud-dialogflow-v2.rb +1 -0
  7. data/lib/google/cloud/common_resources_pb.rb +15 -0
  8. data/lib/google/cloud/dialogflow/v2.rb +24 -0
  9. data/lib/google/cloud/dialogflow/v2/agent_pb.rb +122 -0
  10. data/lib/google/cloud/dialogflow/v2/agent_services_pb.rb +110 -0
  11. data/lib/google/cloud/dialogflow/v2/agents.rb +21 -0
  12. data/lib/google/cloud/dialogflow/v2/agents/client.rb +1047 -0
  13. data/lib/google/cloud/dialogflow/v2/agents/credentials.rb +53 -0
  14. data/lib/google/cloud/dialogflow/v2/agents/operations.rb +559 -0
  15. data/lib/google/cloud/dialogflow/v2/agents/paths.rb +59 -0
  16. data/lib/google/cloud/dialogflow/v2/audio_config_pb.rb +97 -0
  17. data/lib/google/cloud/dialogflow/v2/context_pb.rb +64 -0
  18. data/lib/google/cloud/dialogflow/v2/context_services_pb.rb +74 -0
  19. data/lib/google/cloud/dialogflow/v2/contexts.rb +20 -0
  20. data/lib/google/cloud/dialogflow/v2/contexts/client.rb +756 -0
  21. data/lib/google/cloud/dialogflow/v2/contexts/credentials.rb +53 -0
  22. data/lib/google/cloud/dialogflow/v2/contexts/paths.rb +50 -0
  23. data/lib/google/cloud/dialogflow/v2/entity_type_pb.rb +126 -0
  24. data/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb +104 -0
  25. data/lib/google/cloud/dialogflow/v2/entity_types.rb +21 -0
  26. data/lib/google/cloud/dialogflow/v2/entity_types/client.rb +1150 -0
  27. data/lib/google/cloud/dialogflow/v2/entity_types/credentials.rb +53 -0
  28. data/lib/google/cloud/dialogflow/v2/entity_types/operations.rb +559 -0
  29. data/lib/google/cloud/dialogflow/v2/entity_types/paths.rb +62 -0
  30. data/lib/google/cloud/dialogflow/v2/intent_pb.rb +368 -0
  31. data/lib/google/cloud/dialogflow/v2/intent_services_pb.rb +92 -0
  32. data/lib/google/cloud/dialogflow/v2/intents.rb +21 -0
  33. data/lib/google/cloud/dialogflow/v2/intents/client.rb +893 -0
  34. data/lib/google/cloud/dialogflow/v2/intents/credentials.rb +53 -0
  35. data/lib/google/cloud/dialogflow/v2/intents/operations.rb +559 -0
  36. data/lib/google/cloud/dialogflow/v2/intents/paths.rb +81 -0
  37. data/lib/google/cloud/dialogflow/v2/session_entity_type_pb.rb +66 -0
  38. data/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb +92 -0
  39. data/lib/google/cloud/dialogflow/v2/session_entity_types.rb +20 -0
  40. data/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb +727 -0
  41. data/lib/google/cloud/dialogflow/v2/session_entity_types/credentials.rb +53 -0
  42. data/lib/google/cloud/dialogflow/v2/session_entity_types/paths.rb +69 -0
  43. data/lib/google/cloud/dialogflow/v2/session_pb.rb +142 -0
  44. data/lib/google/cloud/dialogflow/v2/session_services_pb.rb +55 -0
  45. data/lib/google/cloud/dialogflow/v2/sessions.rb +20 -0
  46. data/lib/google/cloud/dialogflow/v2/sessions/client.rb +472 -0
  47. data/lib/google/cloud/dialogflow/v2/sessions/credentials.rb +53 -0
  48. data/lib/google/cloud/dialogflow/v2/sessions/paths.rb +110 -0
  49. data/lib/google/cloud/dialogflow/v2/validation_result_pb.rb +37 -0
  50. data/lib/google/cloud/dialogflow/v2/version.rb +28 -0
  51. data/lib/google/cloud/dialogflow/v2/webhook_pb.rb +47 -0
  52. data/proto_docs/README.md +4 -0
  53. data/proto_docs/google/api/field_behavior.rb +59 -0
  54. data/proto_docs/google/api/resource.rb +247 -0
  55. data/proto_docs/google/cloud/dialogflow/v2/agent.rb +287 -0
  56. data/proto_docs/google/cloud/dialogflow/v2/audio_config.rb +363 -0
  57. data/proto_docs/google/cloud/dialogflow/v2/context.rb +144 -0
  58. data/proto_docs/google/cloud/dialogflow/v2/entity_type.rb +354 -0
  59. data/proto_docs/google/cloud/dialogflow/v2/intent.rb +1070 -0
  60. data/proto_docs/google/cloud/dialogflow/v2/session.rb +541 -0
  61. data/proto_docs/google/cloud/dialogflow/v2/session_entity_type.rb +155 -0
  62. data/proto_docs/google/cloud/dialogflow/v2/validation_result.rb +81 -0
  63. data/proto_docs/google/cloud/dialogflow/v2/webhook.rb +153 -0
  64. data/proto_docs/google/longrunning/operations.rb +150 -0
  65. data/proto_docs/google/protobuf/any.rb +137 -0
  66. data/proto_docs/google/protobuf/duration.rb +98 -0
  67. data/proto_docs/google/protobuf/empty.rb +36 -0
  68. data/proto_docs/google/protobuf/field_mask.rb +237 -0
  69. data/proto_docs/google/protobuf/struct.rb +96 -0
  70. data/proto_docs/google/rpc/status.rb +46 -0
  71. data/proto_docs/google/type/latlng.rb +38 -0
  72. metadata +225 -0
@@ -0,0 +1,287 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Dialogflow
23
+ module V2
24
+ # Represents a conversational agent.
25
+ # @!attribute [rw] parent
26
+ # @return [String]
27
+ # Required. The project of this agent.
28
+ # Format: `projects/<Project ID>`.
29
+ # @!attribute [rw] display_name
30
+ # @return [String]
31
+ # Required. The name of this agent.
32
+ # @!attribute [rw] default_language_code
33
+ # @return [String]
34
+ # Required. The default language of the agent as a language tag. See
35
+ # [Language
36
+ # Support](https://cloud.google.com/dialogflow/docs/reference/language)
37
+ # for a list of the currently supported language codes. This field cannot be
38
+ # set by the `Update` method.
39
+ # @!attribute [rw] supported_language_codes
40
+ # @return [Array<String>]
41
+ # Optional. The list of all languages supported by this agent (except for the
42
+ # `default_language_code`).
43
+ # @!attribute [rw] time_zone
44
+ # @return [String]
45
+ # Required. The time zone of this agent from the
46
+ # [time zone database](https://www.iana.org/time-zones), e.g.,
47
+ # America/New_York, Europe/Paris.
48
+ # @!attribute [rw] description
49
+ # @return [String]
50
+ # Optional. The description of this agent.
51
+ # The maximum length is 500 characters. If exceeded, the request is rejected.
52
+ # @!attribute [rw] avatar_uri
53
+ # @return [String]
54
+ # Optional. The URI of the agent's avatar.
55
+ # Avatars are used throughout the Dialogflow console and in the self-hosted
56
+ # [Web
57
+ # Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo)
58
+ # integration.
59
+ # @!attribute [rw] enable_logging
60
+ # @return [Boolean]
61
+ # Optional. Determines whether this agent should log conversation queries.
62
+ # @!attribute [rw] match_mode
63
+ # @return [Google::Cloud::Dialogflow::V2::Agent::MatchMode]
64
+ # Optional. Determines how intents are detected from user queries.
65
+ # @!attribute [rw] classification_threshold
66
+ # @return [Float]
67
+ # Optional. To filter out false positive results and still get variety in
68
+ # matched natural language inputs for your agent, you can tune the machine
69
+ # learning classification threshold. If the returned score value is less than
70
+ # the threshold value, then a fallback intent will be triggered or, if there
71
+ # are no fallback intents defined, no intent will be triggered. The score
72
+ # values range from 0.0 (completely uncertain) to 1.0 (completely certain).
73
+ # If set to 0.0, the default of 0.3 is used.
74
+ # @!attribute [rw] api_version
75
+ # @return [Google::Cloud::Dialogflow::V2::Agent::ApiVersion]
76
+ # Optional. API version displayed in Dialogflow console. If not specified,
77
+ # V2 API is assumed. Clients are free to query different service endpoints
78
+ # for different API versions. However, bots connectors and webhook calls will
79
+ # follow the specified API version.
80
+ # @!attribute [rw] tier
81
+ # @return [Google::Cloud::Dialogflow::V2::Agent::Tier]
82
+ # Optional. The agent tier. If not specified, TIER_STANDARD is assumed.
83
+ class Agent
84
+ include Google::Protobuf::MessageExts
85
+ extend Google::Protobuf::MessageExts::ClassMethods
86
+
87
+ # Match mode determines how intents are detected from user queries.
88
+ module MatchMode
89
+ # Not specified.
90
+ MATCH_MODE_UNSPECIFIED = 0
91
+
92
+ # Best for agents with a small number of examples in intents and/or wide
93
+ # use of templates syntax and composite entities.
94
+ MATCH_MODE_HYBRID = 1
95
+
96
+ # Can be used for agents with a large number of examples in intents,
97
+ # especially the ones using @sys.any or very large custom entities.
98
+ MATCH_MODE_ML_ONLY = 2
99
+ end
100
+
101
+ # API version for the agent.
102
+ module ApiVersion
103
+ # Not specified.
104
+ API_VERSION_UNSPECIFIED = 0
105
+
106
+ # Legacy V1 API.
107
+ API_VERSION_V1 = 1
108
+
109
+ # V2 API.
110
+ API_VERSION_V2 = 2
111
+
112
+ # V2beta1 API.
113
+ API_VERSION_V2_BETA_1 = 3
114
+ end
115
+
116
+ # Represents the agent tier.
117
+ module Tier
118
+ # Not specified. This value should never be used.
119
+ TIER_UNSPECIFIED = 0
120
+
121
+ # Standard tier.
122
+ TIER_STANDARD = 1
123
+
124
+ # Enterprise tier (Essentials).
125
+ TIER_ENTERPRISE = 2
126
+
127
+ # Enterprise tier (Plus).
128
+ TIER_ENTERPRISE_PLUS = 3
129
+ end
130
+ end
131
+
132
+ # The request message for {Google::Cloud::Dialogflow::V2::Agents::Client#get_agent Agents.GetAgent}.
133
+ # @!attribute [rw] parent
134
+ # @return [String]
135
+ # Required. The project that the agent to fetch is associated with.
136
+ # Format: `projects/<Project ID>`.
137
+ class GetAgentRequest
138
+ include Google::Protobuf::MessageExts
139
+ extend Google::Protobuf::MessageExts::ClassMethods
140
+ end
141
+
142
+ # The request message for {Google::Cloud::Dialogflow::V2::Agents::Client#set_agent Agents.SetAgent}.
143
+ # @!attribute [rw] agent
144
+ # @return [Google::Cloud::Dialogflow::V2::Agent]
145
+ # Required. The agent to update.
146
+ # @!attribute [rw] update_mask
147
+ # @return [Google::Protobuf::FieldMask]
148
+ # Optional. The mask to control which fields get updated.
149
+ class SetAgentRequest
150
+ include Google::Protobuf::MessageExts
151
+ extend Google::Protobuf::MessageExts::ClassMethods
152
+ end
153
+
154
+ # The request message for {Google::Cloud::Dialogflow::V2::Agents::Client#delete_agent Agents.DeleteAgent}.
155
+ # @!attribute [rw] parent
156
+ # @return [String]
157
+ # Required. The project that the agent to delete is associated with.
158
+ # Format: `projects/<Project ID>`.
159
+ class DeleteAgentRequest
160
+ include Google::Protobuf::MessageExts
161
+ extend Google::Protobuf::MessageExts::ClassMethods
162
+ end
163
+
164
+ # The request message for {Google::Cloud::Dialogflow::V2::Agents::Client#search_agents Agents.SearchAgents}.
165
+ # @!attribute [rw] parent
166
+ # @return [String]
167
+ # Required. The project to list agents from.
168
+ # Format: `projects/<Project ID or '-'>`.
169
+ # @!attribute [rw] page_size
170
+ # @return [Integer]
171
+ # Optional. The maximum number of items to return in a single page. By
172
+ # default 100 and at most 1000.
173
+ # @!attribute [rw] page_token
174
+ # @return [String]
175
+ # The next_page_token value returned from a previous list request.
176
+ class SearchAgentsRequest
177
+ include Google::Protobuf::MessageExts
178
+ extend Google::Protobuf::MessageExts::ClassMethods
179
+ end
180
+
181
+ # The response message for {Google::Cloud::Dialogflow::V2::Agents::Client#search_agents Agents.SearchAgents}.
182
+ # @!attribute [rw] agents
183
+ # @return [Array<Google::Cloud::Dialogflow::V2::Agent>]
184
+ # The list of agents. There will be a maximum number of items returned based
185
+ # on the page_size field in the request.
186
+ # @!attribute [rw] next_page_token
187
+ # @return [String]
188
+ # Token to retrieve the next page of results, or empty if there are no
189
+ # more results in the list.
190
+ class SearchAgentsResponse
191
+ include Google::Protobuf::MessageExts
192
+ extend Google::Protobuf::MessageExts::ClassMethods
193
+ end
194
+
195
+ # The request message for {Google::Cloud::Dialogflow::V2::Agents::Client#train_agent Agents.TrainAgent}.
196
+ # @!attribute [rw] parent
197
+ # @return [String]
198
+ # Required. The project that the agent to train is associated with.
199
+ # Format: `projects/<Project ID>`.
200
+ class TrainAgentRequest
201
+ include Google::Protobuf::MessageExts
202
+ extend Google::Protobuf::MessageExts::ClassMethods
203
+ end
204
+
205
+ # The request message for {Google::Cloud::Dialogflow::V2::Agents::Client#export_agent Agents.ExportAgent}.
206
+ # @!attribute [rw] parent
207
+ # @return [String]
208
+ # Required. The project that the agent to export is associated with.
209
+ # Format: `projects/<Project ID>`.
210
+ # @!attribute [rw] agent_uri
211
+ # @return [String]
212
+ # Required. The [Google Cloud Storage](https://cloud.google.com/storage/docs/)
213
+ # URI to export the agent to.
214
+ # The format of this URI must be `gs://<bucket-name>/<object-name>`.
215
+ # If left unspecified, the serialized agent is returned inline.
216
+ class ExportAgentRequest
217
+ include Google::Protobuf::MessageExts
218
+ extend Google::Protobuf::MessageExts::ClassMethods
219
+ end
220
+
221
+ # The response message for {Google::Cloud::Dialogflow::V2::Agents::Client#export_agent Agents.ExportAgent}.
222
+ # @!attribute [rw] agent_uri
223
+ # @return [String]
224
+ # The URI to a file containing the exported agent. This field is populated
225
+ # only if `agent_uri` is specified in `ExportAgentRequest`.
226
+ # @!attribute [rw] agent_content
227
+ # @return [String]
228
+ # Zip compressed raw byte content for agent.
229
+ class ExportAgentResponse
230
+ include Google::Protobuf::MessageExts
231
+ extend Google::Protobuf::MessageExts::ClassMethods
232
+ end
233
+
234
+ # The request message for {Google::Cloud::Dialogflow::V2::Agents::Client#import_agent Agents.ImportAgent}.
235
+ # @!attribute [rw] parent
236
+ # @return [String]
237
+ # Required. The project that the agent to import is associated with.
238
+ # Format: `projects/<Project ID>`.
239
+ # @!attribute [rw] agent_uri
240
+ # @return [String]
241
+ # The URI to a Google Cloud Storage file containing the agent to import.
242
+ # Note: The URI must start with "gs://".
243
+ # @!attribute [rw] agent_content
244
+ # @return [String]
245
+ # Zip compressed raw byte content for agent.
246
+ class ImportAgentRequest
247
+ include Google::Protobuf::MessageExts
248
+ extend Google::Protobuf::MessageExts::ClassMethods
249
+ end
250
+
251
+ # The request message for {Google::Cloud::Dialogflow::V2::Agents::Client#restore_agent Agents.RestoreAgent}.
252
+ # @!attribute [rw] parent
253
+ # @return [String]
254
+ # Required. The project that the agent to restore is associated with.
255
+ # Format: `projects/<Project ID>`.
256
+ # @!attribute [rw] agent_uri
257
+ # @return [String]
258
+ # The URI to a Google Cloud Storage file containing the agent to restore.
259
+ # Note: The URI must start with "gs://".
260
+ # @!attribute [rw] agent_content
261
+ # @return [String]
262
+ # Zip compressed raw byte content for agent.
263
+ class RestoreAgentRequest
264
+ include Google::Protobuf::MessageExts
265
+ extend Google::Protobuf::MessageExts::ClassMethods
266
+ end
267
+
268
+ # The request message for {Google::Cloud::Dialogflow::V2::Agents::Client#get_validation_result Agents.GetValidationResult}.
269
+ # @!attribute [rw] parent
270
+ # @return [String]
271
+ # Required. The project that the agent is associated with.
272
+ # Format: `projects/<Project ID>`.
273
+ # @!attribute [rw] language_code
274
+ # @return [String]
275
+ # Optional. The language for which you want a validation result. If not
276
+ # specified, the agent's default language is used. [Many
277
+ # languages](https://cloud.google.com/dialogflow/docs/reference/language)
278
+ # are supported. Note: languages must be enabled in the agent before they can
279
+ # be used.
280
+ class GetValidationResultRequest
281
+ include Google::Protobuf::MessageExts
282
+ extend Google::Protobuf::MessageExts::ClassMethods
283
+ end
284
+ end
285
+ end
286
+ end
287
+ end
@@ -0,0 +1,363 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Dialogflow
23
+ module V2
24
+ # Hints for the speech recognizer to help with recognition in a specific
25
+ # conversation state.
26
+ # @!attribute [rw] phrases
27
+ # @return [Array<String>]
28
+ # Optional. A list of strings containing words and phrases that the speech
29
+ # recognizer should recognize with higher likelihood.
30
+ #
31
+ # This list can be used to:
32
+ # * improve accuracy for words and phrases you expect the user to say,
33
+ # e.g. typical commands for your Dialogflow agent
34
+ # * add additional words to the speech recognizer vocabulary
35
+ # * ...
36
+ #
37
+ # See the [Cloud Speech
38
+ # documentation](https://cloud.google.com/speech-to-text/quotas) for usage
39
+ # limits.
40
+ # @!attribute [rw] boost
41
+ # @return [Float]
42
+ # Optional. Boost for this context compared to other contexts:
43
+ # * If the boost is positive, Dialogflow will increase the probability that
44
+ # the phrases in this context are recognized over similar sounding phrases.
45
+ # * If the boost is unspecified or non-positive, Dialogflow will not apply
46
+ # any boost.
47
+ #
48
+ # Dialogflow recommends that you use boosts in the range (0, 20] and that you
49
+ # find a value that fits your use case with binary search.
50
+ class SpeechContext
51
+ include Google::Protobuf::MessageExts
52
+ extend Google::Protobuf::MessageExts::ClassMethods
53
+ end
54
+
55
+ # Information for a word recognized by the speech recognizer.
56
+ # @!attribute [rw] word
57
+ # @return [String]
58
+ # The word this info is for.
59
+ # @!attribute [rw] start_offset
60
+ # @return [Google::Protobuf::Duration]
61
+ # Time offset relative to the beginning of the audio that corresponds to the
62
+ # start of the spoken word. This is an experimental feature and the accuracy
63
+ # of the time offset can vary.
64
+ # @!attribute [rw] end_offset
65
+ # @return [Google::Protobuf::Duration]
66
+ # Time offset relative to the beginning of the audio that corresponds to the
67
+ # end of the spoken word. This is an experimental feature and the accuracy of
68
+ # the time offset can vary.
69
+ # @!attribute [rw] confidence
70
+ # @return [Float]
71
+ # The Speech confidence between 0.0 and 1.0 for this word. A higher number
72
+ # indicates an estimated greater likelihood that the recognized word is
73
+ # correct. The default of 0.0 is a sentinel value indicating that confidence
74
+ # was not set.
75
+ #
76
+ # This field is not guaranteed to be fully stable over time for the same
77
+ # audio input. Users should also not rely on it to always be provided.
78
+ class SpeechWordInfo
79
+ include Google::Protobuf::MessageExts
80
+ extend Google::Protobuf::MessageExts::ClassMethods
81
+ end
82
+
83
+ # Instructs the speech recognizer how to process the audio content.
84
+ # @!attribute [rw] audio_encoding
85
+ # @return [Google::Cloud::Dialogflow::V2::AudioEncoding]
86
+ # Required. Audio encoding of the audio content to process.
87
+ # @!attribute [rw] sample_rate_hertz
88
+ # @return [Integer]
89
+ # Required. Sample rate (in Hertz) of the audio content sent in the query.
90
+ # Refer to
91
+ # [Cloud Speech API
92
+ # documentation](https://cloud.google.com/speech-to-text/docs/basics) for
93
+ # more details.
94
+ # @!attribute [rw] language_code
95
+ # @return [String]
96
+ # Required. The language of the supplied audio. Dialogflow does not do
97
+ # translations. See [Language
98
+ # Support](https://cloud.google.com/dialogflow/docs/reference/language)
99
+ # for a list of the currently supported language codes. Note that queries in
100
+ # the same session do not necessarily need to specify the same language.
101
+ # @!attribute [rw] enable_word_info
102
+ # @return [Boolean]
103
+ # Optional. If `true`, Dialogflow returns {Google::Cloud::Dialogflow::V2::SpeechWordInfo SpeechWordInfo} in
104
+ # {Google::Cloud::Dialogflow::V2::StreamingRecognitionResult StreamingRecognitionResult} with information about the recognized speech
105
+ # words, e.g. start and end time offsets. If false or unspecified, Speech
106
+ # doesn't return any word-level information.
107
+ # @!attribute [rw] phrase_hints
108
+ # @return [Array<String>]
109
+ # Optional. A list of strings containing words and phrases that the speech
110
+ # recognizer should recognize with higher likelihood.
111
+ #
112
+ # See [the Cloud Speech
113
+ # documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints)
114
+ # for more details.
115
+ #
116
+ # This field is deprecated. Please use [speech_contexts]() instead. If you
117
+ # specify both [phrase_hints]() and [speech_contexts](), Dialogflow will
118
+ # treat the [phrase_hints]() as a single additional [SpeechContext]().
119
+ # @!attribute [rw] speech_contexts
120
+ # @return [Array<Google::Cloud::Dialogflow::V2::SpeechContext>]
121
+ # Optional. Context information to assist speech recognition.
122
+ #
123
+ # See [the Cloud Speech
124
+ # documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints)
125
+ # for more details.
126
+ # @!attribute [rw] model
127
+ # @return [String]
128
+ # Optional. Which Speech model to select for the given request. Select the
129
+ # model best suited to your domain to get best results. If a model is not
130
+ # explicitly specified, then we auto-select a model based on the parameters
131
+ # in the InputAudioConfig.
132
+ # If enhanced speech model is enabled for the agent and an enhanced
133
+ # version of the specified model for the language does not exist, then the
134
+ # speech is recognized using the standard version of the specified model.
135
+ # Refer to
136
+ # [Cloud Speech API
137
+ # documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model)
138
+ # for more details.
139
+ # @!attribute [rw] model_variant
140
+ # @return [Google::Cloud::Dialogflow::V2::SpeechModelVariant]
141
+ # Optional. Which variant of the [Speech model][google.cloud.dialogflow.v2.InputAudioConfig.model] to use.
142
+ # @!attribute [rw] single_utterance
143
+ # @return [Boolean]
144
+ # Optional. If `false` (default), recognition does not cease until the
145
+ # client closes the stream.
146
+ # If `true`, the recognizer will detect a single spoken utterance in input
147
+ # audio. Recognition ceases when it detects the audio's voice has
148
+ # stopped or paused. In this case, once a detected intent is received, the
149
+ # client should close the stream and start a new request with a new stream as
150
+ # needed.
151
+ # Note: This setting is relevant only for streaming methods.
152
+ # Note: When specified, InputAudioConfig.single_utterance takes precedence
153
+ # over StreamingDetectIntentRequest.single_utterance.
154
+ class InputAudioConfig
155
+ include Google::Protobuf::MessageExts
156
+ extend Google::Protobuf::MessageExts::ClassMethods
157
+ end
158
+
159
+ # Description of which voice to use for speech synthesis.
160
+ # @!attribute [rw] name
161
+ # @return [String]
162
+ # Optional. The name of the voice. If not set, the service will choose a
163
+ # voice based on the other parameters such as language_code and
164
+ # {Google::Cloud::Dialogflow::V2::VoiceSelectionParams#ssml_gender ssml_gender}.
165
+ # @!attribute [rw] ssml_gender
166
+ # @return [Google::Cloud::Dialogflow::V2::SsmlVoiceGender]
167
+ # Optional. The preferred gender of the voice. If not set, the service will
168
+ # choose a voice based on the other parameters such as language_code and
169
+ # {Google::Cloud::Dialogflow::V2::VoiceSelectionParams#name name}. Note that this is only a preference, not requirement. If a
170
+ # voice of the appropriate gender is not available, the synthesizer should
171
+ # substitute a voice with a different gender rather than failing the request.
172
+ class VoiceSelectionParams
173
+ include Google::Protobuf::MessageExts
174
+ extend Google::Protobuf::MessageExts::ClassMethods
175
+ end
176
+
177
+ # Configuration of how speech should be synthesized.
178
+ # @!attribute [rw] speaking_rate
179
+ # @return [Float]
180
+ # Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal
181
+ # native speed supported by the specific voice. 2.0 is twice as fast, and
182
+ # 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any
183
+ # other values < 0.25 or > 4.0 will return an error.
184
+ # @!attribute [rw] pitch
185
+ # @return [Float]
186
+ # Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20
187
+ # semitones from the original pitch. -20 means decrease 20 semitones from the
188
+ # original pitch.
189
+ # @!attribute [rw] volume_gain_db
190
+ # @return [Float]
191
+ # Optional. Volume gain (in dB) of the normal native volume supported by the
192
+ # specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of
193
+ # 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB)
194
+ # will play at approximately half the amplitude of the normal native signal
195
+ # amplitude. A value of +6.0 (dB) will play at approximately twice the
196
+ # amplitude of the normal native signal amplitude. We strongly recommend not
197
+ # to exceed +10 (dB) as there's usually no effective increase in loudness for
198
+ # any value greater than that.
199
+ # @!attribute [rw] effects_profile_id
200
+ # @return [Array<String>]
201
+ # Optional. An identifier which selects 'audio effects' profiles that are
202
+ # applied on (post synthesized) text to speech. Effects are applied on top of
203
+ # each other in the order they are given.
204
+ # @!attribute [rw] voice
205
+ # @return [Google::Cloud::Dialogflow::V2::VoiceSelectionParams]
206
+ # Optional. The desired voice of the synthesized audio.
207
+ class SynthesizeSpeechConfig
208
+ include Google::Protobuf::MessageExts
209
+ extend Google::Protobuf::MessageExts::ClassMethods
210
+ end
211
+
212
+ # Instructs the speech synthesizer on how to generate the output audio content.
213
+ # If this audio config is supplied in a request, it overrides all existing
214
+ # text-to-speech settings applied to the agent.
215
+ # @!attribute [rw] audio_encoding
216
+ # @return [Google::Cloud::Dialogflow::V2::OutputAudioEncoding]
217
+ # Required. Audio encoding of the synthesized audio content.
218
+ # @!attribute [rw] sample_rate_hertz
219
+ # @return [Integer]
220
+ # The synthesis sample rate (in hertz) for this audio. If not
221
+ # provided, then the synthesizer will use the default sample rate based on
222
+ # the audio encoding. If this is different from the voice's natural sample
223
+ # rate, then the synthesizer will honor this request by converting to the
224
+ # desired sample rate (which might result in worse audio quality).
225
+ # @!attribute [rw] synthesize_speech_config
226
+ # @return [Google::Cloud::Dialogflow::V2::SynthesizeSpeechConfig]
227
+ # Configuration of how speech should be synthesized.
228
+ class OutputAudioConfig
229
+ include Google::Protobuf::MessageExts
230
+ extend Google::Protobuf::MessageExts::ClassMethods
231
+ end
232
+
233
+ # Audio encoding of the audio content sent in the conversational query request.
234
+ # Refer to the
235
+ # [Cloud Speech API
236
+ # documentation](https://cloud.google.com/speech-to-text/docs/basics) for more
237
+ # details.
238
+ module AudioEncoding
239
+ # Not specified.
240
+ AUDIO_ENCODING_UNSPECIFIED = 0
241
+
242
+ # Uncompressed 16-bit signed little-endian samples (Linear PCM).
243
+ AUDIO_ENCODING_LINEAR_16 = 1
244
+
245
+ # [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio
246
+ # Codec) is the recommended encoding because it is lossless (therefore
247
+ # recognition is not compromised) and requires only about half the
248
+ # bandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit and
249
+ # 24-bit samples, however, not all fields in `STREAMINFO` are supported.
250
+ AUDIO_ENCODING_FLAC = 2
251
+
252
+ # 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
253
+ AUDIO_ENCODING_MULAW = 3
254
+
255
+ # Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.
256
+ AUDIO_ENCODING_AMR = 4
257
+
258
+ # Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.
259
+ AUDIO_ENCODING_AMR_WB = 5
260
+
261
+ # Opus encoded audio frames in Ogg container
262
+ # ([OggOpus](https://wiki.xiph.org/OggOpus)).
263
+ # `sample_rate_hertz` must be 16000.
264
+ AUDIO_ENCODING_OGG_OPUS = 6
265
+
266
+ # Although the use of lossy encodings is not recommended, if a very low
267
+ # bitrate encoding is required, `OGG_OPUS` is highly preferred over
268
+ # Speex encoding. The [Speex](https://speex.org/) encoding supported by
269
+ # Dialogflow API has a header byte in each block, as in MIME type
270
+ # `audio/x-speex-with-header-byte`.
271
+ # It is a variant of the RTP Speex encoding defined in
272
+ # [RFC 5574](https://tools.ietf.org/html/rfc5574).
273
+ # The stream is a sequence of blocks, one block per RTP packet. Each block
274
+ # starts with a byte containing the length of the block, in bytes, followed
275
+ # by one or more frames of Speex data, padded to an integral number of
276
+ # bytes (octets) as specified in RFC 5574. In other words, each RTP header
277
+ # is replaced with a single byte containing the block length. Only Speex
278
+ # wideband is supported. `sample_rate_hertz` must be 16000.
279
+ AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7
280
+ end
281
+
282
+ # Variant of the specified [Speech model][google.cloud.dialogflow.v2.InputAudioConfig.model] to use.
283
+ #
284
+ # See the [Cloud Speech
285
+ # documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models)
286
+ # for which models have different variants. For example, the "phone_call" model
287
+ # has both a standard and an enhanced variant. When you use an enhanced model,
288
+ # you will generally receive higher quality results than for a standard model.
289
+ module SpeechModelVariant
290
+ # No model variant specified. In this case Dialogflow defaults to
291
+ # USE_BEST_AVAILABLE.
292
+ SPEECH_MODEL_VARIANT_UNSPECIFIED = 0
293
+
294
+ # Use the best available variant of the [Speech
295
+ # model][InputAudioConfig.model] that the caller is eligible for.
296
+ #
297
+ # Please see the [Dialogflow
298
+ # docs](https://cloud.google.com/dialogflow/docs/data-logging) for
299
+ # how to make your project eligible for enhanced models.
300
+ USE_BEST_AVAILABLE = 1
301
+
302
+ # Use standard model variant even if an enhanced model is available. See the
303
+ # [Cloud Speech
304
+ # documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models)
305
+ # for details about enhanced models.
306
+ USE_STANDARD = 2
307
+
308
+ # Use an enhanced model variant:
309
+ #
310
+ # * If an enhanced variant does not exist for the given
311
+ # {Google::Cloud::Dialogflow::V2::InputAudioConfig#model model} and request language, Dialogflow falls
312
+ # back to the standard variant.
313
+ #
314
+ # The [Cloud Speech
315
+ # documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models)
316
+ # describes which models have enhanced variants.
317
+ #
318
+ # * If the API caller isn't eligible for enhanced models, Dialogflow returns
319
+ # an error. Please see the [Dialogflow
320
+ # docs](https://cloud.google.com/dialogflow/docs/data-logging)
321
+ # for how to make your project eligible.
322
+ USE_ENHANCED = 3
323
+ end
324
+
325
+ # Gender of the voice as described in
326
+ # [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice).
327
+ module SsmlVoiceGender
328
+ # An unspecified gender, which means that the client doesn't care which
329
+ # gender the selected voice will have.
330
+ SSML_VOICE_GENDER_UNSPECIFIED = 0
331
+
332
+ # A male voice.
333
+ SSML_VOICE_GENDER_MALE = 1
334
+
335
+ # A female voice.
336
+ SSML_VOICE_GENDER_FEMALE = 2
337
+
338
+ # A gender-neutral voice.
339
+ SSML_VOICE_GENDER_NEUTRAL = 3
340
+ end
341
+
342
+ # Audio encoding of the output audio format in Text-To-Speech.
343
+ module OutputAudioEncoding
344
+ # Not specified.
345
+ OUTPUT_AUDIO_ENCODING_UNSPECIFIED = 0
346
+
347
+ # Uncompressed 16-bit signed little-endian samples (Linear PCM).
348
+ # Audio content returned as LINEAR16 also contains a WAV header.
349
+ OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1
350
+
351
+ # MP3 audio at 32kbps.
352
+ OUTPUT_AUDIO_ENCODING_MP3 = 2
353
+
354
+ # Opus encoded audio wrapped in an ogg container. The result will be a
355
+ # file which can be played natively on Android, and in browsers (at least
356
+ # Chrome and Firefox). The quality of the encoding is considerably higher
357
+ # than MP3 while using approximately the same bitrate.
358
+ OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3
359
+ end
360
+ end
361
+ end
362
+ end
363
+ end