@google/genai 1.29.1 → 1.30.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
@@ -1,4 +1,3 @@
1
- // @ts-ignore
2
1
  import type { Client } from '@modelcontextprotocol/sdk/client/index.js';
3
2
  import { GoogleAuthOptions } from 'google-auth-library';
4
3
 
@@ -1558,7 +1557,7 @@ export declare function createModelContent(partOrString: PartListUnion | string)
1558
1557
  /**
1559
1558
  * Creates a `Part` object from a `base64` encoded `string`.
1560
1559
  */
1561
- export declare function createPartFromBase64(data: string, mimeType: string): Part;
1560
+ export declare function createPartFromBase64(data: string, mimeType: string, mediaResolution?: PartMediaResolutionLevel): Part;
1562
1561
 
1563
1562
  /**
1564
1563
  * Creates a `Part` object from the `outcome` and `output` of a `CodeExecutionResult` object.
@@ -1588,7 +1587,7 @@ export declare function createPartFromText(text: string): Part;
1588
1587
  /**
1589
1588
  * Creates a `Part` object from a `URI` string.
1590
1589
  */
1591
- export declare function createPartFromUri(uri: string, mimeType: string): Part;
1590
+ export declare function createPartFromUri(uri: string, mimeType: string, mediaResolution?: PartMediaResolutionLevel): Part;
1592
1591
 
1593
1592
  /** Fine-tuning job creation request - optional fields. */
1594
1593
  export declare interface CreateTuningJobConfig {
@@ -2719,6 +2718,10 @@ export declare interface FunctionCall {
2719
2718
  args?: Record<string, unknown>;
2720
2719
  /** Optional. The name of the function to call. Matches [FunctionDeclaration.name]. */
2721
2720
  name?: string;
2721
+ /** Optional. The partial argument value of the function call. If provided, represents the arguments/fields that are streamed incrementally. This field is not supported in Gemini API. */
2722
+ partialArgs?: PartialArg[];
2723
+ /** Optional. Whether this is the last part of the FunctionCall. If true, another partial message for the current FunctionCall is expected to follow. This field is not supported in Gemini API. */
2724
+ willContinue?: boolean;
2722
2725
  }
2723
2726
 
2724
2727
  /** Function calling config. */
@@ -2727,6 +2730,8 @@ export declare interface FunctionCallingConfig {
2727
2730
  mode?: FunctionCallingConfigMode;
2728
2731
  /** Optional. Function names to call. Only set when the Mode is ANY. Function names should match [FunctionDeclaration.name]. With mode set to ANY, model will predict a function call from the set of function names provided. */
2729
2732
  allowedFunctionNames?: string[];
2733
+ /** Optional. When set to true, arguments of a single function call will be streamed out in multiple parts/contents/responses. Partial parameter results will be returned in the [FunctionCall.partial_args] field. This field is not supported in Gemini API. */
2734
+ streamFunctionCallArguments?: boolean;
2730
2735
  }
2731
2736
 
2732
2737
  /** Config for the function calling config mode. */
@@ -2801,6 +2806,9 @@ export declare class FunctionResponseBlob {
2801
2806
  /** Required. Inline media bytes.
2802
2807
  * @remarks Encoded as base64 string. */
2803
2808
  data?: string;
2809
+ /** Optional. Display name of the blob.
2810
+ Used to provide a label or filename to distinguish blobs. */
2811
+ displayName?: string;
2804
2812
  }
2805
2813
 
2806
2814
  /** URI based data for function response. */
@@ -2809,6 +2817,9 @@ export declare class FunctionResponseFileData {
2809
2817
  fileUri?: string;
2810
2818
  /** Required. The IANA standard MIME type of the source data. */
2811
2819
  mimeType?: string;
2820
+ /** Optional. Display name of the file.
2821
+ Used to provide a label or filename to distinguish files. */
2822
+ displayName?: string;
2812
2823
  }
2813
2824
 
2814
2825
  /** A datatype containing media that is part of a `FunctionResponse` message.
@@ -4237,6 +4248,12 @@ export declare interface ImageConfig {
4237
4248
  values are `1K`, `2K`, `4K`. If not specified, the model will use default
4238
4249
  value `1K`. */
4239
4250
  imageSize?: string;
4251
+ /** MIME type of the generated image. This field is not
4252
+ supported in Gemini API. */
4253
+ outputMimeType?: string;
4254
+ /** Compression quality of the generated image (for
4255
+ ``image/jpeg`` only). This field is not supported in Gemini API. */
4256
+ outputCompressionQuality?: number;
4240
4257
  }
4241
4258
 
4242
4259
  /** Enum that specifies the language of the text in the prompt. */
@@ -6271,16 +6288,17 @@ export declare class Pager<T> implements AsyncIterable<T> {
6271
6288
  of content being conveyed. Using multiple fields within the same `Part`
6272
6289
  instance is considered invalid. */
6273
6290
  export declare interface Part {
6274
- /** A predicted [FunctionCall] returned from the model that contains a string
6275
- representing the [FunctionDeclaration.name] and a structured JSON object
6276
- containing the parameters and their values. */
6277
- functionCall?: FunctionCall;
6291
+ /** Media resolution for the input media.
6292
+ */
6293
+ mediaResolution?: PartMediaResolution;
6278
6294
  /** Optional. Result of executing the [ExecutableCode]. */
6279
6295
  codeExecutionResult?: CodeExecutionResult;
6280
6296
  /** Optional. Code generated by the model that is meant to be executed. */
6281
6297
  executableCode?: ExecutableCode;
6282
6298
  /** Optional. URI based data. */
6283
6299
  fileData?: FileData;
6300
+ /** Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values. */
6301
+ functionCall?: FunctionCall;
6284
6302
  /** 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. */
6285
6303
  functionResponse?: FunctionResponse;
6286
6304
  /** Optional. Inlined bytes data. */
@@ -6296,8 +6314,54 @@ export declare interface Part {
6296
6314
  videoMetadata?: VideoMetadata;
6297
6315
  }
6298
6316
 
6317
+ /** Partial argument value of the function call. This data type is not supported in Gemini API. */
6318
+ export declare interface PartialArg {
6319
+ /** Optional. Represents a null value. */
6320
+ nullValue?: 'NULL_VALUE';
6321
+ /** Optional. Represents a double value. */
6322
+ numberValue?: number;
6323
+ /** Optional. Represents a string value. */
6324
+ stringValue?: string;
6325
+ /** Optional. Represents a boolean value. */
6326
+ boolValue?: boolean;
6327
+ /** Required. A JSON Path (RFC 9535) to the argument being streamed. https://datatracker.ietf.org/doc/html/rfc9535. e.g. "$.foo.bar[0].data". */
6328
+ jsonPath?: string;
6329
+ /** Optional. Whether this is not the last part of the same json_path. If true, another PartialArg message for the current json_path is expected to follow. */
6330
+ willContinue?: boolean;
6331
+ }
6332
+
6299
6333
  export declare type PartListUnion = PartUnion[] | PartUnion;
6300
6334
 
6335
+ /** Media resolution for the input media. */
6336
+ export declare interface PartMediaResolution {
6337
+ /** The tokenization quality used for given media.
6338
+ */
6339
+ level?: PartMediaResolutionLevel;
6340
+ /** Specifies the required sequence length for media tokenization.
6341
+ */
6342
+ numTokens?: number;
6343
+ }
6344
+
6345
+ /** The tokenization quality used for given media. */
6346
+ export declare enum PartMediaResolutionLevel {
6347
+ /**
6348
+ * Media resolution has not been set.
6349
+ */
6350
+ MEDIA_RESOLUTION_UNSPECIFIED = "MEDIA_RESOLUTION_UNSPECIFIED",
6351
+ /**
6352
+ * Media resolution set to low.
6353
+ */
6354
+ MEDIA_RESOLUTION_LOW = "MEDIA_RESOLUTION_LOW",
6355
+ /**
6356
+ * Media resolution set to medium.
6357
+ */
6358
+ MEDIA_RESOLUTION_MEDIUM = "MEDIA_RESOLUTION_MEDIUM",
6359
+ /**
6360
+ * Media resolution set to high.
6361
+ */
6362
+ MEDIA_RESOLUTION_HIGH = "MEDIA_RESOLUTION_HIGH"
6363
+ }
6364
+
6301
6365
  /** Tuning spec for Partner models. This data type is not supported in Gemini API. */
6302
6366
  export declare interface PartnerModelTuningSpec {
6303
6367
  /** Hyperparameters for tuning. The accepted hyper_parameters and their valid range of values will differ depending on the base model. */
@@ -7347,6 +7411,24 @@ export declare interface ThinkingConfig {
7347
7411
  /** Indicates the thinking budget in tokens. 0 is DISABLED. -1 is AUTOMATIC. The default values and allowed ranges are model dependent.
7348
7412
  */
7349
7413
  thinkingBudget?: number;
7414
+ /** Optional. The level of thoughts tokens that the model should generate. */
7415
+ thinkingLevel?: ThinkingLevel;
7416
+ }
7417
+
7418
+ /** The level of thoughts tokens that the model should generate. */
7419
+ export declare enum ThinkingLevel {
7420
+ /**
7421
+ * Default value.
7422
+ */
7423
+ THINKING_LEVEL_UNSPECIFIED = "THINKING_LEVEL_UNSPECIFIED",
7424
+ /**
7425
+ * Low thinking level.
7426
+ */
7427
+ LOW = "LOW",
7428
+ /**
7429
+ * High thinking level.
7430
+ */
7431
+ HIGH = "HIGH"
7350
7432
  }
7351
7433
 
7352
7434
  export declare class Tokens extends BaseModule {
@@ -7861,6 +7943,7 @@ declare namespace types {
7861
7943
  AuthType,
7862
7944
  HttpElementLocation,
7863
7945
  PhishBlockThreshold,
7946
+ ThinkingLevel,
7864
7947
  HarmCategory,
7865
7948
  HarmBlockMethod,
7866
7949
  HarmBlockThreshold,
@@ -7876,6 +7959,7 @@ declare namespace types {
7876
7959
  AdapterSize,
7877
7960
  JobState,
7878
7961
  TuningTask,
7962
+ PartMediaResolutionLevel,
7879
7963
  FeatureSelectionPreference,
7880
7964
  Behavior,
7881
7965
  DynamicRetrievalConfigMode,
@@ -7905,10 +7989,12 @@ declare namespace types {
7905
7989
  Scale,
7906
7990
  MusicGenerationMode,
7907
7991
  LiveMusicPlaybackControl,
7908
- FunctionCall,
7992
+ PartMediaResolution,
7909
7993
  CodeExecutionResult,
7910
7994
  ExecutableCode,
7911
7995
  FileData,
7996
+ PartialArg,
7997
+ FunctionCall,
7912
7998
  FunctionResponseBlob,
7913
7999
  FunctionResponseFileData,
7914
8000
  FunctionResponsePart,