@google/genai 2.6.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.
package/dist/web/web.d.ts CHANGED
@@ -875,6 +875,32 @@ export declare interface AutomaticFunctionCallingConfig {
875
875
  ignoreCallHistory?: boolean;
876
876
  }
877
877
 
878
+ /** Autorater config used for evaluation. */
879
+ export declare interface AutoraterConfig {
880
+ /** Number of samples for each instance in the dataset.
881
+ If not specified, the default is 4. Minimum value is 1, maximum value
882
+ is 32. */
883
+ samplingCount?: number;
884
+ /** Optional. Default is true. Whether to flip the candidate and baseline
885
+ responses. This is only applicable to the pairwise metric. If enabled, also
886
+ provide PairwiseMetricSpec.candidate_response_field_name and
887
+ PairwiseMetricSpec.baseline_response_field_name. When rendering
888
+ PairwiseMetricSpec.metric_prompt_template, the candidate and baseline
889
+ fields will be flipped for half of the samples to reduce bias. */
890
+ flipEnabled?: boolean;
891
+ /** The fully qualified name of the publisher model or tuned autorater
892
+ endpoint to use.
893
+
894
+ Publisher model format:
895
+ `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}`
896
+
897
+ Tuned model endpoint format:
898
+ `projects/{project}/locations/{location}/endpoints/{endpoint}` */
899
+ autoraterModel?: string;
900
+ /** Configuration options for model generation and outputs. */
901
+ generationConfig?: GenerationConfig;
902
+ }
903
+
878
904
  /** Configures the avatar to be used in the session. */
879
905
  export declare interface AvatarConfig {
880
906
  /** Pre-built avatar id. */
@@ -2124,6 +2150,18 @@ export declare interface CompletionStats {
2124
2150
  successfulForecastPointCount?: string;
2125
2151
  }
2126
2152
 
2153
+ /** Composite reinforcement tuning reward config. */
2154
+ export declare interface CompositeReinforcementTuningRewardConfig {
2155
+ weightedRewardConfigs?: CompositeReinforcementTuningRewardConfigWeightedRewardConfig[];
2156
+ }
2157
+
2158
+ /** Composite reinforcement tuning reward config weighted reward config. */
2159
+ export declare interface CompositeReinforcementTuningRewardConfigWeightedRewardConfig {
2160
+ rewardConfig?: SingleReinforcementTuningRewardConfig;
2161
+ /** How much this single reward contributes to the total overall reward. */
2162
+ weight?: number;
2163
+ }
2164
+
2127
2165
  /** Tool to support computer use. */
2128
2166
  export declare interface ComputerUse {
2129
2167
  /** Required. The environment being operated. */
@@ -2672,7 +2710,7 @@ export declare interface CreateTuningJobConfig {
2672
2710
  be charged usage for any applicable operations.
2673
2711
  */
2674
2712
  abortSignal?: AbortSignal;
2675
- /** The method to use for tuning (SUPERVISED_FINE_TUNING or PREFERENCE_TUNING or DISTILLATION). If not set, the default method (SFT) will be used. */
2713
+ /** The method to use for tuning (SUPERVISED_FINE_TUNING or PREFERENCE_TUNING or DISTILLATION or REINFORCEMENT_TUNING). If not set, the default method (SFT) will be used. */
2676
2714
  method?: TuningMethod;
2677
2715
  /** Validation dataset for tuning. The dataset must be formatted as a JSONL file. */
2678
2716
  validationDataset?: TuningValidationDataset;
@@ -2712,6 +2750,18 @@ export declare interface CreateTuningJobConfig {
2712
2750
  outputUri?: string;
2713
2751
  /** The encryption spec of the tuning job. Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with provided encryption key. */
2714
2752
  encryptionSpec?: EncryptionSpec;
2753
+ /** Reward function configuration for reinforcement tuning. Reinforcement tuning only. */
2754
+ rewardConfig?: SingleReinforcementTuningRewardConfig;
2755
+ /** Composite reward function configuration for reinforcement tuning. Reinforcement tuning only. */
2756
+ compositeRewardConfig?: CompositeReinforcementTuningRewardConfig;
2757
+ /** Number of different responses to generate per prompt during tuning. Reinforcement tuning only. */
2758
+ samplesPerPrompt?: number;
2759
+ /** How often at steps to evaluate the tuning job during training. Reinforcement tuning only. */
2760
+ evaluateInterval?: number;
2761
+ /** How often at steps to save checkpoints during training. Reinforcement tuning only. */
2762
+ checkpointInterval?: number;
2763
+ /** The maximum number of tokens to generate per prompt. Reinforcement tuning only. */
2764
+ maxOutputTokens?: number;
2715
2765
  }
2716
2766
 
2717
2767
  /** Fine-tuning job creation parameters - optional fields. */
@@ -2840,6 +2890,10 @@ declare interface DeepResearchAgentConfig {
2840
2890
  * will then proceed only if the user confirms the plan in the next turn.
2841
2891
  */
2842
2892
  collaborative_planning?: boolean;
2893
+ /**
2894
+ * Enables bigquery tool for the Deep Research agent.
2895
+ */
2896
+ enable_bigquery_tool?: boolean;
2843
2897
  /**
2844
2898
  * Whether to include thought summaries in the response.
2845
2899
  */
@@ -3119,7 +3173,7 @@ declare interface DocumentContent {
3119
3173
  /**
3120
3174
  * The mime type of the document.
3121
3175
  */
3122
- mime_type?: 'application/pdf';
3176
+ mime_type?: 'application/pdf' | 'text/csv';
3123
3177
  /**
3124
3178
  * The URI of the document.
3125
3179
  */
@@ -3621,6 +3675,10 @@ declare interface ErrorEvent_2 {
3621
3675
  * The event_id token to be used to resume the interaction stream, from this event.
3622
3676
  */
3623
3677
  event_id?: string;
3678
+ /**
3679
+ * Optional metadata accompanying ANY streamed event.
3680
+ */
3681
+ metadata?: ErrorEvent_2.Metadata;
3624
3682
  }
3625
3683
 
3626
3684
  declare namespace ErrorEvent_2 {
@@ -3637,6 +3695,15 @@ declare namespace ErrorEvent_2 {
3637
3695
  */
3638
3696
  message?: string;
3639
3697
  }
3698
+ /**
3699
+ * Optional metadata accompanying ANY streamed event.
3700
+ */
3701
+ interface Metadata {
3702
+ /**
3703
+ * Statistics on the interaction request's token usage.
3704
+ */
3705
+ usage?: InteractionsAPI.Usage;
3706
+ }
3640
3707
  }
3641
3708
 
3642
3709
  declare namespace Errors {
@@ -4293,10 +4360,9 @@ declare interface Function_2 {
4293
4360
  parameters?: unknown;
4294
4361
  }
4295
4362
 
4296
- /** A function call. */
4363
+ /** 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. */
4297
4364
  export declare interface FunctionCall {
4298
- /** The unique id of the function call. If populated, the client to execute the
4299
- `function_call` and return the response with the matching `id`. */
4365
+ /** 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`. */
4300
4366
  id?: string;
4301
4367
  /** Optional. The function parameters and values in JSON object format. See FunctionDeclaration.parameters for parameter details. */
4302
4368
  args?: Record<string, unknown>;
@@ -6718,6 +6784,22 @@ declare interface InteractionCompletedEvent {
6718
6784
  * The event_id token to be used to resume the interaction stream, from this event.
6719
6785
  */
6720
6786
  event_id?: string;
6787
+ /**
6788
+ * Optional metadata accompanying ANY streamed event.
6789
+ */
6790
+ metadata?: InteractionCompletedEvent.Metadata;
6791
+ }
6792
+
6793
+ declare namespace InteractionCompletedEvent {
6794
+ /**
6795
+ * Optional metadata accompanying ANY streamed event.
6796
+ */
6797
+ interface Metadata {
6798
+ /**
6799
+ * Statistics on the interaction request's token usage.
6800
+ */
6801
+ usage?: InteractionsAPI.Usage;
6802
+ }
6721
6803
  }
6722
6804
 
6723
6805
  declare interface InteractionCreatedEvent {
@@ -6730,6 +6812,22 @@ declare interface InteractionCreatedEvent {
6730
6812
  * The event_id token to be used to resume the interaction stream, from this event.
6731
6813
  */
6732
6814
  event_id?: string;
6815
+ /**
6816
+ * Optional metadata accompanying ANY streamed event.
6817
+ */
6818
+ metadata?: InteractionCreatedEvent.Metadata;
6819
+ }
6820
+
6821
+ declare namespace InteractionCreatedEvent {
6822
+ /**
6823
+ * Optional metadata accompanying ANY streamed event.
6824
+ */
6825
+ interface Metadata {
6826
+ /**
6827
+ * Statistics on the interaction request's token usage.
6828
+ */
6829
+ usage?: InteractionsAPI.Usage;
6830
+ }
6733
6831
  }
6734
6832
 
6735
6833
  declare type InteractionCreateParams = CreateModelInteractionParamsNonStreaming | CreateModelInteractionParamsStreaming | CreateAgentInteractionParamsNonStreaming | CreateAgentInteractionParamsStreaming;
@@ -6888,6 +6986,22 @@ declare interface InteractionStatusUpdate {
6888
6986
  * The event_id token to be used to resume the interaction stream, from this event.
6889
6987
  */
6890
6988
  event_id?: string;
6989
+ /**
6990
+ * Optional metadata accompanying ANY streamed event.
6991
+ */
6992
+ metadata?: InteractionStatusUpdate.Metadata;
6993
+ }
6994
+
6995
+ declare namespace InteractionStatusUpdate {
6996
+ /**
6997
+ * Optional metadata accompanying ANY streamed event.
6998
+ */
6999
+ interface Metadata {
7000
+ /**
7001
+ * Statistics on the interaction request's token usage.
7002
+ */
7003
+ usage?: InteractionsAPI.Usage;
7004
+ }
6891
7005
  }
6892
7006
 
6893
7007
  /** Parameters for the private _Register method. */
@@ -6983,16 +7097,11 @@ export declare enum Language {
6983
7097
  PYTHON = "PYTHON"
6984
7098
  }
6985
7099
 
6986
- /** An object that represents a latitude/longitude pair.
6987
-
6988
- This is expressed as a pair of doubles to represent degrees latitude and
6989
- degrees longitude. Unless specified otherwise, this object must conform to the
6990
- <a href="https://en.wikipedia.org/wiki/World_Geodetic_System#1984_version">
6991
- WGS84 standard</a>. Values must be within normalized ranges. */
7100
+ /** 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. */
6992
7101
  export declare interface LatLng {
6993
7102
  /** The latitude in degrees. It must be in the range [-90.0, +90.0]. */
6994
7103
  latitude?: number;
6995
- /** The longitude in degrees. It must be in the range [-180.0, +180.0] */
7104
+ /** The longitude in degrees. It must be in the range [-180.0, +180.0]. */
6996
7105
  longitude?: number;
6997
7106
  }
6998
7107
 
@@ -8919,7 +9028,8 @@ export declare enum PagedItem {
8919
9028
  PAGED_ITEM_FILES = "files",
8920
9029
  PAGED_ITEM_CACHED_CONTENTS = "cachedContents",
8921
9030
  PAGED_ITEM_FILE_SEARCH_STORES = "fileSearchStores",
8922
- PAGED_ITEM_DOCUMENTS = "documents"
9031
+ PAGED_ITEM_DOCUMENTS = "documents",
9032
+ PAGED_ITEM_SKILLS = "skills"
8923
9033
  }
8924
9034
 
8925
9035
  declare interface PagedItemConfig {
@@ -8940,6 +9050,7 @@ declare interface PagedItemResponse<T> {
8940
9050
  cachedContents?: T[];
8941
9051
  fileSearchStores?: T[];
8942
9052
  documents?: T[];
9053
+ skills?: T[];
8943
9054
  }
8944
9055
 
8945
9056
  /**
@@ -9621,6 +9732,12 @@ export declare class RegisterFilesResponse {
9621
9732
  files?: File_2[];
9622
9733
  }
9623
9734
 
9735
+ /** Reinforcement tuning autorater scorer. */
9736
+ export declare interface ReinforcementTuningAutoraterScorer {
9737
+ /** Autorater config for evaluation. */
9738
+ autoraterConfig?: AutoraterConfig;
9739
+ }
9740
+
9624
9741
  /** Represents a recorded session. */
9625
9742
  export declare interface ReplayFile {
9626
9743
  replayId?: string;
@@ -9762,10 +9879,9 @@ export declare interface Retrieval {
9762
9879
  vertexRagStore?: VertexRagStore;
9763
9880
  }
9764
9881
 
9765
- /** Retrieval config.
9766
- */
9882
+ /** Retrieval config. */
9767
9883
  export declare interface RetrievalConfig {
9768
- /** Optional. The location of the user. */
9884
+ /** The location of the user. */
9769
9885
  latLng?: LatLng;
9770
9886
  /** The language code of the user. */
9771
9887
  languageCode?: string;
@@ -10281,6 +10397,11 @@ export declare class SingleEmbedContentResponse {
10281
10397
  tokenCount?: string;
10282
10398
  }
10283
10399
 
10400
+ /** Single reinforcement tuning reward config. */
10401
+ export declare interface SingleReinforcementTuningRewardConfig {
10402
+ autoraterScorer?: ReinforcementTuningAutoraterScorer;
10403
+ }
10404
+
10284
10405
  /** Context window will be truncated by keeping only suffix of it.
10285
10406
 
10286
10407
  Context window will always be cut at start of USER role turn. System
@@ -10359,6 +10480,10 @@ declare interface StepDelta {
10359
10480
  * The event_id token to be used to resume the interaction stream, from this event.
10360
10481
  */
10361
10482
  event_id?: string;
10483
+ /**
10484
+ * Optional metadata accompanying ANY streamed event.
10485
+ */
10486
+ metadata?: StepDelta.Metadata;
10362
10487
  }
10363
10488
 
10364
10489
  declare namespace StepDelta {
@@ -10397,7 +10522,7 @@ declare namespace StepDelta {
10397
10522
  interface Document {
10398
10523
  type: 'document';
10399
10524
  data?: string;
10400
- mime_type?: 'application/pdf';
10525
+ mime_type?: 'application/pdf' | 'text/csv';
10401
10526
  uri?: string;
10402
10527
  }
10403
10528
  interface Video {
@@ -10564,6 +10689,15 @@ declare namespace StepDelta {
10564
10689
  is_error?: boolean;
10565
10690
  name?: string;
10566
10691
  }
10692
+ /**
10693
+ * Optional metadata accompanying ANY streamed event.
10694
+ */
10695
+ interface Metadata {
10696
+ /**
10697
+ * Statistics on the interaction request's token usage.
10698
+ */
10699
+ usage?: InteractionsAPI.Usage;
10700
+ }
10567
10701
  }
10568
10702
 
10569
10703
  declare interface StepStart {
@@ -10577,6 +10711,22 @@ declare interface StepStart {
10577
10711
  * The event_id token to be used to resume the interaction stream, from this event.
10578
10712
  */
10579
10713
  event_id?: string;
10714
+ /**
10715
+ * Optional metadata accompanying ANY streamed event.
10716
+ */
10717
+ metadata?: StepStart.Metadata;
10718
+ }
10719
+
10720
+ declare namespace StepStart {
10721
+ /**
10722
+ * Optional metadata accompanying ANY streamed event.
10723
+ */
10724
+ interface Metadata {
10725
+ /**
10726
+ * Statistics on the interaction request's token usage.
10727
+ */
10728
+ usage?: InteractionsAPI.Usage;
10729
+ }
10580
10730
  }
10581
10731
 
10582
10732
  declare interface StepStop {
@@ -10586,6 +10736,22 @@ declare interface StepStop {
10586
10736
  * The event_id token to be used to resume the interaction stream, from this event.
10587
10737
  */
10588
10738
  event_id?: string;
10739
+ /**
10740
+ * Optional metadata accompanying ANY streamed event.
10741
+ */
10742
+ metadata?: StepStop.Metadata;
10743
+ }
10744
+
10745
+ declare namespace StepStop {
10746
+ /**
10747
+ * Optional metadata accompanying ANY streamed event.
10748
+ */
10749
+ interface Metadata {
10750
+ /**
10751
+ * Statistics on the interaction request's token usage.
10752
+ */
10753
+ usage?: InteractionsAPI.Usage;
10754
+ }
10589
10755
  }
10590
10756
 
10591
10757
  declare class Stream<Item> implements AsyncIterable<Item> {
@@ -11201,15 +11367,13 @@ declare type ToolChoiceType = 'auto' | 'any' | 'none' | 'validated';
11201
11367
  export declare interface ToolCodeExecution {
11202
11368
  }
11203
11369
 
11204
- /** Tool config.
11205
-
11206
- This config is shared for all tools provided in the request. */
11370
+ /** Tool config. This config is shared for all tools provided in the request. */
11207
11371
  export declare interface ToolConfig {
11208
11372
  /** Optional. Retrieval config. */
11209
11373
  retrievalConfig?: RetrievalConfig;
11210
11374
  /** Optional. Function calling config. */
11211
11375
  functionCallingConfig?: FunctionCallingConfig;
11212
- /** If true, the API response will include the server-side tool calls and responses within the `Content` message. This allows clients to observe the server's tool invocations. */
11376
+ /** Optional. If true, the API response will include the server-side tool calls and responses within the `Content` message. This allows clients to observe the server's tool interactions. This field is not supported in Vertex AI. */
11213
11377
  includeServerSideToolInvocations?: boolean;
11214
11378
  }
11215
11379
 
@@ -11490,7 +11654,11 @@ export declare enum TuningMethod {
11490
11654
  /**
11491
11655
  * Distillation tuning.
11492
11656
  */
11493
- DISTILLATION = "DISTILLATION"
11657
+ DISTILLATION = "DISTILLATION",
11658
+ /**
11659
+ * Reinforcement tuning.
11660
+ */
11661
+ REINFORCEMENT_TUNING = "REINFORCEMENT_TUNING"
11494
11662
  }
11495
11663
 
11496
11664
  /** Tuning mode. This enum is not supported in Gemini API. */
@@ -11818,13 +11986,13 @@ declare namespace types {
11818
11986
  PhishBlockThreshold,
11819
11987
  Behavior,
11820
11988
  DynamicRetrievalConfigMode,
11821
- FunctionCallingConfigMode,
11822
11989
  ThinkingLevel,
11823
11990
  PersonGeneration,
11824
11991
  ProminentPeople,
11825
11992
  HarmCategory,
11826
11993
  HarmBlockMethod,
11827
11994
  HarmBlockThreshold,
11995
+ FunctionCallingConfigMode,
11828
11996
  FinishReason,
11829
11997
  HarmProbability,
11830
11998
  HarmSeverity,
@@ -11935,10 +12103,6 @@ declare namespace types {
11935
12103
  StreamableHttpTransport,
11936
12104
  McpServer,
11937
12105
  Tool,
11938
- LatLng,
11939
- RetrievalConfig,
11940
- FunctionCallingConfig,
11941
- ToolConfig,
11942
12106
  ReplicatedVoiceConfig,
11943
12107
  PrebuiltVoiceConfig,
11944
12108
  VoiceConfig,
@@ -11953,6 +12117,10 @@ declare namespace types {
11953
12117
  GenerationConfigRoutingConfigManualRoutingMode,
11954
12118
  GenerationConfigRoutingConfig,
11955
12119
  SafetySetting,
12120
+ LatLng,
12121
+ RetrievalConfig,
12122
+ FunctionCallingConfig,
12123
+ ToolConfig,
11956
12124
  ModelArmorConfig,
11957
12125
  GenerateContentConfig,
11958
12126
  GenerateContentParameters,
@@ -12115,6 +12283,11 @@ declare namespace types {
12115
12283
  TuningExample,
12116
12284
  TuningDataset,
12117
12285
  TuningValidationDataset,
12286
+ AutoraterConfig,
12287
+ ReinforcementTuningAutoraterScorer,
12288
+ SingleReinforcementTuningRewardConfig,
12289
+ CompositeReinforcementTuningRewardConfigWeightedRewardConfig,
12290
+ CompositeReinforcementTuningRewardConfig,
12118
12291
  CreateTuningJobConfig,
12119
12292
  CreateTuningJobParametersPrivate,
12120
12293
  TuningOperation,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@google/genai",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/node/index.mjs",