feat: add IMAGE_RECITATION reason when generation is stopped due to recitation

feat: add support for GroundingMetadata.google_maps_widget_context_token
feat: add json_name for GenerationConfig.response_json_schema_ordered field

PiperOrigin-RevId: 846116816
This commit is contained in:
Google APIs 2025-12-18 00:21:08 -08:00 committed by Copybara-Service
parent 6d6acd2e99
commit c631c694fd

View file

@ -145,7 +145,6 @@ enum TaskType {
}
// Request to generate a completion from the model.
// NEXT ID: 18
message GenerateContentRequest {
// Required. The name of the `Model` to use for generating the completion.
//
@ -192,7 +191,6 @@ message GenerateContentRequest {
// Configuration options for model generation and outputs. Not all parameters
// are configurable for every model.
// Next ID: 29
message GenerationConfig {
// Optional. Number of generated responses to return. If unset, this will
// default to 1. Please note that this doesn't work for previous generation
@ -253,8 +251,10 @@ message GenerationConfig {
// Optional. An internal detail. Use `responseJsonSchema` rather than this
// field.
google.protobuf.Value response_json_schema_ordered = 28
[(google.api.field_behavior) = OPTIONAL];
google.protobuf.Value response_json_schema_ordered = 28 [
json_name = "responseJsonSchema",
(google.api.field_behavior) = OPTIONAL
];
// Optional. Presence penalty applied to the next token's logprobs if the
// token has already been seen in the response.
@ -461,6 +461,9 @@ message Candidate {
// The model was expected to generate an image, but none was generated.
NO_IMAGE = 16;
// Image generation stopped due to recitation.
IMAGE_RECITATION = 17;
// Model generated a tool call but no tools were enabled in the request.
UNEXPECTED_TOOL_CALL = 12;
@ -616,6 +619,13 @@ message GroundingMetadata {
// Web search queries for the following-up web search.
repeated string web_search_queries = 5;
// Optional. Resource name of the Google Maps widget context token that can be
// used with the PlacesContextElement widget in order to render contextual
// data. Only populated in the case that grounding with Google Maps is
// enabled.
optional string google_maps_widget_context_token = 7
[(google.api.field_behavior) = OPTIONAL];
}
// Google search entry point.