google-cloud-ai_platform-v1 1.29.0 → 1.30.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.
- checksums.yaml +4 -4
- data/lib/google/cloud/ai_platform/v1/prediction_service/client.rb +106 -0
- data/lib/google/cloud/ai_platform/v1/prediction_service/rest/client.rb +99 -0
- data/lib/google/cloud/ai_platform/v1/prediction_service/rest/service_stub.rb +62 -0
- data/lib/google/cloud/ai_platform/v1/version.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/prediction_service_pb.rb +7 -1
- data/lib/google/cloud/aiplatform/v1/prediction_service_services_pb.rb +2 -0
- data/lib/google/cloud/aiplatform/v1/usage_metadata_pb.rb +47 -0
- data/proto_docs/google/cloud/aiplatform/v1/prediction_service.rb +84 -0
- data/proto_docs/google/cloud/aiplatform/v1/usage_metadata.rb +91 -0
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bc4da46a7070d2c31cd3c49cc499be1dc468379795da7a5830d4720d4d74ba7b
|
|
4
|
+
data.tar.gz: 7efa2a1f511d739265e85654a61f273bf1090f8637dbedb57999635036514513
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 99289cb94666a5c34f458458baaf362dbf62b0ca5307698b2a2530ba4e98ced92766aa55c5a5fe17b53dd530e7a57e231331b68aa2509506a68ebf5225086aa6
|
|
7
|
+
data.tar.gz: '0539d3d2495c0948575efb89ff9cb13b3a9b4ce28d5bcdbed7a3bed424d17a8591bb310ffce3de1a60fbf6bb3e68f8a4d99358292669c618ded95a7f49e9aceb'
|
|
@@ -1523,6 +1523,105 @@ module Google
|
|
|
1523
1523
|
raise ::Google::Cloud::Error.from_error(e)
|
|
1524
1524
|
end
|
|
1525
1525
|
|
|
1526
|
+
##
|
|
1527
|
+
# Embed content with multimodal inputs.
|
|
1528
|
+
#
|
|
1529
|
+
# @overload embed_content(request, options = nil)
|
|
1530
|
+
# Pass arguments to `embed_content` via a request object, either of type
|
|
1531
|
+
# {::Google::Cloud::AIPlatform::V1::EmbedContentRequest} or an equivalent Hash.
|
|
1532
|
+
#
|
|
1533
|
+
# @param request [::Google::Cloud::AIPlatform::V1::EmbedContentRequest, ::Hash]
|
|
1534
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1535
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1536
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1537
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
1538
|
+
#
|
|
1539
|
+
# @overload embed_content(model: nil, content: nil, title: nil, task_type: nil, output_dimensionality: nil, auto_truncate: nil)
|
|
1540
|
+
# Pass arguments to `embed_content` via keyword arguments. Note that at
|
|
1541
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1542
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1543
|
+
#
|
|
1544
|
+
# @param model [::String]
|
|
1545
|
+
# Required. The name of the publisher model requested to serve the
|
|
1546
|
+
# prediction. Format:
|
|
1547
|
+
# `projects/{project}/locations/{location}/publishers/*/models/*`
|
|
1548
|
+
# @param content [::Google::Cloud::AIPlatform::V1::Content, ::Hash]
|
|
1549
|
+
# Required. Input content to be embedded. Required.
|
|
1550
|
+
# @param title [::String]
|
|
1551
|
+
# Optional. An optional title for the text.
|
|
1552
|
+
# @param task_type [::Google::Cloud::AIPlatform::V1::EmbedContentRequest::EmbeddingTaskType]
|
|
1553
|
+
# Optional. The task type of the embedding.
|
|
1554
|
+
# @param output_dimensionality [::Integer]
|
|
1555
|
+
# Optional. Optional reduced dimension for the output embedding. If set,
|
|
1556
|
+
# excessive values in the output embedding are truncated from the end.
|
|
1557
|
+
# @param auto_truncate [::Boolean]
|
|
1558
|
+
# Optional. Whether to silently truncate the input content if it's longer
|
|
1559
|
+
# than the maximum sequence length.
|
|
1560
|
+
#
|
|
1561
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
1562
|
+
# @yieldparam response [::Google::Cloud::AIPlatform::V1::EmbedContentResponse]
|
|
1563
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
1564
|
+
#
|
|
1565
|
+
# @return [::Google::Cloud::AIPlatform::V1::EmbedContentResponse]
|
|
1566
|
+
#
|
|
1567
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
1568
|
+
#
|
|
1569
|
+
# @example Basic example
|
|
1570
|
+
# require "google/cloud/ai_platform/v1"
|
|
1571
|
+
#
|
|
1572
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1573
|
+
# client = Google::Cloud::AIPlatform::V1::PredictionService::Client.new
|
|
1574
|
+
#
|
|
1575
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1576
|
+
# request = Google::Cloud::AIPlatform::V1::EmbedContentRequest.new
|
|
1577
|
+
#
|
|
1578
|
+
# # Call the embed_content method.
|
|
1579
|
+
# result = client.embed_content request
|
|
1580
|
+
#
|
|
1581
|
+
# # The returned object is of type Google::Cloud::AIPlatform::V1::EmbedContentResponse.
|
|
1582
|
+
# p result
|
|
1583
|
+
#
|
|
1584
|
+
def embed_content request, options = nil
|
|
1585
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1586
|
+
|
|
1587
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::EmbedContentRequest
|
|
1588
|
+
|
|
1589
|
+
# Converts hash and nil to an options object
|
|
1590
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1591
|
+
|
|
1592
|
+
# Customize the options with defaults
|
|
1593
|
+
metadata = @config.rpcs.embed_content.metadata.to_h
|
|
1594
|
+
|
|
1595
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1596
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1597
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1598
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
|
1599
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1600
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1601
|
+
|
|
1602
|
+
header_params = {}
|
|
1603
|
+
if request.model
|
|
1604
|
+
header_params["model"] = request.model
|
|
1605
|
+
end
|
|
1606
|
+
|
|
1607
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
1608
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
1609
|
+
|
|
1610
|
+
options.apply_defaults timeout: @config.rpcs.embed_content.timeout,
|
|
1611
|
+
metadata: metadata,
|
|
1612
|
+
retry_policy: @config.rpcs.embed_content.retry_policy
|
|
1613
|
+
|
|
1614
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1615
|
+
metadata: @config.metadata,
|
|
1616
|
+
retry_policy: @config.retry_policy
|
|
1617
|
+
|
|
1618
|
+
@prediction_service_stub.call_rpc :embed_content, request, options: options do |response, operation|
|
|
1619
|
+
yield response, operation if block_given?
|
|
1620
|
+
end
|
|
1621
|
+
rescue ::GRPC::BadStatus => e
|
|
1622
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1623
|
+
end
|
|
1624
|
+
|
|
1526
1625
|
##
|
|
1527
1626
|
# Configuration class for the PredictionService API.
|
|
1528
1627
|
#
|
|
@@ -1754,6 +1853,11 @@ module Google
|
|
|
1754
1853
|
# @return [::Gapic::Config::Method]
|
|
1755
1854
|
#
|
|
1756
1855
|
attr_reader :stream_generate_content
|
|
1856
|
+
##
|
|
1857
|
+
# RPC-specific configuration for `embed_content`
|
|
1858
|
+
# @return [::Gapic::Config::Method]
|
|
1859
|
+
#
|
|
1860
|
+
attr_reader :embed_content
|
|
1757
1861
|
|
|
1758
1862
|
# @private
|
|
1759
1863
|
def initialize parent_rpcs = nil
|
|
@@ -1783,6 +1887,8 @@ module Google
|
|
|
1783
1887
|
@generate_content = ::Gapic::Config::Method.new generate_content_config
|
|
1784
1888
|
stream_generate_content_config = parent_rpcs.stream_generate_content if parent_rpcs.respond_to? :stream_generate_content
|
|
1785
1889
|
@stream_generate_content = ::Gapic::Config::Method.new stream_generate_content_config
|
|
1890
|
+
embed_content_config = parent_rpcs.embed_content if parent_rpcs.respond_to? :embed_content
|
|
1891
|
+
@embed_content = ::Gapic::Config::Method.new embed_content_config
|
|
1786
1892
|
|
|
1787
1893
|
yield self if block_given?
|
|
1788
1894
|
end
|
|
@@ -1146,6 +1146,98 @@ module Google
|
|
|
1146
1146
|
raise ::Google::Cloud::Error.from_error(e)
|
|
1147
1147
|
end
|
|
1148
1148
|
|
|
1149
|
+
##
|
|
1150
|
+
# Embed content with multimodal inputs.
|
|
1151
|
+
#
|
|
1152
|
+
# @overload embed_content(request, options = nil)
|
|
1153
|
+
# Pass arguments to `embed_content` via a request object, either of type
|
|
1154
|
+
# {::Google::Cloud::AIPlatform::V1::EmbedContentRequest} or an equivalent Hash.
|
|
1155
|
+
#
|
|
1156
|
+
# @param request [::Google::Cloud::AIPlatform::V1::EmbedContentRequest, ::Hash]
|
|
1157
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1158
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1159
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1160
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
1161
|
+
#
|
|
1162
|
+
# @overload embed_content(model: nil, content: nil, title: nil, task_type: nil, output_dimensionality: nil, auto_truncate: nil)
|
|
1163
|
+
# Pass arguments to `embed_content` via keyword arguments. Note that at
|
|
1164
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1165
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1166
|
+
#
|
|
1167
|
+
# @param model [::String]
|
|
1168
|
+
# Required. The name of the publisher model requested to serve the
|
|
1169
|
+
# prediction. Format:
|
|
1170
|
+
# `projects/{project}/locations/{location}/publishers/*/models/*`
|
|
1171
|
+
# @param content [::Google::Cloud::AIPlatform::V1::Content, ::Hash]
|
|
1172
|
+
# Required. Input content to be embedded. Required.
|
|
1173
|
+
# @param title [::String]
|
|
1174
|
+
# Optional. An optional title for the text.
|
|
1175
|
+
# @param task_type [::Google::Cloud::AIPlatform::V1::EmbedContentRequest::EmbeddingTaskType]
|
|
1176
|
+
# Optional. The task type of the embedding.
|
|
1177
|
+
# @param output_dimensionality [::Integer]
|
|
1178
|
+
# Optional. Optional reduced dimension for the output embedding. If set,
|
|
1179
|
+
# excessive values in the output embedding are truncated from the end.
|
|
1180
|
+
# @param auto_truncate [::Boolean]
|
|
1181
|
+
# Optional. Whether to silently truncate the input content if it's longer
|
|
1182
|
+
# than the maximum sequence length.
|
|
1183
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
1184
|
+
# @yieldparam result [::Google::Cloud::AIPlatform::V1::EmbedContentResponse]
|
|
1185
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
1186
|
+
#
|
|
1187
|
+
# @return [::Google::Cloud::AIPlatform::V1::EmbedContentResponse]
|
|
1188
|
+
#
|
|
1189
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
1190
|
+
#
|
|
1191
|
+
# @example Basic example
|
|
1192
|
+
# require "google/cloud/ai_platform/v1"
|
|
1193
|
+
#
|
|
1194
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1195
|
+
# client = Google::Cloud::AIPlatform::V1::PredictionService::Rest::Client.new
|
|
1196
|
+
#
|
|
1197
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1198
|
+
# request = Google::Cloud::AIPlatform::V1::EmbedContentRequest.new
|
|
1199
|
+
#
|
|
1200
|
+
# # Call the embed_content method.
|
|
1201
|
+
# result = client.embed_content request
|
|
1202
|
+
#
|
|
1203
|
+
# # The returned object is of type Google::Cloud::AIPlatform::V1::EmbedContentResponse.
|
|
1204
|
+
# p result
|
|
1205
|
+
#
|
|
1206
|
+
def embed_content request, options = nil
|
|
1207
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1208
|
+
|
|
1209
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::EmbedContentRequest
|
|
1210
|
+
|
|
1211
|
+
# Converts hash and nil to an options object
|
|
1212
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1213
|
+
|
|
1214
|
+
# Customize the options with defaults
|
|
1215
|
+
call_metadata = @config.rpcs.embed_content.metadata.to_h
|
|
1216
|
+
|
|
1217
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1218
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1219
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1220
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
|
|
1221
|
+
transports_version_send: [:rest]
|
|
1222
|
+
|
|
1223
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1224
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1225
|
+
|
|
1226
|
+
options.apply_defaults timeout: @config.rpcs.embed_content.timeout,
|
|
1227
|
+
metadata: call_metadata,
|
|
1228
|
+
retry_policy: @config.rpcs.embed_content.retry_policy
|
|
1229
|
+
|
|
1230
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1231
|
+
metadata: @config.metadata,
|
|
1232
|
+
retry_policy: @config.retry_policy
|
|
1233
|
+
|
|
1234
|
+
@prediction_service_stub.embed_content request, options do |result, operation|
|
|
1235
|
+
yield result, operation if block_given?
|
|
1236
|
+
end
|
|
1237
|
+
rescue ::Gapic::Rest::Error => e
|
|
1238
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1239
|
+
end
|
|
1240
|
+
|
|
1149
1241
|
##
|
|
1150
1242
|
# Configuration class for the PredictionService REST API.
|
|
1151
1243
|
#
|
|
@@ -1344,6 +1436,11 @@ module Google
|
|
|
1344
1436
|
# @return [::Gapic::Config::Method]
|
|
1345
1437
|
#
|
|
1346
1438
|
attr_reader :stream_generate_content
|
|
1439
|
+
##
|
|
1440
|
+
# RPC-specific configuration for `embed_content`
|
|
1441
|
+
# @return [::Gapic::Config::Method]
|
|
1442
|
+
#
|
|
1443
|
+
attr_reader :embed_content
|
|
1347
1444
|
|
|
1348
1445
|
# @private
|
|
1349
1446
|
def initialize parent_rpcs = nil
|
|
@@ -1365,6 +1462,8 @@ module Google
|
|
|
1365
1462
|
@generate_content = ::Gapic::Config::Method.new generate_content_config
|
|
1366
1463
|
stream_generate_content_config = parent_rpcs.stream_generate_content if parent_rpcs.respond_to? :stream_generate_content
|
|
1367
1464
|
@stream_generate_content = ::Gapic::Config::Method.new stream_generate_content_config
|
|
1465
|
+
embed_content_config = parent_rpcs.embed_content if parent_rpcs.respond_to? :embed_content
|
|
1466
|
+
@embed_content = ::Gapic::Config::Method.new embed_content_config
|
|
1368
1467
|
|
|
1369
1468
|
yield self if block_given?
|
|
1370
1469
|
end
|
|
@@ -415,6 +415,46 @@ module Google
|
|
|
415
415
|
::Gapic::Rest::TransportOperation.new response
|
|
416
416
|
end
|
|
417
417
|
|
|
418
|
+
##
|
|
419
|
+
# Baseline implementation for the embed_content REST call
|
|
420
|
+
#
|
|
421
|
+
# @param request_pb [::Google::Cloud::AIPlatform::V1::EmbedContentRequest]
|
|
422
|
+
# A request object representing the call parameters. Required.
|
|
423
|
+
# @param options [::Gapic::CallOptions]
|
|
424
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
425
|
+
#
|
|
426
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
427
|
+
# @yieldparam result [::Google::Cloud::AIPlatform::V1::EmbedContentResponse]
|
|
428
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
429
|
+
#
|
|
430
|
+
# @return [::Google::Cloud::AIPlatform::V1::EmbedContentResponse]
|
|
431
|
+
# A result object deserialized from the server's reply
|
|
432
|
+
def embed_content request_pb, options = nil
|
|
433
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
|
434
|
+
|
|
435
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_embed_content_request request_pb
|
|
436
|
+
query_string_params = if query_string_params.any?
|
|
437
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
|
438
|
+
else
|
|
439
|
+
{}
|
|
440
|
+
end
|
|
441
|
+
|
|
442
|
+
response = @client_stub.make_http_request(
|
|
443
|
+
verb,
|
|
444
|
+
uri: uri,
|
|
445
|
+
body: body || "",
|
|
446
|
+
params: query_string_params,
|
|
447
|
+
method_name: "embed_content",
|
|
448
|
+
options: options
|
|
449
|
+
)
|
|
450
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
|
451
|
+
result = ::Google::Cloud::AIPlatform::V1::EmbedContentResponse.decode_json response.body, ignore_unknown_fields: true
|
|
452
|
+
catch :response do
|
|
453
|
+
yield result, operation if block_given?
|
|
454
|
+
result
|
|
455
|
+
end
|
|
456
|
+
end
|
|
457
|
+
|
|
418
458
|
##
|
|
419
459
|
# @private
|
|
420
460
|
#
|
|
@@ -692,6 +732,28 @@ module Google
|
|
|
692
732
|
)
|
|
693
733
|
transcoder.transcode request_pb
|
|
694
734
|
end
|
|
735
|
+
|
|
736
|
+
##
|
|
737
|
+
# @private
|
|
738
|
+
#
|
|
739
|
+
# GRPC transcoding helper method for the embed_content REST call
|
|
740
|
+
#
|
|
741
|
+
# @param request_pb [::Google::Cloud::AIPlatform::V1::EmbedContentRequest]
|
|
742
|
+
# A request object representing the call parameters. Required.
|
|
743
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
|
744
|
+
# Uri, Body, Query string parameters
|
|
745
|
+
def self.transcode_embed_content_request request_pb
|
|
746
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
|
747
|
+
.with_bindings(
|
|
748
|
+
uri_method: :post,
|
|
749
|
+
uri_template: "/v1/{model}:embedContent",
|
|
750
|
+
body: "*",
|
|
751
|
+
matches: [
|
|
752
|
+
["model", %r{^projects/[^/]+/locations/[^/]+/publishers/[^/]+/models/[^/]+/?$}, false]
|
|
753
|
+
]
|
|
754
|
+
)
|
|
755
|
+
transcoder.transcode request_pb
|
|
756
|
+
end
|
|
695
757
|
end
|
|
696
758
|
end
|
|
697
759
|
end
|
|
@@ -13,11 +13,12 @@ require 'google/cloud/aiplatform/v1/content_pb'
|
|
|
13
13
|
require 'google/cloud/aiplatform/v1/explanation_pb'
|
|
14
14
|
require 'google/cloud/aiplatform/v1/tool_pb'
|
|
15
15
|
require 'google/cloud/aiplatform/v1/types_pb'
|
|
16
|
+
require 'google/cloud/aiplatform/v1/usage_metadata_pb'
|
|
16
17
|
require 'google/protobuf/struct_pb'
|
|
17
18
|
require 'google/protobuf/timestamp_pb'
|
|
18
19
|
|
|
19
20
|
|
|
20
|
-
descriptor_data = "\n3google/cloud/aiplatform/v1/prediction_service.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/httpbody.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/aiplatform/v1/content.proto\x1a,google/cloud/aiplatform/v1/explanation.proto\x1a%google/cloud/aiplatform/v1/tool.proto\x1a&google/cloud/aiplatform/v1/types.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa6\x02\n\x0ePredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12.\n\tinstances\x18\x02 \x03(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x02\x12*\n\nparameters\x18\x03 \x01(\x0b\x32\x16.google.protobuf.Value\x12K\n\x06labels\x18\x04 \x03(\x0b\x32\x36.google.cloud.aiplatform.v1.PredictRequest.LabelsEntryB\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\"\x80\x02\n\x0fPredictResponse\x12+\n\x0bpredictions\x18\x01 \x03(\x0b\x32\x16.google.protobuf.Value\x12\x19\n\x11\x64\x65ployed_model_id\x18\x02 \x01(\t\x12\x36\n\x05model\x18\x03 \x01(\tB\'\xe0\x41\x03\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Model\x12\x1d\n\x10model_version_id\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x1f\n\x12model_display_name\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12-\n\x08metadata\x18\x06 \x01(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x03\"z\n\x11RawPredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\'\n\thttp_body\x18\x02 \x01(\x0b\x32\x14.google.api.HttpBody\"\x80\x01\n\x17StreamRawPredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\'\n\thttp_body\x18\x02 \x01(\x0b\x32\x14.google.api.HttpBody\"\xc0\x01\n\x14\x44irectPredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x32\n\x06inputs\x18\x02 \x03(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\x12\x36\n\nparameters\x18\x03 \x01(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\"\x84\x01\n\x15\x44irectPredictResponse\x12\x33\n\x07outputs\x18\x01 \x03(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\x12\x36\n\nparameters\x18\x02 \x01(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\"{\n\x17\x44irectRawPredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x13\n\x0bmethod_name\x18\x02 \x01(\t\x12\r\n\x05input\x18\x03 \x01(\x0c\"*\n\x18\x44irectRawPredictResponse\x12\x0e\n\x06output\x18\x01 \x01(\x0c\"\xd0\x01\n\x1aStreamDirectPredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x37\n\x06inputs\x18\x02 \x03(\x0b\x32\".google.cloud.aiplatform.v1.TensorB\x03\xe0\x41\x01\x12;\n\nparameters\x18\x03 \x01(\x0b\x32\".google.cloud.aiplatform.v1.TensorB\x03\xe0\x41\x01\"\x8a\x01\n\x1bStreamDirectPredictResponse\x12\x33\n\x07outputs\x18\x01 \x03(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\x12\x36\n\nparameters\x18\x02 \x01(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\"\x8b\x01\n\x1dStreamDirectRawPredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x18\n\x0bmethod_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05input\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x01\"0\n\x1eStreamDirectRawPredictResponse\x12\x0e\n\x06output\x18\x01 \x01(\x0c\"\xc3\x01\n\x17StreamingPredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x32\n\x06inputs\x18\x02 \x03(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\x12\x36\n\nparameters\x18\x03 \x01(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\"\x87\x01\n\x18StreamingPredictResponse\x12\x33\n\x07outputs\x18\x01 \x03(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\x12\x36\n\nparameters\x18\x02 \x01(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\"~\n\x1aStreamingRawPredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x13\n\x0bmethod_name\x18\x02 \x01(\t\x12\r\n\x05input\x18\x03 \x01(\x0c\"-\n\x1bStreamingRawPredictResponse\x12\x0e\n\x06output\x18\x01 \x01(\x0c\"\x9d\x02\n\x0e\x45xplainRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12.\n\tinstances\x18\x02 \x03(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x02\x12*\n\nparameters\x18\x04 \x01(\x0b\x32\x16.google.protobuf.Value\x12V\n\x19\x65xplanation_spec_override\x18\x05 \x01(\x0b\x32\x33.google.cloud.aiplatform.v1.ExplanationSpecOverride\x12\x19\n\x11\x64\x65ployed_model_id\x18\x03 \x01(\t\"\x98\x01\n\x0f\x45xplainResponse\x12=\n\x0c\x65xplanations\x18\x01 \x03(\x0b\x32\'.google.cloud.aiplatform.v1.Explanation\x12\x19\n\x11\x64\x65ployed_model_id\x18\x02 \x01(\t\x12+\n\x0bpredictions\x18\x03 \x03(\x0b\x32\x16.google.protobuf.Value\"\xd3\x03\n\x12\x43ountTokensRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x12\n\x05model\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12.\n\tinstances\x18\x02 \x03(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x01\x12:\n\x08\x63ontents\x18\x04 \x03(\x0b\x32#.google.cloud.aiplatform.v1.ContentB\x03\xe0\x41\x01\x12I\n\x12system_instruction\x18\x05 \x01(\x0b\x32#.google.cloud.aiplatform.v1.ContentB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x34\n\x05tools\x18\x06 \x03(\x0b\x32 .google.cloud.aiplatform.v1.ToolB\x03\xe0\x41\x01\x12Q\n\x11generation_config\x18\x07 \x01(\x0b\x32,.google.cloud.aiplatform.v1.GenerationConfigB\x03\xe0\x41\x01H\x01\x88\x01\x01\x42\x15\n\x13_system_instructionB\x14\n\x12_generation_config\"\xa2\x01\n\x13\x43ountTokensResponse\x12\x14\n\x0ctotal_tokens\x18\x01 \x01(\x05\x12!\n\x19total_billable_characters\x18\x02 \x01(\x05\x12R\n\x15prompt_tokens_details\x18\x03 \x03(\x0b\x32..google.cloud.aiplatform.v1.ModalityTokenCountB\x03\xe0\x41\x03\"\xf5\x05\n\x16GenerateContentRequest\x12\x12\n\x05model\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12:\n\x08\x63ontents\x18\x02 \x03(\x0b\x32#.google.cloud.aiplatform.v1.ContentB\x03\xe0\x41\x02\x12I\n\x12system_instruction\x18\x08 \x01(\x0b\x32#.google.cloud.aiplatform.v1.ContentB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12G\n\x0e\x63\x61\x63hed_content\x18\t \x01(\tB/\xe0\x41\x01\xfa\x41)\n\'aiplatform.googleapis.com/CachedContent\x12\x34\n\x05tools\x18\x06 \x03(\x0b\x32 .google.cloud.aiplatform.v1.ToolB\x03\xe0\x41\x01\x12@\n\x0btool_config\x18\x07 \x01(\x0b\x32&.google.cloud.aiplatform.v1.ToolConfigB\x03\xe0\x41\x01\x12S\n\x06labels\x18\n \x03(\x0b\x32>.google.cloud.aiplatform.v1.GenerateContentRequest.LabelsEntryB\x03\xe0\x41\x01\x12G\n\x0fsafety_settings\x18\x03 \x03(\x0b\x32).google.cloud.aiplatform.v1.SafetySettingB\x03\xe0\x41\x01\x12M\n\x12model_armor_config\x18\x0b \x01(\x0b\x32,.google.cloud.aiplatform.v1.ModelArmorConfigB\x03\xe0\x41\x01\x12L\n\x11generation_config\x18\x04 \x01(\x0b\x32,.google.cloud.aiplatform.v1.GenerationConfigB\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\x42\x15\n\x13_system_instruction\"\xb0\t\n\x17GenerateContentResponse\x12>\n\ncandidates\x18\x02 \x03(\x0b\x32%.google.cloud.aiplatform.v1.CandidateB\x03\xe0\x41\x03\x12\x1a\n\rmodel_version\x18\x0b \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x18\n\x0bresponse_id\x18\r \x01(\tB\x03\xe0\x41\x03\x12`\n\x0fprompt_feedback\x18\x03 \x01(\x0b\x32\x42.google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedbackB\x03\xe0\x41\x03\x12Y\n\x0eusage_metadata\x18\x04 \x01(\x0b\x32\x41.google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata\x1a\xf7\x02\n\x0ePromptFeedback\x12k\n\x0c\x62lock_reason\x18\x01 \x01(\x0e\x32P.google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedback.BlockedReasonB\x03\xe0\x41\x03\x12\x45\n\x0esafety_ratings\x18\x02 \x03(\x0b\x32(.google.cloud.aiplatform.v1.SafetyRatingB\x03\xe0\x41\x03\x12!\n\x14\x62lock_reason_message\x18\x03 \x01(\tB\x03\xe0\x41\x03\"\x8d\x01\n\rBlockedReason\x12\x1e\n\x1a\x42LOCKED_REASON_UNSPECIFIED\x10\x00\x12\n\n\x06SAFETY\x10\x01\x12\t\n\x05OTHER\x10\x02\x12\r\n\tBLOCKLIST\x10\x03\x12\x16\n\x12PROHIBITED_CONTENT\x10\x04\x12\x0f\n\x0bMODEL_ARMOR\x10\x05\x12\r\n\tJAILBREAK\x10\x06\x1a\xb1\x03\n\rUsageMetadata\x12\x1a\n\x12prompt_token_count\x18\x01 \x01(\x05\x12\x1e\n\x16\x63\x61ndidates_token_count\x18\x02 \x01(\x05\x12!\n\x14thoughts_token_count\x18\x0e \x01(\x05\x42\x03\xe0\x41\x03\x12\x19\n\x11total_token_count\x18\x03 \x01(\x05\x12\'\n\x1a\x63\x61\x63hed_content_token_count\x18\x05 \x01(\x05\x42\x03\xe0\x41\x03\x12R\n\x15prompt_tokens_details\x18\t \x03(\x0b\x32..google.cloud.aiplatform.v1.ModalityTokenCountB\x03\xe0\x41\x03\x12Q\n\x14\x63\x61\x63he_tokens_details\x18\n \x03(\x0b\x32..google.cloud.aiplatform.v1.ModalityTokenCountB\x03\xe0\x41\x03\x12V\n\x19\x63\x61ndidates_tokens_details\x18\x0b \x03(\x0b\x32..google.cloud.aiplatform.v1.ModalityTokenCountB\x03\xe0\x41\x03\x32\xf2\x19\n\x11PredictionService\x12\x94\x02\n\x07Predict\x12*.google.cloud.aiplatform.v1.PredictRequest\x1a+.google.cloud.aiplatform.v1.PredictResponse\"\xaf\x01\xda\x41\x1d\x65ndpoint,instances,parameters\x82\xd3\xe4\x93\x02\x88\x01\"9/v1/{endpoint=projects/*/locations/*/endpoints/*}:predict:\x01*ZH\"C/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:predict:\x01*\x12\xfe\x01\n\nRawPredict\x12-.google.cloud.aiplatform.v1.RawPredictRequest\x1a\x14.google.api.HttpBody\"\xaa\x01\xda\x41\x12\x65ndpoint,http_body\x82\xd3\xe4\x93\x02\x8e\x01\"</v1/{endpoint=projects/*/locations/*/endpoints/*}:rawPredict:\x01*ZK\"F/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:rawPredict:\x01*\x12\x98\x02\n\x10StreamRawPredict\x12\x33.google.cloud.aiplatform.v1.StreamRawPredictRequest\x1a\x14.google.api.HttpBody\"\xb6\x01\xda\x41\x12\x65ndpoint,http_body\x82\xd3\xe4\x93\x02\x9a\x01\"B/v1/{endpoint=projects/*/locations/*/endpoints/*}:streamRawPredict:\x01*ZQ\"L/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:streamRawPredict:\x01*0\x01\x12\xc0\x01\n\rDirectPredict\x12\x30.google.cloud.aiplatform.v1.DirectPredictRequest\x1a\x31.google.cloud.aiplatform.v1.DirectPredictResponse\"J\x82\xd3\xe4\x93\x02\x44\"?/v1/{endpoint=projects/*/locations/*/endpoints/*}:directPredict:\x01*\x12\xcc\x01\n\x10\x44irectRawPredict\x12\x33.google.cloud.aiplatform.v1.DirectRawPredictRequest\x1a\x34.google.cloud.aiplatform.v1.DirectRawPredictResponse\"M\x82\xd3\xe4\x93\x02G\"B/v1/{endpoint=projects/*/locations/*/endpoints/*}:directRawPredict:\x01*\x12\x8c\x01\n\x13StreamDirectPredict\x12\x36.google.cloud.aiplatform.v1.StreamDirectPredictRequest\x1a\x37.google.cloud.aiplatform.v1.StreamDirectPredictResponse\"\x00(\x01\x30\x01\x12\x95\x01\n\x16StreamDirectRawPredict\x12\x39.google.cloud.aiplatform.v1.StreamDirectRawPredictRequest\x1a:.google.cloud.aiplatform.v1.StreamDirectRawPredictResponse\"\x00(\x01\x30\x01\x12\x83\x01\n\x10StreamingPredict\x12\x33.google.cloud.aiplatform.v1.StreamingPredictRequest\x1a\x34.google.cloud.aiplatform.v1.StreamingPredictResponse\"\x00(\x01\x30\x01\x12\xb5\x02\n\x16ServerStreamingPredict\x12\x33.google.cloud.aiplatform.v1.StreamingPredictRequest\x1a\x34.google.cloud.aiplatform.v1.StreamingPredictResponse\"\xad\x01\x82\xd3\xe4\x93\x02\xa6\x01\"H/v1/{endpoint=projects/*/locations/*/endpoints/*}:serverStreamingPredict:\x01*ZW\"R/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:serverStreamingPredict:\x01*0\x01\x12\x8c\x01\n\x13StreamingRawPredict\x12\x36.google.cloud.aiplatform.v1.StreamingRawPredictRequest\x1a\x37.google.cloud.aiplatform.v1.StreamingRawPredictResponse\"\x00(\x01\x30\x01\x12\xda\x01\n\x07\x45xplain\x12*.google.cloud.aiplatform.v1.ExplainRequest\x1a+.google.cloud.aiplatform.v1.ExplainResponse\"v\xda\x41/endpoint,instances,parameters,deployed_model_id\x82\xd3\xe4\x93\x02>\"9/v1/{endpoint=projects/*/locations/*/endpoints/*}:explain:\x01*\x12\x8d\x03\n\x0fGenerateContent\x12\x32.google.cloud.aiplatform.v1.GenerateContentRequest\x1a\x33.google.cloud.aiplatform.v1.GenerateContentResponse\"\x90\x02\xda\x41\x0emodel,contents\x82\xd3\xe4\x93\x02\xf8\x01\">/v1/{model=projects/*/locations/*/endpoints/*}:generateContent:\x01*ZM\"H/v1/{model=projects/*/locations/*/publishers/*/models/*}:generateContent:\x01*Z,\"\'/v1/{model=endpoints/*}:generateContent:\x01*Z6\"1/v1/{model=publishers/*/models/*}:generateContent:\x01*\x12\xad\x03\n\x15StreamGenerateContent\x12\x32.google.cloud.aiplatform.v1.GenerateContentRequest\x1a\x33.google.cloud.aiplatform.v1.GenerateContentResponse\"\xa8\x02\xda\x41\x0emodel,contents\x82\xd3\xe4\x93\x02\x90\x02\"D/v1/{model=projects/*/locations/*/endpoints/*}:streamGenerateContent:\x01*ZS\"N/v1/{model=projects/*/locations/*/publishers/*/models/*}:streamGenerateContent:\x01*Z2\"-/v1/{model=endpoints/*}:streamGenerateContent:\x01*Z<\"7/v1/{model=publishers/*/models/*}:streamGenerateContent:\x01*0\x01\x1a\x86\x01\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41ghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB\xd4\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x16PredictionServiceProtoP\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"
|
|
21
|
+
descriptor_data = "\n3google/cloud/aiplatform/v1/prediction_service.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/httpbody.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/aiplatform/v1/content.proto\x1a,google/cloud/aiplatform/v1/explanation.proto\x1a%google/cloud/aiplatform/v1/tool.proto\x1a&google/cloud/aiplatform/v1/types.proto\x1a/google/cloud/aiplatform/v1/usage_metadata.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa6\x02\n\x0ePredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12.\n\tinstances\x18\x02 \x03(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x02\x12*\n\nparameters\x18\x03 \x01(\x0b\x32\x16.google.protobuf.Value\x12K\n\x06labels\x18\x04 \x03(\x0b\x32\x36.google.cloud.aiplatform.v1.PredictRequest.LabelsEntryB\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\"\x80\x02\n\x0fPredictResponse\x12+\n\x0bpredictions\x18\x01 \x03(\x0b\x32\x16.google.protobuf.Value\x12\x19\n\x11\x64\x65ployed_model_id\x18\x02 \x01(\t\x12\x36\n\x05model\x18\x03 \x01(\tB\'\xe0\x41\x03\xfa\x41!\n\x1f\x61iplatform.googleapis.com/Model\x12\x1d\n\x10model_version_id\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x1f\n\x12model_display_name\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12-\n\x08metadata\x18\x06 \x01(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x03\"z\n\x11RawPredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\'\n\thttp_body\x18\x02 \x01(\x0b\x32\x14.google.api.HttpBody\"\x80\x01\n\x17StreamRawPredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\'\n\thttp_body\x18\x02 \x01(\x0b\x32\x14.google.api.HttpBody\"\xc0\x01\n\x14\x44irectPredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x32\n\x06inputs\x18\x02 \x03(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\x12\x36\n\nparameters\x18\x03 \x01(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\"\x84\x01\n\x15\x44irectPredictResponse\x12\x33\n\x07outputs\x18\x01 \x03(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\x12\x36\n\nparameters\x18\x02 \x01(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\"{\n\x17\x44irectRawPredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x13\n\x0bmethod_name\x18\x02 \x01(\t\x12\r\n\x05input\x18\x03 \x01(\x0c\"*\n\x18\x44irectRawPredictResponse\x12\x0e\n\x06output\x18\x01 \x01(\x0c\"\xd0\x01\n\x1aStreamDirectPredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x37\n\x06inputs\x18\x02 \x03(\x0b\x32\".google.cloud.aiplatform.v1.TensorB\x03\xe0\x41\x01\x12;\n\nparameters\x18\x03 \x01(\x0b\x32\".google.cloud.aiplatform.v1.TensorB\x03\xe0\x41\x01\"\x8a\x01\n\x1bStreamDirectPredictResponse\x12\x33\n\x07outputs\x18\x01 \x03(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\x12\x36\n\nparameters\x18\x02 \x01(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\"\x8b\x01\n\x1dStreamDirectRawPredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x18\n\x0bmethod_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05input\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x01\"0\n\x1eStreamDirectRawPredictResponse\x12\x0e\n\x06output\x18\x01 \x01(\x0c\"\xc3\x01\n\x17StreamingPredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x32\n\x06inputs\x18\x02 \x03(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\x12\x36\n\nparameters\x18\x03 \x01(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\"\x87\x01\n\x18StreamingPredictResponse\x12\x33\n\x07outputs\x18\x01 \x03(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\x12\x36\n\nparameters\x18\x02 \x01(\x0b\x32\".google.cloud.aiplatform.v1.Tensor\"~\n\x1aStreamingRawPredictRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x13\n\x0bmethod_name\x18\x02 \x01(\t\x12\r\n\x05input\x18\x03 \x01(\x0c\"-\n\x1bStreamingRawPredictResponse\x12\x0e\n\x06output\x18\x01 \x01(\x0c\"\x9d\x02\n\x0e\x45xplainRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12.\n\tinstances\x18\x02 \x03(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x02\x12*\n\nparameters\x18\x04 \x01(\x0b\x32\x16.google.protobuf.Value\x12V\n\x19\x65xplanation_spec_override\x18\x05 \x01(\x0b\x32\x33.google.cloud.aiplatform.v1.ExplanationSpecOverride\x12\x19\n\x11\x64\x65ployed_model_id\x18\x03 \x01(\t\"\x98\x01\n\x0f\x45xplainResponse\x12=\n\x0c\x65xplanations\x18\x01 \x03(\x0b\x32\'.google.cloud.aiplatform.v1.Explanation\x12\x19\n\x11\x64\x65ployed_model_id\x18\x02 \x01(\t\x12+\n\x0bpredictions\x18\x03 \x03(\x0b\x32\x16.google.protobuf.Value\"\xd3\x03\n\x12\x43ountTokensRequest\x12<\n\x08\x65ndpoint\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"aiplatform.googleapis.com/Endpoint\x12\x12\n\x05model\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12.\n\tinstances\x18\x02 \x03(\x0b\x32\x16.google.protobuf.ValueB\x03\xe0\x41\x01\x12:\n\x08\x63ontents\x18\x04 \x03(\x0b\x32#.google.cloud.aiplatform.v1.ContentB\x03\xe0\x41\x01\x12I\n\x12system_instruction\x18\x05 \x01(\x0b\x32#.google.cloud.aiplatform.v1.ContentB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x34\n\x05tools\x18\x06 \x03(\x0b\x32 .google.cloud.aiplatform.v1.ToolB\x03\xe0\x41\x01\x12Q\n\x11generation_config\x18\x07 \x01(\x0b\x32,.google.cloud.aiplatform.v1.GenerationConfigB\x03\xe0\x41\x01H\x01\x88\x01\x01\x42\x15\n\x13_system_instructionB\x14\n\x12_generation_config\"\xa2\x01\n\x13\x43ountTokensResponse\x12\x14\n\x0ctotal_tokens\x18\x01 \x01(\x05\x12!\n\x19total_billable_characters\x18\x02 \x01(\x05\x12R\n\x15prompt_tokens_details\x18\x03 \x03(\x0b\x32..google.cloud.aiplatform.v1.ModalityTokenCountB\x03\xe0\x41\x03\"\xf5\x05\n\x16GenerateContentRequest\x12\x12\n\x05model\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12:\n\x08\x63ontents\x18\x02 \x03(\x0b\x32#.google.cloud.aiplatform.v1.ContentB\x03\xe0\x41\x02\x12I\n\x12system_instruction\x18\x08 \x01(\x0b\x32#.google.cloud.aiplatform.v1.ContentB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12G\n\x0e\x63\x61\x63hed_content\x18\t \x01(\tB/\xe0\x41\x01\xfa\x41)\n\'aiplatform.googleapis.com/CachedContent\x12\x34\n\x05tools\x18\x06 \x03(\x0b\x32 .google.cloud.aiplatform.v1.ToolB\x03\xe0\x41\x01\x12@\n\x0btool_config\x18\x07 \x01(\x0b\x32&.google.cloud.aiplatform.v1.ToolConfigB\x03\xe0\x41\x01\x12S\n\x06labels\x18\n \x03(\x0b\x32>.google.cloud.aiplatform.v1.GenerateContentRequest.LabelsEntryB\x03\xe0\x41\x01\x12G\n\x0fsafety_settings\x18\x03 \x03(\x0b\x32).google.cloud.aiplatform.v1.SafetySettingB\x03\xe0\x41\x01\x12M\n\x12model_armor_config\x18\x0b \x01(\x0b\x32,.google.cloud.aiplatform.v1.ModelArmorConfigB\x03\xe0\x41\x01\x12L\n\x11generation_config\x18\x04 \x01(\x0b\x32,.google.cloud.aiplatform.v1.GenerationConfigB\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\x42\x15\n\x13_system_instruction\"\xb0\t\n\x17GenerateContentResponse\x12>\n\ncandidates\x18\x02 \x03(\x0b\x32%.google.cloud.aiplatform.v1.CandidateB\x03\xe0\x41\x03\x12\x1a\n\rmodel_version\x18\x0b \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x18\n\x0bresponse_id\x18\r \x01(\tB\x03\xe0\x41\x03\x12`\n\x0fprompt_feedback\x18\x03 \x01(\x0b\x32\x42.google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedbackB\x03\xe0\x41\x03\x12Y\n\x0eusage_metadata\x18\x04 \x01(\x0b\x32\x41.google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata\x1a\xf7\x02\n\x0ePromptFeedback\x12k\n\x0c\x62lock_reason\x18\x01 \x01(\x0e\x32P.google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedback.BlockedReasonB\x03\xe0\x41\x03\x12\x45\n\x0esafety_ratings\x18\x02 \x03(\x0b\x32(.google.cloud.aiplatform.v1.SafetyRatingB\x03\xe0\x41\x03\x12!\n\x14\x62lock_reason_message\x18\x03 \x01(\tB\x03\xe0\x41\x03\"\x8d\x01\n\rBlockedReason\x12\x1e\n\x1a\x42LOCKED_REASON_UNSPECIFIED\x10\x00\x12\n\n\x06SAFETY\x10\x01\x12\t\n\x05OTHER\x10\x02\x12\r\n\tBLOCKLIST\x10\x03\x12\x16\n\x12PROHIBITED_CONTENT\x10\x04\x12\x0f\n\x0bMODEL_ARMOR\x10\x05\x12\r\n\tJAILBREAK\x10\x06\x1a\xb1\x03\n\rUsageMetadata\x12\x1a\n\x12prompt_token_count\x18\x01 \x01(\x05\x12\x1e\n\x16\x63\x61ndidates_token_count\x18\x02 \x01(\x05\x12!\n\x14thoughts_token_count\x18\x0e \x01(\x05\x42\x03\xe0\x41\x03\x12\x19\n\x11total_token_count\x18\x03 \x01(\x05\x12\'\n\x1a\x63\x61\x63hed_content_token_count\x18\x05 \x01(\x05\x42\x03\xe0\x41\x03\x12R\n\x15prompt_tokens_details\x18\t \x03(\x0b\x32..google.cloud.aiplatform.v1.ModalityTokenCountB\x03\xe0\x41\x03\x12Q\n\x14\x63\x61\x63he_tokens_details\x18\n \x03(\x0b\x32..google.cloud.aiplatform.v1.ModalityTokenCountB\x03\xe0\x41\x03\x12V\n\x19\x63\x61ndidates_tokens_details\x18\x0b \x03(\x0b\x32..google.cloud.aiplatform.v1.ModalityTokenCountB\x03\xe0\x41\x03\"\x84\x05\n\x13\x45mbedContentRequest\x12;\n\x05model\x18\x01 \x01(\tB\'\xfa\x41$\n\"aiplatform.googleapis.com/EndpointH\x00\x88\x01\x01\x12\x39\n\x07\x63ontent\x18\x02 \x01(\x0b\x32#.google.cloud.aiplatform.v1.ContentH\x01\x88\x01\x01\x12\x17\n\x05title\x18\x04 \x01(\tB\x03\xe0\x41\x01H\x02\x88\x01\x01\x12^\n\ttask_type\x18\x05 \x01(\x0e\x32\x41.google.cloud.aiplatform.v1.EmbedContentRequest.EmbeddingTaskTypeB\x03\xe0\x41\x01H\x03\x88\x01\x01\x12\'\n\x15output_dimensionality\x18\x06 \x01(\x05\x42\x03\xe0\x41\x01H\x04\x88\x01\x01\x12\x1f\n\rauto_truncate\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01H\x05\x88\x01\x01\"\xd7\x01\n\x11\x45mbeddingTaskType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x13\n\x0fRETRIEVAL_QUERY\x10\x02\x12\x16\n\x12RETRIEVAL_DOCUMENT\x10\x03\x12\x17\n\x13SEMANTIC_SIMILARITY\x10\x04\x12\x12\n\x0e\x43LASSIFICATION\x10\x05\x12\x0e\n\nCLUSTERING\x10\x06\x12\x16\n\x12QUESTION_ANSWERING\x10\x07\x12\x15\n\x11\x46\x41\x43T_VERIFICATION\x10\x08\x12\x18\n\x14\x43ODE_RETRIEVAL_QUERY\x10\tB\x08\n\x06_modelB\n\n\x08_contentB\x08\n\x06_titleB\x0c\n\n_task_typeB\x18\n\x16_output_dimensionalityB\x10\n\x0e_auto_truncate\"\xd8\x01\n\x14\x45mbedContentResponse\x12M\n\tembedding\x18\x01 \x01(\x0b\x32:.google.cloud.aiplatform.v1.EmbedContentResponse.Embedding\x12\x41\n\x0eusage_metadata\x18\x02 \x01(\x0b\x32).google.cloud.aiplatform.v1.UsageMetadata\x12\x11\n\ttruncated\x18\x04 \x01(\x08\x1a\x1b\n\tEmbedding\x12\x0e\n\x06values\x18\x01 \x03(\x02\x32\xc8\x1b\n\x11PredictionService\x12\x94\x02\n\x07Predict\x12*.google.cloud.aiplatform.v1.PredictRequest\x1a+.google.cloud.aiplatform.v1.PredictResponse\"\xaf\x01\xda\x41\x1d\x65ndpoint,instances,parameters\x82\xd3\xe4\x93\x02\x88\x01\"9/v1/{endpoint=projects/*/locations/*/endpoints/*}:predict:\x01*ZH\"C/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:predict:\x01*\x12\xfe\x01\n\nRawPredict\x12-.google.cloud.aiplatform.v1.RawPredictRequest\x1a\x14.google.api.HttpBody\"\xaa\x01\xda\x41\x12\x65ndpoint,http_body\x82\xd3\xe4\x93\x02\x8e\x01\"</v1/{endpoint=projects/*/locations/*/endpoints/*}:rawPredict:\x01*ZK\"F/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:rawPredict:\x01*\x12\x98\x02\n\x10StreamRawPredict\x12\x33.google.cloud.aiplatform.v1.StreamRawPredictRequest\x1a\x14.google.api.HttpBody\"\xb6\x01\xda\x41\x12\x65ndpoint,http_body\x82\xd3\xe4\x93\x02\x9a\x01\"B/v1/{endpoint=projects/*/locations/*/endpoints/*}:streamRawPredict:\x01*ZQ\"L/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:streamRawPredict:\x01*0\x01\x12\xc0\x01\n\rDirectPredict\x12\x30.google.cloud.aiplatform.v1.DirectPredictRequest\x1a\x31.google.cloud.aiplatform.v1.DirectPredictResponse\"J\x82\xd3\xe4\x93\x02\x44\"?/v1/{endpoint=projects/*/locations/*/endpoints/*}:directPredict:\x01*\x12\xcc\x01\n\x10\x44irectRawPredict\x12\x33.google.cloud.aiplatform.v1.DirectRawPredictRequest\x1a\x34.google.cloud.aiplatform.v1.DirectRawPredictResponse\"M\x82\xd3\xe4\x93\x02G\"B/v1/{endpoint=projects/*/locations/*/endpoints/*}:directRawPredict:\x01*\x12\x8c\x01\n\x13StreamDirectPredict\x12\x36.google.cloud.aiplatform.v1.StreamDirectPredictRequest\x1a\x37.google.cloud.aiplatform.v1.StreamDirectPredictResponse\"\x00(\x01\x30\x01\x12\x95\x01\n\x16StreamDirectRawPredict\x12\x39.google.cloud.aiplatform.v1.StreamDirectRawPredictRequest\x1a:.google.cloud.aiplatform.v1.StreamDirectRawPredictResponse\"\x00(\x01\x30\x01\x12\x83\x01\n\x10StreamingPredict\x12\x33.google.cloud.aiplatform.v1.StreamingPredictRequest\x1a\x34.google.cloud.aiplatform.v1.StreamingPredictResponse\"\x00(\x01\x30\x01\x12\xb5\x02\n\x16ServerStreamingPredict\x12\x33.google.cloud.aiplatform.v1.StreamingPredictRequest\x1a\x34.google.cloud.aiplatform.v1.StreamingPredictResponse\"\xad\x01\x82\xd3\xe4\x93\x02\xa6\x01\"H/v1/{endpoint=projects/*/locations/*/endpoints/*}:serverStreamingPredict:\x01*ZW\"R/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:serverStreamingPredict:\x01*0\x01\x12\x8c\x01\n\x13StreamingRawPredict\x12\x36.google.cloud.aiplatform.v1.StreamingRawPredictRequest\x1a\x37.google.cloud.aiplatform.v1.StreamingRawPredictResponse\"\x00(\x01\x30\x01\x12\xda\x01\n\x07\x45xplain\x12*.google.cloud.aiplatform.v1.ExplainRequest\x1a+.google.cloud.aiplatform.v1.ExplainResponse\"v\xda\x41/endpoint,instances,parameters,deployed_model_id\x82\xd3\xe4\x93\x02>\"9/v1/{endpoint=projects/*/locations/*/endpoints/*}:explain:\x01*\x12\x8d\x03\n\x0fGenerateContent\x12\x32.google.cloud.aiplatform.v1.GenerateContentRequest\x1a\x33.google.cloud.aiplatform.v1.GenerateContentResponse\"\x90\x02\xda\x41\x0emodel,contents\x82\xd3\xe4\x93\x02\xf8\x01\">/v1/{model=projects/*/locations/*/endpoints/*}:generateContent:\x01*ZM\"H/v1/{model=projects/*/locations/*/publishers/*/models/*}:generateContent:\x01*Z,\"\'/v1/{model=endpoints/*}:generateContent:\x01*Z6\"1/v1/{model=publishers/*/models/*}:generateContent:\x01*\x12\xad\x03\n\x15StreamGenerateContent\x12\x32.google.cloud.aiplatform.v1.GenerateContentRequest\x1a\x33.google.cloud.aiplatform.v1.GenerateContentResponse\"\xa8\x02\xda\x41\x0emodel,contents\x82\xd3\xe4\x93\x02\x90\x02\"D/v1/{model=projects/*/locations/*/endpoints/*}:streamGenerateContent:\x01*ZS\"N/v1/{model=projects/*/locations/*/publishers/*/models/*}:streamGenerateContent:\x01*Z2\"-/v1/{model=endpoints/*}:streamGenerateContent:\x01*Z<\"7/v1/{model=publishers/*/models/*}:streamGenerateContent:\x01*0\x01\x12\xd3\x01\n\x0c\x45mbedContent\x12/.google.cloud.aiplatform.v1.EmbedContentRequest\x1a\x30.google.cloud.aiplatform.v1.EmbedContentResponse\"`\xda\x41\rmodel,content\x82\xd3\xe4\x93\x02J\"E/v1/{model=projects/*/locations/*/publishers/*/models/*}:embedContent:\x01*\x1a\x86\x01\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41ghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB\xd4\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x16PredictionServiceProtoP\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"
|
|
21
22
|
|
|
22
23
|
pool = Google::Protobuf::DescriptorPool.generated_pool
|
|
23
24
|
|
|
@@ -39,6 +40,7 @@ rescue TypeError
|
|
|
39
40
|
["google.cloud.aiplatform.v1.Content", "google/cloud/aiplatform/v1/content.proto"],
|
|
40
41
|
["google.cloud.aiplatform.v1.Tool", "google/cloud/aiplatform/v1/tool.proto"],
|
|
41
42
|
["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"],
|
|
43
|
+
["google.cloud.aiplatform.v1.UsageMetadata", "google/cloud/aiplatform/v1/usage_metadata.proto"],
|
|
42
44
|
]
|
|
43
45
|
imports.each do |type_name, expected_filename|
|
|
44
46
|
import_file = pool.lookup(type_name).file_descriptor
|
|
@@ -79,6 +81,10 @@ module Google
|
|
|
79
81
|
GenerateContentResponse::PromptFeedback = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedback").msgclass
|
|
80
82
|
GenerateContentResponse::PromptFeedback::BlockedReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedback.BlockedReason").enummodule
|
|
81
83
|
GenerateContentResponse::UsageMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata").msgclass
|
|
84
|
+
EmbedContentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.EmbedContentRequest").msgclass
|
|
85
|
+
EmbedContentRequest::EmbeddingTaskType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.EmbedContentRequest.EmbeddingTaskType").enummodule
|
|
86
|
+
EmbedContentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.EmbedContentResponse").msgclass
|
|
87
|
+
EmbedContentResponse::Embedding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.EmbedContentResponse.Embedding").msgclass
|
|
82
88
|
end
|
|
83
89
|
end
|
|
84
90
|
end
|
|
@@ -85,6 +85,8 @@ module Google
|
|
|
85
85
|
rpc :GenerateContent, ::Google::Cloud::AIPlatform::V1::GenerateContentRequest, ::Google::Cloud::AIPlatform::V1::GenerateContentResponse
|
|
86
86
|
# Generate content with multimodal inputs with streaming support.
|
|
87
87
|
rpc :StreamGenerateContent, ::Google::Cloud::AIPlatform::V1::GenerateContentRequest, stream(::Google::Cloud::AIPlatform::V1::GenerateContentResponse)
|
|
88
|
+
# Embed content with multimodal inputs.
|
|
89
|
+
rpc :EmbedContent, ::Google::Cloud::AIPlatform::V1::EmbedContentRequest, ::Google::Cloud::AIPlatform::V1::EmbedContentResponse
|
|
88
90
|
end
|
|
89
91
|
|
|
90
92
|
Stub = Service.rpc_stub_class
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# source: google/cloud/aiplatform/v1/usage_metadata.proto
|
|
4
|
+
|
|
5
|
+
require 'google/protobuf'
|
|
6
|
+
|
|
7
|
+
require 'google/api/field_behavior_pb'
|
|
8
|
+
require 'google/cloud/aiplatform/v1/content_pb'
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
descriptor_data = "\n/google/cloud/aiplatform/v1/usage_metadata.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a(google/cloud/aiplatform/v1/content.proto\"\xe2\x05\n\rUsageMetadata\x12\x1a\n\x12prompt_token_count\x18\x01 \x01(\x05\x12\x1e\n\x16\x63\x61ndidates_token_count\x18\x02 \x01(\x05\x12\x19\n\x11total_token_count\x18\x03 \x01(\x05\x12(\n\x1btool_use_prompt_token_count\x18\r \x01(\x05\x42\x03\xe0\x41\x03\x12!\n\x14thoughts_token_count\x18\x0e \x01(\x05\x42\x03\xe0\x41\x03\x12\'\n\x1a\x63\x61\x63hed_content_token_count\x18\x05 \x01(\x05\x42\x03\xe0\x41\x03\x12R\n\x15prompt_tokens_details\x18\t \x03(\x0b\x32..google.cloud.aiplatform.v1.ModalityTokenCountB\x03\xe0\x41\x03\x12Q\n\x14\x63\x61\x63he_tokens_details\x18\n \x03(\x0b\x32..google.cloud.aiplatform.v1.ModalityTokenCountB\x03\xe0\x41\x03\x12V\n\x19\x63\x61ndidates_tokens_details\x18\x0b \x03(\x0b\x32..google.cloud.aiplatform.v1.ModalityTokenCountB\x03\xe0\x41\x03\x12[\n\x1etool_use_prompt_tokens_details\x18\x0c \x03(\x0b\x32..google.cloud.aiplatform.v1.ModalityTokenCountB\x03\xe0\x41\x03\x12P\n\x0ctraffic_type\x18\x08 \x01(\x0e\x32\x35.google.cloud.aiplatform.v1.UsageMetadata.TrafficTypeB\x03\xe0\x41\x03\"V\n\x0bTrafficType\x12\x1c\n\x18TRAFFIC_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tON_DEMAND\x10\x01\x12\x1a\n\x16PROVISIONED_THROUGHPUT\x10\x02\x42\xd0\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x12UsageMetadataProtoP\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"
|
|
12
|
+
|
|
13
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
|
14
|
+
|
|
15
|
+
begin
|
|
16
|
+
pool.add_serialized_file(descriptor_data)
|
|
17
|
+
rescue TypeError
|
|
18
|
+
# Compatibility code: will be removed in the next major version.
|
|
19
|
+
require 'google/protobuf/descriptor_pb'
|
|
20
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
|
21
|
+
parsed.clear_dependency
|
|
22
|
+
serialized = parsed.class.encode(parsed)
|
|
23
|
+
file = pool.add_serialized_file(serialized)
|
|
24
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
|
25
|
+
imports = [
|
|
26
|
+
["google.cloud.aiplatform.v1.ModalityTokenCount", "google/cloud/aiplatform/v1/content.proto"],
|
|
27
|
+
]
|
|
28
|
+
imports.each do |type_name, expected_filename|
|
|
29
|
+
import_file = pool.lookup(type_name).file_descriptor
|
|
30
|
+
if import_file.name != expected_filename
|
|
31
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
|
35
|
+
warn "This will become an error in the next major version."
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
module Google
|
|
39
|
+
module Cloud
|
|
40
|
+
module AIPlatform
|
|
41
|
+
module V1
|
|
42
|
+
UsageMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UsageMetadata").msgclass
|
|
43
|
+
UsageMetadata::TrafficType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UsageMetadata.TrafficType").enummodule
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -668,6 +668,90 @@ module Google
|
|
|
668
668
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
669
669
|
end
|
|
670
670
|
end
|
|
671
|
+
|
|
672
|
+
# Request message for
|
|
673
|
+
# {::Google::Cloud::AIPlatform::V1::PredictionService::Client#embed_content PredictionService.EmbedContent}.
|
|
674
|
+
# @!attribute [rw] model
|
|
675
|
+
# @return [::String]
|
|
676
|
+
# Required. The name of the publisher model requested to serve the
|
|
677
|
+
# prediction. Format:
|
|
678
|
+
# `projects/{project}/locations/{location}/publishers/*/models/*`
|
|
679
|
+
# @!attribute [rw] content
|
|
680
|
+
# @return [::Google::Cloud::AIPlatform::V1::Content]
|
|
681
|
+
# Required. Input content to be embedded. Required.
|
|
682
|
+
# @!attribute [rw] title
|
|
683
|
+
# @return [::String]
|
|
684
|
+
# Optional. An optional title for the text.
|
|
685
|
+
# @!attribute [rw] task_type
|
|
686
|
+
# @return [::Google::Cloud::AIPlatform::V1::EmbedContentRequest::EmbeddingTaskType]
|
|
687
|
+
# Optional. The task type of the embedding.
|
|
688
|
+
# @!attribute [rw] output_dimensionality
|
|
689
|
+
# @return [::Integer]
|
|
690
|
+
# Optional. Optional reduced dimension for the output embedding. If set,
|
|
691
|
+
# excessive values in the output embedding are truncated from the end.
|
|
692
|
+
# @!attribute [rw] auto_truncate
|
|
693
|
+
# @return [::Boolean]
|
|
694
|
+
# Optional. Whether to silently truncate the input content if it's longer
|
|
695
|
+
# than the maximum sequence length.
|
|
696
|
+
class EmbedContentRequest
|
|
697
|
+
include ::Google::Protobuf::MessageExts
|
|
698
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
699
|
+
|
|
700
|
+
# Represents a downstream task the embeddings will be used for.
|
|
701
|
+
module EmbeddingTaskType
|
|
702
|
+
# Unset value, which will default to one of the other enum values.
|
|
703
|
+
UNSPECIFIED = 0
|
|
704
|
+
|
|
705
|
+
# Specifies the given text is a query in a search/retrieval setting.
|
|
706
|
+
RETRIEVAL_QUERY = 2
|
|
707
|
+
|
|
708
|
+
# Specifies the given text is a document from the corpus being searched.
|
|
709
|
+
RETRIEVAL_DOCUMENT = 3
|
|
710
|
+
|
|
711
|
+
# Specifies the given text will be used for STS.
|
|
712
|
+
SEMANTIC_SIMILARITY = 4
|
|
713
|
+
|
|
714
|
+
# Specifies that the given text will be classified.
|
|
715
|
+
CLASSIFICATION = 5
|
|
716
|
+
|
|
717
|
+
# Specifies that the embeddings will be used for clustering.
|
|
718
|
+
CLUSTERING = 6
|
|
719
|
+
|
|
720
|
+
# Specifies that the embeddings will be used for question answering.
|
|
721
|
+
QUESTION_ANSWERING = 7
|
|
722
|
+
|
|
723
|
+
# Specifies that the embeddings will be used for fact verification.
|
|
724
|
+
FACT_VERIFICATION = 8
|
|
725
|
+
|
|
726
|
+
# Specifies that the embeddings will be used for code retrieval.
|
|
727
|
+
CODE_RETRIEVAL_QUERY = 9
|
|
728
|
+
end
|
|
729
|
+
end
|
|
730
|
+
|
|
731
|
+
# Response message for
|
|
732
|
+
# {::Google::Cloud::AIPlatform::V1::PredictionService::Client#embed_content PredictionService.EmbedContent}.
|
|
733
|
+
# @!attribute [rw] embedding
|
|
734
|
+
# @return [::Google::Cloud::AIPlatform::V1::EmbedContentResponse::Embedding]
|
|
735
|
+
# The embedding generated from the input content.
|
|
736
|
+
# @!attribute [rw] usage_metadata
|
|
737
|
+
# @return [::Google::Cloud::AIPlatform::V1::UsageMetadata]
|
|
738
|
+
# Metadata about the response(s).
|
|
739
|
+
# @!attribute [rw] truncated
|
|
740
|
+
# @return [::Boolean]
|
|
741
|
+
# Whether the input content was truncated before generating the embedding.
|
|
742
|
+
class EmbedContentResponse
|
|
743
|
+
include ::Google::Protobuf::MessageExts
|
|
744
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
745
|
+
|
|
746
|
+
# A list of floats representing an embedding.
|
|
747
|
+
# @!attribute [rw] values
|
|
748
|
+
# @return [::Array<::Float>]
|
|
749
|
+
# Embedding vector values.
|
|
750
|
+
class Embedding
|
|
751
|
+
include ::Google::Protobuf::MessageExts
|
|
752
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
753
|
+
end
|
|
754
|
+
end
|
|
671
755
|
end
|
|
672
756
|
end
|
|
673
757
|
end
|
|
@@ -0,0 +1,91 @@
|
|
|
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
|
+
|
|
20
|
+
module Google
|
|
21
|
+
module Cloud
|
|
22
|
+
module AIPlatform
|
|
23
|
+
module V1
|
|
24
|
+
# Usage metadata about the content generation request and response.
|
|
25
|
+
# This message provides a detailed breakdown of token usage and other
|
|
26
|
+
# relevant metrics.
|
|
27
|
+
# @!attribute [rw] prompt_token_count
|
|
28
|
+
# @return [::Integer]
|
|
29
|
+
# The total number of tokens in the prompt. This includes any text, images,
|
|
30
|
+
# or other media provided in the request. When `cached_content` is set,
|
|
31
|
+
# this also includes the number of tokens in the cached content.
|
|
32
|
+
# @!attribute [rw] candidates_token_count
|
|
33
|
+
# @return [::Integer]
|
|
34
|
+
# The total number of tokens in the generated candidates.
|
|
35
|
+
# @!attribute [rw] total_token_count
|
|
36
|
+
# @return [::Integer]
|
|
37
|
+
# The total number of tokens for the entire request. This is the sum of
|
|
38
|
+
# `prompt_token_count`, `candidates_token_count`,
|
|
39
|
+
# `tool_use_prompt_token_count`, and `thoughts_token_count`.
|
|
40
|
+
# @!attribute [r] tool_use_prompt_token_count
|
|
41
|
+
# @return [::Integer]
|
|
42
|
+
# Output only. The number of tokens in the results from tool executions,
|
|
43
|
+
# which are provided back to the model as input, if applicable.
|
|
44
|
+
# @!attribute [r] thoughts_token_count
|
|
45
|
+
# @return [::Integer]
|
|
46
|
+
# Output only. The number of tokens that were part of the model's generated
|
|
47
|
+
# "thoughts" output, if applicable.
|
|
48
|
+
# @!attribute [r] cached_content_token_count
|
|
49
|
+
# @return [::Integer]
|
|
50
|
+
# Output only. The number of tokens in the cached content that was used for
|
|
51
|
+
# this request.
|
|
52
|
+
# @!attribute [r] prompt_tokens_details
|
|
53
|
+
# @return [::Array<::Google::Cloud::AIPlatform::V1::ModalityTokenCount>]
|
|
54
|
+
# Output only. A detailed breakdown of the token count for each modality in
|
|
55
|
+
# the prompt.
|
|
56
|
+
# @!attribute [r] cache_tokens_details
|
|
57
|
+
# @return [::Array<::Google::Cloud::AIPlatform::V1::ModalityTokenCount>]
|
|
58
|
+
# Output only. A detailed breakdown of the token count for each modality in
|
|
59
|
+
# the cached content.
|
|
60
|
+
# @!attribute [r] candidates_tokens_details
|
|
61
|
+
# @return [::Array<::Google::Cloud::AIPlatform::V1::ModalityTokenCount>]
|
|
62
|
+
# Output only. A detailed breakdown of the token count for each modality in
|
|
63
|
+
# the generated candidates.
|
|
64
|
+
# @!attribute [r] tool_use_prompt_tokens_details
|
|
65
|
+
# @return [::Array<::Google::Cloud::AIPlatform::V1::ModalityTokenCount>]
|
|
66
|
+
# Output only. A detailed breakdown by modality of the token counts from the
|
|
67
|
+
# results of tool executions, which are provided back to the model as input.
|
|
68
|
+
# @!attribute [r] traffic_type
|
|
69
|
+
# @return [::Google::Cloud::AIPlatform::V1::UsageMetadata::TrafficType]
|
|
70
|
+
# Output only. The traffic type for this request.
|
|
71
|
+
class UsageMetadata
|
|
72
|
+
include ::Google::Protobuf::MessageExts
|
|
73
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
74
|
+
|
|
75
|
+
# The type of traffic that this request was processed with, indicating which
|
|
76
|
+
# quota gets consumed.
|
|
77
|
+
module TrafficType
|
|
78
|
+
# Unspecified request traffic type.
|
|
79
|
+
TRAFFIC_TYPE_UNSPECIFIED = 0
|
|
80
|
+
|
|
81
|
+
# Type for Pay-As-You-Go traffic.
|
|
82
|
+
ON_DEMAND = 1
|
|
83
|
+
|
|
84
|
+
# Type for Provisioned Throughput traffic.
|
|
85
|
+
PROVISIONED_THROUGHPUT = 2
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: google-cloud-ai_platform-v1
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.30.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Google LLC
|
|
@@ -506,6 +506,7 @@ files:
|
|
|
506
506
|
- lib/google/cloud/aiplatform/v1/tuning_job_pb.rb
|
|
507
507
|
- lib/google/cloud/aiplatform/v1/types_pb.rb
|
|
508
508
|
- lib/google/cloud/aiplatform/v1/unmanaged_container_model_pb.rb
|
|
509
|
+
- lib/google/cloud/aiplatform/v1/usage_metadata_pb.rb
|
|
509
510
|
- lib/google/cloud/aiplatform/v1/user_action_reference_pb.rb
|
|
510
511
|
- lib/google/cloud/aiplatform/v1/value_pb.rb
|
|
511
512
|
- lib/google/cloud/aiplatform/v1/vertex_rag_data_pb.rb
|
|
@@ -672,6 +673,7 @@ files:
|
|
|
672
673
|
- proto_docs/google/cloud/aiplatform/v1/tuning_job.rb
|
|
673
674
|
- proto_docs/google/cloud/aiplatform/v1/types.rb
|
|
674
675
|
- proto_docs/google/cloud/aiplatform/v1/unmanaged_container_model.rb
|
|
676
|
+
- proto_docs/google/cloud/aiplatform/v1/usage_metadata.rb
|
|
675
677
|
- proto_docs/google/cloud/aiplatform/v1/user_action_reference.rb
|
|
676
678
|
- proto_docs/google/cloud/aiplatform/v1/value.rb
|
|
677
679
|
- proto_docs/google/cloud/aiplatform/v1/vertex_rag_data.rb
|