@google/genai 2.9.0-rc.0 → 2.10.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.
@@ -322,9 +322,14 @@ declare interface AudioChunk {
322
322
 
323
323
  /** The audio transcription configuration in Setup. */
324
324
  declare interface AudioTranscriptionConfig {
325
- /** The language codes of the audio. BCP-47 language code. If not set, the transcription will be in the language detected by the model. If set, the server will use the language code specified in the model config as a hint for the language of the audio
326
- */
325
+ /** Deprecated: use LanguageAuto or LanguageHints instead. */
327
326
  languageCodes?: string[];
327
+ /** The model will detect the language automatically. Do not use together with LanguageHints. */
328
+ languageAuto?: LanguageAuto;
329
+ /** Specifies one or more languages in the audio. Do not use together with LanguageAuto. */
330
+ languageHints?: LanguageHints;
331
+ /** A list of phrases used for speech adaptation, which biases the ASR model to improve recognition of these specific terms. */
332
+ adaptationPhrases?: string[];
328
333
  }
329
334
 
330
335
  /**
@@ -549,7 +554,7 @@ declare interface BatchJob {
549
554
  outputInfo?: BatchJobOutputInfo;
550
555
  }
551
556
 
552
- /** Config for `des` parameter. */
557
+ /** Config for `dest` parameter. */
553
558
  declare interface BatchJobDestination {
554
559
  /** Storage format of the output files. Must be one of:
555
560
  'jsonl', 'bigquery', 'vertex-dataset'.
@@ -928,15 +933,12 @@ declare interface CompositeReinforcementTuningRewardConfigWeightedRewardConfig {
928
933
  declare interface ComputerUse {
929
934
  /** Required. The environment being operated. */
930
935
  environment?: Environment;
931
- /** By default, predefined functions are included in the final model call.
932
- Some of them can be explicitly excluded from being automatically included.
933
- This can serve two purposes:
934
- 1. Using a more restricted / different action space.
935
- 2. Improving the definitions / instructions of predefined functions. */
936
+ /** Optional. By default, [predefined functions](https://cloud.google.com/vertex-ai/generative-ai/docs/computer-use#supported-actions) are included in the final model call. Some of them can be explicitly excluded from being automatically included. This can serve two purposes: 1. Using a more restricted / different action space. 2. Improving the definitions / instructions of predefined functions. */
936
937
  excludedPredefinedFunctions?: string[];
937
- /** Optional. Whether enable the prompt injection detection check on computer-use request.
938
- */
938
+ /** Optional. Enables the prompt injection detection check on computer-use request. */
939
939
  enablePromptInjectionDetection?: boolean;
940
+ /** Optional. Disabled safety policies for computer use. This field is not supported in Vertex AI. */
941
+ disabledSafetyPolicies?: SafetyPolicy[];
940
942
  }
941
943
 
942
944
  /** Optional parameters for computing tokens. */
@@ -4335,6 +4337,16 @@ declare enum Language {
4335
4337
  PYTHON = "PYTHON"
4336
4338
  }
4337
4339
 
4340
+ /** Indicates the language of the audio should be automatically detected. */
4341
+ declare interface LanguageAuto {
4342
+ }
4343
+
4344
+ /** Provides hints to the model about possible languages present in the audio. */
4345
+ declare interface LanguageHints {
4346
+ /** BCP-47 language codes. At least one must be specified. */
4347
+ languageCodes?: string[];
4348
+ }
4349
+
4338
4350
  /** An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. */
4339
4351
  declare interface LatLng {
4340
4352
  /** The latitude in degrees. It must be in the range [-90.0, +90.0]. */
@@ -5084,6 +5096,8 @@ declare interface LiveServerContent {
5084
5096
  it is waiting for more input from the user, e.g. because it expects the
5085
5097
  user to continue talking. */
5086
5098
  waitingForInput?: boolean;
5099
+ /** Low latency transcription updated while the user is speaking. */
5100
+ interimInputTranscription?: Transcription;
5087
5101
  }
5088
5102
 
5089
5103
  /** Server will not be able to service client soon. */
@@ -5141,9 +5155,9 @@ declare interface LiveServerSessionResumptionUpdate {
5141
5155
  resumable?: boolean;
5142
5156
  /** Index of last message sent by client that is included in state represented by this SessionResumptionToken. Only sent when `SessionResumptionConfig.transparent` is set.
5143
5157
 
5144
- Presence of this index allows users to transparently reconnect and avoid issue of losing some part of realtime audio input/video. If client wishes to temporarily disconnect (for example as result of receiving GoAway) they can do it without losing state by buffering messages sent since last `SessionResmumptionTokenUpdate`. This field will enable them to limit buffering (avoid keeping all requests in RAM).
5158
+ Presence of this index allows users to transparently reconnect and avoid issue of losing some part of realtime audio input/video. If client wishes to temporarily disconnect (for example as result of receiving GoAway) they can do it without losing state by buffering messages sent since last `SessionResumptionTokenUpdate`. This field will enable them to limit buffering (avoid keeping all requests in RAM).
5145
5159
 
5146
- Note: This should not be used for when resuming a session at some time later -- in those cases partial audio and video frames arelikely not needed. */
5160
+ Note: This should not be used for when resuming a session at some time later -- in those cases partial audio and video frames are likely not needed. */
5147
5161
  lastConsumedClientMessageIndex?: string;
5148
5162
  }
5149
5163
 
@@ -6384,6 +6398,42 @@ declare enum SafetyFilterLevel {
6384
6398
  BLOCK_NONE = "BLOCK_NONE"
6385
6399
  }
6386
6400
 
6401
+ /** SafetyPolicy */
6402
+ declare enum SafetyPolicy {
6403
+ /**
6404
+ * Unspecified safety policy.
6405
+ */
6406
+ SAFETY_POLICY_UNSPECIFIED = "SAFETY_POLICY_UNSPECIFIED",
6407
+ /**
6408
+ * Safety policy for financial transactions.
6409
+ */
6410
+ FINANCIAL_TRANSACTIONS = "FINANCIAL_TRANSACTIONS",
6411
+ /**
6412
+ * Safety policy for sensitive data modification.
6413
+ */
6414
+ SENSITIVE_DATA_MODIFICATION = "SENSITIVE_DATA_MODIFICATION",
6415
+ /**
6416
+ * Safety policy for communication tools (e.g. Gmail, Chat, Meet).
6417
+ */
6418
+ COMMUNICATION_TOOL = "COMMUNICATION_TOOL",
6419
+ /**
6420
+ * Safety policy for account creation.
6421
+ */
6422
+ ACCOUNT_CREATION = "ACCOUNT_CREATION",
6423
+ /**
6424
+ * Safety policy for data modification.
6425
+ */
6426
+ DATA_MODIFICATION = "DATA_MODIFICATION",
6427
+ /**
6428
+ * Safety policy for user consent management.
6429
+ */
6430
+ USER_CONSENT_MANAGEMENT = "USER_CONSENT_MANAGEMENT",
6431
+ /**
6432
+ * Safety policy for legal terms and agreements.
6433
+ */
6434
+ LEGAL_TERMS_AND_AGREEMENTS = "LEGAL_TERMS_AND_AGREEMENTS"
6435
+ }
6436
+
6387
6437
  /** A safety rating for a piece of content. The safety rating contains the harm category and the harm probability level. */
6388
6438
  declare interface SafetyRating {
6389
6439
  /** Output only. Indicates whether the content was blocked because of this rating. */
@@ -7009,9 +7059,7 @@ declare interface TokensInfo {
7009
7059
  declare interface Tool {
7010
7060
  /** Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation. This field is not supported in Gemini API. */
7011
7061
  retrieval?: Retrieval;
7012
- /** Optional. Tool to support the model interacting directly with the
7013
- computer. If enabled, it automatically populates computer-use specific
7014
- Function Declarations. */
7062
+ /** Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations. */
7015
7063
  computerUse?: ComputerUse;
7016
7064
  /** Optional. FileSearch tool type. Tool to retrieve knowledge from Semantic Retrieval corpora. This field is not supported in Vertex AI. */
7017
7065
  fileSearch?: FileSearch;
@@ -7144,7 +7192,7 @@ declare enum TrafficType {
7144
7192
  PROVISIONED_THROUGHPUT = "PROVISIONED_THROUGHPUT"
7145
7193
  }
7146
7194
 
7147
- /** Audio transcription in Server Conent. */
7195
+ /** Audio transcription in Server Content. */
7148
7196
  declare interface Transcription {
7149
7197
  /** Optional. Transcription text. */
7150
7198
  text?: string;
@@ -7625,10 +7673,11 @@ declare namespace types {
7625
7673
  Language,
7626
7674
  FunctionResponseScheduling,
7627
7675
  Type,
7628
- Environment,
7629
7676
  AuthType,
7630
7677
  HttpElementLocation,
7631
7678
  ApiSpec,
7679
+ Environment,
7680
+ SafetyPolicy,
7632
7681
  PhishBlockThreshold,
7633
7682
  Behavior,
7634
7683
  DynamicRetrievalConfigMode,
@@ -7712,7 +7761,6 @@ declare namespace types {
7712
7761
  HttpOptions,
7713
7762
  Schema,
7714
7763
  ModelSelectionConfig,
7715
- ComputerUse,
7716
7764
  ApiKeyConfig,
7717
7765
  AuthConfigGoogleServiceAccountConfig,
7718
7766
  AuthConfigHttpBasicAuthConfig,
@@ -7736,6 +7784,7 @@ declare namespace types {
7736
7784
  RagRetrievalConfig,
7737
7785
  VertexRagStore,
7738
7786
  Retrieval,
7787
+ ComputerUse,
7739
7788
  FileSearch,
7740
7789
  WebSearch,
7741
7790
  ImageSearch,
@@ -8081,6 +8130,8 @@ declare namespace types {
8081
8130
  SessionResumptionConfig,
8082
8131
  SlidingWindow,
8083
8132
  ContextWindowCompressionConfig,
8133
+ LanguageAuto,
8134
+ LanguageHints,
8084
8135
  AudioTranscriptionConfig,
8085
8136
  ProactivityConfig,
8086
8137
  CustomizedAvatar,
@@ -8734,6 +8785,8 @@ declare enum VideoOrientation {
8734
8785
  declare interface VoiceActivity {
8735
8786
  /** The type of the voice activity signal. */
8736
8787
  voiceActivityType?: VoiceActivityType;
8788
+ /** The time voice activity detected in audio time, relative to the start of the audio stream. */
8789
+ audioOffset?: string;
8737
8790
  }
8738
8791
 
8739
8792
  declare interface VoiceActivityDetectionSignal {
@@ -416,26 +416,6 @@ var Type;
416
416
  */
417
417
  Type["NULL"] = "NULL";
418
418
  })(Type || (Type = {}));
419
- /** The environment being operated. */
420
- var Environment;
421
- (function (Environment) {
422
- /**
423
- * Defaults to browser.
424
- */
425
- Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
426
- /**
427
- * Operates in a web browser.
428
- */
429
- Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
430
- /**
431
- * Operates in a mobile environment.
432
- */
433
- Environment["ENVIRONMENT_MOBILE"] = "ENVIRONMENT_MOBILE";
434
- /**
435
- * Operates in a desktop environment.
436
- */
437
- Environment["ENVIRONMENT_DESKTOP"] = "ENVIRONMENT_DESKTOP";
438
- })(Environment || (Environment = {}));
439
419
  /** Type of auth scheme. This enum is not supported in Gemini API. */
440
420
  var AuthType;
441
421
  (function (AuthType) {
@@ -506,6 +486,62 @@ var ApiSpec;
506
486
  */
507
487
  ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
508
488
  })(ApiSpec || (ApiSpec = {}));
489
+ /** The environment being operated. */
490
+ var Environment;
491
+ (function (Environment) {
492
+ /**
493
+ * Defaults to browser.
494
+ */
495
+ Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
496
+ /**
497
+ * Operates in a web browser.
498
+ */
499
+ Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
500
+ /**
501
+ * Operates in a mobile environment.
502
+ */
503
+ Environment["ENVIRONMENT_MOBILE"] = "ENVIRONMENT_MOBILE";
504
+ /**
505
+ * Operates in a desktop environment.
506
+ */
507
+ Environment["ENVIRONMENT_DESKTOP"] = "ENVIRONMENT_DESKTOP";
508
+ })(Environment || (Environment = {}));
509
+ /** SafetyPolicy */
510
+ var SafetyPolicy;
511
+ (function (SafetyPolicy) {
512
+ /**
513
+ * Unspecified safety policy.
514
+ */
515
+ SafetyPolicy["SAFETY_POLICY_UNSPECIFIED"] = "SAFETY_POLICY_UNSPECIFIED";
516
+ /**
517
+ * Safety policy for financial transactions.
518
+ */
519
+ SafetyPolicy["FINANCIAL_TRANSACTIONS"] = "FINANCIAL_TRANSACTIONS";
520
+ /**
521
+ * Safety policy for sensitive data modification.
522
+ */
523
+ SafetyPolicy["SENSITIVE_DATA_MODIFICATION"] = "SENSITIVE_DATA_MODIFICATION";
524
+ /**
525
+ * Safety policy for communication tools (e.g. Gmail, Chat, Meet).
526
+ */
527
+ SafetyPolicy["COMMUNICATION_TOOL"] = "COMMUNICATION_TOOL";
528
+ /**
529
+ * Safety policy for account creation.
530
+ */
531
+ SafetyPolicy["ACCOUNT_CREATION"] = "ACCOUNT_CREATION";
532
+ /**
533
+ * Safety policy for data modification.
534
+ */
535
+ SafetyPolicy["DATA_MODIFICATION"] = "DATA_MODIFICATION";
536
+ /**
537
+ * Safety policy for user consent management.
538
+ */
539
+ SafetyPolicy["USER_CONSENT_MANAGEMENT"] = "USER_CONSENT_MANAGEMENT";
540
+ /**
541
+ * Safety policy for legal terms and agreements.
542
+ */
543
+ SafetyPolicy["LEGAL_TERMS_AND_AGREEMENTS"] = "LEGAL_TERMS_AND_AGREEMENTS";
544
+ })(SafetyPolicy || (SafetyPolicy = {}));
509
545
  /** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
510
546
  var PhishBlockThreshold;
511
547
  (function (PhishBlockThreshold) {
@@ -2146,7 +2182,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
2146
2182
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
2147
2183
  const USER_AGENT_HEADER = 'User-Agent';
2148
2184
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
2149
- const SDK_VERSION = '2.9.0-rc.0'; // x-release-please-version
2185
+ const SDK_VERSION = '2.10.0'; // x-release-please-version
2150
2186
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
2151
2187
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
2152
2188
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';