google-cloud-dialogflow 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,56 @@
|
|
1
|
+
{
|
2
|
+
"interfaces": {
|
3
|
+
"google.cloud.dialogflow.v2.Contexts": {
|
4
|
+
"retry_codes": {
|
5
|
+
"idempotent": [
|
6
|
+
"DEADLINE_EXCEEDED",
|
7
|
+
"UNAVAILABLE"
|
8
|
+
],
|
9
|
+
"non_idempotent": []
|
10
|
+
},
|
11
|
+
"retry_params": {
|
12
|
+
"default": {
|
13
|
+
"initial_retry_delay_millis": 100,
|
14
|
+
"retry_delay_multiplier": 1.3,
|
15
|
+
"max_retry_delay_millis": 60000,
|
16
|
+
"initial_rpc_timeout_millis": 20000,
|
17
|
+
"rpc_timeout_multiplier": 1.0,
|
18
|
+
"max_rpc_timeout_millis": 20000,
|
19
|
+
"total_timeout_millis": 600000
|
20
|
+
}
|
21
|
+
},
|
22
|
+
"methods": {
|
23
|
+
"ListContexts": {
|
24
|
+
"timeout_millis": 60000,
|
25
|
+
"retry_codes_name": "idempotent",
|
26
|
+
"retry_params_name": "default"
|
27
|
+
},
|
28
|
+
"GetContext": {
|
29
|
+
"timeout_millis": 60000,
|
30
|
+
"retry_codes_name": "idempotent",
|
31
|
+
"retry_params_name": "default"
|
32
|
+
},
|
33
|
+
"CreateContext": {
|
34
|
+
"timeout_millis": 60000,
|
35
|
+
"retry_codes_name": "non_idempotent",
|
36
|
+
"retry_params_name": "default"
|
37
|
+
},
|
38
|
+
"UpdateContext": {
|
39
|
+
"timeout_millis": 60000,
|
40
|
+
"retry_codes_name": "non_idempotent",
|
41
|
+
"retry_params_name": "default"
|
42
|
+
},
|
43
|
+
"DeleteContext": {
|
44
|
+
"timeout_millis": 60000,
|
45
|
+
"retry_codes_name": "idempotent",
|
46
|
+
"retry_params_name": "default"
|
47
|
+
},
|
48
|
+
"DeleteAllContexts": {
|
49
|
+
"timeout_millis": 60000,
|
50
|
+
"retry_codes_name": "idempotent",
|
51
|
+
"retry_params_name": "default"
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
@@ -0,0 +1,223 @@
|
|
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
|
+
module Google
|
16
|
+
module Cloud
|
17
|
+
module Dialogflow
|
18
|
+
##
|
19
|
+
# # Dialogflow API Contents
|
20
|
+
#
|
21
|
+
# | Class | Description |
|
22
|
+
# | ----- | ----------- |
|
23
|
+
# | [AgentsClient][] | Agents are best described as Natural Language Understanding (NLU) modules that transform user requests into actionable data. |
|
24
|
+
# | [Data Types][] | Data types for Google::Cloud::Dialogflow::V2 |
|
25
|
+
#
|
26
|
+
# [AgentsClient]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-dialogflow/latest/google/cloud/dialogflow/v2/agentsclient
|
27
|
+
# [Data Types]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-dialogflow/latest/google/cloud/dialogflow/v2/datatypes
|
28
|
+
#
|
29
|
+
module V2
|
30
|
+
# Represents a conversational agent.
|
31
|
+
# @!attribute [rw] parent
|
32
|
+
# @return [String]
|
33
|
+
# Required. The project of this agent.
|
34
|
+
# Format: +projects/<Project ID>+.
|
35
|
+
# @!attribute [rw] display_name
|
36
|
+
# @return [String]
|
37
|
+
# Required. The name of this agent.
|
38
|
+
# @!attribute [rw] default_language_code
|
39
|
+
# @return [String]
|
40
|
+
# Required. The default language of the agent as a language tag. See
|
41
|
+
# [Language Support](https://dialogflow.com/docs/reference/language) for a
|
42
|
+
# list of the currently supported language codes.
|
43
|
+
# This field cannot be set by the +Update+ method.
|
44
|
+
# @!attribute [rw] supported_language_codes
|
45
|
+
# @return [Array<String>]
|
46
|
+
# Optional. The list of all languages supported by this agent (except for the
|
47
|
+
# +default_language_code+).
|
48
|
+
# @!attribute [rw] time_zone
|
49
|
+
# @return [String]
|
50
|
+
# Required. The time zone of this agent from the
|
51
|
+
# [time zone database](https://www.iana.org/time-zones), e.g.,
|
52
|
+
# America/New_York, Europe/Paris.
|
53
|
+
# @!attribute [rw] description
|
54
|
+
# @return [String]
|
55
|
+
# Optional. The description of this agent.
|
56
|
+
# The maximum length is 500 characters. If exceeded, the request is rejected.
|
57
|
+
# @!attribute [rw] avatar_uri
|
58
|
+
# @return [String]
|
59
|
+
# Optional. The URI of the agent's avatar.
|
60
|
+
# Avatars are used throughout the Dialogflow console and in the self-hosted
|
61
|
+
# [Web Demo](https://dialogflow.com/docs/integrations/web-demo) integration.
|
62
|
+
# @!attribute [rw] enable_logging
|
63
|
+
# @return [true, false]
|
64
|
+
# Optional. Determines whether this agent should log conversation queries.
|
65
|
+
# @!attribute [rw] match_mode
|
66
|
+
# @return [Google::Cloud::Dialogflow::V2::Agent::MatchMode]
|
67
|
+
# Optional. Determines how intents are detected from user queries.
|
68
|
+
# @!attribute [rw] classification_threshold
|
69
|
+
# @return [Float]
|
70
|
+
# Optional. To filter out false positive results and still get variety in
|
71
|
+
# matched natural language inputs for your agent, you can tune the machine
|
72
|
+
# learning classification threshold. If the returned score value is less than
|
73
|
+
# the threshold value, then a fallback intent is be triggered or, if there
|
74
|
+
# are no fallback intents defined, no intent will be triggered. The score
|
75
|
+
# values range from 0.0 (completely uncertain) to 1.0 (completely certain).
|
76
|
+
# If set to 0.0, the default of 0.3 is used.
|
77
|
+
class Agent
|
78
|
+
# Match mode determines how intents are detected from user queries.
|
79
|
+
module MatchMode
|
80
|
+
# Not specified.
|
81
|
+
MATCH_MODE_UNSPECIFIED = 0
|
82
|
+
|
83
|
+
# Best for agents with a small number of examples in intents and/or wide
|
84
|
+
# use of templates syntax and composite entities.
|
85
|
+
MATCH_MODE_HYBRID = 1
|
86
|
+
|
87
|
+
# Can be used for agents with a large number of examples in intents,
|
88
|
+
# especially the ones using @sys.any or very large developer entities.
|
89
|
+
MATCH_MODE_ML_ONLY = 2
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
# The request message for {Google::Cloud::Dialogflow::V2::Agents::GetAgent Agents::GetAgent}.
|
94
|
+
# @!attribute [rw] parent
|
95
|
+
# @return [String]
|
96
|
+
# Required. The project that the agent to fetch is associated with.
|
97
|
+
# Format: +projects/<Project ID>+.
|
98
|
+
class GetAgentRequest; end
|
99
|
+
|
100
|
+
# The request message for {Google::Cloud::Dialogflow::V2::Agents::SearchAgents Agents::SearchAgents}.
|
101
|
+
# @!attribute [rw] parent
|
102
|
+
# @return [String]
|
103
|
+
# Required. The project to list agents from.
|
104
|
+
# Format: +projects/<Project ID or '-'>+.
|
105
|
+
# @!attribute [rw] page_size
|
106
|
+
# @return [Integer]
|
107
|
+
# Optional. The maximum number of items to return in a single page. By
|
108
|
+
# default 100 and at most 1000.
|
109
|
+
# @!attribute [rw] page_token
|
110
|
+
# @return [String]
|
111
|
+
# Optional. The next_page_token value returned from a previous list request.
|
112
|
+
class SearchAgentsRequest; end
|
113
|
+
|
114
|
+
# The response message for {Google::Cloud::Dialogflow::V2::Agents::SearchAgents Agents::SearchAgents}.
|
115
|
+
# @!attribute [rw] agents
|
116
|
+
# @return [Array<Google::Cloud::Dialogflow::V2::Agent>]
|
117
|
+
# The list of agents. There will be a maximum number of items returned based
|
118
|
+
# on the page_size field in the request.
|
119
|
+
# @!attribute [rw] next_page_token
|
120
|
+
# @return [String]
|
121
|
+
# Token to retrieve the next page of results, or empty if there are no
|
122
|
+
# more results in the list.
|
123
|
+
class SearchAgentsResponse; end
|
124
|
+
|
125
|
+
# The request message for {Google::Cloud::Dialogflow::V2::Agents::TrainAgent Agents::TrainAgent}.
|
126
|
+
# @!attribute [rw] parent
|
127
|
+
# @return [String]
|
128
|
+
# Required. The project that the agent to train is associated with.
|
129
|
+
# Format: +projects/<Project ID>+.
|
130
|
+
class TrainAgentRequest; end
|
131
|
+
|
132
|
+
# The request message for {Google::Cloud::Dialogflow::V2::Agents::ExportAgent Agents::ExportAgent}.
|
133
|
+
# @!attribute [rw] parent
|
134
|
+
# @return [String]
|
135
|
+
# Required. The project that the agent to export is associated with.
|
136
|
+
# Format: +projects/<Project ID>+.
|
137
|
+
# @!attribute [rw] agent_uri
|
138
|
+
# @return [String]
|
139
|
+
# Optional. The Google Cloud Storage URI to export the agent to.
|
140
|
+
# Note: The URI must start with
|
141
|
+
# "gs://". If left unspecified, the serialized agent is returned inline.
|
142
|
+
class ExportAgentRequest; end
|
143
|
+
|
144
|
+
# The response message for {Google::Cloud::Dialogflow::V2::Agents::ExportAgent Agents::ExportAgent}.
|
145
|
+
# @!attribute [rw] agent_uri
|
146
|
+
# @return [String]
|
147
|
+
# The URI to a file containing the exported agent. This field is populated
|
148
|
+
# only if +agent_uri+ is specified in +ExportAgentRequest+.
|
149
|
+
# @!attribute [rw] agent_content
|
150
|
+
# @return [String]
|
151
|
+
# The exported agent.
|
152
|
+
#
|
153
|
+
# Example for how to export an agent to a zip file via a command line:
|
154
|
+
#
|
155
|
+
# curl \
|
156
|
+
# 'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:export'\
|
157
|
+
# -X POST \
|
158
|
+
# -H 'Authorization: Bearer '$(gcloud auth print-access-token) \
|
159
|
+
# -H 'Accept: application/json' \
|
160
|
+
# -H 'Content-Type: application/json' \
|
161
|
+
# --compressed \
|
162
|
+
# --data-binary '{}' \
|
163
|
+
# | grep agentContent | sed -e 's/.*"agentContent": "\([^"]*\)".*/\1/' \
|
164
|
+
# | base64 --decode > <agent zip file>
|
165
|
+
class ExportAgentResponse; end
|
166
|
+
|
167
|
+
# The request message for {Google::Cloud::Dialogflow::V2::Agents::ImportAgent Agents::ImportAgent}.
|
168
|
+
# @!attribute [rw] parent
|
169
|
+
# @return [String]
|
170
|
+
# Required. The project that the agent to import is associated with.
|
171
|
+
# Format: +projects/<Project ID>+.
|
172
|
+
# @!attribute [rw] agent_uri
|
173
|
+
# @return [String]
|
174
|
+
# The URI to a Google Cloud Storage file containing the agent to import.
|
175
|
+
# Note: The URI must start with "gs://".
|
176
|
+
# @!attribute [rw] agent_content
|
177
|
+
# @return [String]
|
178
|
+
# The agent to import.
|
179
|
+
#
|
180
|
+
# Example for how to import an agent via the command line:
|
181
|
+
#
|
182
|
+
# curl \
|
183
|
+
# 'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:import\
|
184
|
+
# -X POST \
|
185
|
+
# -H 'Authorization: Bearer '$(gcloud auth print-access-token) \
|
186
|
+
# -H 'Accept: application/json' \
|
187
|
+
# -H 'Content-Type: application/json' \
|
188
|
+
# --compressed \
|
189
|
+
# --data-binary "{
|
190
|
+
# 'agentContent': '$(cat <agent zip file> | base64 -w 0)'
|
191
|
+
# }"
|
192
|
+
class ImportAgentRequest; end
|
193
|
+
|
194
|
+
# The request message for {Google::Cloud::Dialogflow::V2::Agents::RestoreAgent Agents::RestoreAgent}.
|
195
|
+
# @!attribute [rw] parent
|
196
|
+
# @return [String]
|
197
|
+
# Required. The project that the agent to restore is associated with.
|
198
|
+
# Format: +projects/<Project ID>+.
|
199
|
+
# @!attribute [rw] agent_uri
|
200
|
+
# @return [String]
|
201
|
+
# The URI to a Google Cloud Storage file containing the agent to restore.
|
202
|
+
# Note: The URI must start with "gs://".
|
203
|
+
# @!attribute [rw] agent_content
|
204
|
+
# @return [String]
|
205
|
+
# The agent to restore.
|
206
|
+
#
|
207
|
+
# Example for how to restore an agent via the command line:
|
208
|
+
#
|
209
|
+
# curl \
|
210
|
+
# 'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:restore\
|
211
|
+
# -X POST \
|
212
|
+
# -H 'Authorization: Bearer '$(gcloud auth print-access-token) \
|
213
|
+
# -H 'Accept: application/json' \
|
214
|
+
# -H 'Content-Type: application/json' \
|
215
|
+
# --compressed \
|
216
|
+
# --data-binary "{
|
217
|
+
# 'agentContent': '$(cat <agent zip file> | base64 -w 0)'
|
218
|
+
# }" \
|
219
|
+
class RestoreAgentRequest; end
|
220
|
+
end
|
221
|
+
end
|
222
|
+
end
|
223
|
+
end
|
@@ -0,0 +1,115 @@
|
|
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
|
+
module Google
|
16
|
+
module Cloud
|
17
|
+
module Dialogflow
|
18
|
+
##
|
19
|
+
# # Dialogflow API Contents
|
20
|
+
#
|
21
|
+
# | Class | Description |
|
22
|
+
# | ----- | ----------- |
|
23
|
+
# | [ContextsClient][] | A context represents additional information included with user input or with an intent returned by the Dialogflow API. |
|
24
|
+
# | [Data Types][] | Data types for Google::Cloud::Dialogflow::V2 |
|
25
|
+
#
|
26
|
+
# [ContextsClient]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-dialogflow/latest/google/cloud/dialogflow/v2/contextsclient
|
27
|
+
# [Data Types]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-dialogflow/latest/google/cloud/dialogflow/v2/datatypes
|
28
|
+
#
|
29
|
+
module V2
|
30
|
+
# Represents a context.
|
31
|
+
# @!attribute [rw] name
|
32
|
+
# @return [String]
|
33
|
+
# Required. The unique identifier of the context. Format:
|
34
|
+
# +projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>+.
|
35
|
+
# @!attribute [rw] lifespan_count
|
36
|
+
# @return [Integer]
|
37
|
+
# Optional. The number of conversational query requests after which the
|
38
|
+
# context expires. If set to +0+ (the default) the context expires
|
39
|
+
# immediately. Contexts expire automatically after 10 minutes even if there
|
40
|
+
# are no matching queries.
|
41
|
+
# @!attribute [rw] parameters
|
42
|
+
# @return [Google::Protobuf::Struct]
|
43
|
+
# Optional. The collection of parameters associated with this context.
|
44
|
+
# Refer to [this doc](https://dialogflow.com/docs/actions-and-parameters) for
|
45
|
+
# syntax.
|
46
|
+
class Context; end
|
47
|
+
|
48
|
+
# The request message for {Google::Cloud::Dialogflow::V2::Contexts::ListContexts Contexts::ListContexts}.
|
49
|
+
# @!attribute [rw] parent
|
50
|
+
# @return [String]
|
51
|
+
# Required. The session to list all contexts from.
|
52
|
+
# Format: +projects/<Project ID>/agent/sessions/<Session ID>+.
|
53
|
+
# @!attribute [rw] page_size
|
54
|
+
# @return [Integer]
|
55
|
+
# Optional. The maximum number of items to return in a single page. By
|
56
|
+
# default 100 and at most 1000.
|
57
|
+
# @!attribute [rw] page_token
|
58
|
+
# @return [String]
|
59
|
+
# Optional. The next_page_token value returned from a previous list request.
|
60
|
+
class ListContextsRequest; end
|
61
|
+
|
62
|
+
# The response message for {Google::Cloud::Dialogflow::V2::Contexts::ListContexts Contexts::ListContexts}.
|
63
|
+
# @!attribute [rw] contexts
|
64
|
+
# @return [Array<Google::Cloud::Dialogflow::V2::Context>]
|
65
|
+
# The list of contexts. There will be a maximum number of items
|
66
|
+
# returned based on the page_size field in the request.
|
67
|
+
# @!attribute [rw] next_page_token
|
68
|
+
# @return [String]
|
69
|
+
# Token to retrieve the next page of results, or empty if there are no
|
70
|
+
# more results in the list.
|
71
|
+
class ListContextsResponse; end
|
72
|
+
|
73
|
+
# The request message for {Google::Cloud::Dialogflow::V2::Contexts::GetContext Contexts::GetContext}.
|
74
|
+
# @!attribute [rw] name
|
75
|
+
# @return [String]
|
76
|
+
# Required. The name of the context. Format:
|
77
|
+
# +projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>+.
|
78
|
+
class GetContextRequest; end
|
79
|
+
|
80
|
+
# The request message for {Google::Cloud::Dialogflow::V2::Contexts::CreateContext Contexts::CreateContext}.
|
81
|
+
# @!attribute [rw] parent
|
82
|
+
# @return [String]
|
83
|
+
# Required. The session to create a context for.
|
84
|
+
# Format: +projects/<Project ID>/agent/sessions/<Session ID>+.
|
85
|
+
# @!attribute [rw] context
|
86
|
+
# @return [Google::Cloud::Dialogflow::V2::Context]
|
87
|
+
# Required. The context to create.
|
88
|
+
class CreateContextRequest; end
|
89
|
+
|
90
|
+
# The request message for {Google::Cloud::Dialogflow::V2::Contexts::UpdateContext Contexts::UpdateContext}.
|
91
|
+
# @!attribute [rw] context
|
92
|
+
# @return [Google::Cloud::Dialogflow::V2::Context]
|
93
|
+
# Required. The context to update.
|
94
|
+
# @!attribute [rw] update_mask
|
95
|
+
# @return [Google::Protobuf::FieldMask]
|
96
|
+
# Optional. The mask to control which fields get updated.
|
97
|
+
class UpdateContextRequest; end
|
98
|
+
|
99
|
+
# The request message for {Google::Cloud::Dialogflow::V2::Contexts::DeleteContext Contexts::DeleteContext}.
|
100
|
+
# @!attribute [rw] name
|
101
|
+
# @return [String]
|
102
|
+
# Required. The name of the context to delete. Format:
|
103
|
+
# +projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>+.
|
104
|
+
class DeleteContextRequest; end
|
105
|
+
|
106
|
+
# The request message for {Google::Cloud::Dialogflow::V2::Contexts::DeleteAllContexts Contexts::DeleteAllContexts}.
|
107
|
+
# @!attribute [rw] parent
|
108
|
+
# @return [String]
|
109
|
+
# Required. The name of the session to delete all contexts from. Format:
|
110
|
+
# +projects/<Project ID>/agent/sessions/<Session ID>+.
|
111
|
+
class DeleteAllContextsRequest; end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
@@ -0,0 +1,290 @@
|
|
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
|
+
module Google
|
16
|
+
module Cloud
|
17
|
+
module Dialogflow
|
18
|
+
##
|
19
|
+
# # Dialogflow API Contents
|
20
|
+
#
|
21
|
+
# | Class | Description |
|
22
|
+
# | ----- | ----------- |
|
23
|
+
# | [EntityTypesClient][] | Entities are extracted from user input and represent parameters that are meaningful to your application. |
|
24
|
+
# | [Data Types][] | Data types for Google::Cloud::Dialogflow::V2 |
|
25
|
+
#
|
26
|
+
# [EntityTypesClient]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-dialogflow/latest/google/cloud/dialogflow/v2/entitytypesclient
|
27
|
+
# [Data Types]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-dialogflow/latest/google/cloud/dialogflow/v2/datatypes
|
28
|
+
#
|
29
|
+
module V2
|
30
|
+
# Represents an entity type.
|
31
|
+
# Entity types serve as a tool for extracting parameter values from natural
|
32
|
+
# language queries.
|
33
|
+
# @!attribute [rw] name
|
34
|
+
# @return [String]
|
35
|
+
# Required for all methods except +create+ (+create+ populates the name
|
36
|
+
# automatically.
|
37
|
+
# The unique identifier of the entity type. Format:
|
38
|
+
# +projects/<Project ID>/agent/entityTypes/<Entity Type ID>+.
|
39
|
+
# @!attribute [rw] display_name
|
40
|
+
# @return [String]
|
41
|
+
# Required. The name of the entity.
|
42
|
+
# @!attribute [rw] kind
|
43
|
+
# @return [Google::Cloud::Dialogflow::V2::EntityType::Kind]
|
44
|
+
# Required. Indicates the kind of entity type.
|
45
|
+
# @!attribute [rw] auto_expansion_mode
|
46
|
+
# @return [Google::Cloud::Dialogflow::V2::EntityType::AutoExpansionMode]
|
47
|
+
# Optional. Indicates whether the entity type can be automatically
|
48
|
+
# expanded.
|
49
|
+
# @!attribute [rw] entities
|
50
|
+
# @return [Array<Google::Cloud::Dialogflow::V2::EntityType::Entity>]
|
51
|
+
# Optional. The collection of entities associated with the entity type.
|
52
|
+
class EntityType
|
53
|
+
# Optional. Represents an entity.
|
54
|
+
# @!attribute [rw] value
|
55
|
+
# @return [String]
|
56
|
+
# Required.
|
57
|
+
# For +KIND_MAP+ entity types:
|
58
|
+
# A canonical name to be used in place of synonyms.
|
59
|
+
# For +KIND_LIST+ entity types:
|
60
|
+
# A string that can contain references to other entity types (with or
|
61
|
+
# without aliases).
|
62
|
+
# @!attribute [rw] synonyms
|
63
|
+
# @return [Array<String>]
|
64
|
+
# Required. A collection of synonyms. For +KIND_LIST+ entity types this
|
65
|
+
# must contain exactly one synonym equal to +value+.
|
66
|
+
class Entity; end
|
67
|
+
|
68
|
+
# Represents kinds of entities.
|
69
|
+
module Kind
|
70
|
+
# Not specified. This value should be never used.
|
71
|
+
KIND_UNSPECIFIED = 0
|
72
|
+
|
73
|
+
# Map entity types allow mapping of a group of synonyms to a canonical
|
74
|
+
# value.
|
75
|
+
KIND_MAP = 1
|
76
|
+
|
77
|
+
# List entity types contain a set of entries that do not map to canonical
|
78
|
+
# values. However, list entity types can contain references to other entity
|
79
|
+
# types (with or without aliases).
|
80
|
+
KIND_LIST = 2
|
81
|
+
end
|
82
|
+
|
83
|
+
# Represents different entity type expansion modes. Automated expansion
|
84
|
+
# allows an agent to recognize values that have not been explicitly listed in
|
85
|
+
# the entity (for example, new kinds of shopping list items).
|
86
|
+
module AutoExpansionMode
|
87
|
+
# Auto expansion disabled for the entity.
|
88
|
+
AUTO_EXPANSION_MODE_UNSPECIFIED = 0
|
89
|
+
|
90
|
+
# Allows an agent to recognize values that have not been explicitly
|
91
|
+
# listed in the entity.
|
92
|
+
AUTO_EXPANSION_MODE_DEFAULT = 1
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
# The request message for {Google::Cloud::Dialogflow::V2::EntityTypes::ListEntityTypes EntityTypes::ListEntityTypes}.
|
97
|
+
# @!attribute [rw] parent
|
98
|
+
# @return [String]
|
99
|
+
# Required. The agent to list all entity types from.
|
100
|
+
# Format: +projects/<Project ID>/agent+.
|
101
|
+
# @!attribute [rw] language_code
|
102
|
+
# @return [String]
|
103
|
+
# Optional. The language to list entity synonyms for. If not specified,
|
104
|
+
# the agent's default language is used.
|
105
|
+
# [More than a dozen
|
106
|
+
# languages](https://dialogflow.com/docs/reference/language) are supported.
|
107
|
+
# Note: languages must be enabled in the agent, before they can be used.
|
108
|
+
# @!attribute [rw] page_size
|
109
|
+
# @return [Integer]
|
110
|
+
# Optional. The maximum number of items to return in a single page. By
|
111
|
+
# default 100 and at most 1000.
|
112
|
+
# @!attribute [rw] page_token
|
113
|
+
# @return [String]
|
114
|
+
# Optional. The next_page_token value returned from a previous list request.
|
115
|
+
class ListEntityTypesRequest; end
|
116
|
+
|
117
|
+
# The response message for {Google::Cloud::Dialogflow::V2::EntityTypes::ListEntityTypes EntityTypes::ListEntityTypes}.
|
118
|
+
# @!attribute [rw] entity_types
|
119
|
+
# @return [Array<Google::Cloud::Dialogflow::V2::EntityType>]
|
120
|
+
# The list of agent entity types. There will be a maximum number of items
|
121
|
+
# returned based on the page_size field in the request.
|
122
|
+
# @!attribute [rw] next_page_token
|
123
|
+
# @return [String]
|
124
|
+
# Token to retrieve the next page of results, or empty if there are no
|
125
|
+
# more results in the list.
|
126
|
+
class ListEntityTypesResponse; end
|
127
|
+
|
128
|
+
# The request message for {Google::Cloud::Dialogflow::V2::EntityTypes::GetEntityType EntityTypes::GetEntityType}.
|
129
|
+
# @!attribute [rw] name
|
130
|
+
# @return [String]
|
131
|
+
# Required. The name of the entity type.
|
132
|
+
# Format: +projects/<Project ID>/agent/entityTypes/<EntityType ID>+.
|
133
|
+
# @!attribute [rw] language_code
|
134
|
+
# @return [String]
|
135
|
+
# Optional. The language to retrieve entity synonyms for. If not specified,
|
136
|
+
# the agent's default language is used.
|
137
|
+
# [More than a dozen
|
138
|
+
# languages](https://dialogflow.com/docs/reference/language) are supported.
|
139
|
+
# Note: languages must be enabled in the agent, before they can be used.
|
140
|
+
class GetEntityTypeRequest; end
|
141
|
+
|
142
|
+
# The request message for {Google::Cloud::Dialogflow::V2::EntityTypes::CreateEntityType EntityTypes::CreateEntityType}.
|
143
|
+
# @!attribute [rw] parent
|
144
|
+
# @return [String]
|
145
|
+
# Required. The agent to create a entity type for.
|
146
|
+
# Format: +projects/<Project ID>/agent+.
|
147
|
+
# @!attribute [rw] entity_type
|
148
|
+
# @return [Google::Cloud::Dialogflow::V2::EntityType]
|
149
|
+
# Required. The entity type to create.
|
150
|
+
# @!attribute [rw] language_code
|
151
|
+
# @return [String]
|
152
|
+
# Optional. The language of entity synonyms defined in +entity_type+. If not
|
153
|
+
# specified, the agent's default language is used.
|
154
|
+
# [More than a dozen
|
155
|
+
# languages](https://dialogflow.com/docs/reference/language) are supported.
|
156
|
+
# Note: languages must be enabled in the agent, before they can be used.
|
157
|
+
class CreateEntityTypeRequest; end
|
158
|
+
|
159
|
+
# The request message for {Google::Cloud::Dialogflow::V2::EntityTypes::UpdateEntityType EntityTypes::UpdateEntityType}.
|
160
|
+
# @!attribute [rw] entity_type
|
161
|
+
# @return [Google::Cloud::Dialogflow::V2::EntityType]
|
162
|
+
# Required. The entity type to update.
|
163
|
+
# Format: +projects/<Project ID>/agent/entityTypes/<EntityType ID>+.
|
164
|
+
# @!attribute [rw] language_code
|
165
|
+
# @return [String]
|
166
|
+
# Optional. The language of entity synonyms defined in +entity_type+. If not
|
167
|
+
# specified, the agent's default language is used.
|
168
|
+
# [More than a dozen
|
169
|
+
# languages](https://dialogflow.com/docs/reference/language) are supported.
|
170
|
+
# Note: languages must be enabled in the agent, before they can be used.
|
171
|
+
# @!attribute [rw] update_mask
|
172
|
+
# @return [Google::Protobuf::FieldMask]
|
173
|
+
# Optional. The mask to control which fields get updated.
|
174
|
+
class UpdateEntityTypeRequest; end
|
175
|
+
|
176
|
+
# The request message for {Google::Cloud::Dialogflow::V2::EntityTypes::DeleteEntityType EntityTypes::DeleteEntityType}.
|
177
|
+
# @!attribute [rw] name
|
178
|
+
# @return [String]
|
179
|
+
# Required. The name of the entity type to delete.
|
180
|
+
# Format: +projects/<Project ID>/agent/entityTypes/<EntityType ID>+.
|
181
|
+
class DeleteEntityTypeRequest; end
|
182
|
+
|
183
|
+
# The request message for {Google::Cloud::Dialogflow::V2::EntityTypes::BatchUpdateEntityTypes EntityTypes::BatchUpdateEntityTypes}.
|
184
|
+
# @!attribute [rw] parent
|
185
|
+
# @return [String]
|
186
|
+
# Required. The name of the agent to update or create entity types in.
|
187
|
+
# Format: +projects/<Project ID>/agent+.
|
188
|
+
# @!attribute [rw] entity_type_batch_uri
|
189
|
+
# @return [String]
|
190
|
+
# The URI to a Google Cloud Storage file containing entity types to update
|
191
|
+
# or create. The file format can either be a serialized proto (of
|
192
|
+
# EntityBatch type) or a JSON object. Note: The URI must start with
|
193
|
+
# "gs://".
|
194
|
+
# @!attribute [rw] entity_type_batch_inline
|
195
|
+
# @return [Google::Cloud::Dialogflow::V2::EntityTypeBatch]
|
196
|
+
# The collection of entity type to update or create.
|
197
|
+
# @!attribute [rw] language_code
|
198
|
+
# @return [String]
|
199
|
+
# Optional. The language of entity synonyms defined in +entity_types+. If not
|
200
|
+
# specified, the agent's default language is used.
|
201
|
+
# [More than a dozen
|
202
|
+
# languages](https://dialogflow.com/docs/reference/language) are supported.
|
203
|
+
# Note: languages must be enabled in the agent, before they can be used.
|
204
|
+
# @!attribute [rw] update_mask
|
205
|
+
# @return [Google::Protobuf::FieldMask]
|
206
|
+
# Optional. The mask to control which fields get updated.
|
207
|
+
class BatchUpdateEntityTypesRequest; end
|
208
|
+
|
209
|
+
# The response message for {Google::Cloud::Dialogflow::V2::EntityTypes::BatchUpdateEntityTypes EntityTypes::BatchUpdateEntityTypes}.
|
210
|
+
# @!attribute [rw] entity_types
|
211
|
+
# @return [Array<Google::Cloud::Dialogflow::V2::EntityType>]
|
212
|
+
# The collection of updated or created entity types.
|
213
|
+
class BatchUpdateEntityTypesResponse; end
|
214
|
+
|
215
|
+
# The request message for {Google::Cloud::Dialogflow::V2::EntityTypes::BatchDeleteEntityTypes EntityTypes::BatchDeleteEntityTypes}.
|
216
|
+
# @!attribute [rw] parent
|
217
|
+
# @return [String]
|
218
|
+
# Required. The name of the agent to delete all entities types for. Format:
|
219
|
+
# +projects/<Project ID>/agent+.
|
220
|
+
# @!attribute [rw] entity_type_names
|
221
|
+
# @return [Array<String>]
|
222
|
+
# Required. The names entity types to delete. All names must point to the
|
223
|
+
# same agent as +parent+.
|
224
|
+
class BatchDeleteEntityTypesRequest; end
|
225
|
+
|
226
|
+
# The request message for {Google::Cloud::Dialogflow::V2::EntityTypes::BatchCreateEntities EntityTypes::BatchCreateEntities}.
|
227
|
+
# @!attribute [rw] parent
|
228
|
+
# @return [String]
|
229
|
+
# Required. The name of the entity type to create entities in. Format:
|
230
|
+
# +projects/<Project ID>/agent/entityTypes/<Entity Type ID>+.
|
231
|
+
# @!attribute [rw] entities
|
232
|
+
# @return [Array<Google::Cloud::Dialogflow::V2::EntityType::Entity>]
|
233
|
+
# Required. The collection of entities to create.
|
234
|
+
# @!attribute [rw] language_code
|
235
|
+
# @return [String]
|
236
|
+
# Optional. The language of entity synonyms defined in +entities+. If not
|
237
|
+
# specified, the agent's default language is used.
|
238
|
+
# [More than a dozen
|
239
|
+
# languages](https://dialogflow.com/docs/reference/language) are supported.
|
240
|
+
# Note: languages must be enabled in the agent, before they can be used.
|
241
|
+
class BatchCreateEntitiesRequest; end
|
242
|
+
|
243
|
+
# The response message for {Google::Cloud::Dialogflow::V2::EntityTypes::BatchCreateEntities EntityTypes::BatchCreateEntities}.
|
244
|
+
# @!attribute [rw] parent
|
245
|
+
# @return [String]
|
246
|
+
# Required. The name of the entity type to update the entities in. Format:
|
247
|
+
# +projects/<Project ID>/agent/entityTypes/<Entity Type ID>+.
|
248
|
+
# @!attribute [rw] entities
|
249
|
+
# @return [Array<Google::Cloud::Dialogflow::V2::EntityType::Entity>]
|
250
|
+
# Required. The collection of new entities to replace the existing entities.
|
251
|
+
# @!attribute [rw] language_code
|
252
|
+
# @return [String]
|
253
|
+
# Optional. The language of entity synonyms defined in +entities+. If not
|
254
|
+
# specified, the agent's default language is used.
|
255
|
+
# [More than a dozen
|
256
|
+
# languages](https://dialogflow.com/docs/reference/language) are supported.
|
257
|
+
# Note: languages must be enabled in the agent, before they can be used.
|
258
|
+
# @!attribute [rw] update_mask
|
259
|
+
# @return [Google::Protobuf::FieldMask]
|
260
|
+
# Optional. The mask to control which fields get updated.
|
261
|
+
class BatchUpdateEntitiesRequest; end
|
262
|
+
|
263
|
+
# The request message for {Google::Cloud::Dialogflow::V2::EntityTypes::BatchDeleteEntities EntityTypes::BatchDeleteEntities}.
|
264
|
+
# @!attribute [rw] parent
|
265
|
+
# @return [String]
|
266
|
+
# Required. The name of the entity type to delete entries for. Format:
|
267
|
+
# +projects/<Project ID>/agent/entityTypes/<Entity Type ID>+.
|
268
|
+
# @!attribute [rw] entity_values
|
269
|
+
# @return [Array<String>]
|
270
|
+
# Required. The canonical +values+ of the entities to delete. Note that
|
271
|
+
# these are not fully-qualified names, i.e. they don't start with
|
272
|
+
# +projects/<Project ID>+.
|
273
|
+
# @!attribute [rw] language_code
|
274
|
+
# @return [String]
|
275
|
+
# Optional. The language of entity synonyms defined in +entities+. If not
|
276
|
+
# specified, the agent's default language is used.
|
277
|
+
# [More than a dozen
|
278
|
+
# languages](https://dialogflow.com/docs/reference/language) are supported.
|
279
|
+
# Note: languages must be enabled in the agent, before they can be used.
|
280
|
+
class BatchDeleteEntitiesRequest; end
|
281
|
+
|
282
|
+
# This message is a wrapper around a collection of entity types.
|
283
|
+
# @!attribute [rw] entity_types
|
284
|
+
# @return [Array<Google::Cloud::Dialogflow::V2::EntityType>]
|
285
|
+
# A collection of entity types.
|
286
|
+
class EntityTypeBatch; end
|
287
|
+
end
|
288
|
+
end
|
289
|
+
end
|
290
|
+
end
|