@google/genai 1.0.1 → 1.2.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.
@@ -1282,15 +1282,15 @@ export declare interface DistillationHyperParameters {
1282
1282
 
1283
1283
  /** Tuning Spec for Distillation. */
1284
1284
  export declare interface DistillationSpec {
1285
- /** The base teacher model that is being distilled, e.g., "gemini-1.0-pro-002". */
1285
+ /** The base teacher model that is being distilled. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/tuning#supported_models). */
1286
1286
  baseTeacherModel?: string;
1287
1287
  /** Optional. Hyperparameters for Distillation. */
1288
1288
  hyperParameters?: DistillationHyperParameters;
1289
- /** Required. A path in a Cloud Storage bucket, which will be treated as the root output directory of the distillation pipeline. It is used by the system to generate the paths of output artifacts. */
1289
+ /** Deprecated. A path in a Cloud Storage bucket, which will be treated as the root output directory of the distillation pipeline. It is used by the system to generate the paths of output artifacts. */
1290
1290
  pipelineRootDirectory?: string;
1291
- /** The student model that is being tuned, e.g., "google/gemma-2b-1.1-it". */
1291
+ /** The student model that is being tuned, e.g., "google/gemma-2b-1.1-it". Deprecated. Use base_model instead. */
1292
1292
  studentModel?: string;
1293
- /** Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file. */
1293
+ /** Deprecated. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file. */
1294
1294
  trainingDatasetUri?: string;
1295
1295
  /** The resource name of the Tuned teacher model. Format: `projects/{project}/locations/{location}/models/{model}`. */
1296
1296
  tunedTeacherModelSource?: string;
@@ -1619,6 +1619,8 @@ export { File_2 as File }
1619
1619
 
1620
1620
  /** URI based data. */
1621
1621
  export declare interface FileData {
1622
+ /** Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. It is not currently used in the Gemini GenerateContent calls. */
1623
+ displayName?: string;
1622
1624
  /** Required. URI. */
1623
1625
  fileUri?: string;
1624
1626
  /** Required. The IANA standard MIME type of the source data. */
@@ -1843,7 +1845,7 @@ export declare interface FunctionCall {
1843
1845
  /** The unique id of the function call. If populated, the client to execute the
1844
1846
  `function_call` and return the response with the matching `id`. */
1845
1847
  id?: string;
1846
- /** Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details. */
1848
+ /** Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details. */
1847
1849
  args?: Record<string, unknown>;
1848
1850
  /** Required. The name of the function to call. Matches [FunctionDeclaration.name]. */
1849
1851
  name?: string;
@@ -2406,6 +2408,8 @@ export declare interface GenerateVideosConfig {
2406
2408
  negativePrompt?: string;
2407
2409
  /** Whether to use the prompt rewriting logic. */
2408
2410
  enhancePrompt?: boolean;
2411
+ /** Whether to generate audio along with the video. */
2412
+ generateAudio?: boolean;
2409
2413
  }
2410
2414
 
2411
2415
  /** A video generation operation. */
@@ -2448,6 +2452,8 @@ export declare class GenerateVideosResponse {
2448
2452
 
2449
2453
  /** Generation config. */
2450
2454
  export declare interface GenerationConfig {
2455
+ /** Optional. Config for model selection. */
2456
+ modelSelectionConfig?: ModelSelectionConfig;
2451
2457
  /** Optional. If enabled, audio timestamp will be included in the request to the model. */
2452
2458
  audioTimestamp?: boolean;
2453
2459
  /** Optional. Number of candidates to generate. */
@@ -2466,16 +2472,22 @@ export declare interface GenerationConfig {
2466
2472
  responseLogprobs?: boolean;
2467
2473
  /** Optional. Output response mimetype of the generated candidate text. Supported mimetype: - `text/plain`: (default) Text output. - `application/json`: JSON response in the candidates. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature. */
2468
2474
  responseMimeType?: string;
2475
+ /** Optional. The modalities of the response. */
2476
+ responseModalities?: Modality[];
2469
2477
  /** Optional. The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: `application/json`: Schema for JSON response. */
2470
2478
  responseSchema?: Schema;
2471
2479
  /** Optional. Routing configuration. */
2472
2480
  routingConfig?: GenerationConfigRoutingConfig;
2473
2481
  /** Optional. Seed. */
2474
2482
  seed?: number;
2483
+ /** Optional. The speech generation config. */
2484
+ speechConfig?: SpeechConfig;
2475
2485
  /** Optional. Stop sequences. */
2476
2486
  stopSequences?: string[];
2477
2487
  /** Optional. Controls the randomness of predictions. */
2478
2488
  temperature?: number;
2489
+ /** Optional. Config for thinking features. An error will be returned if this field is set for models that don't support thinking. */
2490
+ thinkingConfig?: GenerationConfigThinkingConfig;
2479
2491
  /** Optional. If specified, top-k sampling will be used. */
2480
2492
  topK?: number;
2481
2493
  /** Optional. If specified, nucleus sampling will be used. */
@@ -2498,10 +2510,18 @@ export declare interface GenerationConfigRoutingConfigAutoRoutingMode {
2498
2510
 
2499
2511
  /** When manual routing is set, the specified model will be used directly. */
2500
2512
  export declare interface GenerationConfigRoutingConfigManualRoutingMode {
2501
- /** The model name to use. Only the public LLM models are accepted. e.g. 'gemini-1.5-pro-001'. */
2513
+ /** The model name to use. Only the public LLM models are accepted. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#supported-models). */
2502
2514
  modelName?: string;
2503
2515
  }
2504
2516
 
2517
+ /** Config for thinking features. */
2518
+ export declare interface GenerationConfigThinkingConfig {
2519
+ /** Optional. Indicates whether to include thoughts in the response. If true, thoughts are returned only when available. */
2520
+ includeThoughts?: boolean;
2521
+ /** Optional. Indicates the thinking budget in tokens. This is only applied when enable_thinking is true. */
2522
+ thinkingBudget?: number;
2523
+ }
2524
+
2505
2525
  /** Optional parameters for caches.get method. */
2506
2526
  export declare interface GetCachedContentConfig {
2507
2527
  /** Used to override HTTP request options. */
@@ -2776,6 +2796,8 @@ export declare interface GroundingChunk {
2776
2796
 
2777
2797
  /** Chunk from context retrieved by the retrieval tools. */
2778
2798
  export declare interface GroundingChunkRetrievedContext {
2799
+ /** Additional context for the RAG retrieval result. This is only populated when using the RAG retrieval tool. */
2800
+ ragChunk?: RagChunk;
2779
2801
  /** Text of the attribution. */
2780
2802
  text?: string;
2781
2803
  /** Title of the attribution. */
@@ -2887,7 +2909,7 @@ export declare enum HarmCategory {
2887
2909
  */
2888
2910
  HARM_CATEGORY_SEXUALLY_EXPLICIT = "HARM_CATEGORY_SEXUALLY_EXPLICIT",
2889
2911
  /**
2890
- * The harm category is civic integrity.
2912
+ * Deprecated: Election filter is not longer supported. The harm category is civic integrity.
2891
2913
  */
2892
2914
  HARM_CATEGORY_CIVIC_INTEGRITY = "HARM_CATEGORY_CIVIC_INTEGRITY"
2893
2915
  }
@@ -3687,8 +3709,6 @@ export declare interface LiveMusicGenerationConfig {
3687
3709
  muteDrums?: boolean;
3688
3710
  /** Whether the audio output should contain only bass and drums. */
3689
3711
  onlyBassAndDrums?: boolean;
3690
- /** The mode of music generation. Default mode is QUALITY. */
3691
- musicGenerationMode?: MusicGenerationMode;
3692
3712
  }
3693
3713
 
3694
3714
  /** The playback control signal to apply to the music generation. */
@@ -4138,7 +4158,7 @@ export declare enum Modality {
4138
4158
  */
4139
4159
  IMAGE = "IMAGE",
4140
4160
  /**
4141
- * Indicates the model should return images.
4161
+ * Indicates the model should return audio.
4142
4162
  */
4143
4163
  AUDIO = "AUDIO"
4144
4164
  }
@@ -4512,24 +4532,6 @@ export declare interface MultiSpeakerVoiceConfig {
4512
4532
  speakerVoiceConfigs?: SpeakerVoiceConfig[];
4513
4533
  }
4514
4534
 
4515
- /** The mode of music generation. */
4516
- export declare enum MusicGenerationMode {
4517
- /**
4518
- * This value is unused.
4519
- */
4520
- MUSIC_GENERATION_MODE_UNSPECIFIED = "MUSIC_GENERATION_MODE_UNSPECIFIED",
4521
- /**
4522
- * Steer text prompts to regions of latent space with higher quality
4523
- music.
4524
- */
4525
- QUALITY = "QUALITY",
4526
- /**
4527
- * Steer text prompts to regions of latent space with a larger diversity
4528
- of music.
4529
- */
4530
- DIVERSITY = "DIVERSITY"
4531
- }
4532
-
4533
4535
  /** A long-running operation. */
4534
4536
  export declare interface Operation {
4535
4537
  /** The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. */
@@ -4729,12 +4731,12 @@ export declare interface Part {
4729
4731
  thought?: boolean;
4730
4732
  /** Optional. Inlined bytes data. */
4731
4733
  inlineData?: Blob_2;
4734
+ /** Optional. URI based data. */
4735
+ fileData?: FileData;
4732
4736
  /** Optional. Result of executing the [ExecutableCode]. */
4733
4737
  codeExecutionResult?: CodeExecutionResult;
4734
4738
  /** Optional. Code generated by the model that is meant to be executed. */
4735
4739
  executableCode?: ExecutableCode;
4736
- /** Optional. URI based data. */
4737
- fileData?: FileData;
4738
4740
  /** Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values. */
4739
4741
  functionCall?: FunctionCall;
4740
4742
  /** Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model. */
@@ -4778,6 +4780,22 @@ export declare interface ProactivityConfig {
4778
4780
  proactiveAudio?: boolean;
4779
4781
  }
4780
4782
 
4783
+ /** A RagChunk includes the content of a chunk of a RagFile, and associated metadata. */
4784
+ export declare interface RagChunk {
4785
+ /** If populated, represents where the chunk starts and ends in the document. */
4786
+ pageSpan?: RagChunkPageSpan;
4787
+ /** The content of the chunk. */
4788
+ text?: string;
4789
+ }
4790
+
4791
+ /** Represents where the chunk starts and ends in the document. */
4792
+ export declare interface RagChunkPageSpan {
4793
+ /** Page where chunk starts in the document. Inclusive. 1-indexed. */
4794
+ firstPage?: number;
4795
+ /** Page where chunk ends in the document. Inclusive. 1-indexed. */
4796
+ lastPage?: number;
4797
+ }
4798
+
4781
4799
  /** Specifies the context retrieval config. */
4782
4800
  export declare interface RagRetrievalConfig {
4783
4801
  /** Optional. Config for filters. */
@@ -4816,7 +4834,7 @@ export declare interface RagRetrievalConfigRanking {
4816
4834
 
4817
4835
  /** Config for LlmRanker. */
4818
4836
  export declare interface RagRetrievalConfigRankingLlmRanker {
4819
- /** Optional. The model name used for ranking. Format: `gemini-1.5-pro` */
4837
+ /** Optional. The model name used for ranking. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#supported-models). */
4820
4838
  modelName?: string;
4821
4839
  }
4822
4840
 
@@ -4902,6 +4920,8 @@ export declare interface Retrieval {
4902
4920
  export declare interface RetrievalConfig {
4903
4921
  /** Optional. The location of the user. */
4904
4922
  latLng?: LatLng;
4923
+ /** The language code of the user. */
4924
+ languageCode?: string;
4905
4925
  }
4906
4926
 
4907
4927
  /** Metadata related to retrieval in the grounding flow. */
@@ -5014,7 +5034,12 @@ export declare enum Scale {
5014
5034
  B_MAJOR_A_FLAT_MINOR = "B_MAJOR_A_FLAT_MINOR"
5015
5035
  }
5016
5036
 
5017
- /** Schema is used to define the format of input/output data. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may be added in the future as needed. */
5037
+ /** Schema is used to define the format of input/output data.
5038
+
5039
+ Represents a select subset of an [OpenAPI 3.0 schema
5040
+ object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may
5041
+ be added in the future as needed.
5042
+ */
5018
5043
  export declare interface Schema {
5019
5044
  /** Optional. The value should be validated against any (one or more) of the subschemas in the list. */
5020
5045
  anyOf?: Schema[];
@@ -5427,15 +5452,17 @@ export declare interface SupervisedTuningDatasetDistributionDatasetBucket {
5427
5452
 
5428
5453
  /** Tuning data statistics for Supervised Tuning. */
5429
5454
  export declare interface SupervisedTuningDataStats {
5455
+ /** Output only. For each index in `truncated_example_indices`, the user-facing reason why the example was dropped. */
5456
+ droppedExampleReasons?: string[];
5430
5457
  /** Output only. Number of billable characters in the tuning dataset. */
5431
5458
  totalBillableCharacterCount?: string;
5432
5459
  /** Output only. Number of billable tokens in the tuning dataset. */
5433
5460
  totalBillableTokenCount?: string;
5434
- /** The number of examples in the dataset that have been truncated by any amount. */
5461
+ /** Output only. The number of examples in the dataset that have been dropped. An example can be dropped for reasons including: too many tokens, contains an invalid image, contains too many images, etc. */
5435
5462
  totalTruncatedExampleCount?: string;
5436
5463
  /** Output only. Number of tuning characters in the tuning dataset. */
5437
5464
  totalTuningCharacterCount?: string;
5438
- /** A partial sample of the indices (starting from 1) of the truncated examples. */
5465
+ /** Output only. A partial sample of the indices (starting from 1) of the dropped examples. */
5439
5466
  truncatedExampleIndices?: string[];
5440
5467
  /** Output only. Number of examples in the tuning dataset. */
5441
5468
  tuningDatasetExampleCount?: string;
@@ -5453,14 +5480,14 @@ export declare interface SupervisedTuningDataStats {
5453
5480
 
5454
5481
  /** Tuning Spec for Supervised Tuning for first party models. */
5455
5482
  export declare interface SupervisedTuningSpec {
5483
+ /** Optional. If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for SFT. Default is false. */
5484
+ exportLastCheckpointOnly?: boolean;
5456
5485
  /** Optional. Hyperparameters for SFT. */
5457
5486
  hyperParameters?: SupervisedHyperParameters;
5458
5487
  /** Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file. */
5459
5488
  trainingDatasetUri?: string;
5460
5489
  /** Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file. */
5461
5490
  validationDatasetUri?: string;
5462
- /** Optional. If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported. */
5463
- exportLastCheckpointOnly?: boolean;
5464
5491
  }
5465
5492
 
5466
5493
  export declare interface TestTableFile {
@@ -5528,7 +5555,7 @@ export declare interface Tool {
5528
5555
  googleMaps?: GoogleMaps;
5529
5556
  /** Optional. Tool to support URL context retrieval. */
5530
5557
  urlContext?: UrlContext;
5531
- /** Optional. CodeExecution tool type. Enables the model to execute code as part of generation. This field is only used by the Gemini Developer API services. */
5558
+ /** Optional. CodeExecution tool type. Enables the model to execute code as part of generation. */
5532
5559
  codeExecution?: ToolCodeExecution;
5533
5560
  }
5534
5561
 
@@ -5656,7 +5683,7 @@ export declare interface TuningJob {
5656
5683
  error?: GoogleRpcStatus;
5657
5684
  /** Optional. The description of the TuningJob. */
5658
5685
  description?: string;
5659
- /** The base model that is being tuned, e.g., "gemini-1.0-pro-002". . */
5686
+ /** The base model that is being tuned. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/tuning#supported_models). */
5660
5687
  baseModel?: string;
5661
5688
  /** Output only. The tuned model resources associated with this TuningJob. */
5662
5689
  tunedModel?: TunedModel;
@@ -5676,6 +5703,8 @@ export declare interface TuningJob {
5676
5703
  labels?: Record<string, string>;
5677
5704
  /** Output only. The resource name of the PipelineJob associated with the TuningJob. Format: `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`. */
5678
5705
  pipelineJob?: string;
5706
+ /** The service account that the tuningJob workload runs as. If not specified, the Vertex AI Secure Fine-Tuned Service Agent in the project will be used. See https://cloud.google.com/iam/docs/service-agents#vertex-ai-secure-fine-tuning-service-agent Users starting the pipeline must have the `iam.serviceAccounts.actAs` permission on this service account. */
5707
+ serviceAccount?: string;
5679
5708
  /** Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters. */
5680
5709
  tunedModelDisplayName?: string;
5681
5710
  }
@@ -5769,7 +5798,11 @@ export declare enum Type {
5769
5798
  /**
5770
5799
  * OpenAPI object type
5771
5800
  */
5772
- OBJECT = "OBJECT"
5801
+ OBJECT = "OBJECT",
5802
+ /**
5803
+ * Null type
5804
+ */
5805
+ NULL = "NULL"
5773
5806
  }
5774
5807
 
5775
5808
  declare namespace types {
@@ -5785,10 +5818,10 @@ declare namespace types {
5785
5818
  createModelContent,
5786
5819
  Outcome,
5787
5820
  Language,
5821
+ Type,
5788
5822
  HarmCategory,
5789
5823
  HarmBlockMethod,
5790
5824
  HarmBlockThreshold,
5791
- Type,
5792
5825
  Mode,
5793
5826
  AuthType,
5794
5827
  FinishReason,
@@ -5821,21 +5854,20 @@ declare namespace types {
5821
5854
  TurnCoverage,
5822
5855
  FunctionResponseScheduling,
5823
5856
  Scale,
5824
- MusicGenerationMode,
5825
5857
  LiveMusicPlaybackControl,
5826
5858
  VideoMetadata,
5827
5859
  Blob_2 as Blob,
5860
+ FileData,
5828
5861
  CodeExecutionResult,
5829
5862
  ExecutableCode,
5830
- FileData,
5831
5863
  FunctionCall,
5832
5864
  FunctionResponse,
5833
5865
  Part,
5834
5866
  Content,
5835
5867
  HttpOptions,
5868
+ Schema,
5836
5869
  ModelSelectionConfig,
5837
5870
  SafetySetting,
5838
- Schema,
5839
5871
  FunctionDeclaration,
5840
5872
  Interval,
5841
5873
  GoogleSearch,
@@ -5883,6 +5915,8 @@ declare namespace types {
5883
5915
  CitationMetadata,
5884
5916
  UrlMetadata,
5885
5917
  UrlContextMetadata,
5918
+ RagChunkPageSpan,
5919
+ RagChunk,
5886
5920
  GroundingChunkRetrievedContext,
5887
5921
  GroundingChunkWeb,
5888
5922
  GroundingChunk,
@@ -5935,6 +5969,7 @@ declare namespace types {
5935
5969
  DeleteModelConfig,
5936
5970
  DeleteModelParameters,
5937
5971
  DeleteModelResponse,
5972
+ GenerationConfigThinkingConfig,
5938
5973
  GenerationConfig,
5939
5974
  CountTokensConfig,
5940
5975
  CountTokensParameters,
@@ -6299,6 +6334,10 @@ export declare interface VertexAISearch {
6299
6334
  datastore?: string;
6300
6335
  /** Optional. Fully-qualified Vertex AI Search engine resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` */
6301
6336
  engine?: string;
6337
+ /** Optional. Filter strings to be passed to the search API. */
6338
+ filter?: string;
6339
+ /** Optional. Number of search results to return per query. The default value is 10. The maximumm allowed value is 10. */
6340
+ maxResults?: number;
6302
6341
  }
6303
6342
 
6304
6343
  /** Retrieve from Vertex RAG Store for grounding. */