google-cloud-dialogflow 0.14.0 → 1.1.2
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.
- checksums.yaml +4 -4
- data/.yardopts +2 -1
- data/AUTHENTICATION.md +51 -59
- data/LICENSE.md +203 -0
- data/MIGRATING.md +445 -0
- data/README.md +35 -25
- data/lib/{google/cloud/dialogflow/v2/doc/google/protobuf/empty.rb → google-cloud-dialogflow.rb} +4 -14
- data/lib/google/cloud/dialogflow.rb +256 -506
- data/lib/google/cloud/dialogflow/version.rb +1 -1
- metadata +63 -86
- data/LICENSE +0 -201
- data/lib/google/cloud/dialogflow/v2.rb +0 -598
- data/lib/google/cloud/dialogflow/v2/agent_pb.rb +0 -121
- data/lib/google/cloud/dialogflow/v2/agent_services_pb.rb +0 -111
- data/lib/google/cloud/dialogflow/v2/agents_client.rb +0 -807
- data/lib/google/cloud/dialogflow/v2/agents_client_config.json +0 -71
- data/lib/google/cloud/dialogflow/v2/audio_config_pb.rb +0 -96
- data/lib/google/cloud/dialogflow/v2/context_pb.rb +0 -63
- data/lib/google/cloud/dialogflow/v2/context_services_pb.rb +0 -75
- data/lib/google/cloud/dialogflow/v2/contexts_client.rb +0 -519
- data/lib/google/cloud/dialogflow/v2/contexts_client_config.json +0 -56
- data/lib/google/cloud/dialogflow/v2/credentials.rb +0 -42
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/agent.rb +0 -247
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/audio_config.rb +0 -341
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/context.rb +0 -116
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/entity_type.rb +0 -305
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/intent.rb +0 -937
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/session.rb +0 -498
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/session_entity_type.rb +0 -130
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/validation_result.rb +0 -71
- data/lib/google/cloud/dialogflow/v2/doc/google/longrunning/operations.rb +0 -51
- data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/any.rb +0 -131
- data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/duration.rb +0 -91
- data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/field_mask.rb +0 -222
- data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/struct.rb +0 -74
- data/lib/google/cloud/dialogflow/v2/doc/google/rpc/status.rb +0 -39
- data/lib/google/cloud/dialogflow/v2/doc/google/type/latlng.rb +0 -31
- data/lib/google/cloud/dialogflow/v2/entity_type_pb.rb +0 -125
- data/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb +0 -105
- data/lib/google/cloud/dialogflow/v2/entity_types_client.rb +0 -994
- data/lib/google/cloud/dialogflow/v2/entity_types_client_config.json +0 -76
- data/lib/google/cloud/dialogflow/v2/intent_pb.rb +0 -367
- data/lib/google/cloud/dialogflow/v2/intent_services_pb.rb +0 -93
- data/lib/google/cloud/dialogflow/v2/intents_client.rb +0 -760
- data/lib/google/cloud/dialogflow/v2/intents_client_config.json +0 -61
- data/lib/google/cloud/dialogflow/v2/session_entity_type_pb.rb +0 -65
- data/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb +0 -93
- data/lib/google/cloud/dialogflow/v2/session_entity_types_client.rb +0 -504
- data/lib/google/cloud/dialogflow/v2/session_entity_types_client_config.json +0 -51
- data/lib/google/cloud/dialogflow/v2/session_pb.rb +0 -141
- data/lib/google/cloud/dialogflow/v2/session_services_pb.rb +0 -56
- data/lib/google/cloud/dialogflow/v2/sessions_client.rb +0 -337
- data/lib/google/cloud/dialogflow/v2/sessions_client_config.json +0 -36
- data/lib/google/cloud/dialogflow/v2/validation_result_pb.rb +0 -36
- data/lib/google/cloud/dialogflow/v2/webhook_pb.rb +0 -46
@@ -1,598 +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
|
-
require "google/cloud/dialogflow/v2/agents_client"
|
17
|
-
require "google/cloud/dialogflow/v2/contexts_client"
|
18
|
-
require "google/cloud/dialogflow/v2/entity_types_client"
|
19
|
-
require "google/cloud/dialogflow/v2/intents_client"
|
20
|
-
require "google/cloud/dialogflow/v2/session_entity_types_client"
|
21
|
-
require "google/cloud/dialogflow/v2/sessions_client"
|
22
|
-
require "google/cloud/dialogflow/v2/agent_pb"
|
23
|
-
require "google/cloud/dialogflow/v2/entity_type_pb"
|
24
|
-
require "google/cloud/dialogflow/v2/intent_pb"
|
25
|
-
require "google/cloud/dialogflow/v2/webhook_pb"
|
26
|
-
|
27
|
-
module Google
|
28
|
-
module Cloud
|
29
|
-
module Dialogflow
|
30
|
-
# rubocop:disable LineLength
|
31
|
-
|
32
|
-
##
|
33
|
-
# # Ruby Client for Dialogflow API
|
34
|
-
#
|
35
|
-
# [Dialogflow API][Product Documentation]:
|
36
|
-
# Builds conversational interfaces (for example, chatbots, and voice-powered
|
37
|
-
# apps and devices).
|
38
|
-
# - [Product Documentation][]
|
39
|
-
#
|
40
|
-
# ## Quick Start
|
41
|
-
# In order to use this library, you first need to go through the following
|
42
|
-
# steps:
|
43
|
-
#
|
44
|
-
# 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
45
|
-
# 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
|
46
|
-
# 3. [Enable the Dialogflow API.](https://console.cloud.google.com/apis/library/dialogflow.googleapis.com)
|
47
|
-
# 4. [Setup Authentication.](https://googleapis.dev/ruby/google-cloud-dialogflow/latest/file.AUTHENTICATION.html)
|
48
|
-
#
|
49
|
-
# ### Installation
|
50
|
-
# ```
|
51
|
-
# $ gem install google-cloud-dialogflow
|
52
|
-
# ```
|
53
|
-
#
|
54
|
-
# ### Next Steps
|
55
|
-
# - Read the [Dialogflow API Product documentation][Product Documentation]
|
56
|
-
# to learn more about the product and see How-to Guides.
|
57
|
-
# - View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
|
58
|
-
# to see the full list of Cloud APIs that we cover.
|
59
|
-
#
|
60
|
-
# [Product Documentation]: https://cloud.google.com/dialogflow
|
61
|
-
#
|
62
|
-
# ## Enabling Logging
|
63
|
-
#
|
64
|
-
# To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
65
|
-
# The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below,
|
66
|
-
# or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
67
|
-
# that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
68
|
-
# and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
69
|
-
#
|
70
|
-
# Configuring a Ruby stdlib logger:
|
71
|
-
#
|
72
|
-
# ```ruby
|
73
|
-
# require "logger"
|
74
|
-
#
|
75
|
-
# module MyLogger
|
76
|
-
# LOGGER = Logger.new $stderr, level: Logger::WARN
|
77
|
-
# def logger
|
78
|
-
# LOGGER
|
79
|
-
# end
|
80
|
-
# end
|
81
|
-
#
|
82
|
-
# # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
83
|
-
# module GRPC
|
84
|
-
# extend MyLogger
|
85
|
-
# end
|
86
|
-
# ```
|
87
|
-
#
|
88
|
-
module V2
|
89
|
-
# rubocop:enable LineLength
|
90
|
-
|
91
|
-
module Agents
|
92
|
-
##
|
93
|
-
# Agents are best described as Natural Language Understanding (NLU) modules
|
94
|
-
# that transform user requests into actionable data. You can include agents
|
95
|
-
# in your app, product, or service to determine user intent and respond to the
|
96
|
-
# user in a natural way.
|
97
|
-
#
|
98
|
-
# After you create an agent, you can add {Google::Cloud::Dialogflow::V2::Intents Intents}, {Google::Cloud::Dialogflow::V2::Contexts Contexts},
|
99
|
-
# {Google::Cloud::Dialogflow::V2::EntityTypes Entity Types}, {Google::Cloud::Dialogflow::V2::WebhookRequest Webhooks}, and so on to
|
100
|
-
# manage the flow of a conversation and match user input to predefined intents
|
101
|
-
# and actions.
|
102
|
-
#
|
103
|
-
# You can create an agent using both Dialogflow Standard Edition and
|
104
|
-
# Dialogflow Enterprise Edition. For details, see
|
105
|
-
# [Dialogflow
|
106
|
-
# Editions](https://cloud.google.com/dialogflow/docs/editions).
|
107
|
-
#
|
108
|
-
# You can save your agent for backup or versioning by exporting the agent by
|
109
|
-
# using the {Google::Cloud::Dialogflow::V2::Agents::ExportAgent ExportAgent} method. You can import a saved
|
110
|
-
# agent by using the {Google::Cloud::Dialogflow::V2::Agents::ImportAgent ImportAgent} method.
|
111
|
-
#
|
112
|
-
# Dialogflow provides several
|
113
|
-
# [prebuilt
|
114
|
-
# agents](https://cloud.google.com/dialogflow/docs/agents-prebuilt)
|
115
|
-
# for common conversation scenarios such as determining a date and time,
|
116
|
-
# converting currency, and so on.
|
117
|
-
#
|
118
|
-
# For more information about agents, see the
|
119
|
-
# [Dialogflow
|
120
|
-
# documentation](https://cloud.google.com/dialogflow/docs/agents-overview).
|
121
|
-
#
|
122
|
-
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
123
|
-
# Provides the means for authenticating requests made by the client. This parameter can
|
124
|
-
# be many types.
|
125
|
-
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
126
|
-
# authenticating requests made by this client.
|
127
|
-
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
128
|
-
# credentials for this client.
|
129
|
-
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
130
|
-
# credentials for this client.
|
131
|
-
# A `GRPC::Core::Channel` will be used to make calls through.
|
132
|
-
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
133
|
-
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
134
|
-
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
135
|
-
# metadata for requests, generally, to give OAuth credentials.
|
136
|
-
# @param scopes [Array<String>]
|
137
|
-
# The OAuth scopes for this service. This parameter is ignored if
|
138
|
-
# an updater_proc is supplied.
|
139
|
-
# @param client_config [Hash]
|
140
|
-
# A Hash for call options for each method. See
|
141
|
-
# Google::Gax#construct_settings for the structure of
|
142
|
-
# this data. Falls back to the default config if not specified
|
143
|
-
# or the specified config is missing data points.
|
144
|
-
# @param timeout [Numeric]
|
145
|
-
# The default timeout, in seconds, for calls made through this client.
|
146
|
-
# @param metadata [Hash]
|
147
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
148
|
-
# @param service_address [String]
|
149
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
150
|
-
# @param service_port [Integer]
|
151
|
-
# Override for the service port, or `nil` to leave as the default.
|
152
|
-
# @param exception_transformer [Proc]
|
153
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
154
|
-
# custom error handling.
|
155
|
-
def self.new \
|
156
|
-
credentials: nil,
|
157
|
-
scopes: nil,
|
158
|
-
client_config: nil,
|
159
|
-
timeout: nil,
|
160
|
-
metadata: nil,
|
161
|
-
service_address: nil,
|
162
|
-
service_port: nil,
|
163
|
-
exception_transformer: nil,
|
164
|
-
lib_name: nil,
|
165
|
-
lib_version: nil
|
166
|
-
kwargs = {
|
167
|
-
credentials: credentials,
|
168
|
-
scopes: scopes,
|
169
|
-
client_config: client_config,
|
170
|
-
timeout: timeout,
|
171
|
-
metadata: metadata,
|
172
|
-
exception_transformer: exception_transformer,
|
173
|
-
lib_name: lib_name,
|
174
|
-
service_address: service_address,
|
175
|
-
service_port: service_port,
|
176
|
-
lib_version: lib_version
|
177
|
-
}.select { |_, v| v != nil }
|
178
|
-
Google::Cloud::Dialogflow::V2::AgentsClient.new(**kwargs)
|
179
|
-
end
|
180
|
-
end
|
181
|
-
|
182
|
-
module Contexts
|
183
|
-
##
|
184
|
-
# A context represents additional information included with user input or with
|
185
|
-
# an intent returned by the Dialogflow API. Contexts are helpful for
|
186
|
-
# differentiating user input which may be vague or have a different meaning
|
187
|
-
# depending on additional details from your application such as user setting
|
188
|
-
# and preferences, previous user input, where the user is in your application,
|
189
|
-
# geographic location, and so on.
|
190
|
-
#
|
191
|
-
# You can include contexts as input parameters of a
|
192
|
-
# {Google::Cloud::Dialogflow::V2::Sessions::DetectIntent DetectIntent} (or
|
193
|
-
# {Google::Cloud::Dialogflow::V2::Sessions::StreamingDetectIntent StreamingDetectIntent}) request,
|
194
|
-
# or as output contexts included in the returned intent.
|
195
|
-
# Contexts expire when an intent is matched, after the number of `DetectIntent`
|
196
|
-
# requests specified by the `lifespan_count` parameter, or after 20 minutes
|
197
|
-
# if no intents are matched for a `DetectIntent` request.
|
198
|
-
#
|
199
|
-
# For more information about contexts, see the
|
200
|
-
# [Dialogflow
|
201
|
-
# documentation](https://cloud.google.com/dialogflow/docs/contexts-overview).
|
202
|
-
#
|
203
|
-
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
204
|
-
# Provides the means for authenticating requests made by the client. This parameter can
|
205
|
-
# be many types.
|
206
|
-
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
207
|
-
# authenticating requests made by this client.
|
208
|
-
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
209
|
-
# credentials for this client.
|
210
|
-
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
211
|
-
# credentials for this client.
|
212
|
-
# A `GRPC::Core::Channel` will be used to make calls through.
|
213
|
-
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
214
|
-
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
215
|
-
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
216
|
-
# metadata for requests, generally, to give OAuth credentials.
|
217
|
-
# @param scopes [Array<String>]
|
218
|
-
# The OAuth scopes for this service. This parameter is ignored if
|
219
|
-
# an updater_proc is supplied.
|
220
|
-
# @param client_config [Hash]
|
221
|
-
# A Hash for call options for each method. See
|
222
|
-
# Google::Gax#construct_settings for the structure of
|
223
|
-
# this data. Falls back to the default config if not specified
|
224
|
-
# or the specified config is missing data points.
|
225
|
-
# @param timeout [Numeric]
|
226
|
-
# The default timeout, in seconds, for calls made through this client.
|
227
|
-
# @param metadata [Hash]
|
228
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
229
|
-
# @param service_address [String]
|
230
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
231
|
-
# @param service_port [Integer]
|
232
|
-
# Override for the service port, or `nil` to leave as the default.
|
233
|
-
# @param exception_transformer [Proc]
|
234
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
235
|
-
# custom error handling.
|
236
|
-
def self.new \
|
237
|
-
credentials: nil,
|
238
|
-
scopes: nil,
|
239
|
-
client_config: nil,
|
240
|
-
timeout: nil,
|
241
|
-
metadata: nil,
|
242
|
-
service_address: nil,
|
243
|
-
service_port: nil,
|
244
|
-
exception_transformer: nil,
|
245
|
-
lib_name: nil,
|
246
|
-
lib_version: nil
|
247
|
-
kwargs = {
|
248
|
-
credentials: credentials,
|
249
|
-
scopes: scopes,
|
250
|
-
client_config: client_config,
|
251
|
-
timeout: timeout,
|
252
|
-
metadata: metadata,
|
253
|
-
exception_transformer: exception_transformer,
|
254
|
-
lib_name: lib_name,
|
255
|
-
service_address: service_address,
|
256
|
-
service_port: service_port,
|
257
|
-
lib_version: lib_version
|
258
|
-
}.select { |_, v| v != nil }
|
259
|
-
Google::Cloud::Dialogflow::V2::ContextsClient.new(**kwargs)
|
260
|
-
end
|
261
|
-
end
|
262
|
-
|
263
|
-
module EntityTypes
|
264
|
-
##
|
265
|
-
# Entities are extracted from user input and represent parameters that are
|
266
|
-
# meaningful to your application. For example, a date range, a proper name
|
267
|
-
# such as a geographic location or landmark, and so on. Entities represent
|
268
|
-
# actionable data for your application.
|
269
|
-
#
|
270
|
-
# When you define an entity, you can also include synonyms that all map to
|
271
|
-
# that entity. For example, "soft drink", "soda", "pop", and so on.
|
272
|
-
#
|
273
|
-
# There are three types of entities:
|
274
|
-
#
|
275
|
-
# * **System** - entities that are defined by the Dialogflow API for common
|
276
|
-
# data types such as date, time, currency, and so on. A system entity is
|
277
|
-
# represented by the `EntityType` type.
|
278
|
-
#
|
279
|
-
# * **Custom** - entities that are defined by you that represent
|
280
|
-
# actionable data that is meaningful to your application. For example,
|
281
|
-
# you could define a `pizza.sauce` entity for red or white pizza sauce,
|
282
|
-
# a `pizza.cheese` entity for the different types of cheese on a pizza,
|
283
|
-
# a `pizza.topping` entity for different toppings, and so on. A custom
|
284
|
-
# entity is represented by the `EntityType` type.
|
285
|
-
#
|
286
|
-
# * **User** - entities that are built for an individual user such as
|
287
|
-
# favorites, preferences, playlists, and so on. A user entity is
|
288
|
-
# represented by the {Google::Cloud::Dialogflow::V2::SessionEntityType SessionEntityType} type.
|
289
|
-
#
|
290
|
-
# For more information about entity types, see the
|
291
|
-
# [Dialogflow
|
292
|
-
# documentation](https://cloud.google.com/dialogflow/docs/entities-overview).
|
293
|
-
#
|
294
|
-
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
295
|
-
# Provides the means for authenticating requests made by the client. This parameter can
|
296
|
-
# be many types.
|
297
|
-
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
298
|
-
# authenticating requests made by this client.
|
299
|
-
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
300
|
-
# credentials for this client.
|
301
|
-
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
302
|
-
# credentials for this client.
|
303
|
-
# A `GRPC::Core::Channel` will be used to make calls through.
|
304
|
-
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
305
|
-
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
306
|
-
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
307
|
-
# metadata for requests, generally, to give OAuth credentials.
|
308
|
-
# @param scopes [Array<String>]
|
309
|
-
# The OAuth scopes for this service. This parameter is ignored if
|
310
|
-
# an updater_proc is supplied.
|
311
|
-
# @param client_config [Hash]
|
312
|
-
# A Hash for call options for each method. See
|
313
|
-
# Google::Gax#construct_settings for the structure of
|
314
|
-
# this data. Falls back to the default config if not specified
|
315
|
-
# or the specified config is missing data points.
|
316
|
-
# @param timeout [Numeric]
|
317
|
-
# The default timeout, in seconds, for calls made through this client.
|
318
|
-
# @param metadata [Hash]
|
319
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
320
|
-
# @param service_address [String]
|
321
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
322
|
-
# @param service_port [Integer]
|
323
|
-
# Override for the service port, or `nil` to leave as the default.
|
324
|
-
# @param exception_transformer [Proc]
|
325
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
326
|
-
# custom error handling.
|
327
|
-
def self.new \
|
328
|
-
credentials: nil,
|
329
|
-
scopes: nil,
|
330
|
-
client_config: nil,
|
331
|
-
timeout: nil,
|
332
|
-
metadata: nil,
|
333
|
-
service_address: nil,
|
334
|
-
service_port: nil,
|
335
|
-
exception_transformer: nil,
|
336
|
-
lib_name: nil,
|
337
|
-
lib_version: nil
|
338
|
-
kwargs = {
|
339
|
-
credentials: credentials,
|
340
|
-
scopes: scopes,
|
341
|
-
client_config: client_config,
|
342
|
-
timeout: timeout,
|
343
|
-
metadata: metadata,
|
344
|
-
exception_transformer: exception_transformer,
|
345
|
-
lib_name: lib_name,
|
346
|
-
service_address: service_address,
|
347
|
-
service_port: service_port,
|
348
|
-
lib_version: lib_version
|
349
|
-
}.select { |_, v| v != nil }
|
350
|
-
Google::Cloud::Dialogflow::V2::EntityTypesClient.new(**kwargs)
|
351
|
-
end
|
352
|
-
end
|
353
|
-
|
354
|
-
module Intents
|
355
|
-
##
|
356
|
-
# An intent represents a mapping between input from a user and an action to
|
357
|
-
# be taken by your application. When you pass user input to the
|
358
|
-
# {Google::Cloud::Dialogflow::V2::Sessions::DetectIntent DetectIntent} (or
|
359
|
-
# {Google::Cloud::Dialogflow::V2::Sessions::StreamingDetectIntent StreamingDetectIntent}) method, the
|
360
|
-
# Dialogflow API analyzes the input and searches
|
361
|
-
# for a matching intent. If no match is found, the Dialogflow API returns a
|
362
|
-
# fallback intent (`is_fallback` = true).
|
363
|
-
#
|
364
|
-
# You can provide additional information for the Dialogflow API to use to
|
365
|
-
# match user input to an intent by adding the following to your intent.
|
366
|
-
#
|
367
|
-
# * **Contexts** - provide additional context for intent analysis. For
|
368
|
-
# example, if an intent is related to an object in your application that
|
369
|
-
# plays music, you can provide a context to determine when to match the
|
370
|
-
# intent if the user input is "turn it off". You can include a context
|
371
|
-
# that matches the intent when there is previous user input of
|
372
|
-
# "play music", and not when there is previous user input of
|
373
|
-
# "turn on the light".
|
374
|
-
#
|
375
|
-
# * **Events** - allow for matching an intent by using an event name
|
376
|
-
# instead of user input. Your application can provide an event name and
|
377
|
-
# related parameters to the Dialogflow API to match an intent. For
|
378
|
-
# example, when your application starts, you can send a welcome event
|
379
|
-
# with a user name parameter to the Dialogflow API to match an intent with
|
380
|
-
# a personalized welcome message for the user.
|
381
|
-
#
|
382
|
-
# * **Training phrases** - provide examples of user input to train the
|
383
|
-
# Dialogflow API agent to better match intents.
|
384
|
-
#
|
385
|
-
# For more information about intents, see the
|
386
|
-
# [Dialogflow
|
387
|
-
# documentation](https://cloud.google.com/dialogflow/docs/intents-overview).
|
388
|
-
#
|
389
|
-
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
390
|
-
# Provides the means for authenticating requests made by the client. This parameter can
|
391
|
-
# be many types.
|
392
|
-
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
393
|
-
# authenticating requests made by this client.
|
394
|
-
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
395
|
-
# credentials for this client.
|
396
|
-
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
397
|
-
# credentials for this client.
|
398
|
-
# A `GRPC::Core::Channel` will be used to make calls through.
|
399
|
-
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
400
|
-
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
401
|
-
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
402
|
-
# metadata for requests, generally, to give OAuth credentials.
|
403
|
-
# @param scopes [Array<String>]
|
404
|
-
# The OAuth scopes for this service. This parameter is ignored if
|
405
|
-
# an updater_proc is supplied.
|
406
|
-
# @param client_config [Hash]
|
407
|
-
# A Hash for call options for each method. See
|
408
|
-
# Google::Gax#construct_settings for the structure of
|
409
|
-
# this data. Falls back to the default config if not specified
|
410
|
-
# or the specified config is missing data points.
|
411
|
-
# @param timeout [Numeric]
|
412
|
-
# The default timeout, in seconds, for calls made through this client.
|
413
|
-
# @param metadata [Hash]
|
414
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
415
|
-
# @param service_address [String]
|
416
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
417
|
-
# @param service_port [Integer]
|
418
|
-
# Override for the service port, or `nil` to leave as the default.
|
419
|
-
# @param exception_transformer [Proc]
|
420
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
421
|
-
# custom error handling.
|
422
|
-
def self.new \
|
423
|
-
credentials: nil,
|
424
|
-
scopes: nil,
|
425
|
-
client_config: nil,
|
426
|
-
timeout: nil,
|
427
|
-
metadata: nil,
|
428
|
-
service_address: nil,
|
429
|
-
service_port: nil,
|
430
|
-
exception_transformer: nil,
|
431
|
-
lib_name: nil,
|
432
|
-
lib_version: nil
|
433
|
-
kwargs = {
|
434
|
-
credentials: credentials,
|
435
|
-
scopes: scopes,
|
436
|
-
client_config: client_config,
|
437
|
-
timeout: timeout,
|
438
|
-
metadata: metadata,
|
439
|
-
exception_transformer: exception_transformer,
|
440
|
-
lib_name: lib_name,
|
441
|
-
service_address: service_address,
|
442
|
-
service_port: service_port,
|
443
|
-
lib_version: lib_version
|
444
|
-
}.select { |_, v| v != nil }
|
445
|
-
Google::Cloud::Dialogflow::V2::IntentsClient.new(**kwargs)
|
446
|
-
end
|
447
|
-
end
|
448
|
-
|
449
|
-
module SessionEntityTypes
|
450
|
-
##
|
451
|
-
# Entities are extracted from user input and represent parameters that are
|
452
|
-
# meaningful to your application. For example, a date range, a proper name
|
453
|
-
# such as a geographic location or landmark, and so on. Entities represent
|
454
|
-
# actionable data for your application.
|
455
|
-
#
|
456
|
-
# Session entity types are referred to as **User** entity types and are
|
457
|
-
# entities that are built for an individual user such as
|
458
|
-
# favorites, preferences, playlists, and so on. You can redefine a session
|
459
|
-
# entity type at the session level.
|
460
|
-
#
|
461
|
-
# Session entity methods do not work with Google Assistant integration.
|
462
|
-
# Contact Dialogflow support if you need to use session entities
|
463
|
-
# with Google Assistant integration.
|
464
|
-
#
|
465
|
-
# For more information about entity types, see the
|
466
|
-
# [Dialogflow
|
467
|
-
# documentation](https://cloud.google.com/dialogflow/docs/entities-overview).
|
468
|
-
#
|
469
|
-
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
470
|
-
# Provides the means for authenticating requests made by the client. This parameter can
|
471
|
-
# be many types.
|
472
|
-
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
473
|
-
# authenticating requests made by this client.
|
474
|
-
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
475
|
-
# credentials for this client.
|
476
|
-
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
477
|
-
# credentials for this client.
|
478
|
-
# A `GRPC::Core::Channel` will be used to make calls through.
|
479
|
-
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
480
|
-
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
481
|
-
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
482
|
-
# metadata for requests, generally, to give OAuth credentials.
|
483
|
-
# @param scopes [Array<String>]
|
484
|
-
# The OAuth scopes for this service. This parameter is ignored if
|
485
|
-
# an updater_proc is supplied.
|
486
|
-
# @param client_config [Hash]
|
487
|
-
# A Hash for call options for each method. See
|
488
|
-
# Google::Gax#construct_settings for the structure of
|
489
|
-
# this data. Falls back to the default config if not specified
|
490
|
-
# or the specified config is missing data points.
|
491
|
-
# @param timeout [Numeric]
|
492
|
-
# The default timeout, in seconds, for calls made through this client.
|
493
|
-
# @param metadata [Hash]
|
494
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
495
|
-
# @param service_address [String]
|
496
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
497
|
-
# @param service_port [Integer]
|
498
|
-
# Override for the service port, or `nil` to leave as the default.
|
499
|
-
# @param exception_transformer [Proc]
|
500
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
501
|
-
# custom error handling.
|
502
|
-
def self.new \
|
503
|
-
credentials: nil,
|
504
|
-
scopes: nil,
|
505
|
-
client_config: nil,
|
506
|
-
timeout: nil,
|
507
|
-
metadata: nil,
|
508
|
-
service_address: nil,
|
509
|
-
service_port: nil,
|
510
|
-
exception_transformer: nil,
|
511
|
-
lib_name: nil,
|
512
|
-
lib_version: nil
|
513
|
-
kwargs = {
|
514
|
-
credentials: credentials,
|
515
|
-
scopes: scopes,
|
516
|
-
client_config: client_config,
|
517
|
-
timeout: timeout,
|
518
|
-
metadata: metadata,
|
519
|
-
exception_transformer: exception_transformer,
|
520
|
-
lib_name: lib_name,
|
521
|
-
service_address: service_address,
|
522
|
-
service_port: service_port,
|
523
|
-
lib_version: lib_version
|
524
|
-
}.select { |_, v| v != nil }
|
525
|
-
Google::Cloud::Dialogflow::V2::SessionEntityTypesClient.new(**kwargs)
|
526
|
-
end
|
527
|
-
end
|
528
|
-
|
529
|
-
module Sessions
|
530
|
-
##
|
531
|
-
# A session represents an interaction with a user. You retrieve user input
|
532
|
-
# and pass it to the {Google::Cloud::Dialogflow::V2::Sessions::DetectIntent DetectIntent} (or
|
533
|
-
# {Google::Cloud::Dialogflow::V2::Sessions::StreamingDetectIntent StreamingDetectIntent}) method to determine
|
534
|
-
# user intent and respond.
|
535
|
-
#
|
536
|
-
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
537
|
-
# Provides the means for authenticating requests made by the client. This parameter can
|
538
|
-
# be many types.
|
539
|
-
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
540
|
-
# authenticating requests made by this client.
|
541
|
-
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
542
|
-
# credentials for this client.
|
543
|
-
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
544
|
-
# credentials for this client.
|
545
|
-
# A `GRPC::Core::Channel` will be used to make calls through.
|
546
|
-
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
547
|
-
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
548
|
-
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
549
|
-
# metadata for requests, generally, to give OAuth credentials.
|
550
|
-
# @param scopes [Array<String>]
|
551
|
-
# The OAuth scopes for this service. This parameter is ignored if
|
552
|
-
# an updater_proc is supplied.
|
553
|
-
# @param client_config [Hash]
|
554
|
-
# A Hash for call options for each method. See
|
555
|
-
# Google::Gax#construct_settings for the structure of
|
556
|
-
# this data. Falls back to the default config if not specified
|
557
|
-
# or the specified config is missing data points.
|
558
|
-
# @param timeout [Numeric]
|
559
|
-
# The default timeout, in seconds, for calls made through this client.
|
560
|
-
# @param metadata [Hash]
|
561
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
562
|
-
# @param service_address [String]
|
563
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
564
|
-
# @param service_port [Integer]
|
565
|
-
# Override for the service port, or `nil` to leave as the default.
|
566
|
-
# @param exception_transformer [Proc]
|
567
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
568
|
-
# custom error handling.
|
569
|
-
def self.new \
|
570
|
-
credentials: nil,
|
571
|
-
scopes: nil,
|
572
|
-
client_config: nil,
|
573
|
-
timeout: nil,
|
574
|
-
metadata: nil,
|
575
|
-
service_address: nil,
|
576
|
-
service_port: nil,
|
577
|
-
exception_transformer: nil,
|
578
|
-
lib_name: nil,
|
579
|
-
lib_version: nil
|
580
|
-
kwargs = {
|
581
|
-
credentials: credentials,
|
582
|
-
scopes: scopes,
|
583
|
-
client_config: client_config,
|
584
|
-
timeout: timeout,
|
585
|
-
metadata: metadata,
|
586
|
-
exception_transformer: exception_transformer,
|
587
|
-
lib_name: lib_name,
|
588
|
-
service_address: service_address,
|
589
|
-
service_port: service_port,
|
590
|
-
lib_version: lib_version
|
591
|
-
}.select { |_, v| v != nil }
|
592
|
-
Google::Cloud::Dialogflow::V2::SessionsClient.new(**kwargs)
|
593
|
-
end
|
594
|
-
end
|
595
|
-
end
|
596
|
-
end
|
597
|
-
end
|
598
|
-
end
|