google-cloud-ai_platform-v1 0.33.0 → 0.35.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/client.rb +1796 -0
- data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/credentials.rb +47 -0
- data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/operations.rb +787 -0
- data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/paths.rb +111 -0
- data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service.rb +51 -0
- data/lib/google/cloud/ai_platform/v1/feature_online_store_service/client.rb +431 -0
- data/lib/google/cloud/ai_platform/v1/feature_online_store_service/credentials.rb +47 -0
- data/lib/google/cloud/ai_platform/v1/feature_online_store_service/paths.rb +54 -0
- data/lib/google/cloud/ai_platform/v1/feature_online_store_service.rb +47 -0
- data/lib/google/cloud/ai_platform/v1/feature_registry_service/client.rb +1498 -0
- data/lib/google/cloud/ai_platform/v1/feature_registry_service/credentials.rb +47 -0
- data/lib/google/cloud/ai_platform/v1/feature_registry_service/operations.rb +787 -0
- data/lib/google/cloud/ai_platform/v1/feature_registry_service/paths.rb +139 -0
- data/lib/google/cloud/ai_platform/v1/feature_registry_service.rb +51 -0
- data/lib/google/cloud/ai_platform/v1/featurestore_service/client.rb +20 -7
- data/lib/google/cloud/ai_platform/v1/featurestore_service/paths.rb +53 -8
- data/lib/google/cloud/ai_platform/v1/llm_utility_service/client.rb +528 -0
- data/lib/google/cloud/ai_platform/v1/llm_utility_service/credentials.rb +47 -0
- data/lib/google/cloud/ai_platform/v1/llm_utility_service/paths.rb +78 -0
- data/lib/google/cloud/ai_platform/v1/llm_utility_service.rb +49 -0
- data/lib/google/cloud/ai_platform/v1/prediction_service/client.rb +374 -0
- data/lib/google/cloud/ai_platform/v1/version.rb +1 -1
- data/lib/google/cloud/ai_platform/v1.rb +5 -1
- data/lib/google/cloud/aiplatform/v1/custom_job_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/feature_group_pb.rb +50 -0
- data/lib/google/cloud/aiplatform/v1/feature_online_store_admin_service_pb.rb +79 -0
- data/lib/google/cloud/aiplatform/v1/feature_online_store_admin_service_services_pb.rb +71 -0
- data/lib/google/cloud/aiplatform/v1/feature_online_store_pb.rb +50 -0
- data/lib/google/cloud/aiplatform/v1/feature_online_store_service_pb.rb +56 -0
- data/lib/google/cloud/aiplatform/v1/feature_online_store_service_services_pb.rb +44 -0
- data/lib/google/cloud/aiplatform/v1/feature_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/feature_registry_service_pb.rb +66 -0
- data/lib/google/cloud/aiplatform/v1/feature_registry_service_services_pb.rb +64 -0
- data/lib/google/cloud/aiplatform/v1/feature_view_pb.rb +51 -0
- data/lib/google/cloud/aiplatform/v1/feature_view_sync_pb.rb +51 -0
- data/lib/google/cloud/aiplatform/v1/index_pb.rb +3 -1
- data/lib/google/cloud/aiplatform/v1/llm_utility_service_pb.rb +52 -0
- data/lib/google/cloud/aiplatform/v1/llm_utility_service_services_pb.rb +47 -0
- data/lib/google/cloud/aiplatform/v1/machine_resources_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/model_pb.rb +5 -1
- data/lib/google/cloud/aiplatform/v1/prediction_service_pb.rb +9 -1
- data/lib/google/cloud/aiplatform/v1/prediction_service_services_pb.rb +10 -0
- data/lib/google/cloud/aiplatform/v1/study_pb.rb +5 -1
- data/proto_docs/google/api/client.rb +13 -0
- data/proto_docs/google/cloud/aiplatform/v1/custom_job.rb +6 -0
- data/proto_docs/google/cloud/aiplatform/v1/feature.rb +21 -10
- data/proto_docs/google/cloud/aiplatform/v1/feature_group.rb +91 -0
- data/proto_docs/google/cloud/aiplatform/v1/feature_online_store.rb +124 -0
- data/proto_docs/google/cloud/aiplatform/v1/feature_online_store_admin_service.rb +458 -0
- data/proto_docs/google/cloud/aiplatform/v1/feature_online_store_service.rb +102 -0
- data/proto_docs/google/cloud/aiplatform/v1/feature_registry_service.rb +208 -0
- data/proto_docs/google/cloud/aiplatform/v1/feature_view.rb +131 -0
- data/proto_docs/google/cloud/aiplatform/v1/feature_view_sync.rb +48 -0
- data/proto_docs/google/cloud/aiplatform/v1/featurestore_service.rb +32 -7
- data/proto_docs/google/cloud/aiplatform/v1/index.rb +53 -0
- data/proto_docs/google/cloud/aiplatform/v1/index_endpoint.rb +5 -4
- data/proto_docs/google/cloud/aiplatform/v1/llm_utility_service.rb +64 -0
- data/proto_docs/google/cloud/aiplatform/v1/machine_resources.rb +4 -0
- data/proto_docs/google/cloud/aiplatform/v1/model.rb +61 -0
- data/proto_docs/google/cloud/aiplatform/v1/prediction_service.rb +140 -2
- data/proto_docs/google/cloud/aiplatform/v1/study.rb +75 -0
- metadata +40 -2
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 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/ai_platform/v1/version"
|
24
|
+
|
25
|
+
require "google/cloud/ai_platform/v1/llm_utility_service/credentials"
|
26
|
+
require "google/cloud/ai_platform/v1/llm_utility_service/paths"
|
27
|
+
require "google/cloud/ai_platform/v1/llm_utility_service/client"
|
28
|
+
|
29
|
+
module Google
|
30
|
+
module Cloud
|
31
|
+
module AIPlatform
|
32
|
+
module V1
|
33
|
+
##
|
34
|
+
# Service for LLM related utility functions.
|
35
|
+
#
|
36
|
+
# @example Load this service and instantiate a gRPC client
|
37
|
+
#
|
38
|
+
# require "google/cloud/ai_platform/v1/llm_utility_service"
|
39
|
+
# client = ::Google::Cloud::AIPlatform::V1::LlmUtilityService::Client.new
|
40
|
+
#
|
41
|
+
module LlmUtilityService
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
helper_path = ::File.join __dir__, "llm_utility_service", "helpers.rb"
|
49
|
+
require "google/cloud/ai_platform/v1/llm_utility_service/helpers" if ::File.file? helper_path
|
@@ -389,6 +389,274 @@ module Google
|
|
389
389
|
raise ::Google::Cloud::Error.from_error(e)
|
390
390
|
end
|
391
391
|
|
392
|
+
##
|
393
|
+
# Perform an unary online prediction request for Vertex first-party products
|
394
|
+
# and frameworks.
|
395
|
+
#
|
396
|
+
# @overload direct_predict(request, options = nil)
|
397
|
+
# Pass arguments to `direct_predict` via a request object, either of type
|
398
|
+
# {::Google::Cloud::AIPlatform::V1::DirectPredictRequest} or an equivalent Hash.
|
399
|
+
#
|
400
|
+
# @param request [::Google::Cloud::AIPlatform::V1::DirectPredictRequest, ::Hash]
|
401
|
+
# A request object representing the call parameters. Required. To specify no
|
402
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
403
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
404
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
405
|
+
#
|
406
|
+
# @overload direct_predict(endpoint: nil, inputs: nil, parameters: nil)
|
407
|
+
# Pass arguments to `direct_predict` via keyword arguments. Note that at
|
408
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
409
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
410
|
+
#
|
411
|
+
# @param endpoint [::String]
|
412
|
+
# Required. The name of the Endpoint requested to serve the prediction.
|
413
|
+
# Format:
|
414
|
+
# `projects/{project}/locations/{location}/endpoints/{endpoint}`
|
415
|
+
# @param inputs [::Array<::Google::Cloud::AIPlatform::V1::Tensor, ::Hash>]
|
416
|
+
# The prediction input.
|
417
|
+
# @param parameters [::Google::Cloud::AIPlatform::V1::Tensor, ::Hash]
|
418
|
+
# The parameters that govern the prediction.
|
419
|
+
#
|
420
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
421
|
+
# @yieldparam response [::Google::Cloud::AIPlatform::V1::DirectPredictResponse]
|
422
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
423
|
+
#
|
424
|
+
# @return [::Google::Cloud::AIPlatform::V1::DirectPredictResponse]
|
425
|
+
#
|
426
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
427
|
+
#
|
428
|
+
# @example Basic example
|
429
|
+
# require "google/cloud/ai_platform/v1"
|
430
|
+
#
|
431
|
+
# # Create a client object. The client can be reused for multiple calls.
|
432
|
+
# client = Google::Cloud::AIPlatform::V1::PredictionService::Client.new
|
433
|
+
#
|
434
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
435
|
+
# request = Google::Cloud::AIPlatform::V1::DirectPredictRequest.new
|
436
|
+
#
|
437
|
+
# # Call the direct_predict method.
|
438
|
+
# result = client.direct_predict request
|
439
|
+
#
|
440
|
+
# # The returned object is of type Google::Cloud::AIPlatform::V1::DirectPredictResponse.
|
441
|
+
# p result
|
442
|
+
#
|
443
|
+
def direct_predict request, options = nil
|
444
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
445
|
+
|
446
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DirectPredictRequest
|
447
|
+
|
448
|
+
# Converts hash and nil to an options object
|
449
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
450
|
+
|
451
|
+
# Customize the options with defaults
|
452
|
+
metadata = @config.rpcs.direct_predict.metadata.to_h
|
453
|
+
|
454
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
455
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
456
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
457
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
458
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
459
|
+
|
460
|
+
header_params = {}
|
461
|
+
if request.endpoint
|
462
|
+
header_params["endpoint"] = request.endpoint
|
463
|
+
end
|
464
|
+
|
465
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
466
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
467
|
+
|
468
|
+
options.apply_defaults timeout: @config.rpcs.direct_predict.timeout,
|
469
|
+
metadata: metadata,
|
470
|
+
retry_policy: @config.rpcs.direct_predict.retry_policy
|
471
|
+
|
472
|
+
options.apply_defaults timeout: @config.timeout,
|
473
|
+
metadata: @config.metadata,
|
474
|
+
retry_policy: @config.retry_policy
|
475
|
+
|
476
|
+
@prediction_service_stub.call_rpc :direct_predict, request, options: options do |response, operation|
|
477
|
+
yield response, operation if block_given?
|
478
|
+
return response
|
479
|
+
end
|
480
|
+
rescue ::GRPC::BadStatus => e
|
481
|
+
raise ::Google::Cloud::Error.from_error(e)
|
482
|
+
end
|
483
|
+
|
484
|
+
##
|
485
|
+
# Perform an online prediction request through gRPC.
|
486
|
+
#
|
487
|
+
# @overload direct_raw_predict(request, options = nil)
|
488
|
+
# Pass arguments to `direct_raw_predict` via a request object, either of type
|
489
|
+
# {::Google::Cloud::AIPlatform::V1::DirectRawPredictRequest} or an equivalent Hash.
|
490
|
+
#
|
491
|
+
# @param request [::Google::Cloud::AIPlatform::V1::DirectRawPredictRequest, ::Hash]
|
492
|
+
# A request object representing the call parameters. Required. To specify no
|
493
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
494
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
495
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
496
|
+
#
|
497
|
+
# @overload direct_raw_predict(endpoint: nil, method_name: nil, input: nil)
|
498
|
+
# Pass arguments to `direct_raw_predict` via keyword arguments. Note that at
|
499
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
500
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
501
|
+
#
|
502
|
+
# @param endpoint [::String]
|
503
|
+
# Required. The name of the Endpoint requested to serve the prediction.
|
504
|
+
# Format:
|
505
|
+
# `projects/{project}/locations/{location}/endpoints/{endpoint}`
|
506
|
+
# @param method_name [::String]
|
507
|
+
# Fully qualified name of the API method being invoked to perform
|
508
|
+
# predictions.
|
509
|
+
#
|
510
|
+
# Format:
|
511
|
+
# `/namespace.Service/Method/`
|
512
|
+
# Example:
|
513
|
+
# `/tensorflow.serving.PredictionService/Predict`
|
514
|
+
# @param input [::String]
|
515
|
+
# The prediction input.
|
516
|
+
#
|
517
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
518
|
+
# @yieldparam response [::Google::Cloud::AIPlatform::V1::DirectRawPredictResponse]
|
519
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
520
|
+
#
|
521
|
+
# @return [::Google::Cloud::AIPlatform::V1::DirectRawPredictResponse]
|
522
|
+
#
|
523
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
524
|
+
#
|
525
|
+
# @example Basic example
|
526
|
+
# require "google/cloud/ai_platform/v1"
|
527
|
+
#
|
528
|
+
# # Create a client object. The client can be reused for multiple calls.
|
529
|
+
# client = Google::Cloud::AIPlatform::V1::PredictionService::Client.new
|
530
|
+
#
|
531
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
532
|
+
# request = Google::Cloud::AIPlatform::V1::DirectRawPredictRequest.new
|
533
|
+
#
|
534
|
+
# # Call the direct_raw_predict method.
|
535
|
+
# result = client.direct_raw_predict request
|
536
|
+
#
|
537
|
+
# # The returned object is of type Google::Cloud::AIPlatform::V1::DirectRawPredictResponse.
|
538
|
+
# p result
|
539
|
+
#
|
540
|
+
def direct_raw_predict request, options = nil
|
541
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
542
|
+
|
543
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DirectRawPredictRequest
|
544
|
+
|
545
|
+
# Converts hash and nil to an options object
|
546
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
547
|
+
|
548
|
+
# Customize the options with defaults
|
549
|
+
metadata = @config.rpcs.direct_raw_predict.metadata.to_h
|
550
|
+
|
551
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
552
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
553
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
554
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
555
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
556
|
+
|
557
|
+
header_params = {}
|
558
|
+
if request.endpoint
|
559
|
+
header_params["endpoint"] = request.endpoint
|
560
|
+
end
|
561
|
+
|
562
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
563
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
564
|
+
|
565
|
+
options.apply_defaults timeout: @config.rpcs.direct_raw_predict.timeout,
|
566
|
+
metadata: metadata,
|
567
|
+
retry_policy: @config.rpcs.direct_raw_predict.retry_policy
|
568
|
+
|
569
|
+
options.apply_defaults timeout: @config.timeout,
|
570
|
+
metadata: @config.metadata,
|
571
|
+
retry_policy: @config.retry_policy
|
572
|
+
|
573
|
+
@prediction_service_stub.call_rpc :direct_raw_predict, request, options: options do |response, operation|
|
574
|
+
yield response, operation if block_given?
|
575
|
+
return response
|
576
|
+
end
|
577
|
+
rescue ::GRPC::BadStatus => e
|
578
|
+
raise ::Google::Cloud::Error.from_error(e)
|
579
|
+
end
|
580
|
+
|
581
|
+
##
|
582
|
+
# Perform a streaming online prediction request for Vertex first-party
|
583
|
+
# products and frameworks.
|
584
|
+
#
|
585
|
+
# @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::AIPlatform::V1::StreamingPredictRequest, ::Hash>]
|
586
|
+
# An enumerable of {::Google::Cloud::AIPlatform::V1::StreamingPredictRequest} instances.
|
587
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
588
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
589
|
+
#
|
590
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
591
|
+
# @yieldparam response [::Enumerable<::Google::Cloud::AIPlatform::V1::StreamingPredictResponse>]
|
592
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
593
|
+
#
|
594
|
+
# @return [::Enumerable<::Google::Cloud::AIPlatform::V1::StreamingPredictResponse>]
|
595
|
+
#
|
596
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
597
|
+
#
|
598
|
+
# @example Basic example
|
599
|
+
# require "google/cloud/ai_platform/v1"
|
600
|
+
#
|
601
|
+
# # Create a client object. The client can be reused for multiple calls.
|
602
|
+
# client = Google::Cloud::AIPlatform::V1::PredictionService::Client.new
|
603
|
+
#
|
604
|
+
# # Create an input stream.
|
605
|
+
# input = Gapic::StreamInput.new
|
606
|
+
#
|
607
|
+
# # Call the streaming_predict method to start streaming.
|
608
|
+
# output = client.streaming_predict input
|
609
|
+
#
|
610
|
+
# # Send requests on the stream. For each request object, set fields by
|
611
|
+
# # passing keyword arguments. Be sure to close the stream when done.
|
612
|
+
# input << Google::Cloud::AIPlatform::V1::StreamingPredictRequest.new
|
613
|
+
# input << Google::Cloud::AIPlatform::V1::StreamingPredictRequest.new
|
614
|
+
# input.close
|
615
|
+
#
|
616
|
+
# # The returned object is a streamed enumerable yielding elements of type
|
617
|
+
# # ::Google::Cloud::AIPlatform::V1::StreamingPredictResponse
|
618
|
+
# output.each do |current_response|
|
619
|
+
# p current_response
|
620
|
+
# end
|
621
|
+
#
|
622
|
+
def streaming_predict request, options = nil
|
623
|
+
unless request.is_a? ::Enumerable
|
624
|
+
raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum
|
625
|
+
request = request.to_enum
|
626
|
+
end
|
627
|
+
|
628
|
+
request = request.lazy.map do |req|
|
629
|
+
::Gapic::Protobuf.coerce req, to: ::Google::Cloud::AIPlatform::V1::StreamingPredictRequest
|
630
|
+
end
|
631
|
+
|
632
|
+
# Converts hash and nil to an options object
|
633
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
634
|
+
|
635
|
+
# Customize the options with defaults
|
636
|
+
metadata = @config.rpcs.streaming_predict.metadata.to_h
|
637
|
+
|
638
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
639
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
640
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
641
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
642
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
643
|
+
|
644
|
+
options.apply_defaults timeout: @config.rpcs.streaming_predict.timeout,
|
645
|
+
metadata: metadata,
|
646
|
+
retry_policy: @config.rpcs.streaming_predict.retry_policy
|
647
|
+
|
648
|
+
options.apply_defaults timeout: @config.timeout,
|
649
|
+
metadata: @config.metadata,
|
650
|
+
retry_policy: @config.retry_policy
|
651
|
+
|
652
|
+
@prediction_service_stub.call_rpc :streaming_predict, request, options: options do |response, operation|
|
653
|
+
yield response, operation if block_given?
|
654
|
+
return response
|
655
|
+
end
|
656
|
+
rescue ::GRPC::BadStatus => e
|
657
|
+
raise ::Google::Cloud::Error.from_error(e)
|
658
|
+
end
|
659
|
+
|
392
660
|
##
|
393
661
|
# Perform a server-side streaming online prediction request for Vertex
|
394
662
|
# LLM streaming.
|
@@ -484,6 +752,84 @@ module Google
|
|
484
752
|
raise ::Google::Cloud::Error.from_error(e)
|
485
753
|
end
|
486
754
|
|
755
|
+
##
|
756
|
+
# Perform a streaming online prediction request through gRPC.
|
757
|
+
#
|
758
|
+
# @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::AIPlatform::V1::StreamingRawPredictRequest, ::Hash>]
|
759
|
+
# An enumerable of {::Google::Cloud::AIPlatform::V1::StreamingRawPredictRequest} instances.
|
760
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
761
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
762
|
+
#
|
763
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
764
|
+
# @yieldparam response [::Enumerable<::Google::Cloud::AIPlatform::V1::StreamingRawPredictResponse>]
|
765
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
766
|
+
#
|
767
|
+
# @return [::Enumerable<::Google::Cloud::AIPlatform::V1::StreamingRawPredictResponse>]
|
768
|
+
#
|
769
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
770
|
+
#
|
771
|
+
# @example Basic example
|
772
|
+
# require "google/cloud/ai_platform/v1"
|
773
|
+
#
|
774
|
+
# # Create a client object. The client can be reused for multiple calls.
|
775
|
+
# client = Google::Cloud::AIPlatform::V1::PredictionService::Client.new
|
776
|
+
#
|
777
|
+
# # Create an input stream.
|
778
|
+
# input = Gapic::StreamInput.new
|
779
|
+
#
|
780
|
+
# # Call the streaming_raw_predict method to start streaming.
|
781
|
+
# output = client.streaming_raw_predict input
|
782
|
+
#
|
783
|
+
# # Send requests on the stream. For each request object, set fields by
|
784
|
+
# # passing keyword arguments. Be sure to close the stream when done.
|
785
|
+
# input << Google::Cloud::AIPlatform::V1::StreamingRawPredictRequest.new
|
786
|
+
# input << Google::Cloud::AIPlatform::V1::StreamingRawPredictRequest.new
|
787
|
+
# input.close
|
788
|
+
#
|
789
|
+
# # The returned object is a streamed enumerable yielding elements of type
|
790
|
+
# # ::Google::Cloud::AIPlatform::V1::StreamingRawPredictResponse
|
791
|
+
# output.each do |current_response|
|
792
|
+
# p current_response
|
793
|
+
# end
|
794
|
+
#
|
795
|
+
def streaming_raw_predict request, options = nil
|
796
|
+
unless request.is_a? ::Enumerable
|
797
|
+
raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum
|
798
|
+
request = request.to_enum
|
799
|
+
end
|
800
|
+
|
801
|
+
request = request.lazy.map do |req|
|
802
|
+
::Gapic::Protobuf.coerce req, to: ::Google::Cloud::AIPlatform::V1::StreamingRawPredictRequest
|
803
|
+
end
|
804
|
+
|
805
|
+
# Converts hash and nil to an options object
|
806
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
807
|
+
|
808
|
+
# Customize the options with defaults
|
809
|
+
metadata = @config.rpcs.streaming_raw_predict.metadata.to_h
|
810
|
+
|
811
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
812
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
813
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
814
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
815
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
816
|
+
|
817
|
+
options.apply_defaults timeout: @config.rpcs.streaming_raw_predict.timeout,
|
818
|
+
metadata: metadata,
|
819
|
+
retry_policy: @config.rpcs.streaming_raw_predict.retry_policy
|
820
|
+
|
821
|
+
options.apply_defaults timeout: @config.timeout,
|
822
|
+
metadata: @config.metadata,
|
823
|
+
retry_policy: @config.retry_policy
|
824
|
+
|
825
|
+
@prediction_service_stub.call_rpc :streaming_raw_predict, request, options: options do |response, operation|
|
826
|
+
yield response, operation if block_given?
|
827
|
+
return response
|
828
|
+
end
|
829
|
+
rescue ::GRPC::BadStatus => e
|
830
|
+
raise ::Google::Cloud::Error.from_error(e)
|
831
|
+
end
|
832
|
+
|
487
833
|
##
|
488
834
|
# Perform an online explanation.
|
489
835
|
#
|
@@ -766,11 +1112,31 @@ module Google
|
|
766
1112
|
#
|
767
1113
|
attr_reader :raw_predict
|
768
1114
|
##
|
1115
|
+
# RPC-specific configuration for `direct_predict`
|
1116
|
+
# @return [::Gapic::Config::Method]
|
1117
|
+
#
|
1118
|
+
attr_reader :direct_predict
|
1119
|
+
##
|
1120
|
+
# RPC-specific configuration for `direct_raw_predict`
|
1121
|
+
# @return [::Gapic::Config::Method]
|
1122
|
+
#
|
1123
|
+
attr_reader :direct_raw_predict
|
1124
|
+
##
|
1125
|
+
# RPC-specific configuration for `streaming_predict`
|
1126
|
+
# @return [::Gapic::Config::Method]
|
1127
|
+
#
|
1128
|
+
attr_reader :streaming_predict
|
1129
|
+
##
|
769
1130
|
# RPC-specific configuration for `server_streaming_predict`
|
770
1131
|
# @return [::Gapic::Config::Method]
|
771
1132
|
#
|
772
1133
|
attr_reader :server_streaming_predict
|
773
1134
|
##
|
1135
|
+
# RPC-specific configuration for `streaming_raw_predict`
|
1136
|
+
# @return [::Gapic::Config::Method]
|
1137
|
+
#
|
1138
|
+
attr_reader :streaming_raw_predict
|
1139
|
+
##
|
774
1140
|
# RPC-specific configuration for `explain`
|
775
1141
|
# @return [::Gapic::Config::Method]
|
776
1142
|
#
|
@@ -782,8 +1148,16 @@ module Google
|
|
782
1148
|
@predict = ::Gapic::Config::Method.new predict_config
|
783
1149
|
raw_predict_config = parent_rpcs.raw_predict if parent_rpcs.respond_to? :raw_predict
|
784
1150
|
@raw_predict = ::Gapic::Config::Method.new raw_predict_config
|
1151
|
+
direct_predict_config = parent_rpcs.direct_predict if parent_rpcs.respond_to? :direct_predict
|
1152
|
+
@direct_predict = ::Gapic::Config::Method.new direct_predict_config
|
1153
|
+
direct_raw_predict_config = parent_rpcs.direct_raw_predict if parent_rpcs.respond_to? :direct_raw_predict
|
1154
|
+
@direct_raw_predict = ::Gapic::Config::Method.new direct_raw_predict_config
|
1155
|
+
streaming_predict_config = parent_rpcs.streaming_predict if parent_rpcs.respond_to? :streaming_predict
|
1156
|
+
@streaming_predict = ::Gapic::Config::Method.new streaming_predict_config
|
785
1157
|
server_streaming_predict_config = parent_rpcs.server_streaming_predict if parent_rpcs.respond_to? :server_streaming_predict
|
786
1158
|
@server_streaming_predict = ::Gapic::Config::Method.new server_streaming_predict_config
|
1159
|
+
streaming_raw_predict_config = parent_rpcs.streaming_raw_predict if parent_rpcs.respond_to? :streaming_raw_predict
|
1160
|
+
@streaming_raw_predict = ::Gapic::Config::Method.new streaming_raw_predict_config
|
787
1161
|
explain_config = parent_rpcs.explain if parent_rpcs.respond_to? :explain
|
788
1162
|
@explain = ::Gapic::Config::Method.new explain_config
|
789
1163
|
|
@@ -18,18 +18,22 @@
|
|
18
18
|
|
19
19
|
require "google/cloud/ai_platform/v1/dataset_service"
|
20
20
|
require "google/cloud/ai_platform/v1/endpoint_service"
|
21
|
+
require "google/cloud/ai_platform/v1/feature_online_store_admin_service"
|
21
22
|
require "google/cloud/ai_platform/v1/featurestore_online_serving_service"
|
23
|
+
require "google/cloud/ai_platform/v1/feature_online_store_service"
|
22
24
|
require "google/cloud/ai_platform/v1/featurestore_service"
|
25
|
+
require "google/cloud/ai_platform/v1/feature_registry_service"
|
23
26
|
require "google/cloud/ai_platform/v1/index_endpoint_service"
|
24
27
|
require "google/cloud/ai_platform/v1/index_service"
|
25
28
|
require "google/cloud/ai_platform/v1/job_service"
|
29
|
+
require "google/cloud/ai_platform/v1/prediction_service"
|
30
|
+
require "google/cloud/ai_platform/v1/llm_utility_service"
|
26
31
|
require "google/cloud/ai_platform/v1/match_service"
|
27
32
|
require "google/cloud/ai_platform/v1/metadata_service"
|
28
33
|
require "google/cloud/ai_platform/v1/migration_service"
|
29
34
|
require "google/cloud/ai_platform/v1/model_service"
|
30
35
|
require "google/cloud/ai_platform/v1/model_garden_service"
|
31
36
|
require "google/cloud/ai_platform/v1/pipeline_service"
|
32
|
-
require "google/cloud/ai_platform/v1/prediction_service"
|
33
37
|
require "google/cloud/ai_platform/v1/schedule_service"
|
34
38
|
require "google/cloud/ai_platform/v1/specialist_pool_service"
|
35
39
|
require "google/cloud/ai_platform/v1/tensorboard_service"
|
@@ -16,7 +16,7 @@ require 'google/protobuf/timestamp_pb'
|
|
16
16
|
require 'google/rpc/status_pb'
|
17
17
|
|
18
18
|
|
19
|
-
descriptor_data = "\n+google/cloud/aiplatform/v1/custom_job.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x30google/cloud/aiplatform/v1/encryption_spec.proto\x1a(google/cloud/aiplatform/v1/env_var.proto\x1a#google/cloud/aiplatform/v1/io.proto\x1a*google/cloud/aiplatform/v1/job_state.proto\x1a\x32google/cloud/aiplatform/v1/machine_resources.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xe1\x06\n\tCustomJob\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12@\n\x08job_spec\x18\x04 \x01(\x0b\x32).google.cloud.aiplatform.v1.CustomJobSpecB\x03\xe0\x41\x02\x12\x38\n\x05state\x18\x05 \x01(\x0e\x32$.google.cloud.aiplatform.v1.JobStateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\n \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x41\n\x06labels\x18\x0b \x03(\x0b\x32\x31.google.cloud.aiplatform.v1.CustomJob.LabelsEntry\x12\x43\n\x0f\x65ncryption_spec\x18\x0c \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpec\x12V\n\x0fweb_access_uris\x18\x10 \x03(\x0b\x32\x38.google.cloud.aiplatform.v1.CustomJob.WebAccessUrisEntryB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x34\n\x12WebAccessUrisEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:i\xea\x41\x66\n#aiplatform.googleapis.com/CustomJob\x12?projects/{project}/locations/{location}/customJobs/{custom_job}\"\
|
19
|
+
descriptor_data = "\n+google/cloud/aiplatform/v1/custom_job.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x30google/cloud/aiplatform/v1/encryption_spec.proto\x1a(google/cloud/aiplatform/v1/env_var.proto\x1a#google/cloud/aiplatform/v1/io.proto\x1a*google/cloud/aiplatform/v1/job_state.proto\x1a\x32google/cloud/aiplatform/v1/machine_resources.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xe1\x06\n\tCustomJob\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12@\n\x08job_spec\x18\x04 \x01(\x0b\x32).google.cloud.aiplatform.v1.CustomJobSpecB\x03\xe0\x41\x02\x12\x38\n\x05state\x18\x05 \x01(\x0e\x32$.google.cloud.aiplatform.v1.JobStateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\n \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x41\n\x06labels\x18\x0b \x03(\x0b\x32\x31.google.cloud.aiplatform.v1.CustomJob.LabelsEntry\x12\x43\n\x0f\x65ncryption_spec\x18\x0c \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpec\x12V\n\x0fweb_access_uris\x18\x10 \x03(\x0b\x32\x38.google.cloud.aiplatform.v1.CustomJob.WebAccessUrisEntryB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x34\n\x12WebAccessUrisEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:i\xea\x41\x66\n#aiplatform.googleapis.com/CustomJob\x12?projects/{project}/locations/{location}/customJobs/{custom_job}\"\x89\x05\n\rCustomJobSpec\x12J\n\x11worker_pool_specs\x18\x01 \x03(\x0b\x32*.google.cloud.aiplatform.v1.WorkerPoolSpecB\x03\xe0\x41\x02\x12:\n\nscheduling\x18\x03 \x01(\x0b\x32&.google.cloud.aiplatform.v1.Scheduling\x12\x17\n\x0fservice_account\x18\x04 \x01(\t\x12\x37\n\x07network\x18\x05 \x01(\tB&\xe0\x41\x01\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12\x1f\n\x12reserved_ip_ranges\x18\r \x03(\tB\x03\xe0\x41\x01\x12I\n\x15\x62\x61se_output_directory\x18\x06 \x01(\x0b\x32*.google.cloud.aiplatform.v1.GcsDestination\x12&\n\x1eprotected_artifact_location_id\x18\x13 \x01(\t\x12\x42\n\x0btensorboard\x18\x07 \x01(\tB-\xe0\x41\x01\xfa\x41\'\n%aiplatform.googleapis.com/Tensorboard\x12\x1e\n\x11\x65nable_web_access\x18\n \x01(\x08\x42\x03\xe0\x41\x01\x12$\n\x17\x65nable_dashboard_access\x18\x10 \x01(\x08\x42\x03\xe0\x41\x01\x12=\n\nexperiment\x18\x11 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!aiplatform.googleapis.com/Context\x12\x41\n\x0e\x65xperiment_run\x18\x12 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!aiplatform.googleapis.com/Context\"\x86\x03\n\x0eWorkerPoolSpec\x12\x43\n\x0e\x63ontainer_spec\x18\x06 \x01(\x0b\x32).google.cloud.aiplatform.v1.ContainerSpecH\x00\x12L\n\x13python_package_spec\x18\x07 \x01(\x0b\x32-.google.cloud.aiplatform.v1.PythonPackageSpecH\x00\x12\x45\n\x0cmachine_spec\x18\x01 \x01(\x0b\x32\'.google.cloud.aiplatform.v1.MachineSpecB\x06\xe0\x41\x01\xe0\x41\x05\x12\x1a\n\rreplica_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01\x12=\n\nnfs_mounts\x18\x04 \x03(\x0b\x32$.google.cloud.aiplatform.v1.NfsMountB\x03\xe0\x41\x01\x12\x37\n\tdisk_spec\x18\x05 \x01(\x0b\x32$.google.cloud.aiplatform.v1.DiskSpecB\x06\n\x04task\"w\n\rContainerSpec\x12\x16\n\timage_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0f\n\x07\x63ommand\x18\x02 \x03(\t\x12\x0c\n\x04\x61rgs\x18\x03 \x03(\t\x12/\n\x03\x65nv\x18\x04 \x03(\x0b\x32\".google.cloud.aiplatform.v1.EnvVar\"\xaa\x01\n\x11PythonPackageSpec\x12\x1f\n\x12\x65xecutor_image_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0cpackage_uris\x18\x02 \x03(\tB\x03\xe0\x41\x02\x12\x1a\n\rpython_module\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x0c\n\x04\x61rgs\x18\x04 \x03(\t\x12/\n\x03\x65nv\x18\x05 \x03(\x0b\x32\".google.cloud.aiplatform.v1.EnvVar\"}\n\nScheduling\x12*\n\x07timeout\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12%\n\x1drestart_job_on_worker_restart\x18\x03 \x01(\x08\x12\x1c\n\x0f\x64isable_retries\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x42\xcc\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x0e\x43ustomJobProtoP\x01Z>cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb\xaa\x02\x1aGoogle.Cloud.AIPlatform.V1\xca\x02\x1aGoogle\\Cloud\\AIPlatform\\V1\xea\x02\x1dGoogle::Cloud::AIPlatform::V1b\x06proto3"
|
20
20
|
|
21
21
|
pool = Google::Protobuf::DescriptorPool.generated_pool
|
22
22
|
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: google/cloud/aiplatform/v1/feature_group.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
require 'google/api/field_behavior_pb'
|
8
|
+
require 'google/api/resource_pb'
|
9
|
+
require 'google/cloud/aiplatform/v1/io_pb'
|
10
|
+
require 'google/protobuf/timestamp_pb'
|
11
|
+
|
12
|
+
|
13
|
+
descriptor_data = "\n.google/cloud/aiplatform/v1/feature_group.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/aiplatform/v1/io.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x93\x05\n\x0c\x46\x65\x61tureGroup\x12\x46\n\tbig_query\x18\x07 \x01(\x0b\x32\x31.google.cloud.aiplatform.v1.FeatureGroup.BigQueryH\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12I\n\x06labels\x18\x05 \x03(\x0b\x32\x34.google.cloud.aiplatform.v1.FeatureGroup.LabelsEntryB\x03\xe0\x41\x01\x12\x18\n\x0b\x64\x65scription\x18\x06 \x01(\tB\x03\xe0\x41\x01\x1ax\n\x08\x42igQuery\x12L\n\x10\x62ig_query_source\x18\x01 \x01(\x0b\x32*.google.cloud.aiplatform.v1.BigQuerySourceB\x06\xe0\x41\x05\xe0\x41\x02\x12\x1e\n\x11\x65ntity_id_columns\x18\x02 \x03(\tB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x90\x01\xea\x41\x8c\x01\n&aiplatform.googleapis.com/FeatureGroup\x12\x45projects/{project}/locations/{location}/featureGroups/{feature_group}*\rfeatureGroups2\x0c\x66\x65\x61tureGroupB\x08\n\x06sourceB\xcf\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x11\x46\x65\x61tureGroupProtoP\x01Z>cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb\xaa\x02\x1aGoogle.Cloud.AIPlatform.V1\xca\x02\x1aGoogle\\Cloud\\AIPlatform\\V1\xea\x02\x1dGoogle::Cloud::AIPlatform::V1b\x06proto3"
|
14
|
+
|
15
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
16
|
+
|
17
|
+
begin
|
18
|
+
pool.add_serialized_file(descriptor_data)
|
19
|
+
rescue TypeError => e
|
20
|
+
# Compatibility code: will be removed in the next major version.
|
21
|
+
require 'google/protobuf/descriptor_pb'
|
22
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
23
|
+
parsed.clear_dependency
|
24
|
+
serialized = parsed.class.encode(parsed)
|
25
|
+
file = pool.add_serialized_file(serialized)
|
26
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
27
|
+
imports = [
|
28
|
+
["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"],
|
29
|
+
["google.cloud.aiplatform.v1.BigQuerySource", "google/cloud/aiplatform/v1/io.proto"],
|
30
|
+
]
|
31
|
+
imports.each do |type_name, expected_filename|
|
32
|
+
import_file = pool.lookup(type_name).file_descriptor
|
33
|
+
if import_file.name != expected_filename
|
34
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
38
|
+
warn "This will become an error in the next major version."
|
39
|
+
end
|
40
|
+
|
41
|
+
module Google
|
42
|
+
module Cloud
|
43
|
+
module AIPlatform
|
44
|
+
module V1
|
45
|
+
FeatureGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureGroup").msgclass
|
46
|
+
FeatureGroup::BigQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.FeatureGroup.BigQuery").msgclass
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|