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