google-cloud-discovery_engine-v1 2.3.1 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +4 -4
  3. data/README.md +4 -4
  4. data/lib/google/cloud/discovery_engine/v1/assistant_service/client.rb +509 -0
  5. data/lib/google/cloud/discovery_engine/v1/assistant_service/credentials.rb +47 -0
  6. data/lib/google/cloud/discovery_engine/v1/assistant_service/paths.rb +169 -0
  7. data/lib/google/cloud/discovery_engine/v1/assistant_service/rest/client.rb +478 -0
  8. data/lib/google/cloud/discovery_engine/v1/assistant_service/rest/service_stub.rb +137 -0
  9. data/lib/google/cloud/discovery_engine/v1/assistant_service/rest.rb +52 -0
  10. data/lib/google/cloud/discovery_engine/v1/assistant_service.rb +55 -0
  11. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb +16 -4
  12. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb +16 -4
  13. data/lib/google/cloud/discovery_engine/v1/rest.rb +4 -2
  14. data/lib/google/cloud/discovery_engine/v1/search_service/client.rb +16 -28
  15. data/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb +16 -28
  16. data/lib/google/cloud/discovery_engine/v1/session_service/client.rb +920 -0
  17. data/lib/google/cloud/discovery_engine/v1/session_service/credentials.rb +47 -0
  18. data/lib/google/cloud/discovery_engine/v1/session_service/paths.rb +330 -0
  19. data/lib/google/cloud/discovery_engine/v1/session_service/rest/client.rb +859 -0
  20. data/lib/google/cloud/discovery_engine/v1/session_service/rest/service_stub.rb +462 -0
  21. data/lib/google/cloud/discovery_engine/v1/session_service/rest.rb +52 -0
  22. data/lib/google/cloud/discovery_engine/v1/session_service.rb +55 -0
  23. data/lib/google/cloud/discovery_engine/v1/version.rb +1 -1
  24. data/lib/google/cloud/discovery_engine/v1.rb +5 -3
  25. data/lib/google/cloud/discoveryengine/v1/assist_answer_pb.rb +59 -0
  26. data/lib/google/cloud/discoveryengine/v1/assistant_pb.rb +45 -0
  27. data/lib/google/cloud/discoveryengine/v1/assistant_service_pb.rb +62 -0
  28. data/lib/google/cloud/discoveryengine/v1/assistant_service_services_pb.rb +45 -0
  29. data/lib/google/cloud/discoveryengine/v1/session_pb.rb +1 -1
  30. data/lib/google/cloud/discoveryengine/v1/session_service_pb.rb +49 -0
  31. data/lib/google/cloud/discoveryengine/v1/session_service_services_pb.rb +64 -0
  32. data/proto_docs/google/cloud/discoveryengine/v1/assist_answer.rb +278 -0
  33. data/proto_docs/google/cloud/discoveryengine/v1/assistant.rb +39 -0
  34. data/proto_docs/google/cloud/discoveryengine/v1/assistant_service.rb +207 -0
  35. data/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb +15 -3
  36. data/proto_docs/google/cloud/discoveryengine/v1/search_service.rb +8 -14
  37. data/proto_docs/google/cloud/discoveryengine/v1/session.rb +20 -4
  38. metadata +24 -1
@@ -0,0 +1,137 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 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/discoveryengine/v1/assistant_service_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module DiscoveryEngine
24
+ module V1
25
+ module AssistantService
26
+ module Rest
27
+ ##
28
+ # REST service stub for the AssistantService service.
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
+ #
32
+ class ServiceStub
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
35
+ # These require statements are intentionally placed here to initialize
36
+ # the REST modules only when it's required.
37
+ require "gapic/rest"
38
+
39
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
40
+ endpoint_template: endpoint_template,
41
+ universe_domain: universe_domain,
42
+ credentials: credentials,
43
+ numeric_enums: true,
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
47
+ end
48
+
49
+ ##
50
+ # The effective universe domain
51
+ #
52
+ # @return [String]
53
+ #
54
+ def universe_domain
55
+ @client_stub.universe_domain
56
+ end
57
+
58
+ ##
59
+ # The effective endpoint
60
+ #
61
+ # @return [String]
62
+ #
63
+ def endpoint
64
+ @client_stub.endpoint
65
+ end
66
+
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
76
+ ##
77
+ # Baseline implementation for the stream_assist REST call
78
+ #
79
+ # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest]
80
+ # A request object representing the call parameters. Required.
81
+ # @param options [::Gapic::CallOptions]
82
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
83
+ #
84
+ # @yieldparam chunk [::String] The chunk of data received during server streaming.
85
+ #
86
+ # @return [::Gapic::Rest::TransportOperation]
87
+ def stream_assist(request_pb, options = nil, &)
88
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
89
+
90
+ verb, uri, query_string_params, body = ServiceStub.transcode_stream_assist_request request_pb
91
+ query_string_params = if query_string_params.any?
92
+ query_string_params.to_h { |p| p.split "=", 2 }
93
+ else
94
+ {}
95
+ end
96
+
97
+ response = @client_stub.make_http_request(
98
+ verb,
99
+ uri: uri,
100
+ body: body || "",
101
+ params: query_string_params,
102
+ method_name: "stream_assist",
103
+ options: options,
104
+ is_server_streaming: true,
105
+ &
106
+ )
107
+ ::Gapic::Rest::TransportOperation.new response
108
+ end
109
+
110
+ ##
111
+ # @private
112
+ #
113
+ # GRPC transcoding helper method for the stream_assist REST call
114
+ #
115
+ # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest]
116
+ # A request object representing the call parameters. Required.
117
+ # @return [Array(String, [String, nil], Hash{String => String})]
118
+ # Uri, Body, Query string parameters
119
+ def self.transcode_stream_assist_request request_pb
120
+ transcoder = Gapic::Rest::GrpcTranscoder.new
121
+ .with_bindings(
122
+ uri_method: :post,
123
+ uri_template: "/v1/{name}:streamAssist",
124
+ body: "*",
125
+ matches: [
126
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/assistants/[^/]+/?$}, false]
127
+ ]
128
+ )
129
+ transcoder.transcode request_pb
130
+ end
131
+ end
132
+ end
133
+ end
134
+ end
135
+ end
136
+ end
137
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 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/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/discovery_engine/v1/version"
24
+
25
+ require "google/cloud/discovery_engine/v1/assistant_service/credentials"
26
+ require "google/cloud/discovery_engine/v1/assistant_service/paths"
27
+ require "google/cloud/discovery_engine/v1/assistant_service/rest/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module DiscoveryEngine
32
+ module V1
33
+ ##
34
+ # Service for managing Assistant configuration and assisting users.
35
+ #
36
+ # To load this service and instantiate a REST client:
37
+ #
38
+ # require "google/cloud/discovery_engine/v1/assistant_service/rest"
39
+ # client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client.new
40
+ #
41
+ module AssistantService
42
+ # Client for the REST transport
43
+ module Rest
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+
51
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
52
+ require "google/cloud/discovery_engine/v1/assistant_service/rest/helpers" if ::File.file? helper_path
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 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/discovery_engine/v1/version"
24
+
25
+ require "google/cloud/discovery_engine/v1/assistant_service/credentials"
26
+ require "google/cloud/discovery_engine/v1/assistant_service/paths"
27
+ require "google/cloud/discovery_engine/v1/assistant_service/client"
28
+ require "google/cloud/discovery_engine/v1/assistant_service/rest"
29
+
30
+ module Google
31
+ module Cloud
32
+ module DiscoveryEngine
33
+ module V1
34
+ ##
35
+ # Service for managing Assistant configuration and assisting users.
36
+ #
37
+ # @example Load this service and instantiate a gRPC client
38
+ #
39
+ # require "google/cloud/discovery_engine/v1/assistant_service"
40
+ # client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new
41
+ #
42
+ # @example Load this service and instantiate a REST client
43
+ #
44
+ # require "google/cloud/discovery_engine/v1/assistant_service/rest"
45
+ # client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client.new
46
+ #
47
+ module AssistantService
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
53
+
54
+ helper_path = ::File.join __dir__, "assistant_service", "helpers.rb"
55
+ require "google/cloud/discovery_engine/v1/assistant_service/helpers" if ::File.file? helper_path
@@ -1625,11 +1625,23 @@ module Google
1625
1625
  # A page token, received from a previous `ListSessions` call.
1626
1626
  # Provide this to retrieve the subsequent page.
1627
1627
  # @param filter [::String]
1628
- # A filter to apply on the list results. The supported features are:
1629
- # user_pseudo_id, state.
1630
- #
1631
- # Example:
1628
+ # A comma-separated list of fields to filter by, in EBNF grammar.
1629
+ # The supported fields are:
1630
+ # * `user_pseudo_id`
1631
+ # * `state`
1632
+ # * `display_name`
1633
+ # * `starred`
1634
+ # * `is_pinned`
1635
+ # * `labels`
1636
+ # * `create_time`
1637
+ # * `update_time`
1638
+ #
1639
+ # Examples:
1632
1640
  # "user_pseudo_id = some_id"
1641
+ # "display_name = \"some_name\""
1642
+ # "starred = true"
1643
+ # "is_pinned=true AND (NOT labels:hidden)"
1644
+ # "create_time > \"1970-01-01T12:00:00Z\""
1633
1645
  # @param order_by [::String]
1634
1646
  # A comma-separated list of fields to order by, sorted in ascending order.
1635
1647
  # Use "desc" after a field name for descending.
@@ -1529,11 +1529,23 @@ module Google
1529
1529
  # A page token, received from a previous `ListSessions` call.
1530
1530
  # Provide this to retrieve the subsequent page.
1531
1531
  # @param filter [::String]
1532
- # A filter to apply on the list results. The supported features are:
1533
- # user_pseudo_id, state.
1534
- #
1535
- # Example:
1532
+ # A comma-separated list of fields to filter by, in EBNF grammar.
1533
+ # The supported fields are:
1534
+ # * `user_pseudo_id`
1535
+ # * `state`
1536
+ # * `display_name`
1537
+ # * `starred`
1538
+ # * `is_pinned`
1539
+ # * `labels`
1540
+ # * `create_time`
1541
+ # * `update_time`
1542
+ #
1543
+ # Examples:
1536
1544
  # "user_pseudo_id = some_id"
1545
+ # "display_name = \"some_name\""
1546
+ # "starred = true"
1547
+ # "is_pinned=true AND (NOT labels:hidden)"
1548
+ # "create_time > \"1970-01-01T12:00:00Z\""
1537
1549
  # @param order_by [::String]
1538
1550
  # A comma-separated list of fields to order by, sorted in ascending order.
1539
1551
  # Use "desc" after a field name for descending.
@@ -16,10 +16,11 @@
16
16
 
17
17
  # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
18
 
19
+ require "google/cloud/discovery_engine/v1/search_service/rest"
20
+ require "google/cloud/discovery_engine/v1/assistant_service/rest"
19
21
  require "google/cloud/discovery_engine/v1/cmek_config_service/rest"
20
22
  require "google/cloud/discovery_engine/v1/completion_service/rest"
21
23
  require "google/cloud/discovery_engine/v1/control_service/rest"
22
- require "google/cloud/discovery_engine/v1/search_service/rest"
23
24
  require "google/cloud/discovery_engine/v1/conversational_search_service/rest"
24
25
  require "google/cloud/discovery_engine/v1/data_store_service/rest"
25
26
  require "google/cloud/discovery_engine/v1/document_service/rest"
@@ -32,6 +33,7 @@ require "google/cloud/discovery_engine/v1/recommendation_service/rest"
32
33
  require "google/cloud/discovery_engine/v1/schema_service/rest"
33
34
  require "google/cloud/discovery_engine/v1/search_tuning_service/rest"
34
35
  require "google/cloud/discovery_engine/v1/serving_config_service/rest"
36
+ require "google/cloud/discovery_engine/v1/session_service/rest"
35
37
  require "google/cloud/discovery_engine/v1/site_search_engine_service/rest"
36
38
  require "google/cloud/discovery_engine/v1/user_event_service/rest"
37
39
  require "google/cloud/discovery_engine/v1/user_license_service/rest"
@@ -46,7 +48,7 @@ module Google
46
48
  # @example
47
49
  #
48
50
  # require "google/cloud/discovery_engine/v1/rest"
49
- # client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new
51
+ # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new
50
52
  #
51
53
  module V1
52
54
  end
@@ -415,22 +415,16 @@ module Google
415
415
  # between /search API calls and /answer API calls.
416
416
  #
417
417
  # Example #1 (multi-turn /search API calls):
418
- # 1. Call /search API with the auto-session mode (see below).
419
- # 2. Call /search API with the session ID generated in the first call.
420
- # Here, the previous search query gets considered in query
421
- # standing. I.e., if the first query is "How did Alphabet do in 2022?"
422
- # and the current query is "How about 2023?", the current query will
423
- # be interpreted as "How did Alphabet do in 2023?".
418
+ # Call /search API with the session ID generated in the first call.
419
+ # Here, the previous search query gets considered in query
420
+ # standing. I.e., if the first query is "How did Alphabet do in 2022?"
421
+ # and the current query is "How about 2023?", the current query will
422
+ # be interpreted as "How did Alphabet do in 2023?".
424
423
  #
425
424
  # Example #2 (coordination between /search API calls and /answer API calls):
426
- # 1. Call /search API with the auto-session mode (see below).
427
- # 2. Call /answer API with the session ID generated in the first call.
428
- # Here, the answer generation happens in the context of the search
429
- # results from the first search call.
430
- #
431
- # Auto-session mode: when `projects/.../sessions/-` is used, a new session
432
- # gets automatically created. Otherwise, users can use the create-session API
433
- # to create a session manually.
425
+ # Call /answer API with the session ID generated in the first call.
426
+ # Here, the answer generation happens in the context of the search
427
+ # results from the first search call.
434
428
  #
435
429
  # Multi-turn Search feature is currently at private GA stage. Please use
436
430
  # v1alpha or v1beta version instead before we launch this feature to public
@@ -743,22 +737,16 @@ module Google
743
737
  # between /search API calls and /answer API calls.
744
738
  #
745
739
  # Example #1 (multi-turn /search API calls):
746
- # 1. Call /search API with the auto-session mode (see below).
747
- # 2. Call /search API with the session ID generated in the first call.
748
- # Here, the previous search query gets considered in query
749
- # standing. I.e., if the first query is "How did Alphabet do in 2022?"
750
- # and the current query is "How about 2023?", the current query will
751
- # be interpreted as "How did Alphabet do in 2023?".
740
+ # Call /search API with the session ID generated in the first call.
741
+ # Here, the previous search query gets considered in query
742
+ # standing. I.e., if the first query is "How did Alphabet do in 2022?"
743
+ # and the current query is "How about 2023?", the current query will
744
+ # be interpreted as "How did Alphabet do in 2023?".
752
745
  #
753
746
  # Example #2 (coordination between /search API calls and /answer API calls):
754
- # 1. Call /search API with the auto-session mode (see below).
755
- # 2. Call /answer API with the session ID generated in the first call.
756
- # Here, the answer generation happens in the context of the search
757
- # results from the first search call.
758
- #
759
- # Auto-session mode: when `projects/.../sessions/-` is used, a new session
760
- # gets automatically created. Otherwise, users can use the create-session API
761
- # to create a session manually.
747
+ # Call /answer API with the session ID generated in the first call.
748
+ # Here, the answer generation happens in the context of the search
749
+ # results from the first search call.
762
750
  #
763
751
  # Multi-turn Search feature is currently at private GA stage. Please use
764
752
  # v1alpha or v1beta version instead before we launch this feature to public
@@ -408,22 +408,16 @@ module Google
408
408
  # between /search API calls and /answer API calls.
409
409
  #
410
410
  # Example #1 (multi-turn /search API calls):
411
- # 1. Call /search API with the auto-session mode (see below).
412
- # 2. Call /search API with the session ID generated in the first call.
413
- # Here, the previous search query gets considered in query
414
- # standing. I.e., if the first query is "How did Alphabet do in 2022?"
415
- # and the current query is "How about 2023?", the current query will
416
- # be interpreted as "How did Alphabet do in 2023?".
411
+ # Call /search API with the session ID generated in the first call.
412
+ # Here, the previous search query gets considered in query
413
+ # standing. I.e., if the first query is "How did Alphabet do in 2022?"
414
+ # and the current query is "How about 2023?", the current query will
415
+ # be interpreted as "How did Alphabet do in 2023?".
417
416
  #
418
417
  # Example #2 (coordination between /search API calls and /answer API calls):
419
- # 1. Call /search API with the auto-session mode (see below).
420
- # 2. Call /answer API with the session ID generated in the first call.
421
- # Here, the answer generation happens in the context of the search
422
- # results from the first search call.
423
- #
424
- # Auto-session mode: when `projects/.../sessions/-` is used, a new session
425
- # gets automatically created. Otherwise, users can use the create-session API
426
- # to create a session manually.
418
+ # Call /answer API with the session ID generated in the first call.
419
+ # Here, the answer generation happens in the context of the search
420
+ # results from the first search call.
427
421
  #
428
422
  # Multi-turn Search feature is currently at private GA stage. Please use
429
423
  # v1alpha or v1beta version instead before we launch this feature to public
@@ -729,22 +723,16 @@ module Google
729
723
  # between /search API calls and /answer API calls.
730
724
  #
731
725
  # Example #1 (multi-turn /search API calls):
732
- # 1. Call /search API with the auto-session mode (see below).
733
- # 2. Call /search API with the session ID generated in the first call.
734
- # Here, the previous search query gets considered in query
735
- # standing. I.e., if the first query is "How did Alphabet do in 2022?"
736
- # and the current query is "How about 2023?", the current query will
737
- # be interpreted as "How did Alphabet do in 2023?".
726
+ # Call /search API with the session ID generated in the first call.
727
+ # Here, the previous search query gets considered in query
728
+ # standing. I.e., if the first query is "How did Alphabet do in 2022?"
729
+ # and the current query is "How about 2023?", the current query will
730
+ # be interpreted as "How did Alphabet do in 2023?".
738
731
  #
739
732
  # Example #2 (coordination between /search API calls and /answer API calls):
740
- # 1. Call /search API with the auto-session mode (see below).
741
- # 2. Call /answer API with the session ID generated in the first call.
742
- # Here, the answer generation happens in the context of the search
743
- # results from the first search call.
744
- #
745
- # Auto-session mode: when `projects/.../sessions/-` is used, a new session
746
- # gets automatically created. Otherwise, users can use the create-session API
747
- # to create a session manually.
733
+ # Call /answer API with the session ID generated in the first call.
734
+ # Here, the answer generation happens in the context of the search
735
+ # results from the first search call.
748
736
  #
749
737
  # Multi-turn Search feature is currently at private GA stage. Please use
750
738
  # v1alpha or v1beta version instead before we launch this feature to public