@google/genai 1.8.0 → 1.9.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
@@ -3503,11 +3503,38 @@ export { Image_2 as Image }
3503
3503
 
3504
3504
  /** Enum that specifies the language of the text in the prompt. */
3505
3505
  export declare enum ImagePromptLanguage {
3506
+ /**
3507
+ * Auto-detect the language.
3508
+ */
3506
3509
  auto = "auto",
3510
+ /**
3511
+ * English
3512
+ */
3507
3513
  en = "en",
3514
+ /**
3515
+ * Japanese
3516
+ */
3508
3517
  ja = "ja",
3518
+ /**
3519
+ * Korean
3520
+ */
3509
3521
  ko = "ko",
3510
- hi = "hi"
3522
+ /**
3523
+ * Hindi
3524
+ */
3525
+ hi = "hi",
3526
+ /**
3527
+ * Chinese
3528
+ */
3529
+ zh = "zh",
3530
+ /**
3531
+ * Portuguese
3532
+ */
3533
+ pt = "pt",
3534
+ /**
3535
+ * Spanish
3536
+ */
3537
+ es = "es"
3511
3538
  }
3512
3539
 
3513
3540
  /** Config for inlined request. */
@@ -3805,7 +3832,7 @@ export declare class Live {
3805
3832
  if (GOOGLE_GENAI_USE_VERTEXAI) {
3806
3833
  model = 'gemini-2.0-flash-live-preview-04-09';
3807
3834
  } else {
3808
- model = 'gemini-2.0-flash-live-001';
3835
+ model = 'gemini-live-2.5-flash-preview';
3809
3836
  }
3810
3837
  const session = await ai.live.connect({
3811
3838
  model: model,
@@ -4771,6 +4798,14 @@ export declare class Models extends BaseModule {
4771
4798
  * ```
4772
4799
  */
4773
4800
  generateContent: (params: types.GenerateContentParameters) => Promise<types.GenerateContentResponse>;
4801
+ /**
4802
+ * This logic is needed for GenerateContentConfig only.
4803
+ * Previously we made GenerateContentConfig.responseSchema field to accept
4804
+ * unknown. Since v1.9.0, we switch to use backend JSON schema support.
4805
+ * To maintain backward compatibility, we move the data that was treated as
4806
+ * JSON schema from the responseSchema field to the responseJsonSchema field.
4807
+ */
4808
+ private maybeMoveToResponseJsonSchem;
4774
4809
  /**
4775
4810
  * Makes an API request to generate content with a given model and yields the
4776
4811
  * response in chunks.
@@ -5783,7 +5818,7 @@ export declare class Session {
5783
5818
  if (GOOGLE_GENAI_USE_VERTEXAI) {
5784
5819
  model = 'gemini-2.0-flash-live-preview-04-09';
5785
5820
  } else {
5786
- model = 'gemini-2.0-flash-live-001';
5821
+ model = 'gemini-live-2.5-flash-preview';
5787
5822
  }
5788
5823
  const session = await ai.live.connect({
5789
5824
  model: model,
@@ -6078,14 +6113,20 @@ export declare class Tokens extends BaseModule {
6078
6113
  * @experimental
6079
6114
  *
6080
6115
  * @remarks
6081
- * Ephermeral auth tokens is only supported in the Gemini Developer API.
6116
+ * Ephemeral auth tokens is only supported in the Gemini Developer API.
6082
6117
  * It can be used for the session connection to the Live constrained API.
6118
+ * Support in v1alpha only.
6083
6119
  *
6084
6120
  * @param params - The parameters for the create request.
6085
6121
  * @return The created auth token.
6086
6122
  *
6087
6123
  * @example
6088
6124
  * ```ts
6125
+ * const ai = new GoogleGenAI({
6126
+ * apiKey: token.name,
6127
+ * httpOptions: { apiVersion: 'v1alpha' } // Support in v1alpha only.
6128
+ * });
6129
+ *
6089
6130
  * // Case 1: If LiveEphemeralParameters is unset, unlock LiveConnectConfig
6090
6131
  * // when using the token in Live API sessions. Each session connection can
6091
6132
  * // use a different configuration.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@google/genai",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/node/index.mjs",
@@ -91,13 +91,13 @@
91
91
  "tsx": "^4.19.4",
92
92
  "typedoc": "^0.27.0",
93
93
  "typescript": "~5.2.0",
94
- "typescript-eslint": "8.24.1"
94
+ "typescript-eslint": "8.24.1",
95
+ "zod": "^3.22.4",
96
+ "zod-to-json-schema": "^3.22.4"
95
97
  },
96
98
  "dependencies": {
97
99
  "google-auth-library": "^9.14.2",
98
- "ws": "^8.18.0",
99
- "zod": "^3.22.4",
100
- "zod-to-json-schema": "^3.22.4"
100
+ "ws": "^8.18.0"
101
101
  },
102
102
  "peerDependencies": {
103
103
  "@modelcontextprotocol/sdk": "^1.11.0"