Skip to content

Commit 3133550

Browse files
Google APIscopybara-github
authored andcommitted
feat: add enum value MALFORMED_FUNCTION_CALL to .google.cloud.aiplatform.v1beta1.content.Candidate.FinishReason
feat: add text field in Segment feat: add streamRawPredict rpc to prediction service feat: add fields grounding_chunks and grounding_supports to GroundingMetadata docs: A comment for field `name` in message `.google.cloud.aiplatform.v1beta1.cached_content.CachedContent` is changed docs: A comment for field `distibution` in message `.google.cloud.aiplatform.v1beta1.model_monitoring_stats.ModelMonitoringStatsDataPoint` is changed. docs: A comment for field `source` in message `.google.cloud.aiplatform.v1beta1.tool.Retrieval` is added. PiperOrigin-RevId: 643377787
1 parent 311e0ce commit 3133550

5 files changed

Lines changed: 96 additions & 3 deletions

File tree

google/cloud/aiplatform/v1beta1/cached_content.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ message CachedContent {
5454
[(google.api.field_behavior) = INPUT_ONLY];
5555
}
5656

57-
// Immutable. Identifier. The resource name of the cached content
58-
// Format:
57+
// Immutable. Identifier. The server-generated resource name of the cached
58+
// content Format:
5959
// projects/{project}/locations/{location}/cachedContents/{cached_content}
6060
string name = 1 [
6161
(google.api.field_behavior) = IDENTIFIER,

google/cloud/aiplatform/v1beta1/content.proto

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,9 @@ message Candidate {
346346
// The token generation was stopped as the response was flagged for
347347
// Sensitive Personally Identifiable Information (SPII) contents.
348348
SPII = 8;
349+
350+
// The function call generated by the model is invalid.
351+
MALFORMED_FUNCTION_CALL = 9;
349352
}
350353

351354
// Output only. Index of the candidate.
@@ -390,6 +393,56 @@ message Segment {
390393
// Output only. End index in the given Part, measured in bytes. Offset from
391394
// the start of the Part, exclusive, starting at zero.
392395
int32 end_index = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
396+
397+
// Output only. The text corresponding to the segment from the response.
398+
string text = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
399+
}
400+
401+
// Grounding chunk.
402+
message GroundingChunk {
403+
// Chunk from the web.
404+
message Web {
405+
// URI reference of the chunk.
406+
optional string uri = 1;
407+
408+
// Title of the chunk.
409+
optional string title = 2;
410+
}
411+
412+
// Chunk from context retrieved by the retrieval tools.
413+
message RetrievedContext {
414+
// URI reference of the attribution.
415+
optional string uri = 1;
416+
417+
// Title of the attribution.
418+
optional string title = 2;
419+
}
420+
421+
// Chunk type.
422+
oneof chunk_type {
423+
// Grounding chunk from the web.
424+
Web web = 1;
425+
426+
// Grounding chunk from context retrieved by the retrieval tools.
427+
RetrievedContext retrieved_context = 2;
428+
}
429+
}
430+
431+
// Grounding support.
432+
message GroundingSupport {
433+
// Segment of the content this support belongs to.
434+
optional Segment segment = 1;
435+
436+
// A list of indices (into 'grounding_chunk') specifying the
437+
// citations associated with the claim. For instance [1,3,4] means
438+
// that grounding_chunk[1], grounding_chunk[3],
439+
// grounding_chunk[4] are the retrieved content attributed to the claim.
440+
repeated int32 grounding_chunk_indices = 2;
441+
442+
// Confidence score of the support references. Ranges from 0 to 1. 1 is the
443+
// most confident. This list must have the same size as the
444+
// grounding_chunk_indices.
445+
repeated float confidence_scores = 3;
393446
}
394447

395448
// Grounding attribution.
@@ -449,6 +502,13 @@ message GroundingMetadata {
449502
// Optional. List of grounding attributions.
450503
repeated GroundingAttribution grounding_attributions = 2
451504
[(google.api.field_behavior) = OPTIONAL];
505+
506+
// List of supporting references retrieved from specified grounding source.
507+
repeated GroundingChunk grounding_chunks = 5;
508+
509+
// Optional. List of grounding support.
510+
repeated GroundingSupport grounding_supports = 6
511+
[(google.api.field_behavior) = OPTIONAL];
452512
}
453513

454514
// Google search entry point.

google/cloud/aiplatform/v1beta1/model_monitoring_stats.proto

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ message ModelMonitoringStatsDataPoint {
4141
message TypedValue {
4242
// Summary statistics for a population of values.
4343
message DistributionDataValue {
44-
// tensorflow.metadata.v0.DatasetFeatureStatistics format.
44+
// Predictive monitoring drift distribution in
45+
// `tensorflow.metadata.v0.DatasetFeatureStatistics` format.
4546
google.protobuf.Value distribution = 1;
4647

4748
// Distribution distance deviation from the current dataset's statistics

google/cloud/aiplatform/v1beta1/prediction_service.proto

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,20 @@ service PredictionService {
7878
option (google.api.method_signature) = "endpoint,http_body";
7979
}
8080

81+
// Perform a streaming online prediction with an arbitrary HTTP payload.
82+
rpc StreamRawPredict(StreamRawPredictRequest)
83+
returns (stream google.api.HttpBody) {
84+
option (google.api.http) = {
85+
post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:streamRawPredict"
86+
body: "*"
87+
additional_bindings {
88+
post: "/v1beta1/{endpoint=projects/*/locations/*/publishers/*/models/*}:streamRawPredict"
89+
body: "*"
90+
}
91+
};
92+
option (google.api.method_signature) = "endpoint,http_body";
93+
}
94+
8195
// Perform an unary online prediction request to a gRPC model server for
8296
// Vertex first-party products and frameworks.
8397
rpc DirectPredict(DirectPredictRequest) returns (DirectPredictResponse) {
@@ -305,6 +319,23 @@ message RawPredictRequest {
305319
google.api.HttpBody http_body = 2;
306320
}
307321

322+
// Request message for
323+
// [PredictionService.StreamRawPredict][google.cloud.aiplatform.v1beta1.PredictionService.StreamRawPredict].
324+
message StreamRawPredictRequest {
325+
// Required. The name of the Endpoint requested to serve the prediction.
326+
// Format:
327+
// `projects/{project}/locations/{location}/endpoints/{endpoint}`
328+
string endpoint = 1 [
329+
(google.api.field_behavior) = REQUIRED,
330+
(google.api.resource_reference) = {
331+
type: "aiplatform.googleapis.com/Endpoint"
332+
}
333+
];
334+
335+
// The prediction input. Supports HTTP headers and arbitrary data payload.
336+
google.api.HttpBody http_body = 2;
337+
}
338+
308339
// Request message for
309340
// [PredictionService.DirectPredict][google.cloud.aiplatform.v1beta1.PredictionService.DirectPredict].
310341
message DirectPredictRequest {

google/cloud/aiplatform/v1beta1/tool.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ message FunctionResponse {
164164

165165
// Defines a retrieval tool that model can call to access external knowledge.
166166
message Retrieval {
167+
// The source of the retrieval.
167168
oneof source {
168169
// Set to use data source powered by Vertex AI Search.
169170
VertexAISearch vertex_ai_search = 2;

0 commit comments

Comments
 (0)