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,541 @@
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
+ # ============================================================================
25
+ # Requests and responses for custom methods.
26
+ # The request to detect user's intent.
27
+ # @!attribute [rw] session
28
+ # @return [String]
29
+ # Required. The name of the session this query is sent to. Format:
30
+ # `projects/<Project ID>/agent/sessions/<Session ID>`. It's up to the API
31
+ # caller to choose an appropriate session ID. It can be a random number or
32
+ # some type of user identifier (preferably hashed). The length of the session
33
+ # ID must not exceed 36 bytes.
34
+ # @!attribute [rw] query_params
35
+ # @return [Google::Cloud::Dialogflow::V2::QueryParameters]
36
+ # The parameters of this query.
37
+ # @!attribute [rw] query_input
38
+ # @return [Google::Cloud::Dialogflow::V2::QueryInput]
39
+ # Required. The input specification. It can be set to:
40
+ #
41
+ # 1. an audio config
42
+ # which instructs the speech recognizer how to process the speech audio,
43
+ #
44
+ # 2. a conversational query in the form of text, or
45
+ #
46
+ # 3. an event that specifies which intent to trigger.
47
+ # @!attribute [rw] output_audio_config
48
+ # @return [Google::Cloud::Dialogflow::V2::OutputAudioConfig]
49
+ # Instructs the speech synthesizer how to generate the output
50
+ # audio. If this field is not set and agent-level speech synthesizer is not
51
+ # configured, no output audio is generated.
52
+ # @!attribute [rw] output_audio_config_mask
53
+ # @return [Google::Protobuf::FieldMask]
54
+ # Mask for {Google::Cloud::Dialogflow::V2::DetectIntentRequest#output_audio_config output_audio_config} indicating which settings in this
55
+ # request-level config should override speech synthesizer settings defined at
56
+ # agent-level.
57
+ #
58
+ # If unspecified or empty, {Google::Cloud::Dialogflow::V2::DetectIntentRequest#output_audio_config output_audio_config} replaces the agent-level
59
+ # config in its entirety.
60
+ # @!attribute [rw] input_audio
61
+ # @return [String]
62
+ # The natural language speech audio to be processed. This field
63
+ # should be populated iff `query_input` is set to an input audio config.
64
+ # A single request can contain up to 1 minute of speech audio data.
65
+ class DetectIntentRequest
66
+ include Google::Protobuf::MessageExts
67
+ extend Google::Protobuf::MessageExts::ClassMethods
68
+ end
69
+
70
+ # The message returned from the DetectIntent method.
71
+ # @!attribute [rw] response_id
72
+ # @return [String]
73
+ # The unique identifier of the response. It can be used to
74
+ # locate a response in the training example set or for reporting issues.
75
+ # @!attribute [rw] query_result
76
+ # @return [Google::Cloud::Dialogflow::V2::QueryResult]
77
+ # The selected results of the conversational query or event processing.
78
+ # See `alternative_query_results` for additional potential results.
79
+ # @!attribute [rw] webhook_status
80
+ # @return [Google::Rpc::Status]
81
+ # Specifies the status of the webhook request.
82
+ # @!attribute [rw] output_audio
83
+ # @return [String]
84
+ # The audio data bytes encoded as specified in the request.
85
+ # Note: The output audio is generated based on the values of default platform
86
+ # text responses found in the `query_result.fulfillment_messages` field. If
87
+ # multiple default text responses exist, they will be concatenated when
88
+ # generating audio. If no default platform text responses exist, the
89
+ # generated audio content will be empty.
90
+ # @!attribute [rw] output_audio_config
91
+ # @return [Google::Cloud::Dialogflow::V2::OutputAudioConfig]
92
+ # The config used by the speech synthesizer to generate the output audio.
93
+ class DetectIntentResponse
94
+ include Google::Protobuf::MessageExts
95
+ extend Google::Protobuf::MessageExts::ClassMethods
96
+ end
97
+
98
+ # Represents the parameters of the conversational query.
99
+ # @!attribute [rw] time_zone
100
+ # @return [String]
101
+ # The time zone of this conversational query from the
102
+ # [time zone database](https://www.iana.org/time-zones), e.g.,
103
+ # America/New_York, Europe/Paris. If not provided, the time zone specified in
104
+ # agent settings is used.
105
+ # @!attribute [rw] geo_location
106
+ # @return [Google::Type::LatLng]
107
+ # The geo location of this conversational query.
108
+ # @!attribute [rw] contexts
109
+ # @return [Array<Google::Cloud::Dialogflow::V2::Context>]
110
+ # The collection of contexts to be activated before this query is
111
+ # executed.
112
+ # @!attribute [rw] reset_contexts
113
+ # @return [Boolean]
114
+ # Specifies whether to delete all contexts in the current session
115
+ # before the new ones are activated.
116
+ # @!attribute [rw] session_entity_types
117
+ # @return [Array<Google::Cloud::Dialogflow::V2::SessionEntityType>]
118
+ # Additional session entity types to replace or extend developer
119
+ # entity types with. The entity synonyms apply to all languages and persist
120
+ # for the session of this query.
121
+ # @!attribute [rw] payload
122
+ # @return [Google::Protobuf::Struct]
123
+ # This field can be used to pass custom data into the webhook
124
+ # associated with the agent. Arbitrary JSON objects are supported.
125
+ # @!attribute [rw] sentiment_analysis_request_config
126
+ # @return [Google::Cloud::Dialogflow::V2::SentimentAnalysisRequestConfig]
127
+ # Configures the type of sentiment analysis to perform. If not
128
+ # provided, sentiment analysis is not performed.
129
+ class QueryParameters
130
+ include Google::Protobuf::MessageExts
131
+ extend Google::Protobuf::MessageExts::ClassMethods
132
+ end
133
+
134
+ # Represents the query input. It can contain either:
135
+ #
136
+ # 1. An audio config which
137
+ # instructs the speech recognizer how to process the speech audio.
138
+ #
139
+ # 2. A conversational query in the form of text,.
140
+ #
141
+ # 3. An event that specifies which intent to trigger.
142
+ # @!attribute [rw] audio_config
143
+ # @return [Google::Cloud::Dialogflow::V2::InputAudioConfig]
144
+ # Instructs the speech recognizer how to process the speech audio.
145
+ # @!attribute [rw] text
146
+ # @return [Google::Cloud::Dialogflow::V2::TextInput]
147
+ # The natural language text to be processed.
148
+ # @!attribute [rw] event
149
+ # @return [Google::Cloud::Dialogflow::V2::EventInput]
150
+ # The event to be processed.
151
+ class QueryInput
152
+ include Google::Protobuf::MessageExts
153
+ extend Google::Protobuf::MessageExts::ClassMethods
154
+ end
155
+
156
+ # Represents the result of conversational query or event processing.
157
+ # @!attribute [rw] query_text
158
+ # @return [String]
159
+ # The original conversational query text:
160
+ #
161
+ # - If natural language text was provided as input, `query_text` contains
162
+ # a copy of the input.
163
+ # - If natural language speech audio was provided as input, `query_text`
164
+ # contains the speech recognition result. If speech recognizer produced
165
+ # multiple alternatives, a particular one is picked.
166
+ # - If automatic spell correction is enabled, `query_text` will contain the
167
+ # corrected user input.
168
+ # @!attribute [rw] language_code
169
+ # @return [String]
170
+ # The language that was triggered during intent detection.
171
+ # See [Language
172
+ # Support](https://cloud.google.com/dialogflow/docs/reference/language)
173
+ # for a list of the currently supported language codes.
174
+ # @!attribute [rw] speech_recognition_confidence
175
+ # @return [Float]
176
+ # The Speech recognition confidence between 0.0 and 1.0. A higher number
177
+ # indicates an estimated greater likelihood that the recognized words are
178
+ # correct. The default of 0.0 is a sentinel value indicating that confidence
179
+ # was not set.
180
+ #
181
+ # This field is not guaranteed to be accurate or set. In particular this
182
+ # field isn't set for StreamingDetectIntent since the streaming endpoint has
183
+ # separate confidence estimates per portion of the audio in
184
+ # StreamingRecognitionResult.
185
+ # @!attribute [rw] action
186
+ # @return [String]
187
+ # The action name from the matched intent.
188
+ # @!attribute [rw] parameters
189
+ # @return [Google::Protobuf::Struct]
190
+ # The collection of extracted parameters.
191
+ # @!attribute [rw] all_required_params_present
192
+ # @return [Boolean]
193
+ # This field is set to:
194
+ #
195
+ # - `false` if the matched intent has required parameters and not all of
196
+ # the required parameter values have been collected.
197
+ # - `true` if all required parameter values have been collected, or if the
198
+ # matched intent doesn't contain any required parameters.
199
+ # @!attribute [rw] fulfillment_text
200
+ # @return [String]
201
+ # The text to be pronounced to the user or shown on the screen.
202
+ # Note: This is a legacy field, `fulfillment_messages` should be preferred.
203
+ # @!attribute [rw] fulfillment_messages
204
+ # @return [Array<Google::Cloud::Dialogflow::V2::Intent::Message>]
205
+ # The collection of rich messages to present to the user.
206
+ # @!attribute [rw] webhook_source
207
+ # @return [String]
208
+ # If the query was fulfilled by a webhook call, this field is set to the
209
+ # value of the `source` field returned in the webhook response.
210
+ # @!attribute [rw] webhook_payload
211
+ # @return [Google::Protobuf::Struct]
212
+ # If the query was fulfilled by a webhook call, this field is set to the
213
+ # value of the `payload` field returned in the webhook response.
214
+ # @!attribute [rw] output_contexts
215
+ # @return [Array<Google::Cloud::Dialogflow::V2::Context>]
216
+ # The collection of output contexts. If applicable,
217
+ # `output_contexts.parameters` contains entries with name
218
+ # `<parameter name>.original` containing the original parameter values
219
+ # before the query.
220
+ # @!attribute [rw] intent
221
+ # @return [Google::Cloud::Dialogflow::V2::Intent]
222
+ # The intent that matched the conversational query. Some, not
223
+ # all fields are filled in this message, including but not limited to:
224
+ # `name`, `display_name`, `end_interaction` and `is_fallback`.
225
+ # @!attribute [rw] intent_detection_confidence
226
+ # @return [Float]
227
+ # The intent detection confidence. Values range from 0.0
228
+ # (completely uncertain) to 1.0 (completely certain).
229
+ # This value is for informational purpose only and is only used to
230
+ # help match the best intent within the classification threshold.
231
+ # This value may change for the same end-user expression at any time due to a
232
+ # model retraining or change in implementation.
233
+ # If there are `multiple knowledge_answers` messages, this value is set to
234
+ # the greatest `knowledgeAnswers.match_confidence` value in the list.
235
+ # @!attribute [rw] diagnostic_info
236
+ # @return [Google::Protobuf::Struct]
237
+ # Free-form diagnostic information for the associated detect intent request.
238
+ # The fields of this data can change without notice, so you should not write
239
+ # code that depends on its structure.
240
+ # The data may contain:
241
+ #
242
+ # - webhook call latency
243
+ # - webhook errors
244
+ # @!attribute [rw] sentiment_analysis_result
245
+ # @return [Google::Cloud::Dialogflow::V2::SentimentAnalysisResult]
246
+ # The sentiment analysis result, which depends on the
247
+ # `sentiment_analysis_request_config` specified in the request.
248
+ class QueryResult
249
+ include Google::Protobuf::MessageExts
250
+ extend Google::Protobuf::MessageExts::ClassMethods
251
+ end
252
+
253
+ # The top-level message sent by the client to the
254
+ # {Google::Cloud::Dialogflow::V2::Sessions::Client#streaming_detect_intent Sessions.StreamingDetectIntent} method.
255
+ #
256
+ # Multiple request messages should be sent in order:
257
+ #
258
+ # 1. The first message must contain
259
+ # {Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#session session},
260
+ # {Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#query_input query_input} plus optionally
261
+ # {Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#query_params query_params}. If the client
262
+ # wants to receive an audio response, it should also contain
263
+ # {Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#output_audio_config output_audio_config}.
264
+ # The message must not contain
265
+ # {Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#input_audio input_audio}.
266
+ # 2. If {Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#query_input query_input} was set to
267
+ # {Google::Cloud::Dialogflow::V2::InputAudioConfig query_input.audio_config}, all subsequent
268
+ # messages must contain
269
+ # {Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#input_audio input_audio} to continue with
270
+ # Speech recognition.
271
+ # If you decide to rather detect an intent from text input after you
272
+ # already started Speech recognition, please send a message with
273
+ # {Google::Cloud::Dialogflow::V2::QueryInput#text query_input.text}.
274
+ #
275
+ # However, note that:
276
+ #
277
+ # * Dialogflow will bill you for the audio duration so far.
278
+ # * Dialogflow discards all Speech recognition results in favor of the
279
+ # input text.
280
+ # * Dialogflow will use the language code from the first message.
281
+ #
282
+ # After you sent all input, you must half-close or abort the request stream.
283
+ # @!attribute [rw] session
284
+ # @return [String]
285
+ # Required. The name of the session the query is sent to.
286
+ # Format of the session name:
287
+ # `projects/<Project ID>/agent/sessions/<Session ID>`. It's up to the API
288
+ # caller to choose an appropriate `Session ID`. It can be a random number or
289
+ # some type of user identifier (preferably hashed). The length of the session
290
+ # ID must not exceed 36 characters.
291
+ # @!attribute [rw] query_params
292
+ # @return [Google::Cloud::Dialogflow::V2::QueryParameters]
293
+ # The parameters of this query.
294
+ # @!attribute [rw] query_input
295
+ # @return [Google::Cloud::Dialogflow::V2::QueryInput]
296
+ # Required. The input specification. It can be set to:
297
+ #
298
+ # 1. an audio config which instructs the speech recognizer how to process
299
+ # the speech audio,
300
+ #
301
+ # 2. a conversational query in the form of text, or
302
+ #
303
+ # 3. an event that specifies which intent to trigger.
304
+ # @!attribute [rw] single_utterance
305
+ # @return [Boolean]
306
+ # Please use {Google::Cloud::Dialogflow::V2::InputAudioConfig#single_utterance InputAudioConfig.single_utterance} instead.
307
+ # If `false` (default), recognition does not cease until
308
+ # the client closes the stream. If `true`, the recognizer will detect a
309
+ # single spoken utterance in input audio. Recognition ceases when it detects
310
+ # the audio's voice has stopped or paused. In this case, once a detected
311
+ # intent is received, the client should close the stream and start a new
312
+ # request with a new stream as needed.
313
+ # This setting is ignored when `query_input` is a piece of text or an event.
314
+ # @!attribute [rw] output_audio_config
315
+ # @return [Google::Cloud::Dialogflow::V2::OutputAudioConfig]
316
+ # Instructs the speech synthesizer how to generate the output
317
+ # audio. If this field is not set and agent-level speech synthesizer is not
318
+ # configured, no output audio is generated.
319
+ # @!attribute [rw] output_audio_config_mask
320
+ # @return [Google::Protobuf::FieldMask]
321
+ # Mask for {Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#output_audio_config output_audio_config} indicating which settings in this
322
+ # request-level config should override speech synthesizer settings defined at
323
+ # agent-level.
324
+ #
325
+ # If unspecified or empty, {Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#output_audio_config output_audio_config} replaces the agent-level
326
+ # config in its entirety.
327
+ # @!attribute [rw] input_audio
328
+ # @return [String]
329
+ # The input audio content to be recognized. Must be sent if
330
+ # `query_input` was set to a streaming input audio config. The complete audio
331
+ # over all streaming messages must not exceed 1 minute.
332
+ class StreamingDetectIntentRequest
333
+ include Google::Protobuf::MessageExts
334
+ extend Google::Protobuf::MessageExts::ClassMethods
335
+ end
336
+
337
+ # The top-level message returned from the
338
+ # `StreamingDetectIntent` method.
339
+ #
340
+ # Multiple response messages can be returned in order:
341
+ #
342
+ # 1. If the input was set to streaming audio, the first one or more messages
343
+ # contain `recognition_result`. Each `recognition_result` represents a more
344
+ # complete transcript of what the user said. The last `recognition_result`
345
+ # has `is_final` set to `true`.
346
+ #
347
+ # 2. The next message contains `response_id`, `query_result`
348
+ # and optionally `webhook_status` if a WebHook was called.
349
+ # @!attribute [rw] response_id
350
+ # @return [String]
351
+ # The unique identifier of the response. It can be used to
352
+ # locate a response in the training example set or for reporting issues.
353
+ # @!attribute [rw] recognition_result
354
+ # @return [Google::Cloud::Dialogflow::V2::StreamingRecognitionResult]
355
+ # The result of speech recognition.
356
+ # @!attribute [rw] query_result
357
+ # @return [Google::Cloud::Dialogflow::V2::QueryResult]
358
+ # The result of the conversational query or event processing.
359
+ # @!attribute [rw] webhook_status
360
+ # @return [Google::Rpc::Status]
361
+ # Specifies the status of the webhook request.
362
+ # @!attribute [rw] output_audio
363
+ # @return [String]
364
+ # The audio data bytes encoded as specified in the request.
365
+ # Note: The output audio is generated based on the values of default platform
366
+ # text responses found in the `query_result.fulfillment_messages` field. If
367
+ # multiple default text responses exist, they will be concatenated when
368
+ # generating audio. If no default platform text responses exist, the
369
+ # generated audio content will be empty.
370
+ # @!attribute [rw] output_audio_config
371
+ # @return [Google::Cloud::Dialogflow::V2::OutputAudioConfig]
372
+ # The config used by the speech synthesizer to generate the output audio.
373
+ class StreamingDetectIntentResponse
374
+ include Google::Protobuf::MessageExts
375
+ extend Google::Protobuf::MessageExts::ClassMethods
376
+ end
377
+
378
+ # Contains a speech recognition result corresponding to a portion of the audio
379
+ # that is currently being processed or an indication that this is the end
380
+ # of the single requested utterance.
381
+ #
382
+ # Example:
383
+ #
384
+ # 1. transcript: "tube"
385
+ #
386
+ # 2. transcript: "to be a"
387
+ #
388
+ # 3. transcript: "to be"
389
+ #
390
+ # 4. transcript: "to be or not to be"
391
+ # is_final: true
392
+ #
393
+ # 5. transcript: " that's"
394
+ #
395
+ # 6. transcript: " that is"
396
+ #
397
+ # 7. message_type: `END_OF_SINGLE_UTTERANCE`
398
+ #
399
+ # 8. transcript: " that is the question"
400
+ # is_final: true
401
+ #
402
+ # Only two of the responses contain final results (#4 and #8 indicated by
403
+ # `is_final: true`). Concatenating these generates the full transcript: "to be
404
+ # or not to be that is the question".
405
+ #
406
+ # In each response we populate:
407
+ #
408
+ # * for `TRANSCRIPT`: `transcript` and possibly `is_final`.
409
+ #
410
+ # * for `END_OF_SINGLE_UTTERANCE`: only `message_type`.
411
+ # @!attribute [rw] message_type
412
+ # @return [Google::Cloud::Dialogflow::V2::StreamingRecognitionResult::MessageType]
413
+ # Type of the result message.
414
+ # @!attribute [rw] transcript
415
+ # @return [String]
416
+ # Transcript text representing the words that the user spoke.
417
+ # Populated if and only if `message_type` = `TRANSCRIPT`.
418
+ # @!attribute [rw] is_final
419
+ # @return [Boolean]
420
+ # If `false`, the `StreamingRecognitionResult` represents an
421
+ # interim result that may change. If `true`, the recognizer will not return
422
+ # any further hypotheses about this piece of the audio. May only be populated
423
+ # for `message_type` = `TRANSCRIPT`.
424
+ # @!attribute [rw] confidence
425
+ # @return [Float]
426
+ # The Speech confidence between 0.0 and 1.0 for the current portion of audio.
427
+ # A higher number indicates an estimated greater likelihood that the
428
+ # recognized words are correct. The default of 0.0 is a sentinel value
429
+ # indicating that confidence was not set.
430
+ #
431
+ # This field is typically only provided if `is_final` is true and you should
432
+ # not rely on it being accurate or even set.
433
+ # @!attribute [rw] speech_word_info
434
+ # @return [Array<Google::Cloud::Dialogflow::V2::SpeechWordInfo>]
435
+ # Word-specific information for the words recognized by Speech in
436
+ # {Google::Cloud::Dialogflow::V2::StreamingRecognitionResult#transcript transcript}. Populated if and only if `message_type` = `TRANSCRIPT` and
437
+ # [InputAudioConfig.enable_word_info] is set.
438
+ # @!attribute [rw] speech_end_offset
439
+ # @return [Google::Protobuf::Duration]
440
+ # Time offset of the end of this Speech recognition result relative to the
441
+ # beginning of the audio. Only populated for `message_type` = `TRANSCRIPT`.
442
+ class StreamingRecognitionResult
443
+ include Google::Protobuf::MessageExts
444
+ extend Google::Protobuf::MessageExts::ClassMethods
445
+
446
+ # Type of the response message.
447
+ module MessageType
448
+ # Not specified. Should never be used.
449
+ MESSAGE_TYPE_UNSPECIFIED = 0
450
+
451
+ # Message contains a (possibly partial) transcript.
452
+ TRANSCRIPT = 1
453
+
454
+ # Event indicates that the server has detected the end of the user's speech
455
+ # utterance and expects no additional inputs.
456
+ # Therefore, the server will not process additional audio (although it may subsequently return additional results). The
457
+ # client should stop sending additional audio data, half-close the gRPC
458
+ # connection, and wait for any additional results until the server closes
459
+ # the gRPC connection. This message is only sent if `single_utterance` was
460
+ # set to `true`, and is not used otherwise.
461
+ END_OF_SINGLE_UTTERANCE = 2
462
+ end
463
+ end
464
+
465
+ # Represents the natural language text to be processed.
466
+ # @!attribute [rw] text
467
+ # @return [String]
468
+ # Required. The UTF-8 encoded natural language text to be processed.
469
+ # Text length must not exceed 256 characters.
470
+ # @!attribute [rw] language_code
471
+ # @return [String]
472
+ # Required. The language of this conversational query. See [Language
473
+ # Support](https://cloud.google.com/dialogflow/docs/reference/language)
474
+ # for a list of the currently supported language codes. Note that queries in
475
+ # the same session do not necessarily need to specify the same language.
476
+ class TextInput
477
+ include Google::Protobuf::MessageExts
478
+ extend Google::Protobuf::MessageExts::ClassMethods
479
+ end
480
+
481
+ # Events allow for matching intents by event name instead of the natural
482
+ # language input. For instance, input `<event: { name: "welcome_event",
483
+ # parameters: { name: "Sam" } }>` can trigger a personalized welcome response.
484
+ # The parameter `name` may be used by the agent in the response:
485
+ # `"Hello #welcome_event.name! What can I do for you today?"`.
486
+ # @!attribute [rw] name
487
+ # @return [String]
488
+ # Required. The unique identifier of the event.
489
+ # @!attribute [rw] parameters
490
+ # @return [Google::Protobuf::Struct]
491
+ # The collection of parameters associated with the event.
492
+ # @!attribute [rw] language_code
493
+ # @return [String]
494
+ # Required. The language of this query. See [Language
495
+ # Support](https://cloud.google.com/dialogflow/docs/reference/language)
496
+ # for a list of the currently supported language codes. Note that queries in
497
+ # the same session do not necessarily need to specify the same language.
498
+ class EventInput
499
+ include Google::Protobuf::MessageExts
500
+ extend Google::Protobuf::MessageExts::ClassMethods
501
+ end
502
+
503
+ # Configures the types of sentiment analysis to perform.
504
+ # @!attribute [rw] analyze_query_text_sentiment
505
+ # @return [Boolean]
506
+ # Instructs the service to perform sentiment analysis on
507
+ # `query_text`. If not provided, sentiment analysis is not performed on
508
+ # `query_text`.
509
+ class SentimentAnalysisRequestConfig
510
+ include Google::Protobuf::MessageExts
511
+ extend Google::Protobuf::MessageExts::ClassMethods
512
+ end
513
+
514
+ # The result of sentiment analysis as configured by
515
+ # `sentiment_analysis_request_config`.
516
+ # @!attribute [rw] query_text_sentiment
517
+ # @return [Google::Cloud::Dialogflow::V2::Sentiment]
518
+ # The sentiment analysis result for `query_text`.
519
+ class SentimentAnalysisResult
520
+ include Google::Protobuf::MessageExts
521
+ extend Google::Protobuf::MessageExts::ClassMethods
522
+ end
523
+
524
+ # The sentiment, such as positive/negative feeling or association, for a unit
525
+ # of analysis, such as the query text.
526
+ # @!attribute [rw] score
527
+ # @return [Float]
528
+ # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive
529
+ # sentiment).
530
+ # @!attribute [rw] magnitude
531
+ # @return [Float]
532
+ # A non-negative number in the [0, +inf) range, which represents the absolute
533
+ # magnitude of sentiment, regardless of score (positive or negative).
534
+ class Sentiment
535
+ include Google::Protobuf::MessageExts
536
+ extend Google::Protobuf::MessageExts::ClassMethods
537
+ end
538
+ end
539
+ end
540
+ end
541
+ end