google-cloud-dialogflow-v2 0.6.2 → 0.8.1
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 +70 -2
- data/lib/google/cloud/dialogflow/v2.rb +13 -2
- data/lib/google/cloud/dialogflow/v2/agent_services_pb.rb +25 -40
- data/lib/google/cloud/dialogflow/v2/agents.rb +1 -28
- data/lib/google/cloud/dialogflow/v2/agents/client.rb +41 -100
- 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 +24 -63
- 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 +12 -39
- data/lib/google/cloud/dialogflow/v2/entity_types.rb +1 -28
- data/lib/google/cloud/dialogflow/v2/entity_types/client.rb +28 -91
- 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 +430 -14
- data/lib/google/cloud/dialogflow/v2/environments/paths.rb +104 -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 +9 -40
- data/lib/google/cloud/dialogflow/v2/intents.rb +1 -32
- data/lib/google/cloud/dialogflow/v2/intents/client.rb +34 -81
- 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 +172 -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 +23 -53
- data/lib/google/cloud/dialogflow/v2/session_entity_types/paths.rb +74 -2
- data/lib/google/cloud/dialogflow/v2/session_pb.rb +1 -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 +51 -15
- 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 +9 -1
- 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 +187 -5
- 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 +503 -0
- data/proto_docs/google/cloud/dialogflow/v2/session.rb +52 -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 +73 -9
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "googleauth"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module Dialogflow
|
24
|
+
module V2
|
25
|
+
module KnowledgeBases
|
26
|
+
# Credentials for the KnowledgeBases API.
|
27
|
+
class Credentials < ::Google::Auth::Credentials
|
28
|
+
self.scope = [
|
29
|
+
"https://www.googleapis.com/auth/cloud-platform",
|
30
|
+
"https://www.googleapis.com/auth/dialogflow"
|
31
|
+
]
|
32
|
+
self.env_vars = [
|
33
|
+
"DIALOGFLOW_CREDENTIALS",
|
34
|
+
"DIALOGFLOW_KEYFILE",
|
35
|
+
"GOOGLE_CLOUD_CREDENTIALS",
|
36
|
+
"GOOGLE_CLOUD_KEYFILE",
|
37
|
+
"GCLOUD_KEYFILE",
|
38
|
+
"DIALOGFLOW_CREDENTIALS_JSON",
|
39
|
+
"DIALOGFLOW_KEYFILE_JSON",
|
40
|
+
"GOOGLE_CLOUD_CREDENTIALS_JSON",
|
41
|
+
"GOOGLE_CLOUD_KEYFILE_JSON",
|
42
|
+
"GCLOUD_KEYFILE_JSON"
|
43
|
+
]
|
44
|
+
self.paths = [
|
45
|
+
"~/.config/google_cloud/application_default_credentials.json"
|
46
|
+
]
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,105 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module Dialogflow
|
23
|
+
module V2
|
24
|
+
module KnowledgeBases
|
25
|
+
# Path helper methods for the KnowledgeBases API.
|
26
|
+
module Paths
|
27
|
+
##
|
28
|
+
# Create a fully-qualified KnowledgeBase resource string.
|
29
|
+
#
|
30
|
+
# @overload knowledge_base_path(project:, knowledge_base:)
|
31
|
+
# The resource will be in the following format:
|
32
|
+
#
|
33
|
+
# `projects/{project}/knowledgeBases/{knowledge_base}`
|
34
|
+
#
|
35
|
+
# @param project [String]
|
36
|
+
# @param knowledge_base [String]
|
37
|
+
#
|
38
|
+
# @overload knowledge_base_path(project:, location:, knowledge_base:)
|
39
|
+
# The resource will be in the following format:
|
40
|
+
#
|
41
|
+
# `projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}`
|
42
|
+
#
|
43
|
+
# @param project [String]
|
44
|
+
# @param location [String]
|
45
|
+
# @param knowledge_base [String]
|
46
|
+
#
|
47
|
+
# @return [::String]
|
48
|
+
def knowledge_base_path **args
|
49
|
+
resources = {
|
50
|
+
"knowledge_base:project" => (proc do |project:, knowledge_base:|
|
51
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
52
|
+
|
53
|
+
"projects/#{project}/knowledgeBases/#{knowledge_base}"
|
54
|
+
end),
|
55
|
+
"knowledge_base:location:project" => (proc do |project:, location:, knowledge_base:|
|
56
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
57
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
58
|
+
|
59
|
+
"projects/#{project}/locations/#{location}/knowledgeBases/#{knowledge_base}"
|
60
|
+
end)
|
61
|
+
}
|
62
|
+
|
63
|
+
resource = resources[args.keys.sort.join(":")]
|
64
|
+
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
|
65
|
+
resource.call(**args)
|
66
|
+
end
|
67
|
+
|
68
|
+
##
|
69
|
+
# Create a fully-qualified Location resource string.
|
70
|
+
#
|
71
|
+
# The resource will be in the following format:
|
72
|
+
#
|
73
|
+
# `projects/{project}/locations/{location}`
|
74
|
+
#
|
75
|
+
# @param project [String]
|
76
|
+
# @param location [String]
|
77
|
+
#
|
78
|
+
# @return [::String]
|
79
|
+
def location_path project:, location:
|
80
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
81
|
+
|
82
|
+
"projects/#{project}/locations/#{location}"
|
83
|
+
end
|
84
|
+
|
85
|
+
##
|
86
|
+
# Create a fully-qualified Project resource string.
|
87
|
+
#
|
88
|
+
# The resource will be in the following format:
|
89
|
+
#
|
90
|
+
# `projects/{project}`
|
91
|
+
#
|
92
|
+
# @param project [String]
|
93
|
+
#
|
94
|
+
# @return [::String]
|
95
|
+
def project_path project:
|
96
|
+
"projects/#{project}"
|
97
|
+
end
|
98
|
+
|
99
|
+
extend self
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
@@ -0,0 +1,172 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: google/cloud/dialogflow/v2/participant.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
require 'google/api/annotations_pb'
|
7
|
+
require 'google/api/client_pb'
|
8
|
+
require 'google/api/field_behavior_pb'
|
9
|
+
require 'google/api/resource_pb'
|
10
|
+
require 'google/cloud/dialogflow/v2/audio_config_pb'
|
11
|
+
require 'google/cloud/dialogflow/v2/session_pb'
|
12
|
+
require 'google/protobuf/duration_pb'
|
13
|
+
require 'google/protobuf/field_mask_pb'
|
14
|
+
require 'google/protobuf/struct_pb'
|
15
|
+
require 'google/protobuf/timestamp_pb'
|
16
|
+
require 'google/rpc/status_pb'
|
17
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
18
|
+
add_file("google/cloud/dialogflow/v2/participant.proto", :syntax => :proto3) do
|
19
|
+
add_message "google.cloud.dialogflow.v2.Participant" do
|
20
|
+
optional :name, :string, 1
|
21
|
+
optional :role, :enum, 2, "google.cloud.dialogflow.v2.Participant.Role"
|
22
|
+
optional :sip_recording_media_label, :string, 6
|
23
|
+
end
|
24
|
+
add_enum "google.cloud.dialogflow.v2.Participant.Role" do
|
25
|
+
value :ROLE_UNSPECIFIED, 0
|
26
|
+
value :HUMAN_AGENT, 1
|
27
|
+
value :AUTOMATED_AGENT, 2
|
28
|
+
value :END_USER, 3
|
29
|
+
end
|
30
|
+
add_message "google.cloud.dialogflow.v2.Message" do
|
31
|
+
optional :name, :string, 1
|
32
|
+
optional :content, :string, 2
|
33
|
+
optional :language_code, :string, 3
|
34
|
+
optional :participant, :string, 4
|
35
|
+
optional :participant_role, :enum, 5, "google.cloud.dialogflow.v2.Participant.Role"
|
36
|
+
optional :create_time, :message, 6, "google.protobuf.Timestamp"
|
37
|
+
optional :message_annotation, :message, 7, "google.cloud.dialogflow.v2.MessageAnnotation"
|
38
|
+
end
|
39
|
+
add_message "google.cloud.dialogflow.v2.CreateParticipantRequest" do
|
40
|
+
optional :parent, :string, 1
|
41
|
+
optional :participant, :message, 2, "google.cloud.dialogflow.v2.Participant"
|
42
|
+
end
|
43
|
+
add_message "google.cloud.dialogflow.v2.GetParticipantRequest" do
|
44
|
+
optional :name, :string, 1
|
45
|
+
end
|
46
|
+
add_message "google.cloud.dialogflow.v2.ListParticipantsRequest" do
|
47
|
+
optional :parent, :string, 1
|
48
|
+
optional :page_size, :int32, 2
|
49
|
+
optional :page_token, :string, 3
|
50
|
+
end
|
51
|
+
add_message "google.cloud.dialogflow.v2.ListParticipantsResponse" do
|
52
|
+
repeated :participants, :message, 1, "google.cloud.dialogflow.v2.Participant"
|
53
|
+
optional :next_page_token, :string, 2
|
54
|
+
end
|
55
|
+
add_message "google.cloud.dialogflow.v2.UpdateParticipantRequest" do
|
56
|
+
optional :participant, :message, 1, "google.cloud.dialogflow.v2.Participant"
|
57
|
+
optional :update_mask, :message, 2, "google.protobuf.FieldMask"
|
58
|
+
end
|
59
|
+
add_message "google.cloud.dialogflow.v2.AnalyzeContentRequest" do
|
60
|
+
optional :participant, :string, 1
|
61
|
+
optional :reply_audio_config, :message, 5, "google.cloud.dialogflow.v2.OutputAudioConfig"
|
62
|
+
optional :query_params, :message, 9, "google.cloud.dialogflow.v2.QueryParameters"
|
63
|
+
optional :request_id, :string, 11
|
64
|
+
oneof :input do
|
65
|
+
optional :text_input, :message, 6, "google.cloud.dialogflow.v2.TextInput"
|
66
|
+
optional :event_input, :message, 8, "google.cloud.dialogflow.v2.EventInput"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
add_message "google.cloud.dialogflow.v2.DtmfParameters" do
|
70
|
+
optional :accepts_dtmf_input, :bool, 1
|
71
|
+
end
|
72
|
+
add_message "google.cloud.dialogflow.v2.AnalyzeContentResponse" do
|
73
|
+
optional :reply_text, :string, 1
|
74
|
+
optional :reply_audio, :message, 2, "google.cloud.dialogflow.v2.OutputAudio"
|
75
|
+
optional :automated_agent_reply, :message, 3, "google.cloud.dialogflow.v2.AutomatedAgentReply"
|
76
|
+
optional :message, :message, 5, "google.cloud.dialogflow.v2.Message"
|
77
|
+
repeated :human_agent_suggestion_results, :message, 6, "google.cloud.dialogflow.v2.SuggestionResult"
|
78
|
+
repeated :end_user_suggestion_results, :message, 7, "google.cloud.dialogflow.v2.SuggestionResult"
|
79
|
+
optional :dtmf_parameters, :message, 9, "google.cloud.dialogflow.v2.DtmfParameters"
|
80
|
+
end
|
81
|
+
add_message "google.cloud.dialogflow.v2.SuggestArticlesRequest" do
|
82
|
+
optional :parent, :string, 1
|
83
|
+
optional :latest_message, :string, 2
|
84
|
+
optional :context_size, :int32, 3
|
85
|
+
end
|
86
|
+
add_message "google.cloud.dialogflow.v2.SuggestArticlesResponse" do
|
87
|
+
repeated :article_answers, :message, 1, "google.cloud.dialogflow.v2.ArticleAnswer"
|
88
|
+
optional :latest_message, :string, 2
|
89
|
+
optional :context_size, :int32, 3
|
90
|
+
end
|
91
|
+
add_message "google.cloud.dialogflow.v2.SuggestFaqAnswersRequest" do
|
92
|
+
optional :parent, :string, 1
|
93
|
+
optional :latest_message, :string, 2
|
94
|
+
optional :context_size, :int32, 3
|
95
|
+
end
|
96
|
+
add_message "google.cloud.dialogflow.v2.SuggestFaqAnswersResponse" do
|
97
|
+
repeated :faq_answers, :message, 1, "google.cloud.dialogflow.v2.FaqAnswer"
|
98
|
+
optional :latest_message, :string, 2
|
99
|
+
optional :context_size, :int32, 3
|
100
|
+
end
|
101
|
+
add_message "google.cloud.dialogflow.v2.OutputAudio" do
|
102
|
+
optional :config, :message, 1, "google.cloud.dialogflow.v2.OutputAudioConfig"
|
103
|
+
optional :audio, :bytes, 2
|
104
|
+
end
|
105
|
+
add_message "google.cloud.dialogflow.v2.AutomatedAgentReply" do
|
106
|
+
optional :detect_intent_response, :message, 1, "google.cloud.dialogflow.v2.DetectIntentResponse"
|
107
|
+
end
|
108
|
+
add_message "google.cloud.dialogflow.v2.ArticleAnswer" do
|
109
|
+
optional :title, :string, 1
|
110
|
+
optional :uri, :string, 2
|
111
|
+
repeated :snippets, :string, 3
|
112
|
+
optional :confidence, :float, 4
|
113
|
+
map :metadata, :string, :string, 5
|
114
|
+
optional :answer_record, :string, 6
|
115
|
+
end
|
116
|
+
add_message "google.cloud.dialogflow.v2.FaqAnswer" do
|
117
|
+
optional :answer, :string, 1
|
118
|
+
optional :confidence, :float, 2
|
119
|
+
optional :question, :string, 3
|
120
|
+
optional :source, :string, 4
|
121
|
+
map :metadata, :string, :string, 5
|
122
|
+
optional :answer_record, :string, 6
|
123
|
+
end
|
124
|
+
add_message "google.cloud.dialogflow.v2.SuggestionResult" do
|
125
|
+
oneof :suggestion_response do
|
126
|
+
optional :error, :message, 1, "google.rpc.Status"
|
127
|
+
optional :suggest_articles_response, :message, 2, "google.cloud.dialogflow.v2.SuggestArticlesResponse"
|
128
|
+
optional :suggest_faq_answers_response, :message, 3, "google.cloud.dialogflow.v2.SuggestFaqAnswersResponse"
|
129
|
+
end
|
130
|
+
end
|
131
|
+
add_message "google.cloud.dialogflow.v2.AnnotatedMessagePart" do
|
132
|
+
optional :text, :string, 1
|
133
|
+
optional :entity_type, :string, 2
|
134
|
+
optional :formatted_value, :message, 3, "google.protobuf.Value"
|
135
|
+
end
|
136
|
+
add_message "google.cloud.dialogflow.v2.MessageAnnotation" do
|
137
|
+
repeated :parts, :message, 1, "google.cloud.dialogflow.v2.AnnotatedMessagePart"
|
138
|
+
optional :contain_entities, :bool, 2
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
module Google
|
144
|
+
module Cloud
|
145
|
+
module Dialogflow
|
146
|
+
module V2
|
147
|
+
Participant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Participant").msgclass
|
148
|
+
Participant::Role = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Participant.Role").enummodule
|
149
|
+
Message = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Message").msgclass
|
150
|
+
CreateParticipantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateParticipantRequest").msgclass
|
151
|
+
GetParticipantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetParticipantRequest").msgclass
|
152
|
+
ListParticipantsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListParticipantsRequest").msgclass
|
153
|
+
ListParticipantsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListParticipantsResponse").msgclass
|
154
|
+
UpdateParticipantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateParticipantRequest").msgclass
|
155
|
+
AnalyzeContentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AnalyzeContentRequest").msgclass
|
156
|
+
DtmfParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DtmfParameters").msgclass
|
157
|
+
AnalyzeContentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AnalyzeContentResponse").msgclass
|
158
|
+
SuggestArticlesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestArticlesRequest").msgclass
|
159
|
+
SuggestArticlesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestArticlesResponse").msgclass
|
160
|
+
SuggestFaqAnswersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestFaqAnswersRequest").msgclass
|
161
|
+
SuggestFaqAnswersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestFaqAnswersResponse").msgclass
|
162
|
+
OutputAudio = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.OutputAudio").msgclass
|
163
|
+
AutomatedAgentReply = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AutomatedAgentReply").msgclass
|
164
|
+
ArticleAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ArticleAnswer").msgclass
|
165
|
+
FaqAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.FaqAnswer").msgclass
|
166
|
+
SuggestionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestionResult").msgclass
|
167
|
+
AnnotatedMessagePart = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AnnotatedMessagePart").msgclass
|
168
|
+
MessageAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.MessageAnnotation").msgclass
|
169
|
+
end
|
170
|
+
end
|
171
|
+
end
|
172
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: google/cloud/dialogflow/v2/participant.proto for package 'google.cloud.dialogflow.v2'
|
3
|
+
# Original file comments:
|
4
|
+
# Copyright 2021 Google LLC
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
require 'grpc'
|
20
|
+
require 'google/cloud/dialogflow/v2/participant_pb'
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Dialogflow
|
25
|
+
module V2
|
26
|
+
module Participants
|
27
|
+
# Service for managing [Participants][google.cloud.dialogflow.v2.Participant].
|
28
|
+
class Service
|
29
|
+
|
30
|
+
include ::GRPC::GenericService
|
31
|
+
|
32
|
+
self.marshal_class_method = :encode
|
33
|
+
self.unmarshal_class_method = :decode
|
34
|
+
self.service_name = 'google.cloud.dialogflow.v2.Participants'
|
35
|
+
|
36
|
+
# Creates a new participant in a conversation.
|
37
|
+
rpc :CreateParticipant, ::Google::Cloud::Dialogflow::V2::CreateParticipantRequest, ::Google::Cloud::Dialogflow::V2::Participant
|
38
|
+
# Retrieves a conversation participant.
|
39
|
+
rpc :GetParticipant, ::Google::Cloud::Dialogflow::V2::GetParticipantRequest, ::Google::Cloud::Dialogflow::V2::Participant
|
40
|
+
# Returns the list of all participants in the specified conversation.
|
41
|
+
rpc :ListParticipants, ::Google::Cloud::Dialogflow::V2::ListParticipantsRequest, ::Google::Cloud::Dialogflow::V2::ListParticipantsResponse
|
42
|
+
# Updates the specified participant.
|
43
|
+
rpc :UpdateParticipant, ::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest, ::Google::Cloud::Dialogflow::V2::Participant
|
44
|
+
# Adds a text (chat, for example), or audio (phone recording, for example)
|
45
|
+
# message from a participant into the conversation.
|
46
|
+
#
|
47
|
+
# Note: Always use agent versions for production traffic
|
48
|
+
# sent to virtual agents. See [Versions and
|
49
|
+
# environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
|
50
|
+
rpc :AnalyzeContent, ::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest, ::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse
|
51
|
+
# Gets suggested articles for a participant based on specific historical
|
52
|
+
# messages.
|
53
|
+
rpc :SuggestArticles, ::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest, ::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse
|
54
|
+
# Gets suggested faq answers for a participant based on specific historical
|
55
|
+
# messages.
|
56
|
+
rpc :SuggestFaqAnswers, ::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest, ::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse
|
57
|
+
end
|
58
|
+
|
59
|
+
Stub = Service.rpc_stub_class
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "gapic/common"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/dialogflow/v2/version"
|
24
|
+
|
25
|
+
require "google/cloud/dialogflow/v2/participants/credentials"
|
26
|
+
require "google/cloud/dialogflow/v2/participants/paths"
|
27
|
+
require "google/cloud/dialogflow/v2/participants/client"
|
28
|
+
|
29
|
+
module Google
|
30
|
+
module Cloud
|
31
|
+
module Dialogflow
|
32
|
+
module V2
|
33
|
+
##
|
34
|
+
# Service for managing {::Google::Cloud::Dialogflow::V2::Participant Participants}.
|
35
|
+
#
|
36
|
+
# To load this service and instantiate a client:
|
37
|
+
#
|
38
|
+
# require "google/cloud/dialogflow/v2/participants"
|
39
|
+
# client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new
|
40
|
+
#
|
41
|
+
module Participants
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
helper_path = ::File.join __dir__, "participants", "helpers.rb"
|
49
|
+
require "google/cloud/dialogflow/v2/participants/helpers" if ::File.file? helper_path
|
@@ -0,0 +1,894 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/errors"
|
20
|
+
require "google/cloud/dialogflow/v2/participant_pb"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Dialogflow
|
25
|
+
module V2
|
26
|
+
module Participants
|
27
|
+
##
|
28
|
+
# Client for the Participants service.
|
29
|
+
#
|
30
|
+
# Service for managing {::Google::Cloud::Dialogflow::V2::Participant Participants}.
|
31
|
+
#
|
32
|
+
class Client
|
33
|
+
include Paths
|
34
|
+
|
35
|
+
# @private
|
36
|
+
attr_reader :participants_stub
|
37
|
+
|
38
|
+
##
|
39
|
+
# Configure the Participants Client class.
|
40
|
+
#
|
41
|
+
# See {::Google::Cloud::Dialogflow::V2::Participants::Client::Configuration}
|
42
|
+
# for a description of the configuration fields.
|
43
|
+
#
|
44
|
+
# ## Example
|
45
|
+
#
|
46
|
+
# To modify the configuration for all Participants clients:
|
47
|
+
#
|
48
|
+
# ::Google::Cloud::Dialogflow::V2::Participants::Client.configure do |config|
|
49
|
+
# config.timeout = 10.0
|
50
|
+
# end
|
51
|
+
#
|
52
|
+
# @yield [config] Configure the Client client.
|
53
|
+
# @yieldparam config [Client::Configuration]
|
54
|
+
#
|
55
|
+
# @return [Client::Configuration]
|
56
|
+
#
|
57
|
+
def self.configure
|
58
|
+
@configure ||= begin
|
59
|
+
namespace = ["Google", "Cloud", "Dialogflow", "V2"]
|
60
|
+
parent_config = while namespace.any?
|
61
|
+
parent_name = namespace.join "::"
|
62
|
+
parent_const = const_get parent_name
|
63
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
64
|
+
namespace.pop
|
65
|
+
end
|
66
|
+
default_config = Client::Configuration.new parent_config
|
67
|
+
|
68
|
+
default_config.timeout = 60.0
|
69
|
+
default_config.retry_policy = {
|
70
|
+
initial_delay: 0.1,
|
71
|
+
max_delay: 60.0,
|
72
|
+
multiplier: 1.3,
|
73
|
+
retry_codes: [14]
|
74
|
+
}
|
75
|
+
|
76
|
+
default_config.rpcs.analyze_content.timeout = 220.0
|
77
|
+
default_config.rpcs.analyze_content.retry_policy = {
|
78
|
+
initial_delay: 0.1,
|
79
|
+
max_delay: 60.0,
|
80
|
+
multiplier: 1.3,
|
81
|
+
retry_codes: [14]
|
82
|
+
}
|
83
|
+
|
84
|
+
default_config
|
85
|
+
end
|
86
|
+
yield @configure if block_given?
|
87
|
+
@configure
|
88
|
+
end
|
89
|
+
|
90
|
+
##
|
91
|
+
# Configure the Participants Client instance.
|
92
|
+
#
|
93
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
94
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
95
|
+
# should be made on {Client.configure}.
|
96
|
+
#
|
97
|
+
# See {::Google::Cloud::Dialogflow::V2::Participants::Client::Configuration}
|
98
|
+
# for a description of the configuration fields.
|
99
|
+
#
|
100
|
+
# @yield [config] Configure the Client client.
|
101
|
+
# @yieldparam config [Client::Configuration]
|
102
|
+
#
|
103
|
+
# @return [Client::Configuration]
|
104
|
+
#
|
105
|
+
def configure
|
106
|
+
yield @config if block_given?
|
107
|
+
@config
|
108
|
+
end
|
109
|
+
|
110
|
+
##
|
111
|
+
# Create a new Participants client object.
|
112
|
+
#
|
113
|
+
# ## Examples
|
114
|
+
#
|
115
|
+
# To create a new Participants client with the default
|
116
|
+
# configuration:
|
117
|
+
#
|
118
|
+
# client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new
|
119
|
+
#
|
120
|
+
# To create a new Participants client with a custom
|
121
|
+
# configuration:
|
122
|
+
#
|
123
|
+
# client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config|
|
124
|
+
# config.timeout = 10.0
|
125
|
+
# end
|
126
|
+
#
|
127
|
+
# @yield [config] Configure the Participants client.
|
128
|
+
# @yieldparam config [Client::Configuration]
|
129
|
+
#
|
130
|
+
def initialize
|
131
|
+
# These require statements are intentionally placed here to initialize
|
132
|
+
# the gRPC module only when it's required.
|
133
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
134
|
+
require "gapic/grpc"
|
135
|
+
require "google/cloud/dialogflow/v2/participant_services_pb"
|
136
|
+
|
137
|
+
# Create the configuration object
|
138
|
+
@config = Configuration.new Client.configure
|
139
|
+
|
140
|
+
# Yield the configuration if needed
|
141
|
+
yield @config if block_given?
|
142
|
+
|
143
|
+
# Create credentials
|
144
|
+
credentials = @config.credentials
|
145
|
+
# Use self-signed JWT if the scope and endpoint are unchanged from default,
|
146
|
+
# but only if the default endpoint does not have a region prefix.
|
147
|
+
enable_self_signed_jwt = @config.scope == Client.configure.scope &&
|
148
|
+
@config.endpoint == Client.configure.endpoint &&
|
149
|
+
!@config.endpoint.split(".").first.include?("-")
|
150
|
+
credentials ||= Credentials.default scope: @config.scope,
|
151
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
152
|
+
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
153
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
154
|
+
end
|
155
|
+
@quota_project_id = @config.quota_project
|
156
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
157
|
+
|
158
|
+
@participants_stub = ::Gapic::ServiceStub.new(
|
159
|
+
::Google::Cloud::Dialogflow::V2::Participants::Stub,
|
160
|
+
credentials: credentials,
|
161
|
+
endpoint: @config.endpoint,
|
162
|
+
channel_args: @config.channel_args,
|
163
|
+
interceptors: @config.interceptors
|
164
|
+
)
|
165
|
+
end
|
166
|
+
|
167
|
+
# Service calls
|
168
|
+
|
169
|
+
##
|
170
|
+
# Creates a new participant in a conversation.
|
171
|
+
#
|
172
|
+
# @overload create_participant(request, options = nil)
|
173
|
+
# Pass arguments to `create_participant` via a request object, either of type
|
174
|
+
# {::Google::Cloud::Dialogflow::V2::CreateParticipantRequest} or an equivalent Hash.
|
175
|
+
#
|
176
|
+
# @param request [::Google::Cloud::Dialogflow::V2::CreateParticipantRequest, ::Hash]
|
177
|
+
# A request object representing the call parameters. Required. To specify no
|
178
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
179
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
180
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
181
|
+
#
|
182
|
+
# @overload create_participant(parent: nil, participant: nil)
|
183
|
+
# Pass arguments to `create_participant` via keyword arguments. Note that at
|
184
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
185
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
186
|
+
#
|
187
|
+
# @param parent [::String]
|
188
|
+
# Required. Resource identifier of the conversation adding the participant.
|
189
|
+
# Format: `projects/<Project ID>/locations/<Location
|
190
|
+
# ID>/conversations/<Conversation ID>`.
|
191
|
+
# @param participant [::Google::Cloud::Dialogflow::V2::Participant, ::Hash]
|
192
|
+
# Required. The participant to create.
|
193
|
+
#
|
194
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
195
|
+
# @yieldparam response [::Google::Cloud::Dialogflow::V2::Participant]
|
196
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
197
|
+
#
|
198
|
+
# @return [::Google::Cloud::Dialogflow::V2::Participant]
|
199
|
+
#
|
200
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
201
|
+
#
|
202
|
+
def create_participant request, options = nil
|
203
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
204
|
+
|
205
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateParticipantRequest
|
206
|
+
|
207
|
+
# Converts hash and nil to an options object
|
208
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
209
|
+
|
210
|
+
# Customize the options with defaults
|
211
|
+
metadata = @config.rpcs.create_participant.metadata.to_h
|
212
|
+
|
213
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
214
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
215
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
216
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
|
217
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
218
|
+
|
219
|
+
header_params = {
|
220
|
+
"parent" => request.parent
|
221
|
+
}
|
222
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
223
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
224
|
+
|
225
|
+
options.apply_defaults timeout: @config.rpcs.create_participant.timeout,
|
226
|
+
metadata: metadata,
|
227
|
+
retry_policy: @config.rpcs.create_participant.retry_policy
|
228
|
+
options.apply_defaults metadata: @config.metadata,
|
229
|
+
retry_policy: @config.retry_policy
|
230
|
+
|
231
|
+
@participants_stub.call_rpc :create_participant, request, options: options do |response, operation|
|
232
|
+
yield response, operation if block_given?
|
233
|
+
return response
|
234
|
+
end
|
235
|
+
rescue ::GRPC::BadStatus => e
|
236
|
+
raise ::Google::Cloud::Error.from_error(e)
|
237
|
+
end
|
238
|
+
|
239
|
+
##
|
240
|
+
# Retrieves a conversation participant.
|
241
|
+
#
|
242
|
+
# @overload get_participant(request, options = nil)
|
243
|
+
# Pass arguments to `get_participant` via a request object, either of type
|
244
|
+
# {::Google::Cloud::Dialogflow::V2::GetParticipantRequest} or an equivalent Hash.
|
245
|
+
#
|
246
|
+
# @param request [::Google::Cloud::Dialogflow::V2::GetParticipantRequest, ::Hash]
|
247
|
+
# A request object representing the call parameters. Required. To specify no
|
248
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
249
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
250
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
251
|
+
#
|
252
|
+
# @overload get_participant(name: nil)
|
253
|
+
# Pass arguments to `get_participant` via keyword arguments. Note that at
|
254
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
255
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
256
|
+
#
|
257
|
+
# @param name [::String]
|
258
|
+
# Required. The name of the participant. Format:
|
259
|
+
# `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation
|
260
|
+
# ID>/participants/<Participant ID>`.
|
261
|
+
#
|
262
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
263
|
+
# @yieldparam response [::Google::Cloud::Dialogflow::V2::Participant]
|
264
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
265
|
+
#
|
266
|
+
# @return [::Google::Cloud::Dialogflow::V2::Participant]
|
267
|
+
#
|
268
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
269
|
+
#
|
270
|
+
def get_participant request, options = nil
|
271
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
272
|
+
|
273
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetParticipantRequest
|
274
|
+
|
275
|
+
# Converts hash and nil to an options object
|
276
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
277
|
+
|
278
|
+
# Customize the options with defaults
|
279
|
+
metadata = @config.rpcs.get_participant.metadata.to_h
|
280
|
+
|
281
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
282
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
283
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
284
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
|
285
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
286
|
+
|
287
|
+
header_params = {
|
288
|
+
"name" => request.name
|
289
|
+
}
|
290
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
291
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
292
|
+
|
293
|
+
options.apply_defaults timeout: @config.rpcs.get_participant.timeout,
|
294
|
+
metadata: metadata,
|
295
|
+
retry_policy: @config.rpcs.get_participant.retry_policy
|
296
|
+
options.apply_defaults metadata: @config.metadata,
|
297
|
+
retry_policy: @config.retry_policy
|
298
|
+
|
299
|
+
@participants_stub.call_rpc :get_participant, request, options: options do |response, operation|
|
300
|
+
yield response, operation if block_given?
|
301
|
+
return response
|
302
|
+
end
|
303
|
+
rescue ::GRPC::BadStatus => e
|
304
|
+
raise ::Google::Cloud::Error.from_error(e)
|
305
|
+
end
|
306
|
+
|
307
|
+
##
|
308
|
+
# Returns the list of all participants in the specified conversation.
|
309
|
+
#
|
310
|
+
# @overload list_participants(request, options = nil)
|
311
|
+
# Pass arguments to `list_participants` via a request object, either of type
|
312
|
+
# {::Google::Cloud::Dialogflow::V2::ListParticipantsRequest} or an equivalent Hash.
|
313
|
+
#
|
314
|
+
# @param request [::Google::Cloud::Dialogflow::V2::ListParticipantsRequest, ::Hash]
|
315
|
+
# A request object representing the call parameters. Required. To specify no
|
316
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
317
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
318
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
319
|
+
#
|
320
|
+
# @overload list_participants(parent: nil, page_size: nil, page_token: nil)
|
321
|
+
# Pass arguments to `list_participants` via keyword arguments. Note that at
|
322
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
323
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
324
|
+
#
|
325
|
+
# @param parent [::String]
|
326
|
+
# Required. The conversation to list all participants from.
|
327
|
+
# Format: `projects/<Project ID>/locations/<Location
|
328
|
+
# ID>/conversations/<Conversation ID>`.
|
329
|
+
# @param page_size [::Integer]
|
330
|
+
# Optional. The maximum number of items to return in a single page. By
|
331
|
+
# default 100 and at most 1000.
|
332
|
+
# @param page_token [::String]
|
333
|
+
# Optional. The next_page_token value returned from a previous list request.
|
334
|
+
#
|
335
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
336
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Participant>]
|
337
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
338
|
+
#
|
339
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Participant>]
|
340
|
+
#
|
341
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
342
|
+
#
|
343
|
+
def list_participants request, options = nil
|
344
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
345
|
+
|
346
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListParticipantsRequest
|
347
|
+
|
348
|
+
# Converts hash and nil to an options object
|
349
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
350
|
+
|
351
|
+
# Customize the options with defaults
|
352
|
+
metadata = @config.rpcs.list_participants.metadata.to_h
|
353
|
+
|
354
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
355
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
356
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
357
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
|
358
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
359
|
+
|
360
|
+
header_params = {
|
361
|
+
"parent" => request.parent
|
362
|
+
}
|
363
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
364
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
365
|
+
|
366
|
+
options.apply_defaults timeout: @config.rpcs.list_participants.timeout,
|
367
|
+
metadata: metadata,
|
368
|
+
retry_policy: @config.rpcs.list_participants.retry_policy
|
369
|
+
options.apply_defaults metadata: @config.metadata,
|
370
|
+
retry_policy: @config.retry_policy
|
371
|
+
|
372
|
+
@participants_stub.call_rpc :list_participants, request, options: options do |response, operation|
|
373
|
+
response = ::Gapic::PagedEnumerable.new @participants_stub, :list_participants, request, response, operation, options
|
374
|
+
yield response, operation if block_given?
|
375
|
+
return response
|
376
|
+
end
|
377
|
+
rescue ::GRPC::BadStatus => e
|
378
|
+
raise ::Google::Cloud::Error.from_error(e)
|
379
|
+
end
|
380
|
+
|
381
|
+
##
|
382
|
+
# Updates the specified participant.
|
383
|
+
#
|
384
|
+
# @overload update_participant(request, options = nil)
|
385
|
+
# Pass arguments to `update_participant` via a request object, either of type
|
386
|
+
# {::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest} or an equivalent Hash.
|
387
|
+
#
|
388
|
+
# @param request [::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest, ::Hash]
|
389
|
+
# A request object representing the call parameters. Required. To specify no
|
390
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
391
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
392
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
393
|
+
#
|
394
|
+
# @overload update_participant(participant: nil, update_mask: nil)
|
395
|
+
# Pass arguments to `update_participant` via keyword arguments. Note that at
|
396
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
397
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
398
|
+
#
|
399
|
+
# @param participant [::Google::Cloud::Dialogflow::V2::Participant, ::Hash]
|
400
|
+
# Required. The participant to update.
|
401
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
402
|
+
# Required. The mask to specify which fields to update.
|
403
|
+
#
|
404
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
405
|
+
# @yieldparam response [::Google::Cloud::Dialogflow::V2::Participant]
|
406
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
407
|
+
#
|
408
|
+
# @return [::Google::Cloud::Dialogflow::V2::Participant]
|
409
|
+
#
|
410
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
411
|
+
#
|
412
|
+
def update_participant request, options = nil
|
413
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
414
|
+
|
415
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest
|
416
|
+
|
417
|
+
# Converts hash and nil to an options object
|
418
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
419
|
+
|
420
|
+
# Customize the options with defaults
|
421
|
+
metadata = @config.rpcs.update_participant.metadata.to_h
|
422
|
+
|
423
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
424
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
425
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
426
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
|
427
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
428
|
+
|
429
|
+
header_params = {
|
430
|
+
"participant.name" => request.participant.name
|
431
|
+
}
|
432
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
433
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
434
|
+
|
435
|
+
options.apply_defaults timeout: @config.rpcs.update_participant.timeout,
|
436
|
+
metadata: metadata,
|
437
|
+
retry_policy: @config.rpcs.update_participant.retry_policy
|
438
|
+
options.apply_defaults metadata: @config.metadata,
|
439
|
+
retry_policy: @config.retry_policy
|
440
|
+
|
441
|
+
@participants_stub.call_rpc :update_participant, request, options: options do |response, operation|
|
442
|
+
yield response, operation if block_given?
|
443
|
+
return response
|
444
|
+
end
|
445
|
+
rescue ::GRPC::BadStatus => e
|
446
|
+
raise ::Google::Cloud::Error.from_error(e)
|
447
|
+
end
|
448
|
+
|
449
|
+
##
|
450
|
+
# Adds a text (chat, for example), or audio (phone recording, for example)
|
451
|
+
# message from a participant into the conversation.
|
452
|
+
#
|
453
|
+
# Note: Always use agent versions for production traffic
|
454
|
+
# sent to virtual agents. See [Versions and
|
455
|
+
# environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
|
456
|
+
#
|
457
|
+
# @overload analyze_content(request, options = nil)
|
458
|
+
# Pass arguments to `analyze_content` via a request object, either of type
|
459
|
+
# {::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest} or an equivalent Hash.
|
460
|
+
#
|
461
|
+
# @param request [::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest, ::Hash]
|
462
|
+
# A request object representing the call parameters. Required. To specify no
|
463
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
464
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
465
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
466
|
+
#
|
467
|
+
# @overload analyze_content(participant: nil, text_input: nil, event_input: nil, reply_audio_config: nil, query_params: nil, request_id: nil)
|
468
|
+
# Pass arguments to `analyze_content` via keyword arguments. Note that at
|
469
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
470
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
471
|
+
#
|
472
|
+
# @param participant [::String]
|
473
|
+
# Required. The name of the participant this text comes from.
|
474
|
+
# Format: `projects/<Project ID>/locations/<Location
|
475
|
+
# ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
|
476
|
+
# @param text_input [::Google::Cloud::Dialogflow::V2::TextInput, ::Hash]
|
477
|
+
# The natural language text to be processed.
|
478
|
+
# @param event_input [::Google::Cloud::Dialogflow::V2::EventInput, ::Hash]
|
479
|
+
# An input event to send to Dialogflow.
|
480
|
+
# @param reply_audio_config [::Google::Cloud::Dialogflow::V2::OutputAudioConfig, ::Hash]
|
481
|
+
# Speech synthesis configuration.
|
482
|
+
# The speech synthesis settings for a virtual agent that may be configured
|
483
|
+
# for the associated conversation profile are not used when calling
|
484
|
+
# AnalyzeContent. If this configuration is not supplied, speech synthesis
|
485
|
+
# is disabled.
|
486
|
+
# @param query_params [::Google::Cloud::Dialogflow::V2::QueryParameters, ::Hash]
|
487
|
+
# Parameters for a Dialogflow virtual-agent query.
|
488
|
+
# @param request_id [::String]
|
489
|
+
# A unique identifier for this request. Restricted to 36 ASCII characters.
|
490
|
+
# A random UUID is recommended.
|
491
|
+
# This request is only idempotent if a `request_id` is provided.
|
492
|
+
#
|
493
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
494
|
+
# @yieldparam response [::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse]
|
495
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
496
|
+
#
|
497
|
+
# @return [::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse]
|
498
|
+
#
|
499
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
500
|
+
#
|
501
|
+
def analyze_content request, options = nil
|
502
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
503
|
+
|
504
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest
|
505
|
+
|
506
|
+
# Converts hash and nil to an options object
|
507
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
508
|
+
|
509
|
+
# Customize the options with defaults
|
510
|
+
metadata = @config.rpcs.analyze_content.metadata.to_h
|
511
|
+
|
512
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
513
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
514
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
515
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
|
516
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
517
|
+
|
518
|
+
header_params = {
|
519
|
+
"participant" => request.participant
|
520
|
+
}
|
521
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
522
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
523
|
+
|
524
|
+
options.apply_defaults timeout: @config.rpcs.analyze_content.timeout,
|
525
|
+
metadata: metadata,
|
526
|
+
retry_policy: @config.rpcs.analyze_content.retry_policy
|
527
|
+
options.apply_defaults metadata: @config.metadata,
|
528
|
+
retry_policy: @config.retry_policy
|
529
|
+
|
530
|
+
@participants_stub.call_rpc :analyze_content, request, options: options do |response, operation|
|
531
|
+
yield response, operation if block_given?
|
532
|
+
return response
|
533
|
+
end
|
534
|
+
rescue ::GRPC::BadStatus => e
|
535
|
+
raise ::Google::Cloud::Error.from_error(e)
|
536
|
+
end
|
537
|
+
|
538
|
+
##
|
539
|
+
# Gets suggested articles for a participant based on specific historical
|
540
|
+
# messages.
|
541
|
+
#
|
542
|
+
# @overload suggest_articles(request, options = nil)
|
543
|
+
# Pass arguments to `suggest_articles` via a request object, either of type
|
544
|
+
# {::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest} or an equivalent Hash.
|
545
|
+
#
|
546
|
+
# @param request [::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest, ::Hash]
|
547
|
+
# A request object representing the call parameters. Required. To specify no
|
548
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
549
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
550
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
551
|
+
#
|
552
|
+
# @overload suggest_articles(parent: nil, latest_message: nil, context_size: nil)
|
553
|
+
# Pass arguments to `suggest_articles` via keyword arguments. Note that at
|
554
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
555
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
556
|
+
#
|
557
|
+
# @param parent [::String]
|
558
|
+
# Required. The name of the participant to fetch suggestion for.
|
559
|
+
# Format: `projects/<Project ID>/locations/<Location
|
560
|
+
# ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
|
561
|
+
# @param latest_message [::String]
|
562
|
+
# The name of the latest conversation message to compile suggestion
|
563
|
+
# for. If empty, it will be the latest message of the conversation.
|
564
|
+
#
|
565
|
+
# Format: `projects/<Project ID>/locations/<Location
|
566
|
+
# ID>/conversations/<Conversation ID>/messages/<Message ID>`.
|
567
|
+
# @param context_size [::Integer]
|
568
|
+
# Max number of messages prior to and including
|
569
|
+
# {::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest#latest_message latest_message} to use as context
|
570
|
+
# when compiling the suggestion. By default 20 and at most 50.
|
571
|
+
#
|
572
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
573
|
+
# @yieldparam response [::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse]
|
574
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
575
|
+
#
|
576
|
+
# @return [::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse]
|
577
|
+
#
|
578
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
579
|
+
#
|
580
|
+
def suggest_articles request, options = nil
|
581
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
582
|
+
|
583
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest
|
584
|
+
|
585
|
+
# Converts hash and nil to an options object
|
586
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
587
|
+
|
588
|
+
# Customize the options with defaults
|
589
|
+
metadata = @config.rpcs.suggest_articles.metadata.to_h
|
590
|
+
|
591
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
592
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
593
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
594
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
|
595
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
596
|
+
|
597
|
+
header_params = {
|
598
|
+
"parent" => request.parent
|
599
|
+
}
|
600
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
601
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
602
|
+
|
603
|
+
options.apply_defaults timeout: @config.rpcs.suggest_articles.timeout,
|
604
|
+
metadata: metadata,
|
605
|
+
retry_policy: @config.rpcs.suggest_articles.retry_policy
|
606
|
+
options.apply_defaults metadata: @config.metadata,
|
607
|
+
retry_policy: @config.retry_policy
|
608
|
+
|
609
|
+
@participants_stub.call_rpc :suggest_articles, request, options: options do |response, operation|
|
610
|
+
yield response, operation if block_given?
|
611
|
+
return response
|
612
|
+
end
|
613
|
+
rescue ::GRPC::BadStatus => e
|
614
|
+
raise ::Google::Cloud::Error.from_error(e)
|
615
|
+
end
|
616
|
+
|
617
|
+
##
|
618
|
+
# Gets suggested faq answers for a participant based on specific historical
|
619
|
+
# messages.
|
620
|
+
#
|
621
|
+
# @overload suggest_faq_answers(request, options = nil)
|
622
|
+
# Pass arguments to `suggest_faq_answers` via a request object, either of type
|
623
|
+
# {::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest} or an equivalent Hash.
|
624
|
+
#
|
625
|
+
# @param request [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest, ::Hash]
|
626
|
+
# A request object representing the call parameters. Required. To specify no
|
627
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
628
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
629
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
630
|
+
#
|
631
|
+
# @overload suggest_faq_answers(parent: nil, latest_message: nil, context_size: nil)
|
632
|
+
# Pass arguments to `suggest_faq_answers` via keyword arguments. Note that at
|
633
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
634
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
635
|
+
#
|
636
|
+
# @param parent [::String]
|
637
|
+
# Required. The name of the participant to fetch suggestion for.
|
638
|
+
# Format: `projects/<Project ID>/locations/<Location
|
639
|
+
# ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
|
640
|
+
# @param latest_message [::String]
|
641
|
+
# The name of the latest conversation message to compile suggestion
|
642
|
+
# for. If empty, it will be the latest message of the conversation.
|
643
|
+
#
|
644
|
+
# Format: `projects/<Project ID>/locations/<Location
|
645
|
+
# ID>/conversations/<Conversation ID>/messages/<Message ID>`.
|
646
|
+
# @param context_size [::Integer]
|
647
|
+
# Max number of messages prior to and including
|
648
|
+
# [latest_message] to use as context when compiling the
|
649
|
+
# suggestion. By default 20 and at most 50.
|
650
|
+
#
|
651
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
652
|
+
# @yieldparam response [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse]
|
653
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
654
|
+
#
|
655
|
+
# @return [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse]
|
656
|
+
#
|
657
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
658
|
+
#
|
659
|
+
def suggest_faq_answers request, options = nil
|
660
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
661
|
+
|
662
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest
|
663
|
+
|
664
|
+
# Converts hash and nil to an options object
|
665
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
666
|
+
|
667
|
+
# Customize the options with defaults
|
668
|
+
metadata = @config.rpcs.suggest_faq_answers.metadata.to_h
|
669
|
+
|
670
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
671
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
672
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
673
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
|
674
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
675
|
+
|
676
|
+
header_params = {
|
677
|
+
"parent" => request.parent
|
678
|
+
}
|
679
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
680
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
681
|
+
|
682
|
+
options.apply_defaults timeout: @config.rpcs.suggest_faq_answers.timeout,
|
683
|
+
metadata: metadata,
|
684
|
+
retry_policy: @config.rpcs.suggest_faq_answers.retry_policy
|
685
|
+
options.apply_defaults metadata: @config.metadata,
|
686
|
+
retry_policy: @config.retry_policy
|
687
|
+
|
688
|
+
@participants_stub.call_rpc :suggest_faq_answers, request, options: options do |response, operation|
|
689
|
+
yield response, operation if block_given?
|
690
|
+
return response
|
691
|
+
end
|
692
|
+
rescue ::GRPC::BadStatus => e
|
693
|
+
raise ::Google::Cloud::Error.from_error(e)
|
694
|
+
end
|
695
|
+
|
696
|
+
##
|
697
|
+
# Configuration class for the Participants API.
|
698
|
+
#
|
699
|
+
# This class represents the configuration for Participants,
|
700
|
+
# providing control over timeouts, retry behavior, logging, transport
|
701
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
702
|
+
# applied individually to specific RPCs. See
|
703
|
+
# {::Google::Cloud::Dialogflow::V2::Participants::Client::Configuration::Rpcs}
|
704
|
+
# for a list of RPCs that can be configured independently.
|
705
|
+
#
|
706
|
+
# Configuration can be applied globally to all clients, or to a single client
|
707
|
+
# on construction.
|
708
|
+
#
|
709
|
+
# # Examples
|
710
|
+
#
|
711
|
+
# To modify the global config, setting the timeout for create_participant
|
712
|
+
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
713
|
+
#
|
714
|
+
# ::Google::Cloud::Dialogflow::V2::Participants::Client.configure do |config|
|
715
|
+
# config.timeout = 10.0
|
716
|
+
# config.rpcs.create_participant.timeout = 20.0
|
717
|
+
# end
|
718
|
+
#
|
719
|
+
# To apply the above configuration only to a new client:
|
720
|
+
#
|
721
|
+
# client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config|
|
722
|
+
# config.timeout = 10.0
|
723
|
+
# config.rpcs.create_participant.timeout = 20.0
|
724
|
+
# end
|
725
|
+
#
|
726
|
+
# @!attribute [rw] endpoint
|
727
|
+
# The hostname or hostname:port of the service endpoint.
|
728
|
+
# Defaults to `"dialogflow.googleapis.com"`.
|
729
|
+
# @return [::String]
|
730
|
+
# @!attribute [rw] credentials
|
731
|
+
# Credentials to send with calls. You may provide any of the following types:
|
732
|
+
# * (`String`) The path to a service account key file in JSON format
|
733
|
+
# * (`Hash`) A service account key as a Hash
|
734
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
735
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
736
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
737
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
738
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
739
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
740
|
+
# * (`nil`) indicating no credentials
|
741
|
+
# @return [::Object]
|
742
|
+
# @!attribute [rw] scope
|
743
|
+
# The OAuth scopes
|
744
|
+
# @return [::Array<::String>]
|
745
|
+
# @!attribute [rw] lib_name
|
746
|
+
# The library name as recorded in instrumentation and logging
|
747
|
+
# @return [::String]
|
748
|
+
# @!attribute [rw] lib_version
|
749
|
+
# The library version as recorded in instrumentation and logging
|
750
|
+
# @return [::String]
|
751
|
+
# @!attribute [rw] channel_args
|
752
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
753
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
754
|
+
# @return [::Hash]
|
755
|
+
# @!attribute [rw] interceptors
|
756
|
+
# An array of interceptors that are run before calls are executed.
|
757
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
758
|
+
# @!attribute [rw] timeout
|
759
|
+
# The call timeout in seconds.
|
760
|
+
# @return [::Numeric]
|
761
|
+
# @!attribute [rw] metadata
|
762
|
+
# Additional gRPC headers to be sent with the call.
|
763
|
+
# @return [::Hash{::Symbol=>::String}]
|
764
|
+
# @!attribute [rw] retry_policy
|
765
|
+
# The retry policy. The value is a hash with the following keys:
|
766
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
767
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
768
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
769
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
770
|
+
# trigger a retry.
|
771
|
+
# @return [::Hash]
|
772
|
+
# @!attribute [rw] quota_project
|
773
|
+
# A separate project against which to charge quota.
|
774
|
+
# @return [::String]
|
775
|
+
#
|
776
|
+
class Configuration
|
777
|
+
extend ::Gapic::Config
|
778
|
+
|
779
|
+
config_attr :endpoint, "dialogflow.googleapis.com", ::String
|
780
|
+
config_attr :credentials, nil do |value|
|
781
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
782
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
783
|
+
allowed.any? { |klass| klass === value }
|
784
|
+
end
|
785
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
786
|
+
config_attr :lib_name, nil, ::String, nil
|
787
|
+
config_attr :lib_version, nil, ::String, nil
|
788
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
789
|
+
config_attr :interceptors, nil, ::Array, nil
|
790
|
+
config_attr :timeout, nil, ::Numeric, nil
|
791
|
+
config_attr :metadata, nil, ::Hash, nil
|
792
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
793
|
+
config_attr :quota_project, nil, ::String, nil
|
794
|
+
|
795
|
+
# @private
|
796
|
+
def initialize parent_config = nil
|
797
|
+
@parent_config = parent_config unless parent_config.nil?
|
798
|
+
|
799
|
+
yield self if block_given?
|
800
|
+
end
|
801
|
+
|
802
|
+
##
|
803
|
+
# Configurations for individual RPCs
|
804
|
+
# @return [Rpcs]
|
805
|
+
#
|
806
|
+
def rpcs
|
807
|
+
@rpcs ||= begin
|
808
|
+
parent_rpcs = nil
|
809
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
810
|
+
Rpcs.new parent_rpcs
|
811
|
+
end
|
812
|
+
end
|
813
|
+
|
814
|
+
##
|
815
|
+
# Configuration RPC class for the Participants API.
|
816
|
+
#
|
817
|
+
# Includes fields providing the configuration for each RPC in this service.
|
818
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
819
|
+
# the following configuration fields:
|
820
|
+
#
|
821
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
822
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
823
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
824
|
+
# include the following keys:
|
825
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
826
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
827
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
828
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
829
|
+
# trigger a retry.
|
830
|
+
#
|
831
|
+
class Rpcs
|
832
|
+
##
|
833
|
+
# RPC-specific configuration for `create_participant`
|
834
|
+
# @return [::Gapic::Config::Method]
|
835
|
+
#
|
836
|
+
attr_reader :create_participant
|
837
|
+
##
|
838
|
+
# RPC-specific configuration for `get_participant`
|
839
|
+
# @return [::Gapic::Config::Method]
|
840
|
+
#
|
841
|
+
attr_reader :get_participant
|
842
|
+
##
|
843
|
+
# RPC-specific configuration for `list_participants`
|
844
|
+
# @return [::Gapic::Config::Method]
|
845
|
+
#
|
846
|
+
attr_reader :list_participants
|
847
|
+
##
|
848
|
+
# RPC-specific configuration for `update_participant`
|
849
|
+
# @return [::Gapic::Config::Method]
|
850
|
+
#
|
851
|
+
attr_reader :update_participant
|
852
|
+
##
|
853
|
+
# RPC-specific configuration for `analyze_content`
|
854
|
+
# @return [::Gapic::Config::Method]
|
855
|
+
#
|
856
|
+
attr_reader :analyze_content
|
857
|
+
##
|
858
|
+
# RPC-specific configuration for `suggest_articles`
|
859
|
+
# @return [::Gapic::Config::Method]
|
860
|
+
#
|
861
|
+
attr_reader :suggest_articles
|
862
|
+
##
|
863
|
+
# RPC-specific configuration for `suggest_faq_answers`
|
864
|
+
# @return [::Gapic::Config::Method]
|
865
|
+
#
|
866
|
+
attr_reader :suggest_faq_answers
|
867
|
+
|
868
|
+
# @private
|
869
|
+
def initialize parent_rpcs = nil
|
870
|
+
create_participant_config = parent_rpcs.create_participant if parent_rpcs.respond_to? :create_participant
|
871
|
+
@create_participant = ::Gapic::Config::Method.new create_participant_config
|
872
|
+
get_participant_config = parent_rpcs.get_participant if parent_rpcs.respond_to? :get_participant
|
873
|
+
@get_participant = ::Gapic::Config::Method.new get_participant_config
|
874
|
+
list_participants_config = parent_rpcs.list_participants if parent_rpcs.respond_to? :list_participants
|
875
|
+
@list_participants = ::Gapic::Config::Method.new list_participants_config
|
876
|
+
update_participant_config = parent_rpcs.update_participant if parent_rpcs.respond_to? :update_participant
|
877
|
+
@update_participant = ::Gapic::Config::Method.new update_participant_config
|
878
|
+
analyze_content_config = parent_rpcs.analyze_content if parent_rpcs.respond_to? :analyze_content
|
879
|
+
@analyze_content = ::Gapic::Config::Method.new analyze_content_config
|
880
|
+
suggest_articles_config = parent_rpcs.suggest_articles if parent_rpcs.respond_to? :suggest_articles
|
881
|
+
@suggest_articles = ::Gapic::Config::Method.new suggest_articles_config
|
882
|
+
suggest_faq_answers_config = parent_rpcs.suggest_faq_answers if parent_rpcs.respond_to? :suggest_faq_answers
|
883
|
+
@suggest_faq_answers = ::Gapic::Config::Method.new suggest_faq_answers_config
|
884
|
+
|
885
|
+
yield self if block_given?
|
886
|
+
end
|
887
|
+
end
|
888
|
+
end
|
889
|
+
end
|
890
|
+
end
|
891
|
+
end
|
892
|
+
end
|
893
|
+
end
|
894
|
+
end
|