@google/genai 2.5.0 → 2.7.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.
@@ -349,18 +349,6 @@ function uploadToFileSearchStoreResponseFromMldev(fromObject) {
349
349
  * Copyright 2025 Google LLC
350
350
  * SPDX-License-Identifier: Apache-2.0
351
351
  */
352
- /** Programming language of the `code`. */
353
- var Language;
354
- (function (Language) {
355
- /**
356
- * Unspecified language. This value should not be used.
357
- */
358
- Language["LANGUAGE_UNSPECIFIED"] = "LANGUAGE_UNSPECIFIED";
359
- /**
360
- * Python >= 3.10, with numpy and simpy available.
361
- */
362
- Language["PYTHON"] = "PYTHON";
363
- })(Language || (Language = {}));
364
352
  /** Outcome of the code execution. */
365
353
  var Outcome;
366
354
  (function (Outcome) {
@@ -369,18 +357,30 @@ var Outcome;
369
357
  */
370
358
  Outcome["OUTCOME_UNSPECIFIED"] = "OUTCOME_UNSPECIFIED";
371
359
  /**
372
- * Code execution completed successfully.
360
+ * Code execution completed successfully. `output` contains the stdout, if any.
373
361
  */
374
362
  Outcome["OUTCOME_OK"] = "OUTCOME_OK";
375
363
  /**
376
- * Code execution finished but with a failure. `stderr` should contain the reason.
364
+ * Code execution failed. `output` contains the stderr and stdout, if any.
377
365
  */
378
366
  Outcome["OUTCOME_FAILED"] = "OUTCOME_FAILED";
379
367
  /**
380
- * Code execution ran for too long, and was cancelled. There may or may not be a partial output present.
368
+ * Code execution ran for too long, and was cancelled. There may or may not be a partial `output` present.
381
369
  */
382
370
  Outcome["OUTCOME_DEADLINE_EXCEEDED"] = "OUTCOME_DEADLINE_EXCEEDED";
383
371
  })(Outcome || (Outcome = {}));
372
+ /** Programming language of the `code`. */
373
+ var Language;
374
+ (function (Language) {
375
+ /**
376
+ * Unspecified language. This value should not be used.
377
+ */
378
+ Language["LANGUAGE_UNSPECIFIED"] = "LANGUAGE_UNSPECIFIED";
379
+ /**
380
+ * Python >= 3.10, with numpy and simpy available.
381
+ */
382
+ Language["PYTHON"] = "PYTHON";
383
+ })(Language || (Language = {}));
384
384
  /** Specifies how the response should be scheduled in the conversation. */
385
385
  var FunctionResponseScheduling;
386
386
  (function (FunctionResponseScheduling) {
@@ -448,6 +448,14 @@ var Environment;
448
448
  * Operates in a web browser.
449
449
  */
450
450
  Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
451
+ /**
452
+ * Operates in a mobile environment.
453
+ */
454
+ Environment["ENVIRONMENT_MOBILE"] = "ENVIRONMENT_MOBILE";
455
+ /**
456
+ * Operates in a desktop environment.
457
+ */
458
+ Environment["ENVIRONMENT_DESKTOP"] = "ENVIRONMENT_DESKTOP";
451
459
  })(Environment || (Environment = {}));
452
460
  /** Type of auth scheme. This enum is not supported in Gemini API. */
453
461
  var AuthType;
@@ -579,30 +587,6 @@ var DynamicRetrievalConfigMode;
579
587
  */
580
588
  DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
581
589
  })(DynamicRetrievalConfigMode || (DynamicRetrievalConfigMode = {}));
582
- /** Function calling mode. */
583
- var FunctionCallingConfigMode;
584
- (function (FunctionCallingConfigMode) {
585
- /**
586
- * Unspecified function calling mode. This value should not be used.
587
- */
588
- FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
589
- /**
590
- * Default model behavior, model decides to predict either function calls or natural language response.
591
- */
592
- FunctionCallingConfigMode["AUTO"] = "AUTO";
593
- /**
594
- * 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".
595
- */
596
- FunctionCallingConfigMode["ANY"] = "ANY";
597
- /**
598
- * Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
599
- */
600
- FunctionCallingConfigMode["NONE"] = "NONE";
601
- /**
602
- * 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".
603
- */
604
- FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
605
- })(FunctionCallingConfigMode || (FunctionCallingConfigMode = {}));
606
590
  /** The number of thoughts tokens that the model should generate. */
607
591
  var ThinkingLevel;
608
592
  (function (ThinkingLevel) {
@@ -751,6 +735,30 @@ var HarmBlockThreshold;
751
735
  */
752
736
  HarmBlockThreshold["OFF"] = "OFF";
753
737
  })(HarmBlockThreshold || (HarmBlockThreshold = {}));
738
+ /** Function calling mode. */
739
+ var FunctionCallingConfigMode;
740
+ (function (FunctionCallingConfigMode) {
741
+ /**
742
+ * Unspecified function calling mode. This value should not be used.
743
+ */
744
+ FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
745
+ /**
746
+ * Default model behavior, model decides to predict either function calls or natural language response.
747
+ */
748
+ FunctionCallingConfigMode["AUTO"] = "AUTO";
749
+ /**
750
+ * 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".
751
+ */
752
+ FunctionCallingConfigMode["ANY"] = "ANY";
753
+ /**
754
+ * Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
755
+ */
756
+ FunctionCallingConfigMode["NONE"] = "NONE";
757
+ /**
758
+ * 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".
759
+ */
760
+ FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
761
+ })(FunctionCallingConfigMode || (FunctionCallingConfigMode = {}));
754
762
  /** Output only. The reason why the model stopped generating tokens.
755
763
 
756
764
  If empty, the model has not stopped generating the tokens. */
@@ -1233,7 +1241,23 @@ var PairwiseChoice;
1233
1241
  */
1234
1242
  PairwiseChoice["TIE"] = "TIE";
1235
1243
  })(PairwiseChoice || (PairwiseChoice = {}));
1236
- /** The tuning task. Either I2V or T2V. This enum is not supported in Gemini API. */
1244
+ /** The speed of the tuning job. Only supported for Veo 3.0 models. This enum is not supported in Gemini API. */
1245
+ var TuningSpeed;
1246
+ (function (TuningSpeed) {
1247
+ /**
1248
+ * The default / unset value. For Veo 3.0 models, this defaults to FAST.
1249
+ */
1250
+ TuningSpeed["TUNING_SPEED_UNSPECIFIED"] = "TUNING_SPEED_UNSPECIFIED";
1251
+ /**
1252
+ * Regular tuning speed.
1253
+ */
1254
+ TuningSpeed["REGULAR"] = "REGULAR";
1255
+ /**
1256
+ * Fast tuning speed.
1257
+ */
1258
+ TuningSpeed["FAST"] = "FAST";
1259
+ })(TuningSpeed || (TuningSpeed = {}));
1260
+ /** The tuning task for Veo. This enum is not supported in Gemini API. */
1237
1261
  var TuningTask;
1238
1262
  (function (TuningTask) {
1239
1263
  /**
@@ -1253,6 +1277,22 @@ var TuningTask;
1253
1277
  */
1254
1278
  TuningTask["TUNING_TASK_R2V"] = "TUNING_TASK_R2V";
1255
1279
  })(TuningTask || (TuningTask = {}));
1280
+ /** The orientation of the video. Defaults to LANDSCAPE. This enum is not supported in Gemini API. */
1281
+ var VideoOrientation;
1282
+ (function (VideoOrientation) {
1283
+ /**
1284
+ * Unspecified video orientation. Defaults to landscape.
1285
+ */
1286
+ VideoOrientation["VIDEO_ORIENTATION_UNSPECIFIED"] = "VIDEO_ORIENTATION_UNSPECIFIED";
1287
+ /**
1288
+ * Landscape orientation (e.g. 16:9, 1280x720).
1289
+ */
1290
+ VideoOrientation["LANDSCAPE"] = "LANDSCAPE";
1291
+ /**
1292
+ * Portrait orientation (e.g. 9:16, 720x1280).
1293
+ */
1294
+ VideoOrientation["PORTRAIT"] = "PORTRAIT";
1295
+ })(VideoOrientation || (VideoOrientation = {}));
1256
1296
  /** Output only. Current state of the `Document`. This enum is not supported in Vertex AI. */
1257
1297
  var DocumentState;
1258
1298
  (function (DocumentState) {
@@ -1552,6 +1592,10 @@ var TuningMethod;
1552
1592
  * Distillation tuning.
1553
1593
  */
1554
1594
  TuningMethod["DISTILLATION"] = "DISTILLATION";
1595
+ /**
1596
+ * Reinforcement tuning.
1597
+ */
1598
+ TuningMethod["REINFORCEMENT_TUNING"] = "REINFORCEMENT_TUNING";
1555
1599
  })(TuningMethod || (TuningMethod = {}));
1556
1600
  /** State for the lifecycle of a File. */
1557
1601
  var FileState;
@@ -2071,7 +2115,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
2071
2115
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
2072
2116
  const USER_AGENT_HEADER = 'User-Agent';
2073
2117
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
2074
- const SDK_VERSION = '2.5.0'; // x-release-please-version
2118
+ const SDK_VERSION = '2.7.0'; // x-release-please-version
2075
2119
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
2076
2120
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
2077
2121
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';