google-developers-developer_knowledge-v1 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/google/developers/developer_knowledge/v1/developer_knowledge/client.rb +91 -4
- data/lib/google/developers/developer_knowledge/v1/developer_knowledge/rest/client.rb +92 -4
- data/lib/google/developers/developer_knowledge/v1/developer_knowledge/rest/service_stub.rb +60 -0
- data/lib/google/developers/developer_knowledge/v1/version.rb +1 -1
- data/lib/google/developers/knowledge/v1/developerknowledge_pb.rb +8 -1
- data/lib/google/developers/knowledge/v1/developerknowledge_services_pb.rb +2 -0
- data/proto_docs/google/developers/knowledge/v1/developerknowledge.rb +98 -4
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ee4729b01d4e0fcdf8e649be0b2147f1eeaa90cd147b7af4427c88e38fab4ad3
|
|
4
|
+
data.tar.gz: 103d3fbf909989b6aff8c06ec4fcad3cf836be5e2d7d1c90a7654b4d76eada82
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c75b827aa790cc49f5b00cf58a5b535992f211c6fa12f91b0fe4903574d9549ac032620e29508672056b4518d4b2226e8d71fb9b1c810ba31051158735595fc8
|
|
7
|
+
data.tar.gz: cada3ca87b2faca794a7a5583c24495c6f55baf9420547a26e7327dad1993730287ce53cabeba4003a0cdcc26b48887f85514360bd6c8579341dfbf129543e27
|
|
@@ -246,8 +246,7 @@ module Google
|
|
|
246
246
|
#
|
|
247
247
|
# If unspecified, at most 5 results will be returned.
|
|
248
248
|
#
|
|
249
|
-
# The maximum value is
|
|
250
|
-
# error.
|
|
249
|
+
# The maximum value is 100; values above 100 will be coerced to 100.
|
|
251
250
|
# @param page_token [::String]
|
|
252
251
|
# Optional. Contains a page token, received from a previous
|
|
253
252
|
# `SearchDocumentChunks` call. Provide this to retrieve the subsequent page.
|
|
@@ -278,6 +277,10 @@ module Google
|
|
|
278
277
|
# TIMESTAMP fields support `=`, `<`, `<=`, `>`, and `>=` operators.
|
|
279
278
|
# Timestamps must be in RFC-3339 format, e.g., `"2025-01-01T00:00:00Z"`.
|
|
280
279
|
#
|
|
280
|
+
# Note: Field names must be in `snake_case` (e.g., `data_source`). Values on
|
|
281
|
+
# the right-hand side of filtering expressions must be string literals
|
|
282
|
+
# enclosed in double quotes (e.g., `"docs.cloud.google.com"`).
|
|
283
|
+
#
|
|
281
284
|
# You can combine expressions using `AND`, `OR`, and `NOT` (or `-`) logical
|
|
282
285
|
# operators. `OR` has higher precedence than `AND`. Use parentheses for
|
|
283
286
|
# explicit precedence grouping.
|
|
@@ -285,11 +288,11 @@ module Google
|
|
|
285
288
|
# Examples:
|
|
286
289
|
#
|
|
287
290
|
# * `data_source = "docs.cloud.google.com" OR data_source =
|
|
288
|
-
#
|
|
291
|
+
# "firebase.google.com"`
|
|
289
292
|
# * `data_source != "firebase.google.com"`
|
|
290
293
|
# * `update_time < "2024-01-01T00:00:00Z"`
|
|
291
294
|
# * `update_time >= "2025-01-22T00:00:00Z" AND (data_source =
|
|
292
|
-
#
|
|
295
|
+
# "developer.chrome.com" OR data_source = "web.dev")`
|
|
293
296
|
# * `uri = "https://docs.cloud.google.com/release-notes"`
|
|
294
297
|
#
|
|
295
298
|
# The `filter` string must not exceed 500 characters; values longer than 500
|
|
@@ -538,6 +541,83 @@ module Google
|
|
|
538
541
|
raise ::Google::Cloud::Error.from_error(e)
|
|
539
542
|
end
|
|
540
543
|
|
|
544
|
+
##
|
|
545
|
+
# Answers a query using grounded generation.
|
|
546
|
+
#
|
|
547
|
+
# @overload answer_query(request, options = nil)
|
|
548
|
+
# Pass arguments to `answer_query` via a request object, either of type
|
|
549
|
+
# {::Google::Developers::DeveloperKnowledge::V1::AnswerQueryRequest} or an equivalent Hash.
|
|
550
|
+
#
|
|
551
|
+
# @param request [::Google::Developers::DeveloperKnowledge::V1::AnswerQueryRequest, ::Hash]
|
|
552
|
+
# A request object representing the call parameters. Required. To specify no
|
|
553
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
554
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
555
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
556
|
+
#
|
|
557
|
+
# @overload answer_query(query: nil)
|
|
558
|
+
# Pass arguments to `answer_query` via keyword arguments. Note that at
|
|
559
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
560
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
561
|
+
#
|
|
562
|
+
# @param query [::String]
|
|
563
|
+
# Required. The query to answer.
|
|
564
|
+
#
|
|
565
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
566
|
+
# @yieldparam response [::Google::Developers::DeveloperKnowledge::V1::AnswerQueryResponse]
|
|
567
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
568
|
+
#
|
|
569
|
+
# @return [::Google::Developers::DeveloperKnowledge::V1::AnswerQueryResponse]
|
|
570
|
+
#
|
|
571
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
572
|
+
#
|
|
573
|
+
# @example Basic example
|
|
574
|
+
# require "google/developers/developer_knowledge/v1"
|
|
575
|
+
#
|
|
576
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
577
|
+
# client = Google::Developers::DeveloperKnowledge::V1::DeveloperKnowledge::Client.new
|
|
578
|
+
#
|
|
579
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
580
|
+
# request = Google::Developers::DeveloperKnowledge::V1::AnswerQueryRequest.new
|
|
581
|
+
#
|
|
582
|
+
# # Call the answer_query method.
|
|
583
|
+
# result = client.answer_query request
|
|
584
|
+
#
|
|
585
|
+
# # The returned object is of type Google::Developers::DeveloperKnowledge::V1::AnswerQueryResponse.
|
|
586
|
+
# p result
|
|
587
|
+
#
|
|
588
|
+
def answer_query request, options = nil
|
|
589
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
590
|
+
|
|
591
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Developers::DeveloperKnowledge::V1::AnswerQueryRequest
|
|
592
|
+
|
|
593
|
+
# Converts hash and nil to an options object
|
|
594
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
595
|
+
|
|
596
|
+
# Customize the options with defaults
|
|
597
|
+
metadata = @config.rpcs.answer_query.metadata.to_h
|
|
598
|
+
|
|
599
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
600
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
601
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
602
|
+
gapic_version: ::Google::Developers::DeveloperKnowledge::V1::VERSION
|
|
603
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
604
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
605
|
+
|
|
606
|
+
options.apply_defaults timeout: @config.rpcs.answer_query.timeout,
|
|
607
|
+
metadata: metadata,
|
|
608
|
+
retry_policy: @config.rpcs.answer_query.retry_policy
|
|
609
|
+
|
|
610
|
+
options.apply_defaults timeout: @config.timeout,
|
|
611
|
+
metadata: @config.metadata,
|
|
612
|
+
retry_policy: @config.retry_policy
|
|
613
|
+
|
|
614
|
+
@developer_knowledge_stub.call_rpc :answer_query, request, options: options do |response, operation|
|
|
615
|
+
yield response, operation if block_given?
|
|
616
|
+
end
|
|
617
|
+
rescue ::GRPC::BadStatus => e
|
|
618
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
619
|
+
end
|
|
620
|
+
|
|
541
621
|
##
|
|
542
622
|
# Configuration class for the DeveloperKnowledge API.
|
|
543
623
|
#
|
|
@@ -738,6 +818,11 @@ module Google
|
|
|
738
818
|
# @return [::Gapic::Config::Method]
|
|
739
819
|
#
|
|
740
820
|
attr_reader :batch_get_documents
|
|
821
|
+
##
|
|
822
|
+
# RPC-specific configuration for `answer_query`
|
|
823
|
+
# @return [::Gapic::Config::Method]
|
|
824
|
+
#
|
|
825
|
+
attr_reader :answer_query
|
|
741
826
|
|
|
742
827
|
# @private
|
|
743
828
|
def initialize parent_rpcs = nil
|
|
@@ -747,6 +832,8 @@ module Google
|
|
|
747
832
|
@get_document = ::Gapic::Config::Method.new get_document_config
|
|
748
833
|
batch_get_documents_config = parent_rpcs.batch_get_documents if parent_rpcs.respond_to? :batch_get_documents
|
|
749
834
|
@batch_get_documents = ::Gapic::Config::Method.new batch_get_documents_config
|
|
835
|
+
answer_query_config = parent_rpcs.answer_query if parent_rpcs.respond_to? :answer_query
|
|
836
|
+
@answer_query = ::Gapic::Config::Method.new answer_query_config
|
|
750
837
|
|
|
751
838
|
yield self if block_given?
|
|
752
839
|
end
|
|
@@ -239,8 +239,7 @@ module Google
|
|
|
239
239
|
#
|
|
240
240
|
# If unspecified, at most 5 results will be returned.
|
|
241
241
|
#
|
|
242
|
-
# The maximum value is
|
|
243
|
-
# error.
|
|
242
|
+
# The maximum value is 100; values above 100 will be coerced to 100.
|
|
244
243
|
# @param page_token [::String]
|
|
245
244
|
# Optional. Contains a page token, received from a previous
|
|
246
245
|
# `SearchDocumentChunks` call. Provide this to retrieve the subsequent page.
|
|
@@ -271,6 +270,10 @@ module Google
|
|
|
271
270
|
# TIMESTAMP fields support `=`, `<`, `<=`, `>`, and `>=` operators.
|
|
272
271
|
# Timestamps must be in RFC-3339 format, e.g., `"2025-01-01T00:00:00Z"`.
|
|
273
272
|
#
|
|
273
|
+
# Note: Field names must be in `snake_case` (e.g., `data_source`). Values on
|
|
274
|
+
# the right-hand side of filtering expressions must be string literals
|
|
275
|
+
# enclosed in double quotes (e.g., `"docs.cloud.google.com"`).
|
|
276
|
+
#
|
|
274
277
|
# You can combine expressions using `AND`, `OR`, and `NOT` (or `-`) logical
|
|
275
278
|
# operators. `OR` has higher precedence than `AND`. Use parentheses for
|
|
276
279
|
# explicit precedence grouping.
|
|
@@ -278,11 +281,11 @@ module Google
|
|
|
278
281
|
# Examples:
|
|
279
282
|
#
|
|
280
283
|
# * `data_source = "docs.cloud.google.com" OR data_source =
|
|
281
|
-
#
|
|
284
|
+
# "firebase.google.com"`
|
|
282
285
|
# * `data_source != "firebase.google.com"`
|
|
283
286
|
# * `update_time < "2024-01-01T00:00:00Z"`
|
|
284
287
|
# * `update_time >= "2025-01-22T00:00:00Z" AND (data_source =
|
|
285
|
-
#
|
|
288
|
+
# "developer.chrome.com" OR data_source = "web.dev")`
|
|
286
289
|
# * `uri = "https://docs.cloud.google.com/release-notes"`
|
|
287
290
|
#
|
|
288
291
|
# The `filter` string must not exceed 500 characters; values longer than 500
|
|
@@ -526,6 +529,84 @@ module Google
|
|
|
526
529
|
raise ::Google::Cloud::Error.from_error(e)
|
|
527
530
|
end
|
|
528
531
|
|
|
532
|
+
##
|
|
533
|
+
# Answers a query using grounded generation.
|
|
534
|
+
#
|
|
535
|
+
# @overload answer_query(request, options = nil)
|
|
536
|
+
# Pass arguments to `answer_query` via a request object, either of type
|
|
537
|
+
# {::Google::Developers::DeveloperKnowledge::V1::AnswerQueryRequest} or an equivalent Hash.
|
|
538
|
+
#
|
|
539
|
+
# @param request [::Google::Developers::DeveloperKnowledge::V1::AnswerQueryRequest, ::Hash]
|
|
540
|
+
# A request object representing the call parameters. Required. To specify no
|
|
541
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
542
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
543
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
544
|
+
#
|
|
545
|
+
# @overload answer_query(query: nil)
|
|
546
|
+
# Pass arguments to `answer_query` via keyword arguments. Note that at
|
|
547
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
548
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
549
|
+
#
|
|
550
|
+
# @param query [::String]
|
|
551
|
+
# Required. The query to answer.
|
|
552
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
553
|
+
# @yieldparam result [::Google::Developers::DeveloperKnowledge::V1::AnswerQueryResponse]
|
|
554
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
555
|
+
#
|
|
556
|
+
# @return [::Google::Developers::DeveloperKnowledge::V1::AnswerQueryResponse]
|
|
557
|
+
#
|
|
558
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
559
|
+
#
|
|
560
|
+
# @example Basic example
|
|
561
|
+
# require "google/developers/developer_knowledge/v1"
|
|
562
|
+
#
|
|
563
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
564
|
+
# client = Google::Developers::DeveloperKnowledge::V1::DeveloperKnowledge::Rest::Client.new
|
|
565
|
+
#
|
|
566
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
567
|
+
# request = Google::Developers::DeveloperKnowledge::V1::AnswerQueryRequest.new
|
|
568
|
+
#
|
|
569
|
+
# # Call the answer_query method.
|
|
570
|
+
# result = client.answer_query request
|
|
571
|
+
#
|
|
572
|
+
# # The returned object is of type Google::Developers::DeveloperKnowledge::V1::AnswerQueryResponse.
|
|
573
|
+
# p result
|
|
574
|
+
#
|
|
575
|
+
def answer_query request, options = nil
|
|
576
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
577
|
+
|
|
578
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Developers::DeveloperKnowledge::V1::AnswerQueryRequest
|
|
579
|
+
|
|
580
|
+
# Converts hash and nil to an options object
|
|
581
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
582
|
+
|
|
583
|
+
# Customize the options with defaults
|
|
584
|
+
call_metadata = @config.rpcs.answer_query.metadata.to_h
|
|
585
|
+
|
|
586
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
587
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
588
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
589
|
+
gapic_version: ::Google::Developers::DeveloperKnowledge::V1::VERSION,
|
|
590
|
+
transports_version_send: [:rest]
|
|
591
|
+
|
|
592
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
593
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
594
|
+
|
|
595
|
+
options.apply_defaults timeout: @config.rpcs.answer_query.timeout,
|
|
596
|
+
metadata: call_metadata,
|
|
597
|
+
retry_policy: @config.rpcs.answer_query.retry_policy
|
|
598
|
+
|
|
599
|
+
options.apply_defaults timeout: @config.timeout,
|
|
600
|
+
metadata: @config.metadata,
|
|
601
|
+
retry_policy: @config.retry_policy
|
|
602
|
+
|
|
603
|
+
@developer_knowledge_stub.answer_query request, options do |result, operation|
|
|
604
|
+
yield result, operation if block_given?
|
|
605
|
+
end
|
|
606
|
+
rescue ::Gapic::Rest::Error => e
|
|
607
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
608
|
+
end
|
|
609
|
+
|
|
529
610
|
##
|
|
530
611
|
# Configuration class for the DeveloperKnowledge REST API.
|
|
531
612
|
#
|
|
@@ -689,6 +770,11 @@ module Google
|
|
|
689
770
|
# @return [::Gapic::Config::Method]
|
|
690
771
|
#
|
|
691
772
|
attr_reader :batch_get_documents
|
|
773
|
+
##
|
|
774
|
+
# RPC-specific configuration for `answer_query`
|
|
775
|
+
# @return [::Gapic::Config::Method]
|
|
776
|
+
#
|
|
777
|
+
attr_reader :answer_query
|
|
692
778
|
|
|
693
779
|
# @private
|
|
694
780
|
def initialize parent_rpcs = nil
|
|
@@ -698,6 +784,8 @@ module Google
|
|
|
698
784
|
@get_document = ::Gapic::Config::Method.new get_document_config
|
|
699
785
|
batch_get_documents_config = parent_rpcs.batch_get_documents if parent_rpcs.respond_to? :batch_get_documents
|
|
700
786
|
@batch_get_documents = ::Gapic::Config::Method.new batch_get_documents_config
|
|
787
|
+
answer_query_config = parent_rpcs.answer_query if parent_rpcs.respond_to? :answer_query
|
|
788
|
+
@answer_query = ::Gapic::Config::Method.new answer_query_config
|
|
701
789
|
|
|
702
790
|
yield self if block_given?
|
|
703
791
|
end
|
|
@@ -193,6 +193,46 @@ module Google
|
|
|
193
193
|
end
|
|
194
194
|
end
|
|
195
195
|
|
|
196
|
+
##
|
|
197
|
+
# Baseline implementation for the answer_query REST call
|
|
198
|
+
#
|
|
199
|
+
# @param request_pb [::Google::Developers::DeveloperKnowledge::V1::AnswerQueryRequest]
|
|
200
|
+
# A request object representing the call parameters. Required.
|
|
201
|
+
# @param options [::Gapic::CallOptions]
|
|
202
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
203
|
+
#
|
|
204
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
205
|
+
# @yieldparam result [::Google::Developers::DeveloperKnowledge::V1::AnswerQueryResponse]
|
|
206
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
207
|
+
#
|
|
208
|
+
# @return [::Google::Developers::DeveloperKnowledge::V1::AnswerQueryResponse]
|
|
209
|
+
# A result object deserialized from the server's reply
|
|
210
|
+
def answer_query request_pb, options = nil
|
|
211
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
|
212
|
+
|
|
213
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_answer_query_request request_pb
|
|
214
|
+
query_string_params = if query_string_params.any?
|
|
215
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
|
216
|
+
else
|
|
217
|
+
{}
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
response = @client_stub.make_http_request(
|
|
221
|
+
verb,
|
|
222
|
+
uri: uri,
|
|
223
|
+
body: body || "",
|
|
224
|
+
params: query_string_params,
|
|
225
|
+
method_name: "answer_query",
|
|
226
|
+
options: options
|
|
227
|
+
)
|
|
228
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
|
229
|
+
result = ::Google::Developers::DeveloperKnowledge::V1::AnswerQueryResponse.decode_json response.body, ignore_unknown_fields: true
|
|
230
|
+
catch :response do
|
|
231
|
+
yield result, operation if block_given?
|
|
232
|
+
result
|
|
233
|
+
end
|
|
234
|
+
end
|
|
235
|
+
|
|
196
236
|
##
|
|
197
237
|
# @private
|
|
198
238
|
#
|
|
@@ -251,6 +291,26 @@ module Google
|
|
|
251
291
|
)
|
|
252
292
|
transcoder.transcode request_pb
|
|
253
293
|
end
|
|
294
|
+
|
|
295
|
+
##
|
|
296
|
+
# @private
|
|
297
|
+
#
|
|
298
|
+
# GRPC transcoding helper method for the answer_query REST call
|
|
299
|
+
#
|
|
300
|
+
# @param request_pb [::Google::Developers::DeveloperKnowledge::V1::AnswerQueryRequest]
|
|
301
|
+
# A request object representing the call parameters. Required.
|
|
302
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
|
303
|
+
# Uri, Body, Query string parameters
|
|
304
|
+
def self.transcode_answer_query_request request_pb
|
|
305
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
|
306
|
+
.with_bindings(
|
|
307
|
+
uri_method: :post,
|
|
308
|
+
uri_template: "/v1:answerQuery",
|
|
309
|
+
body: "*",
|
|
310
|
+
matches: []
|
|
311
|
+
)
|
|
312
|
+
transcoder.transcode request_pb
|
|
313
|
+
end
|
|
254
314
|
end
|
|
255
315
|
end
|
|
256
316
|
end
|
|
@@ -11,7 +11,7 @@ require 'google/api/resource_pb'
|
|
|
11
11
|
require 'google/protobuf/timestamp_pb'
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
descriptor_data = "\n7google/developers/knowledge/v1/developerknowledge.proto\x12\x1egoogle.developers.knowledge.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\
|
|
14
|
+
descriptor_data = "\n7google/developers/knowledge/v1/developerknowledge.proto\x12\x1egoogle.developers.knowledge.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x83\x03\n\x08\x44ocument\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x10\n\x03uri\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07\x63ontent\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x61ta_source\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x12\n\x05title\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12?\n\x04view\x18\x08 \x01(\x0e\x32,.google.developers.knowledge.v1.DocumentViewB\x03\xe0\x41\x03\x12!\n\x14\x63ontent_length_bytes\x18\t \x01(\x05\x42\x03\xe0\x41\x03:Z\xea\x41W\n*developerknowledge.googleapis.com/Document\x12\x14\x64ocuments/{document}*\tdocuments2\x08\x64ocument\"w\n\x1bSearchDocumentChunksRequest\x12\x12\n\x05query\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"|\n\x1cSearchDocumentChunksResponse\x12>\n\x07results\x18\x01 \x03(\x0b\x32-.google.developers.knowledge.v1.DocumentChunk\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x97\x01\n\x12GetDocumentRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*developerknowledge.googleapis.com/Document\x12?\n\x04view\x18\x02 \x01(\x0e\x32,.google.developers.knowledge.v1.DocumentViewB\x03\xe0\x41\x01\"\x9e\x01\n\x18\x42\x61tchGetDocumentsRequest\x12\x41\n\x05names\x18\x01 \x03(\tB2\xe0\x41\x02\xfa\x41,\n*developerknowledge.googleapis.com/Document\x12?\n\x04view\x18\x02 \x01(\x0e\x32,.google.developers.knowledge.v1.DocumentViewB\x03\xe0\x41\x01\"X\n\x19\x42\x61tchGetDocumentsResponse\x12;\n\tdocuments\x18\x01 \x03(\x0b\x32(.google.developers.knowledge.v1.Document\"(\n\x12\x41nswerQueryRequest\x12\x12\n\x05query\x18\x01 \x01(\tB\x03\xe0\x41\x02\"M\n\x13\x41nswerQueryResponse\x12\x36\n\x06\x61nswer\x18\x01 \x01(\x0b\x32&.google.developers.knowledge.v1.Answer\"\xdb\x04\n\x06\x41nswer\x12\x13\n\x0b\x61nswer_text\x18\x01 \x01(\t\x12M\n\tcitations\x18\x02 \x03(\x0b\x32\x35.google.developers.knowledge.v1.Answer.AnswerCitationB\x03\xe0\x41\x03\x12O\n\nreferences\x18\x03 \x03(\x0b\x32\x36.google.developers.knowledge.v1.Answer.AnswerReferenceB\x03\xe0\x41\x03\x1a\x8f\x01\n\x0e\x41nswerCitation\x12\x18\n\x0bstart_index\x18\x01 \x01(\x05\x42\x03\xe0\x41\x03\x12\x16\n\tend_index\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03\x12K\n\x07sources\x18\x03 \x03(\x0b\x32\x35.google.developers.knowledge.v1.Answer.CitationSourceB\x03\xe0\x41\x03\x1a.\n\x0e\x43itationSource\x12\x1c\n\x0freference_index\x18\x01 \x01(\x05\x42\x03\xe0\x41\x03\x1ay\n\x0f\x41nswerReference\x12[\n\x12\x64ocument_reference\x18\x01 \x01(\x0b\x32\x38.google.developers.knowledge.v1.Answer.DocumentReferenceB\x03\xe0\x41\x03H\x00\x42\t\n\x07\x63ontent\x1a_\n\x11\x44ocumentReference\x12J\n\x0e\x64ocument_chunk\x18\x01 \x01(\x0b\x32-.google.developers.knowledge.v1.DocumentChunkB\x03\xe0\x41\x03\"\xbb\x01\n\rDocumentChunk\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x03\xfa\x41,\n*developerknowledge.googleapis.com/Document\x12\x0f\n\x02id\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07\x63ontent\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12?\n\x08\x64ocument\x18\x04 \x01(\x0b\x32(.google.developers.knowledge.v1.DocumentB\x03\xe0\x41\x03*y\n\x0c\x44ocumentView\x12\x1d\n\x19\x44OCUMENT_VIEW_UNSPECIFIED\x10\x00\x12\x17\n\x13\x44OCUMENT_VIEW_BASIC\x10\x01\x12\x16\n\x12\x44OCUMENT_VIEW_FULL\x10\x02\x12\x19\n\x15\x44OCUMENT_VIEW_CONTENT\x10\x03\x32\x81\x06\n\x12\x44\x65veloperKnowledge\x12\xbd\x01\n\x14SearchDocumentChunks\x12;.google.developers.knowledge.v1.SearchDocumentChunksRequest\x1a<.google.developers.knowledge.v1.SearchDocumentChunksResponse\"*\x82\xd3\xe4\x93\x02$\x12\"/v1/documents:searchDocumentChunks\x12\x93\x01\n\x0bGetDocument\x12\x32.google.developers.knowledge.v1.GetDocumentRequest\x1a(.google.developers.knowledge.v1.Document\"&\xda\x41\x04name\x82\xd3\xe4\x93\x02\x19\x12\x17/v1/{name=documents/**}\x12\xa8\x01\n\x11\x42\x61tchGetDocuments\x12\x38.google.developers.knowledge.v1.BatchGetDocumentsRequest\x1a\x39.google.developers.knowledge.v1.BatchGetDocumentsResponse\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/v1/documents:batchGet\x12\x92\x01\n\x0b\x41nswerQuery\x12\x32.google.developers.knowledge.v1.AnswerQueryRequest\x1a\x33.google.developers.knowledge.v1.AnswerQueryResponse\"\x1a\x82\xd3\xe4\x93\x02\x14\"\x0f/v1:answerQuery:\x01*\x1aU\xca\x41!developerknowledge.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x89\x02\n\"com.google.developers.knowledge.v1B\x17\x44\x65veloperKnowledgeProtoP\x01ZGgoogle.golang.org/genproto/googleapis/developers/knowledge/v1;knowledge\xaa\x02\'Google.Developers.DeveloperKnowledge.V1\xca\x02\'Google\\Developers\\DeveloperKnowledge\\V1\xea\x02*Google::Developers::DeveloperKnowledge::V1b\x06proto3"
|
|
15
15
|
|
|
16
16
|
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
|
17
17
|
pool.add_serialized_file(descriptor_data)
|
|
@@ -26,6 +26,13 @@ module Google
|
|
|
26
26
|
GetDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.developers.knowledge.v1.GetDocumentRequest").msgclass
|
|
27
27
|
BatchGetDocumentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.developers.knowledge.v1.BatchGetDocumentsRequest").msgclass
|
|
28
28
|
BatchGetDocumentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.developers.knowledge.v1.BatchGetDocumentsResponse").msgclass
|
|
29
|
+
AnswerQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.developers.knowledge.v1.AnswerQueryRequest").msgclass
|
|
30
|
+
AnswerQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.developers.knowledge.v1.AnswerQueryResponse").msgclass
|
|
31
|
+
Answer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.developers.knowledge.v1.Answer").msgclass
|
|
32
|
+
Answer::AnswerCitation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.developers.knowledge.v1.Answer.AnswerCitation").msgclass
|
|
33
|
+
Answer::CitationSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.developers.knowledge.v1.Answer.CitationSource").msgclass
|
|
34
|
+
Answer::AnswerReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.developers.knowledge.v1.Answer.AnswerReference").msgclass
|
|
35
|
+
Answer::DocumentReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.developers.knowledge.v1.Answer.DocumentReference").msgclass
|
|
29
36
|
DocumentChunk = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.developers.knowledge.v1.DocumentChunk").msgclass
|
|
30
37
|
DocumentView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.developers.knowledge.v1.DocumentView").enummodule
|
|
31
38
|
end
|
|
@@ -65,6 +65,8 @@ module Google
|
|
|
65
65
|
rpc :GetDocument, ::Google::Developers::DeveloperKnowledge::V1::GetDocumentRequest, ::Google::Developers::DeveloperKnowledge::V1::Document
|
|
66
66
|
# Retrieves multiple documents, each with its full Markdown content.
|
|
67
67
|
rpc :BatchGetDocuments, ::Google::Developers::DeveloperKnowledge::V1::BatchGetDocumentsRequest, ::Google::Developers::DeveloperKnowledge::V1::BatchGetDocumentsResponse
|
|
68
|
+
# Answers a query using grounded generation.
|
|
69
|
+
rpc :AnswerQuery, ::Google::Developers::DeveloperKnowledge::V1::AnswerQueryRequest, ::Google::Developers::DeveloperKnowledge::V1::AnswerQueryResponse
|
|
68
70
|
end
|
|
69
71
|
|
|
70
72
|
Stub = Service.rpc_stub_class
|
|
@@ -53,6 +53,9 @@ module Google
|
|
|
53
53
|
# Output only. Specifies the
|
|
54
54
|
# {::Google::Developers::DeveloperKnowledge::V1::DocumentView DocumentView} of the
|
|
55
55
|
# document.
|
|
56
|
+
# @!attribute [r] content_length_bytes
|
|
57
|
+
# @return [::Integer]
|
|
58
|
+
# Output only. The length of the `content` field in bytes.
|
|
56
59
|
class Document
|
|
57
60
|
include ::Google::Protobuf::MessageExts
|
|
58
61
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
@@ -71,8 +74,7 @@ module Google
|
|
|
71
74
|
#
|
|
72
75
|
# If unspecified, at most 5 results will be returned.
|
|
73
76
|
#
|
|
74
|
-
# The maximum value is
|
|
75
|
-
# error.
|
|
77
|
+
# The maximum value is 100; values above 100 will be coerced to 100.
|
|
76
78
|
# @!attribute [rw] page_token
|
|
77
79
|
# @return [::String]
|
|
78
80
|
# Optional. Contains a page token, received from a previous
|
|
@@ -105,6 +107,10 @@ module Google
|
|
|
105
107
|
# TIMESTAMP fields support `=`, `<`, `<=`, `>`, and `>=` operators.
|
|
106
108
|
# Timestamps must be in RFC-3339 format, e.g., `"2025-01-01T00:00:00Z"`.
|
|
107
109
|
#
|
|
110
|
+
# Note: Field names must be in `snake_case` (e.g., `data_source`). Values on
|
|
111
|
+
# the right-hand side of filtering expressions must be string literals
|
|
112
|
+
# enclosed in double quotes (e.g., `"docs.cloud.google.com"`).
|
|
113
|
+
#
|
|
108
114
|
# You can combine expressions using `AND`, `OR`, and `NOT` (or `-`) logical
|
|
109
115
|
# operators. `OR` has higher precedence than `AND`. Use parentheses for
|
|
110
116
|
# explicit precedence grouping.
|
|
@@ -112,11 +118,11 @@ module Google
|
|
|
112
118
|
# Examples:
|
|
113
119
|
#
|
|
114
120
|
# * `data_source = "docs.cloud.google.com" OR data_source =
|
|
115
|
-
#
|
|
121
|
+
# "firebase.google.com"`
|
|
116
122
|
# * `data_source != "firebase.google.com"`
|
|
117
123
|
# * `update_time < "2024-01-01T00:00:00Z"`
|
|
118
124
|
# * `update_time >= "2025-01-22T00:00:00Z" AND (data_source =
|
|
119
|
-
#
|
|
125
|
+
# "developer.chrome.com" OR data_source = "web.dev")`
|
|
120
126
|
# * `uri = "https://docs.cloud.google.com/release-notes"`
|
|
121
127
|
#
|
|
122
128
|
# The `filter` string must not exceed 500 characters; values longer than 500
|
|
@@ -199,6 +205,92 @@ module Google
|
|
|
199
205
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
200
206
|
end
|
|
201
207
|
|
|
208
|
+
# Request message for
|
|
209
|
+
# {::Google::Developers::DeveloperKnowledge::V1::DeveloperKnowledge::Client#answer_query DeveloperKnowledge.AnswerQuery}.
|
|
210
|
+
# @!attribute [rw] query
|
|
211
|
+
# @return [::String]
|
|
212
|
+
# Required. The query to answer.
|
|
213
|
+
class AnswerQueryRequest
|
|
214
|
+
include ::Google::Protobuf::MessageExts
|
|
215
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# Response message for
|
|
219
|
+
# {::Google::Developers::DeveloperKnowledge::V1::DeveloperKnowledge::Client#answer_query DeveloperKnowledge.AnswerQuery}.
|
|
220
|
+
# @!attribute [rw] answer
|
|
221
|
+
# @return [::Google::Developers::DeveloperKnowledge::V1::Answer]
|
|
222
|
+
# The answer to the query.
|
|
223
|
+
class AnswerQueryResponse
|
|
224
|
+
include ::Google::Protobuf::MessageExts
|
|
225
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# An answer to a query.
|
|
229
|
+
# @!attribute [rw] answer_text
|
|
230
|
+
# @return [::String]
|
|
231
|
+
# Contains the text of the answer.
|
|
232
|
+
# @!attribute [r] citations
|
|
233
|
+
# @return [::Array<::Google::Developers::DeveloperKnowledge::V1::Answer::AnswerCitation>]
|
|
234
|
+
# Output only. Contains citations for the answer.
|
|
235
|
+
# @!attribute [r] references
|
|
236
|
+
# @return [::Array<::Google::Developers::DeveloperKnowledge::V1::Answer::AnswerReference>]
|
|
237
|
+
# Output only. Contains references for the answer.
|
|
238
|
+
class Answer
|
|
239
|
+
include ::Google::Protobuf::MessageExts
|
|
240
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
241
|
+
|
|
242
|
+
# Citation info for a segment.
|
|
243
|
+
# @!attribute [r] start_index
|
|
244
|
+
# @return [::Integer]
|
|
245
|
+
# Output only. Indicates the start of the segment, measured in bytes (UTF-8
|
|
246
|
+
# unicode), inclusive. If there are multi-byte characters, such as
|
|
247
|
+
# non-ASCII characters, the index measurement is longer than the string
|
|
248
|
+
# length.
|
|
249
|
+
# @!attribute [r] end_index
|
|
250
|
+
# @return [::Integer]
|
|
251
|
+
# Output only. Indicates the end of the segment, measured in bytes (UTF-8
|
|
252
|
+
# unicode), exclusive. If there are multi-byte characters, such as
|
|
253
|
+
# non-ASCII characters, the index measurement is longer than the string
|
|
254
|
+
# length.
|
|
255
|
+
# @!attribute [r] sources
|
|
256
|
+
# @return [::Array<::Google::Developers::DeveloperKnowledge::V1::Answer::CitationSource>]
|
|
257
|
+
# Output only. Contains citation sources for the attributed segment.
|
|
258
|
+
class AnswerCitation
|
|
259
|
+
include ::Google::Protobuf::MessageExts
|
|
260
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
# Citation source.
|
|
264
|
+
# @!attribute [r] reference_index
|
|
265
|
+
# @return [::Integer]
|
|
266
|
+
# Output only. Contains the index of the
|
|
267
|
+
# {::Google::Developers::DeveloperKnowledge::V1::Answer::AnswerReference Answer.AnswerReference}
|
|
268
|
+
# in the `references` repeated field.
|
|
269
|
+
class CitationSource
|
|
270
|
+
include ::Google::Protobuf::MessageExts
|
|
271
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# Represents a reference to a source.
|
|
275
|
+
# @!attribute [r] document_reference
|
|
276
|
+
# @return [::Google::Developers::DeveloperKnowledge::V1::Answer::DocumentReference]
|
|
277
|
+
# Output only. The reference document.
|
|
278
|
+
class AnswerReference
|
|
279
|
+
include ::Google::Protobuf::MessageExts
|
|
280
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
# Represents a reference to a document.
|
|
284
|
+
# @!attribute [r] document_chunk
|
|
285
|
+
# @return [::Google::Developers::DeveloperKnowledge::V1::DocumentChunk]
|
|
286
|
+
# Output only. Contains the document chunk. The `document_chunk.id` field
|
|
287
|
+
# is not set and will be empty.
|
|
288
|
+
class DocumentReference
|
|
289
|
+
include ::Google::Protobuf::MessageExts
|
|
290
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
291
|
+
end
|
|
292
|
+
end
|
|
293
|
+
|
|
202
294
|
# A DocumentChunk represents a piece of content from a
|
|
203
295
|
# {::Google::Developers::DeveloperKnowledge::V1::Document Document} in the DeveloperKnowledge
|
|
204
296
|
# corpus. To fetch the entire document content, pass the `parent` to
|
|
@@ -248,6 +340,7 @@ module Google
|
|
|
248
340
|
DOCUMENT_VIEW_UNSPECIFIED = 0
|
|
249
341
|
|
|
250
342
|
# Includes only the basic metadata fields:
|
|
343
|
+
#
|
|
251
344
|
# - `name`
|
|
252
345
|
# - `uri`
|
|
253
346
|
# - `data_source`
|
|
@@ -255,6 +348,7 @@ module Google
|
|
|
255
348
|
# - `description`
|
|
256
349
|
# - `update_time`
|
|
257
350
|
# - `view`
|
|
351
|
+
# - `content_length_bytes`
|
|
258
352
|
#
|
|
259
353
|
# This is the default of view for
|
|
260
354
|
# {::Google::Developers::DeveloperKnowledge::V1::DeveloperKnowledge::Client#search_document_chunks DeveloperKnowledge.SearchDocumentChunks}.
|