@@ -141,6 +141,29 @@ message Part {
141141 // Optional. An opaque signature for the thought so it can be reused in
142142 // subsequent requests.
143143 bytes thought_signature = 13 [(google.api.field_behavior ) = OPTIONAL ];
144+
145+ // Custom metadata associated with the Part.
146+ // Agents using genai.Part as content representation may need to keep track
147+ // of the additional information. For example it can be name of a file/source
148+ // from which the Part originates or a way to multiplex multiple Part streams.
149+ google.protobuf.Struct part_metadata = 8 ;
150+ }
151+
152+ // A datatype containing media that is part of a `FunctionResponse` message.
153+ //
154+ // A `FunctionResponsePart` consists of data which has an associated datatype. A
155+ // `FunctionResponsePart` can only contain one of the accepted types in
156+ // `FunctionResponsePart.data`.
157+ //
158+ // A `FunctionResponsePart` must have a fixed IANA MIME type identifying the
159+ // type and subtype of the media if the `inline_data` field is filled with raw
160+ // bytes.
161+ message FunctionResponsePart {
162+ // The data of the function response part.
163+ oneof data {
164+ // Inline media bytes.
165+ FunctionResponseBlob inline_data = 1 ;
166+ }
144167}
145168
146169// Raw media bytes.
@@ -160,6 +183,24 @@ message Blob {
160183 bytes data = 2 ;
161184}
162185
186+ // Raw media bytes for function response.
187+ //
188+ // Text should not be sent as raw bytes, use the 'FunctionResponse.response'
189+ // field.
190+ message FunctionResponseBlob {
191+ // The IANA standard MIME type of the source data.
192+ // Examples:
193+ // - image/png
194+ // - image/jpeg
195+ // If an unsupported MIME type is provided, an error will be returned. For a
196+ // complete list of supported types, see [Supported file
197+ // formats](https://ai.google.dev/gemini-api/docs/prompting_with_media#supported_file_formats).
198+ string mime_type = 1 ;
199+
200+ // Raw bytes for media formats.
201+ bytes data = 2 ;
202+ }
203+
163204// URI based data.
164205message FileData {
165206 // Optional. The IANA standard MIME type of the source data.
@@ -242,6 +283,8 @@ message CodeExecutionResult {
242283// A `Tool` is a piece of code that enables the system to interact with
243284// external systems to perform an action, or set of actions, outside of
244285// knowledge and scope of the model.
286+ //
287+ // Next ID: 12
245288message Tool {
246289 // GoogleSearch tool type.
247290 // Tool to support Google Search in Model. Powered by Google.
@@ -253,6 +296,29 @@ message Tool {
253296 [(google.api.field_behavior ) = OPTIONAL ];
254297 }
255298
299+ // Computer Use tool type.
300+ message ComputerUse {
301+ // Represents the environment being operated, such as a web browser.
302+ enum Environment {
303+ // Defaults to browser.
304+ ENVIRONMENT_UNSPECIFIED = 0 ;
305+
306+ // Operates in a web browser.
307+ ENVIRONMENT_BROWSER = 1 ;
308+ }
309+
310+ // Required. The environment being operated.
311+ Environment environment = 3 [(google.api.field_behavior ) = REQUIRED ];
312+
313+ // Optional. By default, predefined functions are included in the final
314+ // model call. Some of them can be explicitly excluded from being
315+ // automatically included. This can serve two purposes:
316+ // 1. Using a more restricted / different action space.
317+ // 2. Improving the definitions / instructions of predefined functions.
318+ repeated string excluded_predefined_functions = 5
319+ [(google.api.field_behavior ) = OPTIONAL ];
320+ }
321+
256322 // Optional. A list of `FunctionDeclarations` available to the model that can
257323 // be used for function calling.
258324 //
@@ -280,6 +346,11 @@ message Tool {
280346 // Tool to support Google Search in Model. Powered by Google.
281347 GoogleSearch google_search = 4 [(google.api.field_behavior ) = OPTIONAL ];
282348
349+ // Optional. Tool to support the model interacting directly with the computer.
350+ // If enabled, it automatically populates computer-use specific Function
351+ // Declarations.
352+ ComputerUse computer_use = 6 [(google.api.field_behavior ) = OPTIONAL ];
353+
283354 // Optional. Tool to support URL context retrieval.
284355 UrlContext url_context = 8 [(google.api.field_behavior ) = OPTIONAL ];
285356}
@@ -352,6 +423,9 @@ message FunctionCallingConfig {
352423 // Model decides to predict either a function call
353424 // or a natural language response, but will validate function calls with
354425 // constrained decoding.
426+ // If "allowed_function_names" are set, the predicted function call will be
427+ // limited to any one of "allowed_function_names", else the predicted
428+ // function call will be any one of the provided "function_declarations".
355429 VALIDATED = 4 ;
356430 }
357431
@@ -362,9 +436,9 @@ message FunctionCallingConfig {
362436 // Optional. A set of function names that, when provided, limits the functions
363437 // the model will call.
364438 //
365- // This should only be set when the Mode is ANY. Function names
366- // should match [FunctionDeclaration.name]. With mode set to ANY , model will
367- // predict a function call from the set of function names provided .
439+ // This should only be set when the Mode is ANY or VALIDATED . Function names
440+ // should match [FunctionDeclaration.name]. When set, model will
441+ // predict a function call from only allowed function names.
368442 repeated string allowed_function_names = 2
369443 [(google.api.field_behavior ) = OPTIONAL ];
370444}
@@ -392,8 +466,8 @@ message FunctionDeclaration {
392466 }
393467
394468 // Required. The name of the function.
395- // Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum
396- // length of 63 .
469+ // Must be a-z, A-Z, 0-9, or contain underscores, colons, dots, and dashes,
470+ // with a maximum length of 64 .
397471 string name = 1 [(google.api.field_behavior ) = REQUIRED ];
398472
399473 // Required. A brief description of the function.
@@ -453,7 +527,7 @@ message FunctionCall {
453527
454528 // Required. The name of the function to call.
455529 // Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum
456- // length of 63 .
530+ // length of 64 .
457531 string name = 1 [(google.api.field_behavior ) = REQUIRED ];
458532
459533 // Optional. The function parameters and values in JSON object format.
@@ -491,12 +565,21 @@ message FunctionResponse {
491565
492566 // Required. The name of the function to call.
493567 // Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum
494- // length of 63 .
568+ // length of 64 .
495569 string name = 1 [(google.api.field_behavior ) = REQUIRED ];
496570
497571 // Required. The function response in JSON object format.
572+ // Callers can use any keys of their choice that fit the function's syntax
573+ // to return the function output, e.g. "output", "result", etc.
574+ // In particular, if the function call failed to execute, the response can
575+ // have an "error" key to return error details to the model.
498576 google.protobuf.Struct response = 2 [(google.api.field_behavior ) = REQUIRED ];
499577
578+ // Optional. Ordered `Parts` that constitute a function response. Parts may
579+ // have different IANA MIME types.
580+ repeated FunctionResponsePart parts = 8
581+ [(google.api.field_behavior ) = OPTIONAL ];
582+
500583 // Optional. Signals that function call continues, and more responses will be
501584 // returned, turning the function call into a generator.
502585 // Is only applicable to NON_BLOCKING function calls, is ignored otherwise.
@@ -521,11 +604,8 @@ message Schema {
521604 // Required. Data type.
522605 Type type = 1 [(google.api.field_behavior ) = REQUIRED ];
523606
524- // Optional. The format of the data. This is used only for primitive
525- // datatypes. Supported formats:
526- // for NUMBER type: float, double
527- // for INTEGER type: int32, int64
528- // for STRING type: enum, date-time
607+ // Optional. The format of the data. Any value is allowed, but most do not
608+ // trigger any special functionality.
529609 string format = 2 [(google.api.field_behavior ) = OPTIONAL ];
530610
531611 // Optional. The title of the schema.
0 commit comments