google-cloud-dialogflow 0.13.0 → 1.1.1

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