Skip to content

Commit 9d5f10d

Browse files
Google APIscopybara-github
authored andcommitted
feat: Add new embed_content_config to message EmbedContentRequest
PiperOrigin-RevId: 885256653
1 parent 6c3dce4 commit 9d5f10d

File tree

1 file changed

+54
-12
lines changed

1 file changed

+54
-12
lines changed

google/cloud/aiplatform/v1/prediction_service.proto

Lines changed: 54 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -892,6 +892,38 @@ message GenerateContentResponse {
892892
// Request message for
893893
// [PredictionService.EmbedContent][google.cloud.aiplatform.v1.PredictionService.EmbedContent].
894894
message EmbedContentRequest {
895+
// Configurations for the EmbedContent API.
896+
message EmbedContentConfig {
897+
// Optional. The title for the text.
898+
//
899+
// Only applicable to text-only embedding models.
900+
optional string title = 1 [(google.api.field_behavior) = OPTIONAL];
901+
902+
// Optional. The task type of the embedding.
903+
//
904+
// Only applicable to text-only embedding models.
905+
optional EmbeddingTaskType task_type = 2
906+
[(google.api.field_behavior) = OPTIONAL];
907+
908+
// Optional. Whether to silently truncate the input content if it's longer
909+
// than the maximum sequence length.
910+
//
911+
// Only applicable to text-only embedding models.
912+
optional bool auto_truncate = 3 [(google.api.field_behavior) = OPTIONAL];
913+
914+
// Optional. Reduced dimension for the output embedding. If set, excessive
915+
// values in the output embedding are truncated from the end.
916+
optional int32 output_dimensionality = 4
917+
[(google.api.field_behavior) = OPTIONAL];
918+
919+
// Optional. Whether to enable OCR for document content.
920+
optional bool document_ocr = 5 [(google.api.field_behavior) = OPTIONAL];
921+
922+
// Optional. Whether to extract audio from video content.
923+
optional bool audio_track_extraction = 6
924+
[(google.api.field_behavior) = OPTIONAL];
925+
}
926+
895927
// Represents a downstream task the embeddings will be used for.
896928
enum EmbeddingTaskType {
897929
// Unset value, which will default to one of the other enum values.
@@ -929,24 +961,34 @@ message EmbedContentRequest {
929961
type: "aiplatform.googleapis.com/Endpoint"
930962
}];
931963

932-
// Required. Input content to be embedded. Required.
964+
// Required. Input content to be embedded.
933965
optional Content content = 2;
934966

935-
// Optional. An optional title for the text.
936-
optional string title = 4 [(google.api.field_behavior) = OPTIONAL];
967+
// Optional. Deprecated: Please use EmbedContentConfig.title instead.
968+
// The title for the text.
969+
optional string title = 4
970+
[deprecated = true, (google.api.field_behavior) = OPTIONAL];
937971

938-
// Optional. The task type of the embedding.
972+
// Optional. Deprecated: Please use EmbedContentConfig.task_type instead.
973+
// The task type of the embedding.
939974
optional EmbeddingTaskType task_type = 5
940-
[(google.api.field_behavior) = OPTIONAL];
975+
[deprecated = true, (google.api.field_behavior) = OPTIONAL];
941976

942-
// Optional. Optional reduced dimension for the output embedding. If set,
943-
// excessive values in the output embedding are truncated from the end.
977+
// Optional. Deprecated: Please use EmbedContentConfig.output_dimensionality
978+
// instead. Reduced dimension for the output embedding. If set, excessive
979+
// values in the output embedding are truncated from the end.
944980
optional int32 output_dimensionality = 6
945-
[(google.api.field_behavior) = OPTIONAL];
981+
[deprecated = true, (google.api.field_behavior) = OPTIONAL];
946982

947-
// Optional. Whether to silently truncate the input content if it's longer
983+
// Optional. Deprecated: Please use EmbedContentConfig.auto_truncate instead.
984+
// Whether to silently truncate the input content if it's longer
948985
// than the maximum sequence length.
949-
optional bool auto_truncate = 7 [(google.api.field_behavior) = OPTIONAL];
986+
optional bool auto_truncate = 7
987+
[deprecated = true, (google.api.field_behavior) = OPTIONAL];
988+
989+
// Optional. Configuration for the EmbedContent request.
990+
optional EmbedContentConfig embed_content_config = 8
991+
[(google.api.field_behavior) = OPTIONAL];
950992
}
951993

952994
// Response message for
@@ -961,7 +1003,7 @@ message EmbedContentResponse {
9611003
// The embedding generated from the input content.
9621004
Embedding embedding = 1;
9631005

964-
// Metadata about the response(s).
1006+
// Usage metadata about the response(s).
9651007
UsageMetadata usage_metadata = 2;
9661008

9671009
// Whether the input content was truncated before generating the embedding.

0 commit comments

Comments
 (0)