Skip to content

Commit 130b113

Browse files
Google APIscopybara-github
authored andcommitted
feat: Add GoogleSearch tool type
feat: Add return type `Schema response` to function declarations feat: Add id to FunctionCall and FunctionResponse feat: Add civic_integrity toggle to generation_config feat: Add response_modalities to generation_config feat: Add voice_config to generation_config docs: Update safety filter list to include civic_integrity feat: Add image_safety block_reason + finish_reason PiperOrigin-RevId: 713080033
1 parent 23553a9 commit 130b113

4 files changed

Lines changed: 90 additions & 3 deletions

File tree

google/ai/generativelanguage/v1beta/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ load(
370370

371371
csharp_proto_library(
372372
name = "generativelanguage_csharp_proto",
373+
extra_opts = [],
373374
deps = [":generativelanguage_proto"],
374375
)
375376

google/ai/generativelanguage/v1beta/content.proto

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ message CodeExecutionResult {
188188
// external systems to perform an action, or set of actions, outside of
189189
// knowledge and scope of the model.
190190
message Tool {
191+
// GoogleSearch tool type.
192+
// Tool to support Google Search in Model. Powered by Google.
193+
message GoogleSearch {}
194+
191195
// Optional. A list of `FunctionDeclarations` available to the model that can
192196
// be used for function calling.
193197
//
@@ -210,6 +214,10 @@ message Tool {
210214

211215
// Optional. Enables the model to execute code as part of generation.
212216
CodeExecution code_execution = 3 [(google.api.field_behavior) = OPTIONAL];
217+
218+
// Optional. GoogleSearch tool type.
219+
// Tool to support Google Search in Model. Powered by Google.
220+
GoogleSearch google_search = 4 [(google.api.field_behavior) = OPTIONAL];
213221
}
214222

215223
// Tool to retrieve public web data for grounding, powered by Google.
@@ -308,12 +316,21 @@ message FunctionDeclaration {
308316
// names are case sensitive. Schema Value: the Schema defining the type used
309317
// for the parameter.
310318
optional Schema parameters = 3 [(google.api.field_behavior) = OPTIONAL];
319+
320+
// Optional. Describes the output from this function in JSON Schema format.
321+
// Reflects the Open API 3.03 Response Object. The Schema defines the type
322+
// used for the response value of the function.
323+
optional Schema response = 4 [(google.api.field_behavior) = OPTIONAL];
311324
}
312325

313326
// A predicted `FunctionCall` returned from the model that contains
314327
// a string representing the `FunctionDeclaration.name` with the
315328
// arguments and their values.
316329
message FunctionCall {
330+
// Optional. The unique id of the function call. If populated, the client to
331+
// execute the `function_call` and return the response with the matching `id`.
332+
string id = 3 [(google.api.field_behavior) = OPTIONAL];
333+
317334
// Required. The name of the function to call.
318335
// Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum
319336
// length of 63.
@@ -330,6 +347,10 @@ message FunctionCall {
330347
// the model. This should contain the result of a`FunctionCall` made
331348
// based on model prediction.
332349
message FunctionResponse {
350+
// Optional. The id of the function call this response is for. Populated by
351+
// the client to match the corresponding function call `id`.
352+
string id = 3 [(google.api.field_behavior) = OPTIONAL];
353+
333354
// Required. The name of the function to call.
334355
// Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum
335356
// length of 63.

google/ai/generativelanguage/v1beta/file.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ option java_outer_classname = "FileProto";
2828
option java_package = "com.google.ai.generativelanguage.v1beta";
2929

3030
// A file uploaded to the API.
31+
// Next ID: 15
3132
message File {
3233
option (google.api.resource) = {
3334
type: "generativelanguage.googleapis.com/File"

google/ai/generativelanguage/v1beta/generative_service.proto

Lines changed: 67 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ enum TaskType {
148148
message GenerateContentRequest {
149149
// Required. The name of the `Model` to use for generating the completion.
150150
//
151-
// Format: `name=models/{model}`.
151+
// Format: `models/{model}`.
152152
string model = 1 [
153153
(google.api.field_behavior) = REQUIRED,
154154
(google.api.resource_reference) = {
@@ -200,8 +200,8 @@ message GenerateContentRequest {
200200
// `SafetyCategory` provided in the list, the API will use the default safety
201201
// setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH,
202202
// HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT,
203-
// HARM_CATEGORY_HARASSMENT are supported. Refer to the
204-
// [guide](https://ai.google.dev/gemini-api/docs/safety-settings)
203+
// HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported.
204+
// Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings)
205205
// for detailed information on available safety settings. Also refer to the
206206
// [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to
207207
// learn how to incorporate safety considerations in your AI applications.
@@ -223,9 +223,45 @@ message GenerateContentRequest {
223223
];
224224
}
225225

226+
// The configuration for the prebuilt speaker to use.
227+
message PrebuiltVoiceConfig {
228+
// The name of the preset voice to use.
229+
optional string voice_name = 1;
230+
}
231+
232+
// The configuration for the voice to use.
233+
message VoiceConfig {
234+
// The configuration for the speaker to use.
235+
oneof voice_config {
236+
// The configuration for the prebuilt voice to use.
237+
PrebuiltVoiceConfig prebuilt_voice_config = 1;
238+
}
239+
}
240+
241+
// The speech generation config.
242+
message SpeechConfig {
243+
// The configuration for the speaker to use.
244+
VoiceConfig voice_config = 1;
245+
}
246+
226247
// Configuration options for model generation and outputs. Not all parameters
227248
// are configurable for every model.
228249
message GenerationConfig {
250+
// Supported modalities of the response.
251+
enum Modality {
252+
// Default value.
253+
MODALITY_UNSPECIFIED = 0;
254+
255+
// Indicates the model should return text.
256+
TEXT = 1;
257+
258+
// Indicates the model should return images.
259+
IMAGE = 2;
260+
261+
// Indicates the model should return audio.
262+
AUDIO = 3;
263+
}
264+
229265
// Optional. Number of generated responses to return.
230266
//
231267
// Currently, this value can only be set to 1. If unset, this will default
@@ -343,6 +379,27 @@ message GenerationConfig {
343379
// This sets the number of top logprobs to return at each decoding step in the
344380
// [Candidate.logprobs_result][google.ai.generativelanguage.v1beta.Candidate.logprobs_result].
345381
optional int32 logprobs = 18 [(google.api.field_behavior) = OPTIONAL];
382+
383+
// Optional. Enables enhanced civic answers. It may not be available for all
384+
// models.
385+
optional bool enable_enhanced_civic_answers = 19
386+
[(google.api.field_behavior) = OPTIONAL];
387+
388+
// Optional. The requested modalities of the response. Represents the set of
389+
// modalities that the model can return, and should be expected in the
390+
// response. This is an exact match to the modalities of the response.
391+
//
392+
// A model may have multiple combinations of supported modalities. If the
393+
// requested modalities do not match any of the supported combinations, an
394+
// error will be returned.
395+
//
396+
// An empty list is equivalent to requesting only text.
397+
repeated Modality response_modalities = 20
398+
[(google.api.field_behavior) = OPTIONAL];
399+
400+
// Optional. The speech generation config.
401+
optional SpeechConfig speech_config = 21
402+
[(google.api.field_behavior) = OPTIONAL];
346403
}
347404

348405
// Configuration for retrieving grounding content from a `Corpus` or
@@ -401,6 +458,9 @@ message GenerateContentResponse {
401458

402459
// Prompt was blocked due to prohibited content.
403460
PROHIBITED_CONTENT = 4;
461+
462+
// Candidates blocked due to unsafe image generation content.
463+
IMAGE_SAFETY = 5;
404464
}
405465

406466
// Optional. If set, the prompt was blocked and no candidates are returned.
@@ -481,6 +541,10 @@ message Candidate {
481541

482542
// The function call generated by the model is invalid.
483543
MALFORMED_FUNCTION_CALL = 10;
544+
545+
// Token generation stopped because generated images contain safety
546+
// violations.
547+
IMAGE_SAFETY = 11;
484548
}
485549

486550
// Output only. Index of the candidate in the list of response candidates.

0 commit comments

Comments
 (0)