@google/genai 0.6.0 → 0.6.1

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
@@ -725,6 +725,24 @@ export declare interface DeleteCachedContentParameters {
725
725
  export declare class DeleteCachedContentResponse {
726
726
  }
727
727
 
728
+ /** Used to override the default configuration. */
729
+ export declare interface DeleteFileConfig {
730
+ /** Used to override HTTP request options. */
731
+ httpOptions?: HttpOptions;
732
+ }
733
+
734
+ /** Generates the parameters for the get method. */
735
+ export declare interface DeleteFileParameters {
736
+ /** The name identifier for the file to be deleted. */
737
+ name: string;
738
+ /** Used to override the default configuration. */
739
+ config?: DeleteFileConfig;
740
+ }
741
+
742
+ /** Response for the delete file method. */
743
+ export declare class DeleteFileResponse {
744
+ }
745
+
728
746
  /** Used to override the default configuration. */
729
747
  export declare interface DownloadFileConfig {
730
748
  /** Used to override HTTP request options. */
@@ -933,6 +951,20 @@ declare class Files extends BaseModule {
933
951
  * ```
934
952
  */
935
953
  get(params: types.GetFileParameters): Promise<types.File>;
954
+ /**
955
+ * Deletes a remotely stored file.
956
+ *
957
+ * @param params - The parameters for the delete request.
958
+ * @return The DeleteFileResponse, the response for the delete method.
959
+ *
960
+ * @example
961
+ * The following code deletes an example file named "files/mehozpxf877d".
962
+ *
963
+ * ```ts
964
+ * await ai.files.delete({name: file.name});
965
+ * ```
966
+ */
967
+ delete(params: types.DeleteFileParameters): Promise<types.DeleteFileResponse>;
936
968
  }
937
969
 
938
970
  export declare enum FileSource {
@@ -1386,7 +1418,8 @@ export declare interface GenerateImagesConfig {
1386
1418
  /** Allows generation of people by the model.
1387
1419
  */
1388
1420
  personGeneration?: PersonGeneration;
1389
- /** Whether to report the safety scores of each image in the response.
1421
+ /** Whether to report the safety scores of each generated image and
1422
+ the positive prompt in the response.
1390
1423
  */
1391
1424
  includeSafetyAttributes?: boolean;
1392
1425
  /** Whether to include the Responsible AI filter reason if the image
@@ -1429,6 +1462,10 @@ export declare class GenerateImagesResponse {
1429
1462
  /** List of generated images.
1430
1463
  */
1431
1464
  generatedImages?: GeneratedImage[];
1465
+ /** Safety attributes of the positive prompt. Only populated if
1466
+ ``include_safety_attributes`` is set to True.
1467
+ */
1468
+ positivePromptSafetyAttributes?: SafetyAttributes;
1432
1469
  }
1433
1470
 
1434
1471
  /** Generation config. */
@@ -2320,6 +2357,28 @@ export declare class Models extends BaseModule {
2320
2357
  * ```
2321
2358
  */
2322
2359
  generateContentStream: (params: types.GenerateContentParameters) => Promise<AsyncGenerator<types.GenerateContentResponse>>;
2360
+ /**
2361
+ * Generates an image based on a text description and configuration.
2362
+ *
2363
+ * @param model - The model to use.
2364
+ * @param prompt - A text description of the image to generate.
2365
+ * @param [config] - The config for image generation.
2366
+ * @return The response from the API.
2367
+ *
2368
+ * @example
2369
+ * ```ts
2370
+ * const response = await client.models.generateImages({
2371
+ * model: 'imagen-3.0-generate-002',
2372
+ * prompt: 'Robot holding a red skateboard',
2373
+ * config: {
2374
+ * numberOfImages: 1,
2375
+ * includeRaiReason: true,
2376
+ * },
2377
+ * });
2378
+ * console.log(response?.generatedImages?.[0]?.image?.imageBytes);
2379
+ * ```
2380
+ */
2381
+ generateImages: (params: types.GenerateImagesParameters) => Promise<types.GenerateImagesResponse>;
2323
2382
  private generateContentInternal;
2324
2383
  private generateContentStreamInternal;
2325
2384
  /**
@@ -2363,7 +2422,7 @@ export declare class Models extends BaseModule {
2363
2422
  * console.log(response?.generatedImages?.[0]?.image?.imageBytes);
2364
2423
  * ```
2365
2424
  */
2366
- generateImages(params: types.GenerateImagesParameters): Promise<types.GenerateImagesResponse>;
2425
+ private generateImagesInternal;
2367
2426
  /**
2368
2427
  * Counts the number of tokens in the given contents. Multimodal input is
2369
2428
  * supported for Gemini models.
@@ -2652,6 +2711,9 @@ export declare interface SafetyAttributes {
2652
2711
  /** List of scores of each categories.
2653
2712
  */
2654
2713
  scores?: number[];
2714
+ /** Internal use only.
2715
+ */
2716
+ contentType?: string;
2655
2717
  }
2656
2718
 
2657
2719
  export declare enum SafetyFilterLevel {
@@ -2701,8 +2763,6 @@ export declare interface Schema {
2701
2763
  default?: unknown;
2702
2764
  /** Optional. Maximum length of the Type.STRING */
2703
2765
  maxLength?: string;
2704
- /** Optional. The title of the Schema. */
2705
- title?: string;
2706
2766
  /** Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING */
2707
2767
  minLength?: string;
2708
2768
  /** Optional. Minimum number of the properties for Type.OBJECT. */
@@ -2735,6 +2795,8 @@ export declare interface Schema {
2735
2795
  propertyOrdering?: string[];
2736
2796
  /** Optional. Required properties of Type.OBJECT. */
2737
2797
  required?: string[];
2798
+ /** Optional. The title of the Schema. */
2799
+ title?: string;
2738
2800
  /** Optional. The type of the data. */
2739
2801
  type?: Type;
2740
2802
  }
@@ -3000,6 +3062,8 @@ export declare interface TestTableItem {
3000
3062
  hasUnion?: boolean;
3001
3063
  /** When set to a reason string, this test will be skipped in the API mode. Use this flag for tests that can not be reproduced with the real API. E.g. a test that deletes a resource. */
3002
3064
  skipInApiMode?: string;
3065
+ /** Keys to ignore when comparing the request and response. This is useful for tests that are not deterministic. */
3066
+ ignoreKeys?: string[];
3003
3067
  }
3004
3068
 
3005
3069
  /** The thinking features configuration. */
@@ -3193,6 +3257,9 @@ declare namespace types {
3193
3257
  CreateFileResponse,
3194
3258
  GetFileConfig,
3195
3259
  GetFileParameters,
3260
+ DeleteFileConfig,
3261
+ DeleteFileParameters,
3262
+ DeleteFileResponse,
3196
3263
  TestTableItem,
3197
3264
  TestTableFile,
3198
3265
  ReplayRequest,
@@ -3332,10 +3399,12 @@ export declare interface UpscaleImageParameters {
3332
3399
  config?: UpscaleImageConfig;
3333
3400
  }
3334
3401
 
3335
- /** Retrieve from Vertex AI Search datastore for grounding. See https://cloud.google.com/products/agent-builder */
3402
+ /** Retrieve from Vertex AI Search datastore or engine for grounding. datastore and engine are mutually exclusive. See https://cloud.google.com/products/agent-builder */
3336
3403
  export declare interface VertexAISearch {
3337
- /** Required. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}` */
3404
+ /** Optional. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}` */
3338
3405
  datastore?: string;
3406
+ /** Optional. Fully-qualified Vertex AI Search engine resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` */
3407
+ engine?: string;
3339
3408
  }
3340
3409
 
3341
3410
  /** Retrieve from Vertex RAG Store for grounding. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@google/genai",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "",
5
5
  "main": "dist/node/index.js",
6
6
  "module": "dist/web/index.mjs",
@@ -35,6 +35,7 @@
35
35
  }
36
36
  },
37
37
  "scripts": {
38
+ "prepare": "npm run build-prod",
38
39
  "build": "rollup -c && api-extractor run --local --verbose && api-extractor run -c api-extractor.node.json --local --verbose&& api-extractor run -c api-extractor.web.json --local --verbose",
39
40
  "build-prod": "rollup -c && api-extractor run --verbose && api-extractor run -c api-extractor.node.json --verbose && api-extractor run -c api-extractor.web.json --verbose",
40
41
  "unit-test": "ts-node node_modules/jasmine/bin/jasmine test/unit/web/*_test.ts test/unit/node/*_test.ts test/unit/*_test.ts",