@google/genai 1.0.1 → 1.1.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
@@ -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;
@@ -2448,6 +2450,8 @@ export declare class GenerateVideosResponse {
2448
2450
 
2449
2451
  /** Generation config. */
2450
2452
  export declare interface GenerationConfig {
2453
+ /** Optional. Config for model selection. */
2454
+ modelSelectionConfig?: ModelSelectionConfig;
2451
2455
  /** Optional. If enabled, audio timestamp will be included in the request to the model. */
2452
2456
  audioTimestamp?: boolean;
2453
2457
  /** Optional. Number of candidates to generate. */
@@ -2466,16 +2470,22 @@ export declare interface GenerationConfig {
2466
2470
  responseLogprobs?: boolean;
2467
2471
  /** 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
2472
  responseMimeType?: string;
2473
+ /** Optional. The modalities of the response. */
2474
+ responseModalities?: Modality[];
2469
2475
  /** 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
2476
  responseSchema?: Schema;
2471
2477
  /** Optional. Routing configuration. */
2472
2478
  routingConfig?: GenerationConfigRoutingConfig;
2473
2479
  /** Optional. Seed. */
2474
2480
  seed?: number;
2481
+ /** Optional. The speech generation config. */
2482
+ speechConfig?: SpeechConfig;
2475
2483
  /** Optional. Stop sequences. */
2476
2484
  stopSequences?: string[];
2477
2485
  /** Optional. Controls the randomness of predictions. */
2478
2486
  temperature?: number;
2487
+ /** Optional. Config for thinking features. An error will be returned if this field is set for models that don't support thinking. */
2488
+ thinkingConfig?: GenerationConfigThinkingConfig;
2479
2489
  /** Optional. If specified, top-k sampling will be used. */
2480
2490
  topK?: number;
2481
2491
  /** Optional. If specified, nucleus sampling will be used. */
@@ -2498,10 +2508,18 @@ export declare interface GenerationConfigRoutingConfigAutoRoutingMode {
2498
2508
 
2499
2509
  /** When manual routing is set, the specified model will be used directly. */
2500
2510
  export declare interface GenerationConfigRoutingConfigManualRoutingMode {
2501
- /** The model name to use. Only the public LLM models are accepted. e.g. 'gemini-1.5-pro-001'. */
2511
+ /** 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
2512
  modelName?: string;
2503
2513
  }
2504
2514
 
2515
+ /** Config for thinking features. */
2516
+ export declare interface GenerationConfigThinkingConfig {
2517
+ /** Optional. Indicates whether to include thoughts in the response. If true, thoughts are returned only when available. */
2518
+ includeThoughts?: boolean;
2519
+ /** Optional. Indicates the thinking budget in tokens. This is only applied when enable_thinking is true. */
2520
+ thinkingBudget?: number;
2521
+ }
2522
+
2505
2523
  /** Optional parameters for caches.get method. */
2506
2524
  export declare interface GetCachedContentConfig {
2507
2525
  /** Used to override HTTP request options. */
@@ -2769,6 +2787,8 @@ export declare interface GroundingChunk {
2769
2787
 
2770
2788
  /** Chunk from context retrieved by the retrieval tools. */
2771
2789
  export declare interface GroundingChunkRetrievedContext {
2790
+ /** Additional context for the RAG retrieval result. This is only populated when using the RAG retrieval tool. */
2791
+ ragChunk?: RagChunk;
2772
2792
  /** Text of the attribution. */
2773
2793
  text?: string;
2774
2794
  /** Title of the attribution. */
@@ -2880,7 +2900,7 @@ export declare enum HarmCategory {
2880
2900
  */
2881
2901
  HARM_CATEGORY_SEXUALLY_EXPLICIT = "HARM_CATEGORY_SEXUALLY_EXPLICIT",
2882
2902
  /**
2883
- * The harm category is civic integrity.
2903
+ * Deprecated: Election filter is not longer supported. The harm category is civic integrity.
2884
2904
  */
2885
2905
  HARM_CATEGORY_CIVIC_INTEGRITY = "HARM_CATEGORY_CIVIC_INTEGRITY"
2886
2906
  }
@@ -4722,12 +4742,12 @@ export declare interface Part {
4722
4742
  thought?: boolean;
4723
4743
  /** Optional. Inlined bytes data. */
4724
4744
  inlineData?: Blob_2;
4745
+ /** Optional. URI based data. */
4746
+ fileData?: FileData;
4725
4747
  /** Optional. Result of executing the [ExecutableCode]. */
4726
4748
  codeExecutionResult?: CodeExecutionResult;
4727
4749
  /** Optional. Code generated by the model that is meant to be executed. */
4728
4750
  executableCode?: ExecutableCode;
4729
- /** Optional. URI based data. */
4730
- fileData?: FileData;
4731
4751
  /** Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values. */
4732
4752
  functionCall?: FunctionCall;
4733
4753
  /** 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. */
@@ -4771,6 +4791,22 @@ export declare interface ProactivityConfig {
4771
4791
  proactiveAudio?: boolean;
4772
4792
  }
4773
4793
 
4794
+ /** A RagChunk includes the content of a chunk of a RagFile, and associated metadata. */
4795
+ export declare interface RagChunk {
4796
+ /** If populated, represents where the chunk starts and ends in the document. */
4797
+ pageSpan?: RagChunkPageSpan;
4798
+ /** The content of the chunk. */
4799
+ text?: string;
4800
+ }
4801
+
4802
+ /** Represents where the chunk starts and ends in the document. */
4803
+ export declare interface RagChunkPageSpan {
4804
+ /** Page where chunk starts in the document. Inclusive. 1-indexed. */
4805
+ firstPage?: number;
4806
+ /** Page where chunk ends in the document. Inclusive. 1-indexed. */
4807
+ lastPage?: number;
4808
+ }
4809
+
4774
4810
  /** Specifies the context retrieval config. */
4775
4811
  export declare interface RagRetrievalConfig {
4776
4812
  /** Optional. Config for filters. */
@@ -4809,7 +4845,7 @@ export declare interface RagRetrievalConfigRanking {
4809
4845
 
4810
4846
  /** Config for LlmRanker. */
4811
4847
  export declare interface RagRetrievalConfigRankingLlmRanker {
4812
- /** Optional. The model name used for ranking. Format: `gemini-1.5-pro` */
4848
+ /** Optional. The model name used for ranking. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#supported-models). */
4813
4849
  modelName?: string;
4814
4850
  }
4815
4851
 
@@ -4895,6 +4931,8 @@ export declare interface Retrieval {
4895
4931
  export declare interface RetrievalConfig {
4896
4932
  /** Optional. The location of the user. */
4897
4933
  latLng?: LatLng;
4934
+ /** The language code of the user. */
4935
+ languageCode?: string;
4898
4936
  }
4899
4937
 
4900
4938
  /** Metadata related to retrieval in the grounding flow. */
@@ -5007,7 +5045,12 @@ export declare enum Scale {
5007
5045
  B_MAJOR_A_FLAT_MINOR = "B_MAJOR_A_FLAT_MINOR"
5008
5046
  }
5009
5047
 
5010
- /** 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. */
5048
+ /** Schema is used to define the format of input/output data.
5049
+
5050
+ Represents a select subset of an [OpenAPI 3.0 schema
5051
+ object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may
5052
+ be added in the future as needed.
5053
+ */
5011
5054
  export declare interface Schema {
5012
5055
  /** Optional. The value should be validated against any (one or more) of the subschemas in the list. */
5013
5056
  anyOf?: Schema[];
@@ -5420,15 +5463,17 @@ export declare interface SupervisedTuningDatasetDistributionDatasetBucket {
5420
5463
 
5421
5464
  /** Tuning data statistics for Supervised Tuning. */
5422
5465
  export declare interface SupervisedTuningDataStats {
5466
+ /** Output only. For each index in `truncated_example_indices`, the user-facing reason why the example was dropped. */
5467
+ droppedExampleReasons?: string[];
5423
5468
  /** Output only. Number of billable characters in the tuning dataset. */
5424
5469
  totalBillableCharacterCount?: string;
5425
5470
  /** Output only. Number of billable tokens in the tuning dataset. */
5426
5471
  totalBillableTokenCount?: string;
5427
- /** The number of examples in the dataset that have been truncated by any amount. */
5472
+ /** 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. */
5428
5473
  totalTruncatedExampleCount?: string;
5429
5474
  /** Output only. Number of tuning characters in the tuning dataset. */
5430
5475
  totalTuningCharacterCount?: string;
5431
- /** A partial sample of the indices (starting from 1) of the truncated examples. */
5476
+ /** Output only. A partial sample of the indices (starting from 1) of the dropped examples. */
5432
5477
  truncatedExampleIndices?: string[];
5433
5478
  /** Output only. Number of examples in the tuning dataset. */
5434
5479
  tuningDatasetExampleCount?: string;
@@ -5446,14 +5491,14 @@ export declare interface SupervisedTuningDataStats {
5446
5491
 
5447
5492
  /** Tuning Spec for Supervised Tuning for first party models. */
5448
5493
  export declare interface SupervisedTuningSpec {
5494
+ /** 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. */
5495
+ exportLastCheckpointOnly?: boolean;
5449
5496
  /** Optional. Hyperparameters for SFT. */
5450
5497
  hyperParameters?: SupervisedHyperParameters;
5451
5498
  /** Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file. */
5452
5499
  trainingDatasetUri?: string;
5453
5500
  /** Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file. */
5454
5501
  validationDatasetUri?: string;
5455
- /** Optional. If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported. */
5456
- exportLastCheckpointOnly?: boolean;
5457
5502
  }
5458
5503
 
5459
5504
  export declare interface TestTableFile {
@@ -5521,7 +5566,7 @@ export declare interface Tool {
5521
5566
  googleMaps?: GoogleMaps;
5522
5567
  /** Optional. Tool to support URL context retrieval. */
5523
5568
  urlContext?: UrlContext;
5524
- /** 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. */
5569
+ /** Optional. CodeExecution tool type. Enables the model to execute code as part of generation. */
5525
5570
  codeExecution?: ToolCodeExecution;
5526
5571
  }
5527
5572
 
@@ -5649,7 +5694,7 @@ export declare interface TuningJob {
5649
5694
  error?: GoogleRpcStatus;
5650
5695
  /** Optional. The description of the TuningJob. */
5651
5696
  description?: string;
5652
- /** The base model that is being tuned, e.g., "gemini-1.0-pro-002". . */
5697
+ /** The base model that is being tuned. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/tuning#supported_models). */
5653
5698
  baseModel?: string;
5654
5699
  /** Output only. The tuned model resources associated with this TuningJob. */
5655
5700
  tunedModel?: TunedModel;
@@ -5669,6 +5714,8 @@ export declare interface TuningJob {
5669
5714
  labels?: Record<string, string>;
5670
5715
  /** Output only. The resource name of the PipelineJob associated with the TuningJob. Format: `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`. */
5671
5716
  pipelineJob?: string;
5717
+ /** 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. */
5718
+ serviceAccount?: string;
5672
5719
  /** Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters. */
5673
5720
  tunedModelDisplayName?: string;
5674
5721
  }
@@ -5762,7 +5809,11 @@ export declare enum Type {
5762
5809
  /**
5763
5810
  * OpenAPI object type
5764
5811
  */
5765
- OBJECT = "OBJECT"
5812
+ OBJECT = "OBJECT",
5813
+ /**
5814
+ * Null type
5815
+ */
5816
+ NULL = "NULL"
5766
5817
  }
5767
5818
 
5768
5819
  declare namespace types {
@@ -5778,10 +5829,10 @@ declare namespace types {
5778
5829
  createModelContent,
5779
5830
  Outcome,
5780
5831
  Language,
5832
+ Type,
5781
5833
  HarmCategory,
5782
5834
  HarmBlockMethod,
5783
5835
  HarmBlockThreshold,
5784
- Type,
5785
5836
  Mode,
5786
5837
  AuthType,
5787
5838
  FinishReason,
@@ -5818,17 +5869,17 @@ declare namespace types {
5818
5869
  LiveMusicPlaybackControl,
5819
5870
  VideoMetadata,
5820
5871
  Blob_2 as Blob,
5872
+ FileData,
5821
5873
  CodeExecutionResult,
5822
5874
  ExecutableCode,
5823
- FileData,
5824
5875
  FunctionCall,
5825
5876
  FunctionResponse,
5826
5877
  Part,
5827
5878
  Content,
5828
5879
  HttpOptions,
5880
+ Schema,
5829
5881
  ModelSelectionConfig,
5830
5882
  SafetySetting,
5831
- Schema,
5832
5883
  FunctionDeclaration,
5833
5884
  Interval,
5834
5885
  GoogleSearch,
@@ -5876,6 +5927,8 @@ declare namespace types {
5876
5927
  CitationMetadata,
5877
5928
  UrlMetadata,
5878
5929
  UrlContextMetadata,
5930
+ RagChunkPageSpan,
5931
+ RagChunk,
5879
5932
  GroundingChunkRetrievedContext,
5880
5933
  GroundingChunkWeb,
5881
5934
  GroundingChunk,
@@ -5928,6 +5981,7 @@ declare namespace types {
5928
5981
  DeleteModelConfig,
5929
5982
  DeleteModelParameters,
5930
5983
  DeleteModelResponse,
5984
+ GenerationConfigThinkingConfig,
5931
5985
  GenerationConfig,
5932
5986
  CountTokensConfig,
5933
5987
  CountTokensParameters,
@@ -6292,6 +6346,10 @@ export declare interface VertexAISearch {
6292
6346
  datastore?: string;
6293
6347
  /** Optional. Fully-qualified Vertex AI Search engine resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` */
6294
6348
  engine?: string;
6349
+ /** Optional. Filter strings to be passed to the search API. */
6350
+ filter?: string;
6351
+ /** Optional. Number of search results to return per query. The default value is 10. The maximumm allowed value is 10. */
6352
+ maxResults?: number;
6295
6353
  }
6296
6354
 
6297
6355
  /** Retrieve from Vertex RAG Store for grounding. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@google/genai",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/node/index.mjs",
@@ -17,10 +17,12 @@
17
17
  "node": {
18
18
  "types": "./dist/node/node.d.ts",
19
19
  "import": "./dist/node/index.mjs",
20
+ "require": "./dist/node/index.cjs",
20
21
  "default": "./dist/node/index.mjs"
21
22
  },
22
23
  "types": "./dist/genai.d.ts",
23
24
  "import": "./dist/index.mjs",
25
+ "require": "./dist/index.cjs",
24
26
  "default": "./dist/index.mjs"
25
27
  },
26
28
  "./web": {
@@ -55,8 +57,10 @@
55
57
  "files": [
56
58
  "dist/genai.d.ts",
57
59
  "dist/index.mjs",
60
+ "dist/index.cjs",
58
61
  "dist/index.mjs.map",
59
62
  "dist/node/index.mjs",
63
+ "dist/node/index.cjs",
60
64
  "dist/node/index.mjs.map",
61
65
  "dist/node/node.d.ts",
62
66
  "dist/web/index.mjs",