@google/genai 2.6.0 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -65,7 +65,7 @@ var Language;
65
65
  */
66
66
  Language["PYTHON"] = "PYTHON";
67
67
  })(Language || (Language = {}));
68
- /** Specifies how the response should be scheduled in the conversation. */
68
+ /** Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE. */
69
69
  var FunctionResponseScheduling;
70
70
  (function (FunctionResponseScheduling) {
71
71
  /**
@@ -271,30 +271,6 @@ var DynamicRetrievalConfigMode;
271
271
  */
272
272
  DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
273
273
  })(DynamicRetrievalConfigMode || (DynamicRetrievalConfigMode = {}));
274
- /** Function calling mode. */
275
- var FunctionCallingConfigMode;
276
- (function (FunctionCallingConfigMode) {
277
- /**
278
- * Unspecified function calling mode. This value should not be used.
279
- */
280
- FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
281
- /**
282
- * Default model behavior, model decides to predict either function calls or natural language response.
283
- */
284
- FunctionCallingConfigMode["AUTO"] = "AUTO";
285
- /**
286
- * Model is constrained to always predicting function calls only. If "allowed_function_names" are set, the predicted function calls will be limited to any one of "allowed_function_names", else the predicted function calls will be any one of the provided "function_declarations".
287
- */
288
- FunctionCallingConfigMode["ANY"] = "ANY";
289
- /**
290
- * Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
291
- */
292
- FunctionCallingConfigMode["NONE"] = "NONE";
293
- /**
294
- * Model is constrained to predict either function calls or natural language response. If "allowed_function_names" are set, the predicted function calls will be limited to any one of "allowed_function_names", else the predicted function calls will be any one of the provided "function_declarations".
295
- */
296
- FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
297
- })(FunctionCallingConfigMode || (FunctionCallingConfigMode = {}));
298
274
  /** The number of thoughts tokens that the model should generate. */
299
275
  var ThinkingLevel;
300
276
  (function (ThinkingLevel) {
@@ -443,6 +419,30 @@ var HarmBlockThreshold;
443
419
  */
444
420
  HarmBlockThreshold["OFF"] = "OFF";
445
421
  })(HarmBlockThreshold || (HarmBlockThreshold = {}));
422
+ /** Function calling mode. */
423
+ var FunctionCallingConfigMode;
424
+ (function (FunctionCallingConfigMode) {
425
+ /**
426
+ * Unspecified function calling mode. This value should not be used.
427
+ */
428
+ FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
429
+ /**
430
+ * Default model behavior, model decides to predict either function calls or natural language response.
431
+ */
432
+ FunctionCallingConfigMode["AUTO"] = "AUTO";
433
+ /**
434
+ * Model is constrained to always predicting function calls only. If "allowed_function_names" are set, the predicted function calls will be limited to any one of "allowed_function_names", else the predicted function calls will be any one of the provided "function_declarations".
435
+ */
436
+ FunctionCallingConfigMode["ANY"] = "ANY";
437
+ /**
438
+ * Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
439
+ */
440
+ FunctionCallingConfigMode["NONE"] = "NONE";
441
+ /**
442
+ * Model is constrained to predict either function calls or natural language response. If "allowed_function_names" are set, the predicted function calls will be limited to any one of "allowed_function_names", else the predicted function calls will be any one of the provided "function_declarations".
443
+ */
444
+ FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
445
+ })(FunctionCallingConfigMode || (FunctionCallingConfigMode = {}));
446
446
  /** Output only. The reason why the model stopped generating tokens.
447
447
 
448
448
  If empty, the model has not stopped generating the tokens. */
@@ -1261,6 +1261,58 @@ var ImageResizeMode;
1261
1261
  */
1262
1262
  ImageResizeMode["PAD"] = "PAD";
1263
1263
  })(ImageResizeMode || (ImageResizeMode = {}));
1264
+ /** Defines how to parse sample response. */
1265
+ var ResponseParseType;
1266
+ (function (ResponseParseType) {
1267
+ /**
1268
+ * Default value. This value is unused.
1269
+ */
1270
+ ResponseParseType["RESPONSE_PARSE_TYPE_UNSPECIFIED"] = "RESPONSE_PARSE_TYPE_UNSPECIFIED";
1271
+ /**
1272
+ * Use the sample response as is.
1273
+ */
1274
+ ResponseParseType["IDENTITY"] = "IDENTITY";
1275
+ /**
1276
+ * Use regex to extract the important part of sample response.
1277
+ */
1278
+ ResponseParseType["REGEX_EXTRACT"] = "REGEX_EXTRACT";
1279
+ })(ResponseParseType || (ResponseParseType = {}));
1280
+ /** Match operation to use for evaluation. */
1281
+ var MatchOperation;
1282
+ (function (MatchOperation) {
1283
+ /**
1284
+ * Default value. This value is unused.
1285
+ */
1286
+ MatchOperation["MATCH_OPERATION_UNSPECIFIED"] = "MATCH_OPERATION_UNSPECIFIED";
1287
+ /**
1288
+ * Equivalent to GoogleSQL `REGEX_CONTAINS(target, expression)`.
1289
+ */
1290
+ MatchOperation["REGEX_CONTAINS"] = "REGEX_CONTAINS";
1291
+ /**
1292
+ * `expression` is a substring of target.
1293
+ */
1294
+ MatchOperation["PARTIAL_MATCH"] = "PARTIAL_MATCH";
1295
+ /**
1296
+ * `expression` is an exact match of target.
1297
+ */
1298
+ MatchOperation["EXACT_MATCH"] = "EXACT_MATCH";
1299
+ })(MatchOperation || (MatchOperation = {}));
1300
+ /** Represents how much to think for the tuning job. */
1301
+ var ReinforcementTuningThinkingLevel;
1302
+ (function (ReinforcementTuningThinkingLevel) {
1303
+ /**
1304
+ * Unspecified thinking level.
1305
+ */
1306
+ ReinforcementTuningThinkingLevel["REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED"] = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED";
1307
+ /**
1308
+ * Little to no thinking.
1309
+ */
1310
+ ReinforcementTuningThinkingLevel["MINIMAL"] = "MINIMAL";
1311
+ /**
1312
+ * High thinking level.
1313
+ */
1314
+ ReinforcementTuningThinkingLevel["HIGH"] = "HIGH";
1315
+ })(ReinforcementTuningThinkingLevel || (ReinforcementTuningThinkingLevel = {}));
1264
1316
  /** Enum representing the tuning method. */
1265
1317
  var TuningMethod;
1266
1318
  (function (TuningMethod) {
@@ -1276,6 +1328,10 @@ var TuningMethod;
1276
1328
  * Distillation tuning.
1277
1329
  */
1278
1330
  TuningMethod["DISTILLATION"] = "DISTILLATION";
1331
+ /**
1332
+ * Reinforcement tuning.
1333
+ */
1334
+ TuningMethod["REINFORCEMENT_TUNING"] = "REINFORCEMENT_TUNING";
1279
1335
  })(TuningMethod || (TuningMethod = {}));
1280
1336
  /** State for the lifecycle of a File. */
1281
1337
  var FileState;
@@ -332,10 +332,9 @@ declare interface FileSearch {
332
332
  metadataFilter?: string;
333
333
  }
334
334
 
335
- /** A function call. */
335
+ /** A predicted FunctionCall returned from the model that contains a string representing the FunctionDeclaration.name and a structured JSON object containing the parameters and their values. */
336
336
  declare interface FunctionCall {
337
- /** The unique id of the function call. If populated, the client to execute the
338
- `function_call` and return the response with the matching `id`. */
337
+ /** Optional. The unique id of the function call. If populated, the client to execute the `function_call` and return the response with the matching `id`. */
339
338
  id?: string;
340
339
  /** Optional. The function parameters and values in JSON object format. See FunctionDeclaration.parameters for parameter details. */
341
340
  args?: Record<string, unknown>;
@@ -365,14 +364,13 @@ declare interface FunctionDeclaration {
365
364
  behavior?: Behavior;
366
365
  }
367
366
 
368
- /** A function response. */
367
+ /** The result output from a FunctionCall that contains a string representing the FunctionDeclaration.name and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a `FunctionCall` made based on model prediction. */
369
368
  declare class FunctionResponse {
370
- /** Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished. */
369
+ /** Optional. Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished. This may still trigger the model generation. To avoid triggering the generation and finish the function call, additionally set `scheduling` to `SILENT`. This field is not supported in Vertex AI. */
371
370
  willContinue?: boolean;
372
- /** Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE. */
371
+ /** Optional. Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE. */
373
372
  scheduling?: FunctionResponseScheduling;
374
- /** List of parts that constitute a function response. Each part may
375
- have a different IANA MIME type. */
373
+ /** Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types. */
376
374
  parts?: FunctionResponsePart[];
377
375
  /** Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`. */
378
376
  id?: string;
@@ -382,49 +380,36 @@ declare class FunctionResponse {
382
380
  response?: Record<string, unknown>;
383
381
  }
384
382
 
385
- /** Raw media bytes for function response.
386
-
387
- Text should not be sent as raw bytes, use the FunctionResponse.response
388
- field. */
383
+ /** Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field. */
389
384
  declare class FunctionResponseBlob {
390
385
  /** Required. The IANA standard MIME type of the source data. */
391
386
  mimeType?: string;
392
- /** Required. Inline media bytes.
387
+ /** Required. Raw bytes.
393
388
  * @remarks Encoded as base64 string. */
394
389
  data?: string;
395
- /** Optional. Display name of the blob.
396
- Used to provide a label or filename to distinguish blobs. */
390
+ /** Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled. This field is not supported in Gemini API. */
397
391
  displayName?: string;
398
392
  }
399
393
 
400
- /** URI based data for function response. */
394
+ /** URI based data for function response. This data type is not supported in Gemini API. */
401
395
  declare class FunctionResponseFileData {
402
396
  /** Required. URI. */
403
397
  fileUri?: string;
404
398
  /** Required. The IANA standard MIME type of the source data. */
405
399
  mimeType?: string;
406
- /** Optional. Display name of the file.
407
- Used to provide a label or filename to distinguish files. */
400
+ /** Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled. */
408
401
  displayName?: string;
409
402
  }
410
403
 
411
- /** A datatype containing media that is part of a `FunctionResponse` message.
412
-
413
- A `FunctionResponsePart` consists of data which has an associated datatype. A
414
- `FunctionResponsePart` can only contain one of the accepted types in
415
- `FunctionResponsePart.data`.
416
-
417
- A `FunctionResponsePart` must have a fixed IANA MIME type identifying the
418
- type and subtype of the media if the `inline_data` field is filled with raw
419
- bytes. */
404
+ /** A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes. */
420
405
  declare class FunctionResponsePart {
421
- /** Optional. Inline media bytes. */
406
+ /** Inline media bytes. */
422
407
  inlineData?: FunctionResponseBlob;
423
- /** Optional. URI based data. */
408
+ /** URI based data. This field is not supported in Gemini API. */
424
409
  fileData?: FunctionResponseFileData;
425
410
  }
426
411
 
427
- /** Specifies how the response should be scheduled in the conversation. */
412
+ /** Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE. */
428
413
  declare enum FunctionResponseScheduling {
429
414
  /**
430
415
  * This value is unused.
@@ -520,7 +505,7 @@ declare interface GenerationConfigRoutingConfigManualRoutingMode {
520
505
  declare interface GoogleMaps {
521
506
  /** The authentication config to access the API. Only API key is supported. This field is not supported in Gemini API. */
522
507
  authConfig?: AuthConfig;
523
- /** Optional. Whether to return a widget context token in the GroundingMetadata of the response. Developers can use the widget context token to render a Google Maps widget with geospatial context related to the places that the model references in the response. */
508
+ /** Deprecated. The Google Maps contextual widget behavior in Grounding with Google Maps is being deprecated; this field is planned for removal and no longer has any effect once removed. Optional. Whether to return a widget context token in the GroundingMetadata of the response. */
524
509
  enableWidget?: boolean;
525
510
  }
526
511
 
@@ -41,7 +41,7 @@ var Language;
41
41
  */
42
42
  Language["PYTHON"] = "PYTHON";
43
43
  })(Language || (Language = {}));
44
- /** Specifies how the response should be scheduled in the conversation. */
44
+ /** Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE. */
45
45
  var FunctionResponseScheduling;
46
46
  (function (FunctionResponseScheduling) {
47
47
  /**
@@ -247,30 +247,6 @@ var DynamicRetrievalConfigMode;
247
247
  */
248
248
  DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
249
249
  })(DynamicRetrievalConfigMode || (DynamicRetrievalConfigMode = {}));
250
- /** Function calling mode. */
251
- var FunctionCallingConfigMode;
252
- (function (FunctionCallingConfigMode) {
253
- /**
254
- * Unspecified function calling mode. This value should not be used.
255
- */
256
- FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
257
- /**
258
- * Default model behavior, model decides to predict either function calls or natural language response.
259
- */
260
- FunctionCallingConfigMode["AUTO"] = "AUTO";
261
- /**
262
- * Model is constrained to always predicting function calls only. If "allowed_function_names" are set, the predicted function calls will be limited to any one of "allowed_function_names", else the predicted function calls will be any one of the provided "function_declarations".
263
- */
264
- FunctionCallingConfigMode["ANY"] = "ANY";
265
- /**
266
- * Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
267
- */
268
- FunctionCallingConfigMode["NONE"] = "NONE";
269
- /**
270
- * Model is constrained to predict either function calls or natural language response. If "allowed_function_names" are set, the predicted function calls will be limited to any one of "allowed_function_names", else the predicted function calls will be any one of the provided "function_declarations".
271
- */
272
- FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
273
- })(FunctionCallingConfigMode || (FunctionCallingConfigMode = {}));
274
250
  /** The number of thoughts tokens that the model should generate. */
275
251
  var ThinkingLevel;
276
252
  (function (ThinkingLevel) {
@@ -419,6 +395,30 @@ var HarmBlockThreshold;
419
395
  */
420
396
  HarmBlockThreshold["OFF"] = "OFF";
421
397
  })(HarmBlockThreshold || (HarmBlockThreshold = {}));
398
+ /** Function calling mode. */
399
+ var FunctionCallingConfigMode;
400
+ (function (FunctionCallingConfigMode) {
401
+ /**
402
+ * Unspecified function calling mode. This value should not be used.
403
+ */
404
+ FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
405
+ /**
406
+ * Default model behavior, model decides to predict either function calls or natural language response.
407
+ */
408
+ FunctionCallingConfigMode["AUTO"] = "AUTO";
409
+ /**
410
+ * Model is constrained to always predicting function calls only. If "allowed_function_names" are set, the predicted function calls will be limited to any one of "allowed_function_names", else the predicted function calls will be any one of the provided "function_declarations".
411
+ */
412
+ FunctionCallingConfigMode["ANY"] = "ANY";
413
+ /**
414
+ * Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
415
+ */
416
+ FunctionCallingConfigMode["NONE"] = "NONE";
417
+ /**
418
+ * Model is constrained to predict either function calls or natural language response. If "allowed_function_names" are set, the predicted function calls will be limited to any one of "allowed_function_names", else the predicted function calls will be any one of the provided "function_declarations".
419
+ */
420
+ FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
421
+ })(FunctionCallingConfigMode || (FunctionCallingConfigMode = {}));
422
422
  /** Output only. The reason why the model stopped generating tokens.
423
423
 
424
424
  If empty, the model has not stopped generating the tokens. */
@@ -1237,6 +1237,58 @@ var ImageResizeMode;
1237
1237
  */
1238
1238
  ImageResizeMode["PAD"] = "PAD";
1239
1239
  })(ImageResizeMode || (ImageResizeMode = {}));
1240
+ /** Defines how to parse sample response. */
1241
+ var ResponseParseType;
1242
+ (function (ResponseParseType) {
1243
+ /**
1244
+ * Default value. This value is unused.
1245
+ */
1246
+ ResponseParseType["RESPONSE_PARSE_TYPE_UNSPECIFIED"] = "RESPONSE_PARSE_TYPE_UNSPECIFIED";
1247
+ /**
1248
+ * Use the sample response as is.
1249
+ */
1250
+ ResponseParseType["IDENTITY"] = "IDENTITY";
1251
+ /**
1252
+ * Use regex to extract the important part of sample response.
1253
+ */
1254
+ ResponseParseType["REGEX_EXTRACT"] = "REGEX_EXTRACT";
1255
+ })(ResponseParseType || (ResponseParseType = {}));
1256
+ /** Match operation to use for evaluation. */
1257
+ var MatchOperation;
1258
+ (function (MatchOperation) {
1259
+ /**
1260
+ * Default value. This value is unused.
1261
+ */
1262
+ MatchOperation["MATCH_OPERATION_UNSPECIFIED"] = "MATCH_OPERATION_UNSPECIFIED";
1263
+ /**
1264
+ * Equivalent to GoogleSQL `REGEX_CONTAINS(target, expression)`.
1265
+ */
1266
+ MatchOperation["REGEX_CONTAINS"] = "REGEX_CONTAINS";
1267
+ /**
1268
+ * `expression` is a substring of target.
1269
+ */
1270
+ MatchOperation["PARTIAL_MATCH"] = "PARTIAL_MATCH";
1271
+ /**
1272
+ * `expression` is an exact match of target.
1273
+ */
1274
+ MatchOperation["EXACT_MATCH"] = "EXACT_MATCH";
1275
+ })(MatchOperation || (MatchOperation = {}));
1276
+ /** Represents how much to think for the tuning job. */
1277
+ var ReinforcementTuningThinkingLevel;
1278
+ (function (ReinforcementTuningThinkingLevel) {
1279
+ /**
1280
+ * Unspecified thinking level.
1281
+ */
1282
+ ReinforcementTuningThinkingLevel["REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED"] = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED";
1283
+ /**
1284
+ * Little to no thinking.
1285
+ */
1286
+ ReinforcementTuningThinkingLevel["MINIMAL"] = "MINIMAL";
1287
+ /**
1288
+ * High thinking level.
1289
+ */
1290
+ ReinforcementTuningThinkingLevel["HIGH"] = "HIGH";
1291
+ })(ReinforcementTuningThinkingLevel || (ReinforcementTuningThinkingLevel = {}));
1240
1292
  /** Enum representing the tuning method. */
1241
1293
  var TuningMethod;
1242
1294
  (function (TuningMethod) {
@@ -1252,6 +1304,10 @@ var TuningMethod;
1252
1304
  * Distillation tuning.
1253
1305
  */
1254
1306
  TuningMethod["DISTILLATION"] = "DISTILLATION";
1307
+ /**
1308
+ * Reinforcement tuning.
1309
+ */
1310
+ TuningMethod["REINFORCEMENT_TUNING"] = "REINFORCEMENT_TUNING";
1255
1311
  })(TuningMethod || (TuningMethod = {}));
1256
1312
  /** State for the lifecycle of a File. */
1257
1313
  var FileState;