google-cloud-dialogflow-v2 0.6.4 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.md +188 -190
- data/README.md +66 -2
- data/lib/google/cloud/dialogflow/v2.rb +13 -2
- data/lib/google/cloud/dialogflow/v2/agent_services_pb.rb +26 -15
- data/lib/google/cloud/dialogflow/v2/agents/client.rb +40 -23
- data/lib/google/cloud/dialogflow/v2/agents/operations.rb +96 -11
- data/lib/google/cloud/dialogflow/v2/agents/paths.rb +42 -3
- data/lib/google/cloud/dialogflow/v2/answer_record_pb.rb +100 -0
- data/lib/google/cloud/dialogflow/v2/answer_record_services_pb.rb +48 -0
- data/lib/google/cloud/dialogflow/v2/answer_records.rb +49 -0
- data/lib/google/cloud/dialogflow/v2/answer_records/client.rb +478 -0
- data/lib/google/cloud/dialogflow/v2/answer_records/credentials.rb +52 -0
- data/lib/google/cloud/dialogflow/v2/answer_records/paths.rb +105 -0
- data/lib/google/cloud/dialogflow/v2/audio_config_pb.rb +7 -0
- data/lib/google/cloud/dialogflow/v2/context_services_pb.rb +8 -25
- data/lib/google/cloud/dialogflow/v2/contexts.rb +1 -18
- data/lib/google/cloud/dialogflow/v2/contexts/client.rb +22 -33
- data/lib/google/cloud/dialogflow/v2/contexts/paths.rb +74 -2
- data/lib/google/cloud/dialogflow/v2/conversation_event_pb.rb +39 -0
- data/lib/google/cloud/dialogflow/v2/conversation_pb.rb +89 -0
- data/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb +182 -0
- data/lib/google/cloud/dialogflow/v2/conversation_profile_services_pb.rb +61 -0
- data/lib/google/cloud/dialogflow/v2/conversation_profiles.rb +49 -0
- data/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb +699 -0
- data/lib/google/cloud/dialogflow/v2/conversation_profiles/credentials.rb +52 -0
- data/lib/google/cloud/dialogflow/v2/conversation_profiles/paths.rb +246 -0
- data/lib/google/cloud/dialogflow/v2/conversation_services_pb.rb +75 -0
- data/lib/google/cloud/dialogflow/v2/conversations.rb +49 -0
- data/lib/google/cloud/dialogflow/v2/conversations/client.rb +757 -0
- data/lib/google/cloud/dialogflow/v2/conversations/credentials.rb +52 -0
- data/lib/google/cloud/dialogflow/v2/conversations/paths.rb +146 -0
- data/lib/google/cloud/dialogflow/v2/document_pb.rb +99 -0
- data/lib/google/cloud/dialogflow/v2/document_services_pb.rb +73 -0
- data/lib/google/cloud/dialogflow/v2/documents.rb +50 -0
- data/lib/google/cloud/dialogflow/v2/documents/client.rb +810 -0
- data/lib/google/cloud/dialogflow/v2/documents/credentials.rb +52 -0
- data/lib/google/cloud/dialogflow/v2/documents/operations.rb +655 -0
- data/lib/google/cloud/dialogflow/v2/documents/paths.rb +119 -0
- data/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb +40 -46
- data/lib/google/cloud/dialogflow/v2/entity_types.rb +1 -28
- data/lib/google/cloud/dialogflow/v2/entity_types/client.rb +54 -54
- data/lib/google/cloud/dialogflow/v2/entity_types/operations.rb +96 -11
- data/lib/google/cloud/dialogflow/v2/entity_types/paths.rb +58 -12
- data/lib/google/cloud/dialogflow/v2/environment_pb.rb +50 -1
- data/lib/google/cloud/dialogflow/v2/environment_services_pb.rb +24 -3
- data/lib/google/cloud/dialogflow/v2/environments.rb +1 -1
- data/lib/google/cloud/dialogflow/v2/environments/client.rb +428 -12
- data/lib/google/cloud/dialogflow/v2/environments/paths.rb +145 -5
- data/lib/google/cloud/dialogflow/v2/fulfillment_pb.rb +59 -0
- data/lib/google/cloud/dialogflow/v2/fulfillment_services_pb.rb +47 -0
- data/lib/google/cloud/dialogflow/v2/fulfillments.rb +49 -0
- data/lib/google/cloud/dialogflow/v2/fulfillments/client.rb +460 -0
- data/lib/google/cloud/dialogflow/v2/fulfillments/credentials.rb +52 -0
- data/lib/google/cloud/dialogflow/v2/fulfillments/paths.rb +69 -0
- data/lib/google/cloud/dialogflow/v2/gcs_pb.rb +20 -0
- data/lib/google/cloud/dialogflow/v2/human_agent_assistant_event_pb.rb +26 -0
- data/lib/google/cloud/dialogflow/v2/intent_pb.rb +2 -0
- data/lib/google/cloud/dialogflow/v2/intent_services_pb.rb +29 -42
- data/lib/google/cloud/dialogflow/v2/intents.rb +1 -32
- data/lib/google/cloud/dialogflow/v2/intents/client.rb +52 -51
- data/lib/google/cloud/dialogflow/v2/intents/operations.rb +96 -11
- data/lib/google/cloud/dialogflow/v2/intents/paths.rb +97 -13
- data/lib/google/cloud/dialogflow/v2/knowledge_base_pb.rb +60 -0
- data/lib/google/cloud/dialogflow/v2/knowledge_base_services_pb.rb +53 -0
- data/lib/google/cloud/dialogflow/v2/knowledge_bases.rb +49 -0
- data/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb +696 -0
- data/lib/google/cloud/dialogflow/v2/knowledge_bases/credentials.rb +52 -0
- data/lib/google/cloud/dialogflow/v2/knowledge_bases/paths.rb +105 -0
- data/lib/google/cloud/dialogflow/v2/participant_pb.rb +181 -0
- data/lib/google/cloud/dialogflow/v2/participant_services_pb.rb +64 -0
- data/lib/google/cloud/dialogflow/v2/participants.rb +49 -0
- data/lib/google/cloud/dialogflow/v2/participants/client.rb +894 -0
- data/lib/google/cloud/dialogflow/v2/participants/credentials.rb +52 -0
- data/lib/google/cloud/dialogflow/v2/participants/paths.rb +334 -0
- data/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb +7 -23
- data/lib/google/cloud/dialogflow/v2/session_entity_types.rb +1 -17
- data/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb +21 -31
- data/lib/google/cloud/dialogflow/v2/session_entity_types/paths.rb +74 -2
- data/lib/google/cloud/dialogflow/v2/session_pb.rb +2 -0
- data/lib/google/cloud/dialogflow/v2/session_services_pb.rb +15 -7
- data/lib/google/cloud/dialogflow/v2/sessions.rb +4 -4
- data/lib/google/cloud/dialogflow/v2/sessions/client.rb +43 -21
- data/lib/google/cloud/dialogflow/v2/sessions/paths.rb +113 -3
- data/lib/google/cloud/dialogflow/v2/version.rb +1 -1
- data/lib/google/cloud/dialogflow/v2/version_pb.rb +69 -0
- data/lib/google/cloud/dialogflow/v2/version_services_pb.rb +59 -0
- data/lib/google/cloud/dialogflow/v2/versions.rb +49 -0
- data/lib/google/cloud/dialogflow/v2/versions/client.rb +709 -0
- data/lib/google/cloud/dialogflow/v2/versions/credentials.rb +52 -0
- data/lib/google/cloud/dialogflow/v2/versions/paths.rb +110 -0
- data/proto_docs/google/api/field_behavior.rb +6 -0
- data/proto_docs/google/api/resource.rb +50 -14
- data/proto_docs/google/cloud/dialogflow/v2/agent.rb +1 -2
- data/proto_docs/google/cloud/dialogflow/v2/answer_record.rb +252 -0
- data/proto_docs/google/cloud/dialogflow/v2/audio_config.rb +25 -0
- data/proto_docs/google/cloud/dialogflow/v2/context.rb +17 -2
- data/proto_docs/google/cloud/dialogflow/v2/conversation.rb +253 -0
- data/proto_docs/google/cloud/dialogflow/v2/conversation_event.rb +83 -0
- data/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb +522 -0
- data/proto_docs/google/cloud/dialogflow/v2/document.rb +267 -0
- data/proto_docs/google/cloud/dialogflow/v2/entity_type.rb +12 -3
- data/proto_docs/google/cloud/dialogflow/v2/environment.rb +188 -6
- data/proto_docs/google/cloud/dialogflow/v2/fulfillment.rb +144 -0
- data/proto_docs/google/cloud/dialogflow/v2/human_agent_assistant_event.rb +45 -0
- data/proto_docs/google/cloud/dialogflow/v2/intent.rb +29 -4
- data/proto_docs/google/cloud/dialogflow/v2/knowledge_base.rb +139 -0
- data/proto_docs/google/cloud/dialogflow/v2/participant.rb +525 -0
- data/proto_docs/google/cloud/dialogflow/v2/session.rb +56 -7
- data/proto_docs/google/cloud/dialogflow/v2/session_entity_type.rb +7 -6
- data/proto_docs/google/cloud/dialogflow/v2/validation_result.rb +1 -1
- data/proto_docs/google/cloud/dialogflow/v2/version.rb +176 -0
- data/proto_docs/google/cloud/dialogflow/v2/webhook.rb +2 -2
- data/proto_docs/google/longrunning/operations.rb +17 -3
- data/proto_docs/google/protobuf/any.rb +5 -2
- data/proto_docs/google/protobuf/timestamp.rb +10 -1
- data/proto_docs/google/type/latlng.rb +2 -2
- metadata +81 -11
@@ -31,23 +31,7 @@ module Google
|
|
31
31
|
module Dialogflow
|
32
32
|
module V2
|
33
33
|
##
|
34
|
-
#
|
35
|
-
# meaningful to your application. For example, a date range, a proper name
|
36
|
-
# such as a geographic location or landmark, and so on. Entities represent
|
37
|
-
# actionable data for your application.
|
38
|
-
#
|
39
|
-
# Session entity types are referred to as **User** entity types and are
|
40
|
-
# entities that are built for an individual user such as
|
41
|
-
# favorites, preferences, playlists, and so on. You can redefine a session
|
42
|
-
# entity type at the session level.
|
43
|
-
#
|
44
|
-
# Session entity methods do not work with Google Assistant integration.
|
45
|
-
# Contact Dialogflow support if you need to use session entities
|
46
|
-
# with Google Assistant integration.
|
47
|
-
#
|
48
|
-
# For more information about entity types, see the
|
49
|
-
# [Dialogflow
|
50
|
-
# documentation](https://cloud.google.com/dialogflow/docs/entities-overview).
|
34
|
+
# Service for managing {::Google::Cloud::Dialogflow::V2::SessionEntityType SessionEntityTypes}.
|
51
35
|
#
|
52
36
|
# To load this service and instantiate a client:
|
53
37
|
#
|
@@ -27,23 +27,7 @@ module Google
|
|
27
27
|
##
|
28
28
|
# Client for the SessionEntityTypes service.
|
29
29
|
#
|
30
|
-
#
|
31
|
-
# meaningful to your application. For example, a date range, a proper name
|
32
|
-
# such as a geographic location or landmark, and so on. Entities represent
|
33
|
-
# actionable data for your application.
|
34
|
-
#
|
35
|
-
# Session entity types are referred to as **User** entity types and are
|
36
|
-
# entities that are built for an individual user such as
|
37
|
-
# favorites, preferences, playlists, and so on. You can redefine a session
|
38
|
-
# entity type at the session level.
|
39
|
-
#
|
40
|
-
# Session entity methods do not work with Google Assistant integration.
|
41
|
-
# Contact Dialogflow support if you need to use session entities
|
42
|
-
# with Google Assistant integration.
|
43
|
-
#
|
44
|
-
# For more information about entity types, see the
|
45
|
-
# [Dialogflow
|
46
|
-
# documentation](https://cloud.google.com/dialogflow/docs/entities-overview).
|
30
|
+
# Service for managing {::Google::Cloud::Dialogflow::V2::SessionEntityType SessionEntityTypes}.
|
47
31
|
#
|
48
32
|
class Client
|
49
33
|
include Paths
|
@@ -76,7 +60,7 @@ module Google
|
|
76
60
|
parent_config = while namespace.any?
|
77
61
|
parent_name = namespace.join "::"
|
78
62
|
parent_const = const_get parent_name
|
79
|
-
break parent_const.configure if parent_const
|
63
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
80
64
|
namespace.pop
|
81
65
|
end
|
82
66
|
default_config = Client::Configuration.new parent_config
|
@@ -84,9 +68,9 @@ module Google
|
|
84
68
|
default_config.timeout = 60.0
|
85
69
|
default_config.retry_policy = {
|
86
70
|
initial_delay: 0.1,
|
87
|
-
|
88
|
-
|
89
|
-
|
71
|
+
max_delay: 60.0,
|
72
|
+
multiplier: 1.3,
|
73
|
+
retry_codes: [14]
|
90
74
|
}
|
91
75
|
|
92
76
|
default_config
|
@@ -150,7 +134,13 @@ module Google
|
|
150
134
|
|
151
135
|
# Create credentials
|
152
136
|
credentials = @config.credentials
|
153
|
-
|
137
|
+
# Use self-signed JWT if the scope and endpoint are unchanged from default,
|
138
|
+
# but only if the default endpoint does not have a region prefix.
|
139
|
+
enable_self_signed_jwt = @config.scope == Client.configure.scope &&
|
140
|
+
@config.endpoint == Client.configure.endpoint &&
|
141
|
+
!@config.endpoint.split(".").first.include?("-")
|
142
|
+
credentials ||= Credentials.default scope: @config.scope,
|
143
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
154
144
|
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
155
145
|
credentials = Credentials.new credentials, scope: @config.scope
|
156
146
|
end
|
@@ -638,14 +628,14 @@ module Google
|
|
638
628
|
|
639
629
|
config_attr :endpoint, "dialogflow.googleapis.com", ::String
|
640
630
|
config_attr :credentials, nil do |value|
|
641
|
-
allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
631
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
642
632
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
643
633
|
allowed.any? { |klass| klass === value }
|
644
634
|
end
|
645
635
|
config_attr :scope, nil, ::String, ::Array, nil
|
646
636
|
config_attr :lib_name, nil, ::String, nil
|
647
637
|
config_attr :lib_version, nil, ::String, nil
|
648
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
638
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
649
639
|
config_attr :interceptors, nil, ::Array, nil
|
650
640
|
config_attr :timeout, nil, ::Numeric, nil
|
651
641
|
config_attr :metadata, nil, ::Hash, nil
|
@@ -666,7 +656,7 @@ module Google
|
|
666
656
|
def rpcs
|
667
657
|
@rpcs ||= begin
|
668
658
|
parent_rpcs = nil
|
669
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config
|
659
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
670
660
|
Rpcs.new parent_rpcs
|
671
661
|
end
|
672
662
|
end
|
@@ -678,7 +668,7 @@ module Google
|
|
678
668
|
# Each configuration object is of type `Gapic::Config::Method` and includes
|
679
669
|
# the following configuration fields:
|
680
670
|
#
|
681
|
-
# * `timeout` (*type:* `Numeric`) - The call timeout in
|
671
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
682
672
|
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
683
673
|
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
684
674
|
# include the following keys:
|
@@ -717,15 +707,15 @@ module Google
|
|
717
707
|
|
718
708
|
# @private
|
719
709
|
def initialize parent_rpcs = nil
|
720
|
-
list_session_entity_types_config = parent_rpcs
|
710
|
+
list_session_entity_types_config = parent_rpcs.list_session_entity_types if parent_rpcs.respond_to? :list_session_entity_types
|
721
711
|
@list_session_entity_types = ::Gapic::Config::Method.new list_session_entity_types_config
|
722
|
-
get_session_entity_type_config = parent_rpcs
|
712
|
+
get_session_entity_type_config = parent_rpcs.get_session_entity_type if parent_rpcs.respond_to? :get_session_entity_type
|
723
713
|
@get_session_entity_type = ::Gapic::Config::Method.new get_session_entity_type_config
|
724
|
-
create_session_entity_type_config = parent_rpcs
|
714
|
+
create_session_entity_type_config = parent_rpcs.create_session_entity_type if parent_rpcs.respond_to? :create_session_entity_type
|
725
715
|
@create_session_entity_type = ::Gapic::Config::Method.new create_session_entity_type_config
|
726
|
-
update_session_entity_type_config = parent_rpcs
|
716
|
+
update_session_entity_type_config = parent_rpcs.update_session_entity_type if parent_rpcs.respond_to? :update_session_entity_type
|
727
717
|
@update_session_entity_type = ::Gapic::Config::Method.new update_session_entity_type_config
|
728
|
-
delete_session_entity_type_config = parent_rpcs
|
718
|
+
delete_session_entity_type_config = parent_rpcs.delete_session_entity_type if parent_rpcs.respond_to? :delete_session_entity_type
|
729
719
|
@delete_session_entity_type = ::Gapic::Config::Method.new delete_session_entity_type_config
|
730
720
|
|
731
721
|
yield self if block_given?
|
@@ -45,10 +45,30 @@ module Google
|
|
45
45
|
# @param user [String]
|
46
46
|
# @param session [String]
|
47
47
|
#
|
48
|
+
# @overload session_path(project:, location:, session:)
|
49
|
+
# The resource will be in the following format:
|
50
|
+
#
|
51
|
+
# `projects/{project}/locations/{location}/agent/sessions/{session}`
|
52
|
+
#
|
53
|
+
# @param project [String]
|
54
|
+
# @param location [String]
|
55
|
+
# @param session [String]
|
56
|
+
#
|
57
|
+
# @overload session_path(project:, location:, environment:, user:, session:)
|
58
|
+
# The resource will be in the following format:
|
59
|
+
#
|
60
|
+
# `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}`
|
61
|
+
#
|
62
|
+
# @param project [String]
|
63
|
+
# @param location [String]
|
64
|
+
# @param environment [String]
|
65
|
+
# @param user [String]
|
66
|
+
# @param session [String]
|
67
|
+
#
|
48
68
|
# @return [::String]
|
49
69
|
def session_path **args
|
50
70
|
resources = {
|
51
|
-
"project:session"
|
71
|
+
"project:session" => (proc do |project:, session:|
|
52
72
|
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
53
73
|
|
54
74
|
"projects/#{project}/agent/sessions/#{session}"
|
@@ -59,6 +79,20 @@ module Google
|
|
59
79
|
raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/"
|
60
80
|
|
61
81
|
"projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}"
|
82
|
+
end),
|
83
|
+
"location:project:session" => (proc do |project:, location:, session:|
|
84
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
85
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
86
|
+
|
87
|
+
"projects/#{project}/locations/#{location}/agent/sessions/#{session}"
|
88
|
+
end),
|
89
|
+
"environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:|
|
90
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
91
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
92
|
+
raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/"
|
93
|
+
raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/"
|
94
|
+
|
95
|
+
"projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/sessions/#{session}"
|
62
96
|
end)
|
63
97
|
}
|
64
98
|
|
@@ -90,10 +124,32 @@ module Google
|
|
90
124
|
# @param session [String]
|
91
125
|
# @param entity_type [String]
|
92
126
|
#
|
127
|
+
# @overload session_entity_type_path(project:, location:, session:, entity_type:)
|
128
|
+
# The resource will be in the following format:
|
129
|
+
#
|
130
|
+
# `projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}`
|
131
|
+
#
|
132
|
+
# @param project [String]
|
133
|
+
# @param location [String]
|
134
|
+
# @param session [String]
|
135
|
+
# @param entity_type [String]
|
136
|
+
#
|
137
|
+
# @overload session_entity_type_path(project:, location:, environment:, user:, session:, entity_type:)
|
138
|
+
# The resource will be in the following format:
|
139
|
+
#
|
140
|
+
# `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}`
|
141
|
+
#
|
142
|
+
# @param project [String]
|
143
|
+
# @param location [String]
|
144
|
+
# @param environment [String]
|
145
|
+
# @param user [String]
|
146
|
+
# @param session [String]
|
147
|
+
# @param entity_type [String]
|
148
|
+
#
|
93
149
|
# @return [::String]
|
94
150
|
def session_entity_type_path **args
|
95
151
|
resources = {
|
96
|
-
"entity_type:project:session"
|
152
|
+
"entity_type:project:session" => (proc do |project:, session:, entity_type:|
|
97
153
|
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
98
154
|
raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"
|
99
155
|
|
@@ -106,6 +162,22 @@ module Google
|
|
106
162
|
raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"
|
107
163
|
|
108
164
|
"projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/entityTypes/#{entity_type}"
|
165
|
+
end),
|
166
|
+
"entity_type:location:project:session" => (proc do |project:, location:, session:, entity_type:|
|
167
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
168
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
169
|
+
raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"
|
170
|
+
|
171
|
+
"projects/#{project}/locations/#{location}/agent/sessions/#{session}/entityTypes/#{entity_type}"
|
172
|
+
end),
|
173
|
+
"entity_type:environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:, entity_type:|
|
174
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
175
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
176
|
+
raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/"
|
177
|
+
raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/"
|
178
|
+
raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"
|
179
|
+
|
180
|
+
"projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/entityTypes/#{entity_type}"
|
109
181
|
end)
|
110
182
|
}
|
111
183
|
|
@@ -41,6 +41,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
41
41
|
repeated :session_entity_types, :message, 5, "google.cloud.dialogflow.v2.SessionEntityType"
|
42
42
|
optional :payload, :message, 6, "google.protobuf.Struct"
|
43
43
|
optional :sentiment_analysis_request_config, :message, 10, "google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig"
|
44
|
+
map :webhook_headers, :string, :string, 14
|
44
45
|
end
|
45
46
|
add_message "google.cloud.dialogflow.v2.QueryInput" do
|
46
47
|
oneof :input do
|
@@ -56,6 +57,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
56
57
|
optional :action, :string, 3
|
57
58
|
optional :parameters, :message, 4, "google.protobuf.Struct"
|
58
59
|
optional :all_required_params_present, :bool, 5
|
60
|
+
optional :cancels_slot_filling, :bool, 21
|
59
61
|
optional :fulfillment_text, :string, 6
|
60
62
|
repeated :fulfillment_messages, :message, 7, "google.cloud.dialogflow.v2.Intent.Message"
|
61
63
|
optional :webhook_source, :string, 8
|
@@ -24,13 +24,13 @@ module Google
|
|
24
24
|
module Dialogflow
|
25
25
|
module V2
|
26
26
|
module Sessions
|
27
|
-
# A
|
28
|
-
#
|
29
|
-
#
|
30
|
-
#
|
27
|
+
# A service used for session interactions.
|
28
|
+
#
|
29
|
+
# For more information, see the [API interactions
|
30
|
+
# guide](https://cloud.google.com/dialogflow/docs/api-overview).
|
31
31
|
class Service
|
32
32
|
|
33
|
-
include GRPC::GenericService
|
33
|
+
include ::GRPC::GenericService
|
34
34
|
|
35
35
|
self.marshal_class_method = :encode
|
36
36
|
self.unmarshal_class_method = :decode
|
@@ -40,11 +40,19 @@ module Google
|
|
40
40
|
# as a result. This method is not idempotent, because it may cause contexts
|
41
41
|
# and session entity types to be updated, which in turn might affect
|
42
42
|
# results of future queries.
|
43
|
-
|
43
|
+
#
|
44
|
+
# Note: Always use agent versions for production traffic.
|
45
|
+
# See [Versions and
|
46
|
+
# environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
|
47
|
+
rpc :DetectIntent, ::Google::Cloud::Dialogflow::V2::DetectIntentRequest, ::Google::Cloud::Dialogflow::V2::DetectIntentResponse
|
44
48
|
# Processes a natural language query in audio format in a streaming fashion
|
45
49
|
# and returns structured, actionable data as a result. This method is only
|
46
50
|
# available via the gRPC API (not REST).
|
47
|
-
|
51
|
+
#
|
52
|
+
# Note: Always use agent versions for production traffic.
|
53
|
+
# See [Versions and
|
54
|
+
# environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
|
55
|
+
rpc :StreamingDetectIntent, stream(::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest), stream(::Google::Cloud::Dialogflow::V2::StreamingDetectIntentResponse)
|
48
56
|
end
|
49
57
|
|
50
58
|
Stub = Service.rpc_stub_class
|
@@ -31,10 +31,10 @@ module Google
|
|
31
31
|
module Dialogflow
|
32
32
|
module V2
|
33
33
|
##
|
34
|
-
# A
|
35
|
-
#
|
36
|
-
#
|
37
|
-
#
|
34
|
+
# A service used for session interactions.
|
35
|
+
#
|
36
|
+
# For more information, see the [API interactions
|
37
|
+
# guide](https://cloud.google.com/dialogflow/docs/api-overview).
|
38
38
|
#
|
39
39
|
# To load this service and instantiate a client:
|
40
40
|
#
|
@@ -27,10 +27,10 @@ module Google
|
|
27
27
|
##
|
28
28
|
# Client for the Sessions service.
|
29
29
|
#
|
30
|
-
# A
|
31
|
-
#
|
32
|
-
#
|
33
|
-
#
|
30
|
+
# A service used for session interactions.
|
31
|
+
#
|
32
|
+
# For more information, see the [API interactions
|
33
|
+
# guide](https://cloud.google.com/dialogflow/docs/api-overview).
|
34
34
|
#
|
35
35
|
class Client
|
36
36
|
include Paths
|
@@ -63,7 +63,7 @@ module Google
|
|
63
63
|
parent_config = while namespace.any?
|
64
64
|
parent_name = namespace.join "::"
|
65
65
|
parent_const = const_get parent_name
|
66
|
-
break parent_const.configure if parent_const
|
66
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
67
67
|
namespace.pop
|
68
68
|
end
|
69
69
|
default_config = Client::Configuration.new parent_config
|
@@ -71,17 +71,17 @@ module Google
|
|
71
71
|
default_config.timeout = 60.0
|
72
72
|
default_config.retry_policy = {
|
73
73
|
initial_delay: 0.1,
|
74
|
-
|
75
|
-
|
76
|
-
|
74
|
+
max_delay: 60.0,
|
75
|
+
multiplier: 1.3,
|
76
|
+
retry_codes: [14]
|
77
77
|
}
|
78
78
|
|
79
79
|
default_config.rpcs.detect_intent.timeout = 220.0
|
80
80
|
default_config.rpcs.detect_intent.retry_policy = {
|
81
81
|
initial_delay: 0.1,
|
82
|
-
|
83
|
-
|
84
|
-
|
82
|
+
max_delay: 60.0,
|
83
|
+
multiplier: 1.3,
|
84
|
+
retry_codes: [14]
|
85
85
|
}
|
86
86
|
|
87
87
|
default_config.rpcs.streaming_detect_intent.timeout = 220.0
|
@@ -147,7 +147,13 @@ module Google
|
|
147
147
|
|
148
148
|
# Create credentials
|
149
149
|
credentials = @config.credentials
|
150
|
-
|
150
|
+
# Use self-signed JWT if the scope and endpoint are unchanged from default,
|
151
|
+
# but only if the default endpoint does not have a region prefix.
|
152
|
+
enable_self_signed_jwt = @config.scope == Client.configure.scope &&
|
153
|
+
@config.endpoint == Client.configure.endpoint &&
|
154
|
+
!@config.endpoint.split(".").first.include?("-")
|
155
|
+
credentials ||= Credentials.default scope: @config.scope,
|
156
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
151
157
|
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
152
158
|
credentials = Credentials.new credentials, scope: @config.scope
|
153
159
|
end
|
@@ -171,6 +177,10 @@ module Google
|
|
171
177
|
# and session entity types to be updated, which in turn might affect
|
172
178
|
# results of future queries.
|
173
179
|
#
|
180
|
+
# Note: Always use agent versions for production traffic.
|
181
|
+
# See [Versions and
|
182
|
+
# environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
|
183
|
+
#
|
174
184
|
# @overload detect_intent(request, options = nil)
|
175
185
|
# Pass arguments to `detect_intent` via a request object, either of type
|
176
186
|
# {::Google::Cloud::Dialogflow::V2::DetectIntentRequest} or an equivalent Hash.
|
@@ -191,11 +201,19 @@ module Google
|
|
191
201
|
# `projects/<Project ID>/agent/sessions/<Session ID>`, or
|
192
202
|
# `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
|
193
203
|
# ID>/sessions/<Session ID>`. If `Environment ID` is not specified, we assume
|
194
|
-
# default 'draft' environment
|
195
|
-
#
|
196
|
-
#
|
204
|
+
# default 'draft' environment (`Environment ID` might be referred to as
|
205
|
+
# environment name at some places). If `User ID` is not specified, we are
|
206
|
+
# using "-". It's up to the API caller to choose an appropriate `Session ID`
|
207
|
+
# and `User Id`. They can be a random number or some type of user and session
|
197
208
|
# identifiers (preferably hashed). The length of the `Session ID` and
|
198
209
|
# `User ID` must not exceed 36 characters.
|
210
|
+
#
|
211
|
+
# For more information, see the [API interactions
|
212
|
+
# guide](https://cloud.google.com/dialogflow/docs/api-overview).
|
213
|
+
#
|
214
|
+
# Note: Always use agent versions for production traffic.
|
215
|
+
# See [Versions and
|
216
|
+
# environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
|
199
217
|
# @param query_params [::Google::Cloud::Dialogflow::V2::QueryParameters, ::Hash]
|
200
218
|
# The parameters of this query.
|
201
219
|
# @param query_input [::Google::Cloud::Dialogflow::V2::QueryInput, ::Hash]
|
@@ -273,6 +291,10 @@ module Google
|
|
273
291
|
# and returns structured, actionable data as a result. This method is only
|
274
292
|
# available via the gRPC API (not REST).
|
275
293
|
#
|
294
|
+
# Note: Always use agent versions for production traffic.
|
295
|
+
# See [Versions and
|
296
|
+
# environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
|
297
|
+
#
|
276
298
|
# @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest, ::Hash>]
|
277
299
|
# An enumerable of {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest} instances.
|
278
300
|
# @param options [::Gapic::CallOptions, ::Hash]
|
@@ -407,14 +429,14 @@ module Google
|
|
407
429
|
|
408
430
|
config_attr :endpoint, "dialogflow.googleapis.com", ::String
|
409
431
|
config_attr :credentials, nil do |value|
|
410
|
-
allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
432
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
411
433
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
412
434
|
allowed.any? { |klass| klass === value }
|
413
435
|
end
|
414
436
|
config_attr :scope, nil, ::String, ::Array, nil
|
415
437
|
config_attr :lib_name, nil, ::String, nil
|
416
438
|
config_attr :lib_version, nil, ::String, nil
|
417
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
439
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
418
440
|
config_attr :interceptors, nil, ::Array, nil
|
419
441
|
config_attr :timeout, nil, ::Numeric, nil
|
420
442
|
config_attr :metadata, nil, ::Hash, nil
|
@@ -435,7 +457,7 @@ module Google
|
|
435
457
|
def rpcs
|
436
458
|
@rpcs ||= begin
|
437
459
|
parent_rpcs = nil
|
438
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config
|
460
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
439
461
|
Rpcs.new parent_rpcs
|
440
462
|
end
|
441
463
|
end
|
@@ -447,7 +469,7 @@ module Google
|
|
447
469
|
# Each configuration object is of type `Gapic::Config::Method` and includes
|
448
470
|
# the following configuration fields:
|
449
471
|
#
|
450
|
-
# * `timeout` (*type:* `Numeric`) - The call timeout in
|
472
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
451
473
|
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
452
474
|
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
453
475
|
# include the following keys:
|
@@ -471,9 +493,9 @@ module Google
|
|
471
493
|
|
472
494
|
# @private
|
473
495
|
def initialize parent_rpcs = nil
|
474
|
-
detect_intent_config = parent_rpcs
|
496
|
+
detect_intent_config = parent_rpcs.detect_intent if parent_rpcs.respond_to? :detect_intent
|
475
497
|
@detect_intent = ::Gapic::Config::Method.new detect_intent_config
|
476
|
-
streaming_detect_intent_config = parent_rpcs
|
498
|
+
streaming_detect_intent_config = parent_rpcs.streaming_detect_intent if parent_rpcs.respond_to? :streaming_detect_intent
|
477
499
|
@streaming_detect_intent = ::Gapic::Config::Method.new streaming_detect_intent_config
|
478
500
|
|
479
501
|
yield self if block_given?
|