google-cloud-dialogflow 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +8 -0
- data/LICENSE +201 -0
- data/README.md +32 -0
- data/lib/google/cloud/dialogflow.rb +452 -0
- data/lib/google/cloud/dialogflow/credentials.rb +30 -0
- data/lib/google/cloud/dialogflow/v2.rb +454 -0
- data/lib/google/cloud/dialogflow/v2/agent_pb.rb +87 -0
- data/lib/google/cloud/dialogflow/v2/agent_services_pb.rb +104 -0
- data/lib/google/cloud/dialogflow/v2/agents_client.rb +639 -0
- data/lib/google/cloud/dialogflow/v2/agents_client_config.json +56 -0
- data/lib/google/cloud/dialogflow/v2/context_pb.rb +59 -0
- data/lib/google/cloud/dialogflow/v2/context_services_pb.rb +71 -0
- data/lib/google/cloud/dialogflow/v2/contexts_client.rb +445 -0
- data/lib/google/cloud/dialogflow/v2/contexts_client_config.json +56 -0
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/agent.rb +223 -0
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/context.rb +115 -0
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/entity_type.rb +290 -0
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/intent.rb +714 -0
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/session.rb +451 -0
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/session_entity_type.rb +134 -0
- data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/any.rb +124 -0
- data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/field_mask.rb +223 -0
- data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/struct.rb +73 -0
- data/lib/google/cloud/dialogflow/v2/doc/google/rpc/status.rb +83 -0
- data/lib/google/cloud/dialogflow/v2/doc/google/type/latlng.rb +64 -0
- data/lib/google/cloud/dialogflow/v2/doc/overview.rb +55 -0
- data/lib/google/cloud/dialogflow/v2/entity_type_pb.rb +120 -0
- data/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb +105 -0
- data/lib/google/cloud/dialogflow/v2/entity_types_client.rb +900 -0
- data/lib/google/cloud/dialogflow/v2/entity_types_client_config.json +76 -0
- data/lib/google/cloud/dialogflow/v2/intent_pb.rb +274 -0
- data/lib/google/cloud/dialogflow/v2/intent_services_pb.rb +91 -0
- data/lib/google/cloud/dialogflow/v2/intents_client.rb +684 -0
- data/lib/google/cloud/dialogflow/v2/intents_client_config.json +61 -0
- data/lib/google/cloud/dialogflow/v2/session_entity_type_pb.rb +61 -0
- data/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb +64 -0
- data/lib/google/cloud/dialogflow/v2/session_entity_types_client.rb +413 -0
- data/lib/google/cloud/dialogflow/v2/session_entity_types_client_config.json +51 -0
- data/lib/google/cloud/dialogflow/v2/session_pb.rb +127 -0
- data/lib/google/cloud/dialogflow/v2/session_services_pb.rb +55 -0
- data/lib/google/cloud/dialogflow/v2/sessions_client.rb +286 -0
- data/lib/google/cloud/dialogflow/v2/sessions_client_config.json +36 -0
- data/lib/google/cloud/dialogflow/v2/webhook_pb.rb +42 -0
- metadata +142 -0
@@ -0,0 +1,30 @@
|
|
1
|
+
# Copyright 2018 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
|
+
require "googleauth"
|
16
|
+
|
17
|
+
module Google
|
18
|
+
module Cloud
|
19
|
+
module Dialogflow
|
20
|
+
class Credentials < Google::Auth::Credentials
|
21
|
+
SCOPE = [
|
22
|
+
"https://www.googleapis.com/auth/cloud-platform"
|
23
|
+
].freeze
|
24
|
+
PATH_ENV_VARS = %w(DIALOGFLOW_KEYFILE GOOGLE_CLOUD_KEYFILE GCLOUD_KEYFILE)
|
25
|
+
JSON_ENV_VARS = %w(DIALOGFLOW_KEYFILE_JSON GOOGLE_CLOUD_KEYFILE_JSON GCLOUD_KEYFILE_JSON)
|
26
|
+
DEFAULT_PATHS = ["~/.config/gcloud/application_default_credentials.json"]
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,454 @@
|
|
1
|
+
# Copyright 2018 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
|
+
require "google/cloud/dialogflow/v2/agents_client"
|
16
|
+
require "google/cloud/dialogflow/v2/contexts_client"
|
17
|
+
require "google/cloud/dialogflow/v2/entity_types_client"
|
18
|
+
require "google/cloud/dialogflow/v2/intents_client"
|
19
|
+
require "google/cloud/dialogflow/v2/session_entity_types_client"
|
20
|
+
require "google/cloud/dialogflow/v2/sessions_client"
|
21
|
+
require "google/cloud/dialogflow/v2/agent_pb"
|
22
|
+
require "google/cloud/dialogflow/v2/entity_type_pb"
|
23
|
+
require "google/cloud/dialogflow/v2/intent_pb"
|
24
|
+
require "google/cloud/dialogflow/v2/webhook_pb"
|
25
|
+
|
26
|
+
module Google
|
27
|
+
module Cloud
|
28
|
+
# rubocop:disable LineLength
|
29
|
+
|
30
|
+
##
|
31
|
+
# # Ruby Client for Dialogflow API ([Alpha](https://github.com/GoogleCloudPlatform/google-cloud-ruby#versioning))
|
32
|
+
#
|
33
|
+
# [Dialogflow API][Product Documentation]:
|
34
|
+
# An end-to-end development suite for conversational interfaces (e.g.,
|
35
|
+
# chatbots, voice-powered apps and devices).
|
36
|
+
# - [Product Documentation][]
|
37
|
+
#
|
38
|
+
# ## Quick Start
|
39
|
+
# In order to use this library, you first need to go through the following
|
40
|
+
# steps:
|
41
|
+
#
|
42
|
+
# 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
43
|
+
# 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
|
44
|
+
# 3. [Enable the Dialogflow API.](https://console.cloud.google.com/apis/api/dialogflow)
|
45
|
+
# 4. [Setup Authentication.](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud/master/guides/authentication)
|
46
|
+
#
|
47
|
+
# ### Next Steps
|
48
|
+
# - Read the [Dialogflow API Product documentation][Product Documentation]
|
49
|
+
# to learn more about the product and see How-to Guides.
|
50
|
+
# - View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/master/README.md)
|
51
|
+
# to see the full list of Cloud APIs that we cover.
|
52
|
+
#
|
53
|
+
# [Product Documentation]: https://cloud.google.com/dialogflow
|
54
|
+
#
|
55
|
+
#
|
56
|
+
module Dialogflow
|
57
|
+
module V2
|
58
|
+
# rubocop:enable LineLength
|
59
|
+
|
60
|
+
module Agents
|
61
|
+
##
|
62
|
+
# Agents are best described as Natural Language Understanding (NLU) modules
|
63
|
+
# that transform user requests into actionable data. You can include agents
|
64
|
+
# in your app, product, or service to determine user intent and respond to the
|
65
|
+
# user in a natural way.
|
66
|
+
#
|
67
|
+
# After you create an agent, you can add {Google::Cloud::Dialogflow::V2::Intents Intents}, {Google::Cloud::Dialogflow::V2::Contexts Contexts},
|
68
|
+
# {Google::Cloud::Dialogflow::V2::EntityTypes Entity Types}, {Google::Cloud::Dialogflow::V2::WebhookRequest Webhooks}, and so on to
|
69
|
+
# manage the flow of a conversation and match user input to predefined intents
|
70
|
+
# and actions.
|
71
|
+
#
|
72
|
+
# You can create an agent using both Dialogflow Standard Edition and
|
73
|
+
# Dialogflow Enterprise Edition. For details, see
|
74
|
+
# [Dialogflow Editions](https://cloud.google.com/dialogflow-enterprise/docs/editions).
|
75
|
+
#
|
76
|
+
# You can save your agent for backup or versioning by exporting the agent by
|
77
|
+
# using the {Google::Cloud::Dialogflow::V2::Agents::ExportAgent ExportAgent} method. You can import a saved
|
78
|
+
# agent by using the {Google::Cloud::Dialogflow::V2::Agents::ImportAgent ImportAgent} method.
|
79
|
+
#
|
80
|
+
# Dialogflow provides several
|
81
|
+
# [prebuilt agents](https://dialogflow.com/docs/prebuilt-agents) for common
|
82
|
+
# conversation scenarios such as determining a date and time, converting
|
83
|
+
# currency, and so on.
|
84
|
+
#
|
85
|
+
# For more information about agents, see the
|
86
|
+
# [Dialogflow documentation](https://dialogflow.com/docs/agents).
|
87
|
+
#
|
88
|
+
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
89
|
+
# Provides the means for authenticating requests made by the client. This parameter can
|
90
|
+
# be many types.
|
91
|
+
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
92
|
+
# authenticating requests made by this client.
|
93
|
+
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
94
|
+
# credentials for this client.
|
95
|
+
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
96
|
+
# credentials for this client.
|
97
|
+
# A `GRPC::Core::Channel` will be used to make calls through.
|
98
|
+
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
99
|
+
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
100
|
+
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
101
|
+
# metadata for requests, generally, to give OAuth credentials.
|
102
|
+
# @param scopes [Array<String>]
|
103
|
+
# The OAuth scopes for this service. This parameter is ignored if
|
104
|
+
# an updater_proc is supplied.
|
105
|
+
# @param client_config [Hash]
|
106
|
+
# A Hash for call options for each method. See
|
107
|
+
# Google::Gax#construct_settings for the structure of
|
108
|
+
# this data. Falls back to the default config if not specified
|
109
|
+
# or the specified config is missing data points.
|
110
|
+
# @param timeout [Numeric]
|
111
|
+
# The default timeout, in seconds, for calls made through this client.
|
112
|
+
def self.new \
|
113
|
+
credentials: nil,
|
114
|
+
scopes: nil,
|
115
|
+
client_config: nil,
|
116
|
+
timeout: nil,
|
117
|
+
lib_name: nil,
|
118
|
+
lib_version: nil
|
119
|
+
kwargs = {
|
120
|
+
credentials: credentials,
|
121
|
+
scopes: scopes,
|
122
|
+
client_config: client_config,
|
123
|
+
timeout: timeout,
|
124
|
+
lib_name: lib_name,
|
125
|
+
lib_version: lib_version
|
126
|
+
}.select { |_, v| v != nil }
|
127
|
+
Google::Cloud::Dialogflow::V2::AgentsClient.new(**kwargs)
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
module Contexts
|
132
|
+
##
|
133
|
+
# A context represents additional information included with user input or with
|
134
|
+
# an intent returned by the Dialogflow API. Contexts are helpful for
|
135
|
+
# differentiating user input which may be vague or have a different meaning
|
136
|
+
# depending on additional details from your application such as user setting
|
137
|
+
# and preferences, previous user input, where the user is in your application,
|
138
|
+
# geographic location, and so on.
|
139
|
+
#
|
140
|
+
# You can include contexts as input parameters of a
|
141
|
+
# {Google::Cloud::Dialogflow::V2::Sessions::DetectIntent DetectIntent} (or
|
142
|
+
# {Google::Cloud::Dialogflow::V2::Sessions::StreamingDetectIntent StreamingDetectIntent}) request,
|
143
|
+
# or as output contexts included in the returned intent.
|
144
|
+
# Contexts expire when an intent is matched, after the number of +DetectIntent+
|
145
|
+
# requests specified by the +lifespan_count+ parameter, or after 10 minutes
|
146
|
+
# if no intents are matched for a +DetectIntent+ request.
|
147
|
+
#
|
148
|
+
# For more information about contexts, see the
|
149
|
+
# [Dialogflow documentation](https://dialogflow.com/docs/contexts).
|
150
|
+
#
|
151
|
+
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
152
|
+
# Provides the means for authenticating requests made by the client. This parameter can
|
153
|
+
# be many types.
|
154
|
+
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
155
|
+
# authenticating requests made by this client.
|
156
|
+
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
157
|
+
# credentials for this client.
|
158
|
+
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
159
|
+
# credentials for this client.
|
160
|
+
# A `GRPC::Core::Channel` will be used to make calls through.
|
161
|
+
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
162
|
+
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
163
|
+
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
164
|
+
# metadata for requests, generally, to give OAuth credentials.
|
165
|
+
# @param scopes [Array<String>]
|
166
|
+
# The OAuth scopes for this service. This parameter is ignored if
|
167
|
+
# an updater_proc is supplied.
|
168
|
+
# @param client_config [Hash]
|
169
|
+
# A Hash for call options for each method. See
|
170
|
+
# Google::Gax#construct_settings for the structure of
|
171
|
+
# this data. Falls back to the default config if not specified
|
172
|
+
# or the specified config is missing data points.
|
173
|
+
# @param timeout [Numeric]
|
174
|
+
# The default timeout, in seconds, for calls made through this client.
|
175
|
+
def self.new \
|
176
|
+
credentials: nil,
|
177
|
+
scopes: nil,
|
178
|
+
client_config: nil,
|
179
|
+
timeout: nil,
|
180
|
+
lib_name: nil,
|
181
|
+
lib_version: nil
|
182
|
+
kwargs = {
|
183
|
+
credentials: credentials,
|
184
|
+
scopes: scopes,
|
185
|
+
client_config: client_config,
|
186
|
+
timeout: timeout,
|
187
|
+
lib_name: lib_name,
|
188
|
+
lib_version: lib_version
|
189
|
+
}.select { |_, v| v != nil }
|
190
|
+
Google::Cloud::Dialogflow::V2::ContextsClient.new(**kwargs)
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
module EntityTypes
|
195
|
+
##
|
196
|
+
# Entities are extracted from user input and represent parameters that are
|
197
|
+
# meaningful to your application. For example, a date range, a proper name
|
198
|
+
# such as a geographic location or landmark, and so on. Entities represent
|
199
|
+
# actionable data for your application.
|
200
|
+
#
|
201
|
+
# When you define an entity, you can also include synonyms that all map to
|
202
|
+
# that entity. For example, "soft drink", "soda", "pop", and so on.
|
203
|
+
#
|
204
|
+
# There are three types of entities:
|
205
|
+
#
|
206
|
+
# * **System** - entities that are defined by the Dialogflow API for common
|
207
|
+
# data types such as date, time, currency, and so on. A system entity is
|
208
|
+
# represented by the +EntityType+ type.
|
209
|
+
#
|
210
|
+
# * **Developer** - entities that are defined by you that represent
|
211
|
+
# actionable data that is meaningful to your application. For example,
|
212
|
+
# you could define a +pizza.sauce+ entity for red or white pizza sauce,
|
213
|
+
# a +pizza.cheese+ entity for the different types of cheese on a pizza,
|
214
|
+
# a +pizza.topping+ entity for different toppings, and so on. A developer
|
215
|
+
# entity is represented by the +EntityType+ type.
|
216
|
+
#
|
217
|
+
# * **User** - entities that are built for an individual user such as
|
218
|
+
# favorites, preferences, playlists, and so on. A user entity is
|
219
|
+
# represented by the {Google::Cloud::Dialogflow::V2::SessionEntityType SessionEntityType} type.
|
220
|
+
#
|
221
|
+
# For more information about entity types, see the
|
222
|
+
# [Dialogflow documentation](https://dialogflow.com/docs/entities).
|
223
|
+
#
|
224
|
+
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
225
|
+
# Provides the means for authenticating requests made by the client. This parameter can
|
226
|
+
# be many types.
|
227
|
+
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
228
|
+
# authenticating requests made by this client.
|
229
|
+
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
230
|
+
# credentials for this client.
|
231
|
+
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
232
|
+
# credentials for this client.
|
233
|
+
# A `GRPC::Core::Channel` will be used to make calls through.
|
234
|
+
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
235
|
+
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
236
|
+
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
237
|
+
# metadata for requests, generally, to give OAuth credentials.
|
238
|
+
# @param scopes [Array<String>]
|
239
|
+
# The OAuth scopes for this service. This parameter is ignored if
|
240
|
+
# an updater_proc is supplied.
|
241
|
+
# @param client_config [Hash]
|
242
|
+
# A Hash for call options for each method. See
|
243
|
+
# Google::Gax#construct_settings for the structure of
|
244
|
+
# this data. Falls back to the default config if not specified
|
245
|
+
# or the specified config is missing data points.
|
246
|
+
# @param timeout [Numeric]
|
247
|
+
# The default timeout, in seconds, for calls made through this client.
|
248
|
+
def self.new \
|
249
|
+
credentials: nil,
|
250
|
+
scopes: nil,
|
251
|
+
client_config: nil,
|
252
|
+
timeout: nil,
|
253
|
+
lib_name: nil,
|
254
|
+
lib_version: nil
|
255
|
+
kwargs = {
|
256
|
+
credentials: credentials,
|
257
|
+
scopes: scopes,
|
258
|
+
client_config: client_config,
|
259
|
+
timeout: timeout,
|
260
|
+
lib_name: lib_name,
|
261
|
+
lib_version: lib_version
|
262
|
+
}.select { |_, v| v != nil }
|
263
|
+
Google::Cloud::Dialogflow::V2::EntityTypesClient.new(**kwargs)
|
264
|
+
end
|
265
|
+
end
|
266
|
+
|
267
|
+
module Intents
|
268
|
+
##
|
269
|
+
# An intent represents a mapping between input from a user and an action to
|
270
|
+
# be taken by your application. When you pass user input to the
|
271
|
+
# {Google::Cloud::Dialogflow::V2::Sessions::DetectIntent DetectIntent} (or
|
272
|
+
# {Google::Cloud::Dialogflow::V2::Sessions::StreamingDetectIntent StreamingDetectIntent}) method, the
|
273
|
+
# Dialogflow API analyzes the input and searches
|
274
|
+
# for a matching intent. If no match is found, the Dialogflow API returns a
|
275
|
+
# fallback intent (+is_fallback+ = true).
|
276
|
+
#
|
277
|
+
# You can provide additional information for the Dialogflow API to use to
|
278
|
+
# match user input to an intent by adding the following to your intent.
|
279
|
+
#
|
280
|
+
# * **Contexts** - provide additional context for intent analysis. For
|
281
|
+
# example, if an intent is related to an object in your application that
|
282
|
+
# plays music, you can provide a context to determine when to match the
|
283
|
+
# intent if the user input is “turn it off”. You can include a context
|
284
|
+
# that matches the intent when there is previous user input of
|
285
|
+
# "play music", and not when there is previous user input of
|
286
|
+
# "turn on the light".
|
287
|
+
#
|
288
|
+
# * **Events** - allow for matching an intent by using an event name
|
289
|
+
# instead of user input. Your application can provide an event name and
|
290
|
+
# related parameters to the Dialogflow API to match an intent. For
|
291
|
+
# example, when your application starts, you can send a welcome event
|
292
|
+
# with a user name parameter to the Dialogflow API to match an intent with
|
293
|
+
# a personalized welcome message for the user.
|
294
|
+
#
|
295
|
+
# * **Training phrases** - provide examples of user input to train the
|
296
|
+
# Dialogflow API agent to better match intents.
|
297
|
+
#
|
298
|
+
# For more information about intents, see the
|
299
|
+
# [Dialogflow documentation](https://dialogflow.com/docs/intents).
|
300
|
+
#
|
301
|
+
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
302
|
+
# Provides the means for authenticating requests made by the client. This parameter can
|
303
|
+
# be many types.
|
304
|
+
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
305
|
+
# authenticating requests made by this client.
|
306
|
+
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
307
|
+
# credentials for this client.
|
308
|
+
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
309
|
+
# credentials for this client.
|
310
|
+
# A `GRPC::Core::Channel` will be used to make calls through.
|
311
|
+
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
312
|
+
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
313
|
+
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
314
|
+
# metadata for requests, generally, to give OAuth credentials.
|
315
|
+
# @param scopes [Array<String>]
|
316
|
+
# The OAuth scopes for this service. This parameter is ignored if
|
317
|
+
# an updater_proc is supplied.
|
318
|
+
# @param client_config [Hash]
|
319
|
+
# A Hash for call options for each method. See
|
320
|
+
# Google::Gax#construct_settings for the structure of
|
321
|
+
# this data. Falls back to the default config if not specified
|
322
|
+
# or the specified config is missing data points.
|
323
|
+
# @param timeout [Numeric]
|
324
|
+
# The default timeout, in seconds, for calls made through this client.
|
325
|
+
def self.new \
|
326
|
+
credentials: nil,
|
327
|
+
scopes: nil,
|
328
|
+
client_config: nil,
|
329
|
+
timeout: nil,
|
330
|
+
lib_name: nil,
|
331
|
+
lib_version: nil
|
332
|
+
kwargs = {
|
333
|
+
credentials: credentials,
|
334
|
+
scopes: scopes,
|
335
|
+
client_config: client_config,
|
336
|
+
timeout: timeout,
|
337
|
+
lib_name: lib_name,
|
338
|
+
lib_version: lib_version
|
339
|
+
}.select { |_, v| v != nil }
|
340
|
+
Google::Cloud::Dialogflow::V2::IntentsClient.new(**kwargs)
|
341
|
+
end
|
342
|
+
end
|
343
|
+
|
344
|
+
module SessionEntityTypes
|
345
|
+
##
|
346
|
+
# Entities are extracted from user input and represent parameters that are
|
347
|
+
# meaningful to your application. For example, a date range, a proper name
|
348
|
+
# such as a geographic location or landmark, and so on. Entities represent
|
349
|
+
# actionable data for your application.
|
350
|
+
#
|
351
|
+
# Session entity types are referred to as **User** entity types and are
|
352
|
+
# entities that are built for an individual user such as
|
353
|
+
# favorites, preferences, playlists, and so on. You can redefine a session
|
354
|
+
# entity type at the session level.
|
355
|
+
#
|
356
|
+
# For more information about entity types, see the
|
357
|
+
# [Dialogflow documentation](https://dialogflow.com/docs/entities).
|
358
|
+
#
|
359
|
+
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
360
|
+
# Provides the means for authenticating requests made by the client. This parameter can
|
361
|
+
# be many types.
|
362
|
+
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
363
|
+
# authenticating requests made by this client.
|
364
|
+
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
365
|
+
# credentials for this client.
|
366
|
+
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
367
|
+
# credentials for this client.
|
368
|
+
# A `GRPC::Core::Channel` will be used to make calls through.
|
369
|
+
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
370
|
+
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
371
|
+
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
372
|
+
# metadata for requests, generally, to give OAuth credentials.
|
373
|
+
# @param scopes [Array<String>]
|
374
|
+
# The OAuth scopes for this service. This parameter is ignored if
|
375
|
+
# an updater_proc is supplied.
|
376
|
+
# @param client_config [Hash]
|
377
|
+
# A Hash for call options for each method. See
|
378
|
+
# Google::Gax#construct_settings for the structure of
|
379
|
+
# this data. Falls back to the default config if not specified
|
380
|
+
# or the specified config is missing data points.
|
381
|
+
# @param timeout [Numeric]
|
382
|
+
# The default timeout, in seconds, for calls made through this client.
|
383
|
+
def self.new \
|
384
|
+
credentials: nil,
|
385
|
+
scopes: nil,
|
386
|
+
client_config: nil,
|
387
|
+
timeout: nil,
|
388
|
+
lib_name: nil,
|
389
|
+
lib_version: nil
|
390
|
+
kwargs = {
|
391
|
+
credentials: credentials,
|
392
|
+
scopes: scopes,
|
393
|
+
client_config: client_config,
|
394
|
+
timeout: timeout,
|
395
|
+
lib_name: lib_name,
|
396
|
+
lib_version: lib_version
|
397
|
+
}.select { |_, v| v != nil }
|
398
|
+
Google::Cloud::Dialogflow::V2::SessionEntityTypesClient.new(**kwargs)
|
399
|
+
end
|
400
|
+
end
|
401
|
+
|
402
|
+
module Sessions
|
403
|
+
##
|
404
|
+
# A session represents an interaction with a user. You retrieve user input
|
405
|
+
# and pass it to the {Google::Cloud::Dialogflow::V2::Sessions::DetectIntent DetectIntent} (or
|
406
|
+
# {Google::Cloud::Dialogflow::V2::Sessions::StreamingDetectIntent StreamingDetectIntent}) method to determine
|
407
|
+
# user intent and respond.
|
408
|
+
#
|
409
|
+
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
410
|
+
# Provides the means for authenticating requests made by the client. This parameter can
|
411
|
+
# be many types.
|
412
|
+
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
413
|
+
# authenticating requests made by this client.
|
414
|
+
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
415
|
+
# credentials for this client.
|
416
|
+
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
417
|
+
# credentials for this client.
|
418
|
+
# A `GRPC::Core::Channel` will be used to make calls through.
|
419
|
+
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
420
|
+
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
421
|
+
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
422
|
+
# metadata for requests, generally, to give OAuth credentials.
|
423
|
+
# @param scopes [Array<String>]
|
424
|
+
# The OAuth scopes for this service. This parameter is ignored if
|
425
|
+
# an updater_proc is supplied.
|
426
|
+
# @param client_config [Hash]
|
427
|
+
# A Hash for call options for each method. See
|
428
|
+
# Google::Gax#construct_settings for the structure of
|
429
|
+
# this data. Falls back to the default config if not specified
|
430
|
+
# or the specified config is missing data points.
|
431
|
+
# @param timeout [Numeric]
|
432
|
+
# The default timeout, in seconds, for calls made through this client.
|
433
|
+
def self.new \
|
434
|
+
credentials: nil,
|
435
|
+
scopes: nil,
|
436
|
+
client_config: nil,
|
437
|
+
timeout: nil,
|
438
|
+
lib_name: nil,
|
439
|
+
lib_version: nil
|
440
|
+
kwargs = {
|
441
|
+
credentials: credentials,
|
442
|
+
scopes: scopes,
|
443
|
+
client_config: client_config,
|
444
|
+
timeout: timeout,
|
445
|
+
lib_name: lib_name,
|
446
|
+
lib_version: lib_version
|
447
|
+
}.select { |_, v| v != nil }
|
448
|
+
Google::Cloud::Dialogflow::V2::SessionsClient.new(**kwargs)
|
449
|
+
end
|
450
|
+
end
|
451
|
+
end
|
452
|
+
end
|
453
|
+
end
|
454
|
+
end
|