@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/genai.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>;
@@ -6713,6 +6779,22 @@ declare interface InteractionCompletedEvent {
6713
6779
  * The event_id token to be used to resume the interaction stream, from this event.
6714
6780
  */
6715
6781
  event_id?: string;
6782
+ /**
6783
+ * Optional metadata accompanying ANY streamed event.
6784
+ */
6785
+ metadata?: InteractionCompletedEvent.Metadata;
6786
+ }
6787
+
6788
+ declare namespace InteractionCompletedEvent {
6789
+ /**
6790
+ * Optional metadata accompanying ANY streamed event.
6791
+ */
6792
+ interface Metadata {
6793
+ /**
6794
+ * Statistics on the interaction request's token usage.
6795
+ */
6796
+ usage?: InteractionsAPI.Usage;
6797
+ }
6716
6798
  }
6717
6799
 
6718
6800
  declare interface InteractionCreatedEvent {
@@ -6725,6 +6807,22 @@ declare interface InteractionCreatedEvent {
6725
6807
  * The event_id token to be used to resume the interaction stream, from this event.
6726
6808
  */
6727
6809
  event_id?: string;
6810
+ /**
6811
+ * Optional metadata accompanying ANY streamed event.
6812
+ */
6813
+ metadata?: InteractionCreatedEvent.Metadata;
6814
+ }
6815
+
6816
+ declare namespace InteractionCreatedEvent {
6817
+ /**
6818
+ * Optional metadata accompanying ANY streamed event.
6819
+ */
6820
+ interface Metadata {
6821
+ /**
6822
+ * Statistics on the interaction request's token usage.
6823
+ */
6824
+ usage?: InteractionsAPI.Usage;
6825
+ }
6728
6826
  }
6729
6827
 
6730
6828
  declare type InteractionCreateParams = CreateModelInteractionParamsNonStreaming | CreateModelInteractionParamsStreaming | CreateAgentInteractionParamsNonStreaming | CreateAgentInteractionParamsStreaming;
@@ -6883,6 +6981,22 @@ declare interface InteractionStatusUpdate {
6883
6981
  * The event_id token to be used to resume the interaction stream, from this event.
6884
6982
  */
6885
6983
  event_id?: string;
6984
+ /**
6985
+ * Optional metadata accompanying ANY streamed event.
6986
+ */
6987
+ metadata?: InteractionStatusUpdate.Metadata;
6988
+ }
6989
+
6990
+ declare namespace InteractionStatusUpdate {
6991
+ /**
6992
+ * Optional metadata accompanying ANY streamed event.
6993
+ */
6994
+ interface Metadata {
6995
+ /**
6996
+ * Statistics on the interaction request's token usage.
6997
+ */
6998
+ usage?: InteractionsAPI.Usage;
6999
+ }
6886
7000
  }
6887
7001
 
6888
7002
  /** Parameters for the private _Register method. */
@@ -6978,16 +7092,11 @@ export declare enum Language {
6978
7092
  PYTHON = "PYTHON"
6979
7093
  }
6980
7094
 
6981
- /** An object that represents a latitude/longitude pair.
6982
-
6983
- This is expressed as a pair of doubles to represent degrees latitude and
6984
- degrees longitude. Unless specified otherwise, this object must conform to the
6985
- <a href="https://en.wikipedia.org/wiki/World_Geodetic_System#1984_version">
6986
- WGS84 standard</a>. Values must be within normalized ranges. */
7095
+ /** 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. */
6987
7096
  export declare interface LatLng {
6988
7097
  /** The latitude in degrees. It must be in the range [-90.0, +90.0]. */
6989
7098
  latitude?: number;
6990
- /** The longitude in degrees. It must be in the range [-180.0, +180.0] */
7099
+ /** The longitude in degrees. It must be in the range [-180.0, +180.0]. */
6991
7100
  longitude?: number;
6992
7101
  }
6993
7102
 
@@ -8914,7 +9023,8 @@ export declare enum PagedItem {
8914
9023
  PAGED_ITEM_FILES = "files",
8915
9024
  PAGED_ITEM_CACHED_CONTENTS = "cachedContents",
8916
9025
  PAGED_ITEM_FILE_SEARCH_STORES = "fileSearchStores",
8917
- PAGED_ITEM_DOCUMENTS = "documents"
9026
+ PAGED_ITEM_DOCUMENTS = "documents",
9027
+ PAGED_ITEM_SKILLS = "skills"
8918
9028
  }
8919
9029
 
8920
9030
  declare interface PagedItemConfig {
@@ -8935,6 +9045,7 @@ declare interface PagedItemResponse<T> {
8935
9045
  cachedContents?: T[];
8936
9046
  fileSearchStores?: T[];
8937
9047
  documents?: T[];
9048
+ skills?: T[];
8938
9049
  }
8939
9050
 
8940
9051
  /**
@@ -9616,6 +9727,12 @@ export declare class RegisterFilesResponse {
9616
9727
  files?: File_2[];
9617
9728
  }
9618
9729
 
9730
+ /** Reinforcement tuning autorater scorer. */
9731
+ export declare interface ReinforcementTuningAutoraterScorer {
9732
+ /** Autorater config for evaluation. */
9733
+ autoraterConfig?: AutoraterConfig;
9734
+ }
9735
+
9619
9736
  /** Represents a recorded session. */
9620
9737
  export declare interface ReplayFile {
9621
9738
  replayId?: string;
@@ -9757,10 +9874,9 @@ export declare interface Retrieval {
9757
9874
  vertexRagStore?: VertexRagStore;
9758
9875
  }
9759
9876
 
9760
- /** Retrieval config.
9761
- */
9877
+ /** Retrieval config. */
9762
9878
  export declare interface RetrievalConfig {
9763
- /** Optional. The location of the user. */
9879
+ /** The location of the user. */
9764
9880
  latLng?: LatLng;
9765
9881
  /** The language code of the user. */
9766
9882
  languageCode?: string;
@@ -10276,6 +10392,11 @@ export declare class SingleEmbedContentResponse {
10276
10392
  tokenCount?: string;
10277
10393
  }
10278
10394
 
10395
+ /** Single reinforcement tuning reward config. */
10396
+ export declare interface SingleReinforcementTuningRewardConfig {
10397
+ autoraterScorer?: ReinforcementTuningAutoraterScorer;
10398
+ }
10399
+
10279
10400
  /** Context window will be truncated by keeping only suffix of it.
10280
10401
 
10281
10402
  Context window will always be cut at start of USER role turn. System
@@ -10354,6 +10475,10 @@ declare interface StepDelta {
10354
10475
  * The event_id token to be used to resume the interaction stream, from this event.
10355
10476
  */
10356
10477
  event_id?: string;
10478
+ /**
10479
+ * Optional metadata accompanying ANY streamed event.
10480
+ */
10481
+ metadata?: StepDelta.Metadata;
10357
10482
  }
10358
10483
 
10359
10484
  declare namespace StepDelta {
@@ -10392,7 +10517,7 @@ declare namespace StepDelta {
10392
10517
  interface Document {
10393
10518
  type: 'document';
10394
10519
  data?: string;
10395
- mime_type?: 'application/pdf';
10520
+ mime_type?: 'application/pdf' | 'text/csv';
10396
10521
  uri?: string;
10397
10522
  }
10398
10523
  interface Video {
@@ -10559,6 +10684,15 @@ declare namespace StepDelta {
10559
10684
  is_error?: boolean;
10560
10685
  name?: string;
10561
10686
  }
10687
+ /**
10688
+ * Optional metadata accompanying ANY streamed event.
10689
+ */
10690
+ interface Metadata {
10691
+ /**
10692
+ * Statistics on the interaction request's token usage.
10693
+ */
10694
+ usage?: InteractionsAPI.Usage;
10695
+ }
10562
10696
  }
10563
10697
 
10564
10698
  declare interface StepStart {
@@ -10572,6 +10706,22 @@ declare interface StepStart {
10572
10706
  * The event_id token to be used to resume the interaction stream, from this event.
10573
10707
  */
10574
10708
  event_id?: string;
10709
+ /**
10710
+ * Optional metadata accompanying ANY streamed event.
10711
+ */
10712
+ metadata?: StepStart.Metadata;
10713
+ }
10714
+
10715
+ declare namespace StepStart {
10716
+ /**
10717
+ * Optional metadata accompanying ANY streamed event.
10718
+ */
10719
+ interface Metadata {
10720
+ /**
10721
+ * Statistics on the interaction request's token usage.
10722
+ */
10723
+ usage?: InteractionsAPI.Usage;
10724
+ }
10575
10725
  }
10576
10726
 
10577
10727
  declare interface StepStop {
@@ -10581,6 +10731,22 @@ declare interface StepStop {
10581
10731
  * The event_id token to be used to resume the interaction stream, from this event.
10582
10732
  */
10583
10733
  event_id?: string;
10734
+ /**
10735
+ * Optional metadata accompanying ANY streamed event.
10736
+ */
10737
+ metadata?: StepStop.Metadata;
10738
+ }
10739
+
10740
+ declare namespace StepStop {
10741
+ /**
10742
+ * Optional metadata accompanying ANY streamed event.
10743
+ */
10744
+ interface Metadata {
10745
+ /**
10746
+ * Statistics on the interaction request's token usage.
10747
+ */
10748
+ usage?: InteractionsAPI.Usage;
10749
+ }
10584
10750
  }
10585
10751
 
10586
10752
  declare class Stream<Item> implements AsyncIterable<Item> {
@@ -11196,15 +11362,13 @@ declare type ToolChoiceType = 'auto' | 'any' | 'none' | 'validated';
11196
11362
  export declare interface ToolCodeExecution {
11197
11363
  }
11198
11364
 
11199
- /** Tool config.
11200
-
11201
- This config is shared for all tools provided in the request. */
11365
+ /** Tool config. This config is shared for all tools provided in the request. */
11202
11366
  export declare interface ToolConfig {
11203
11367
  /** Optional. Retrieval config. */
11204
11368
  retrievalConfig?: RetrievalConfig;
11205
11369
  /** Optional. Function calling config. */
11206
11370
  functionCallingConfig?: FunctionCallingConfig;
11207
- /** 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. */
11371
+ /** 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. */
11208
11372
  includeServerSideToolInvocations?: boolean;
11209
11373
  }
11210
11374
 
@@ -11485,7 +11649,11 @@ export declare enum TuningMethod {
11485
11649
  /**
11486
11650
  * Distillation tuning.
11487
11651
  */
11488
- DISTILLATION = "DISTILLATION"
11652
+ DISTILLATION = "DISTILLATION",
11653
+ /**
11654
+ * Reinforcement tuning.
11655
+ */
11656
+ REINFORCEMENT_TUNING = "REINFORCEMENT_TUNING"
11489
11657
  }
11490
11658
 
11491
11659
  /** Tuning mode. This enum is not supported in Gemini API. */
@@ -11813,13 +11981,13 @@ declare namespace types {
11813
11981
  PhishBlockThreshold,
11814
11982
  Behavior,
11815
11983
  DynamicRetrievalConfigMode,
11816
- FunctionCallingConfigMode,
11817
11984
  ThinkingLevel,
11818
11985
  PersonGeneration,
11819
11986
  ProminentPeople,
11820
11987
  HarmCategory,
11821
11988
  HarmBlockMethod,
11822
11989
  HarmBlockThreshold,
11990
+ FunctionCallingConfigMode,
11823
11991
  FinishReason,
11824
11992
  HarmProbability,
11825
11993
  HarmSeverity,
@@ -11930,10 +12098,6 @@ declare namespace types {
11930
12098
  StreamableHttpTransport,
11931
12099
  McpServer,
11932
12100
  Tool,
11933
- LatLng,
11934
- RetrievalConfig,
11935
- FunctionCallingConfig,
11936
- ToolConfig,
11937
12101
  ReplicatedVoiceConfig,
11938
12102
  PrebuiltVoiceConfig,
11939
12103
  VoiceConfig,
@@ -11948,6 +12112,10 @@ declare namespace types {
11948
12112
  GenerationConfigRoutingConfigManualRoutingMode,
11949
12113
  GenerationConfigRoutingConfig,
11950
12114
  SafetySetting,
12115
+ LatLng,
12116
+ RetrievalConfig,
12117
+ FunctionCallingConfig,
12118
+ ToolConfig,
11951
12119
  ModelArmorConfig,
11952
12120
  GenerateContentConfig,
11953
12121
  GenerateContentParameters,
@@ -12110,6 +12278,11 @@ declare namespace types {
12110
12278
  TuningExample,
12111
12279
  TuningDataset,
12112
12280
  TuningValidationDataset,
12281
+ AutoraterConfig,
12282
+ ReinforcementTuningAutoraterScorer,
12283
+ SingleReinforcementTuningRewardConfig,
12284
+ CompositeReinforcementTuningRewardConfigWeightedRewardConfig,
12285
+ CompositeReinforcementTuningRewardConfig,
12113
12286
  CreateTuningJobConfig,
12114
12287
  CreateTuningJobParametersPrivate,
12115
12288
  TuningOperation,