@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/genai.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. */
@@ -2315,6 +2352,28 @@ export declare class Models extends BaseModule {
2315
2352
  * ```
2316
2353
  */
2317
2354
  generateContentStream: (params: types.GenerateContentParameters) => Promise<AsyncGenerator<types.GenerateContentResponse>>;
2355
+ /**
2356
+ * Generates an image based on a text description and configuration.
2357
+ *
2358
+ * @param model - The model to use.
2359
+ * @param prompt - A text description of the image to generate.
2360
+ * @param [config] - The config for image generation.
2361
+ * @return The response from the API.
2362
+ *
2363
+ * @example
2364
+ * ```ts
2365
+ * const response = await client.models.generateImages({
2366
+ * model: 'imagen-3.0-generate-002',
2367
+ * prompt: 'Robot holding a red skateboard',
2368
+ * config: {
2369
+ * numberOfImages: 1,
2370
+ * includeRaiReason: true,
2371
+ * },
2372
+ * });
2373
+ * console.log(response?.generatedImages?.[0]?.image?.imageBytes);
2374
+ * ```
2375
+ */
2376
+ generateImages: (params: types.GenerateImagesParameters) => Promise<types.GenerateImagesResponse>;
2318
2377
  private generateContentInternal;
2319
2378
  private generateContentStreamInternal;
2320
2379
  /**
@@ -2358,7 +2417,7 @@ export declare class Models extends BaseModule {
2358
2417
  * console.log(response?.generatedImages?.[0]?.image?.imageBytes);
2359
2418
  * ```
2360
2419
  */
2361
- generateImages(params: types.GenerateImagesParameters): Promise<types.GenerateImagesResponse>;
2420
+ private generateImagesInternal;
2362
2421
  /**
2363
2422
  * Counts the number of tokens in the given contents. Multimodal input is
2364
2423
  * supported for Gemini models.
@@ -2647,6 +2706,9 @@ export declare interface SafetyAttributes {
2647
2706
  /** List of scores of each categories.
2648
2707
  */
2649
2708
  scores?: number[];
2709
+ /** Internal use only.
2710
+ */
2711
+ contentType?: string;
2650
2712
  }
2651
2713
 
2652
2714
  export declare enum SafetyFilterLevel {
@@ -2696,8 +2758,6 @@ export declare interface Schema {
2696
2758
  default?: unknown;
2697
2759
  /** Optional. Maximum length of the Type.STRING */
2698
2760
  maxLength?: string;
2699
- /** Optional. The title of the Schema. */
2700
- title?: string;
2701
2761
  /** Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING */
2702
2762
  minLength?: string;
2703
2763
  /** Optional. Minimum number of the properties for Type.OBJECT. */
@@ -2730,6 +2790,8 @@ export declare interface Schema {
2730
2790
  propertyOrdering?: string[];
2731
2791
  /** Optional. Required properties of Type.OBJECT. */
2732
2792
  required?: string[];
2793
+ /** Optional. The title of the Schema. */
2794
+ title?: string;
2733
2795
  /** Optional. The type of the data. */
2734
2796
  type?: Type;
2735
2797
  }
@@ -2995,6 +3057,8 @@ export declare interface TestTableItem {
2995
3057
  hasUnion?: boolean;
2996
3058
  /** 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. */
2997
3059
  skipInApiMode?: string;
3060
+ /** Keys to ignore when comparing the request and response. This is useful for tests that are not deterministic. */
3061
+ ignoreKeys?: string[];
2998
3062
  }
2999
3063
 
3000
3064
  /** The thinking features configuration. */
@@ -3188,6 +3252,9 @@ declare namespace types {
3188
3252
  CreateFileResponse,
3189
3253
  GetFileConfig,
3190
3254
  GetFileParameters,
3255
+ DeleteFileConfig,
3256
+ DeleteFileParameters,
3257
+ DeleteFileResponse,
3191
3258
  TestTableItem,
3192
3259
  TestTableFile,
3193
3260
  ReplayRequest,
@@ -3327,10 +3394,12 @@ export declare interface UpscaleImageParameters {
3327
3394
  config?: UpscaleImageConfig;
3328
3395
  }
3329
3396
 
3330
- /** Retrieve from Vertex AI Search datastore for grounding. See https://cloud.google.com/products/agent-builder */
3397
+ /** Retrieve from Vertex AI Search datastore or engine for grounding. datastore and engine are mutually exclusive. See https://cloud.google.com/products/agent-builder */
3331
3398
  export declare interface VertexAISearch {
3332
- /** Required. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}` */
3399
+ /** Optional. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}` */
3333
3400
  datastore?: string;
3401
+ /** Optional. Fully-qualified Vertex AI Search engine resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` */
3402
+ engine?: string;
3334
3403
  }
3335
3404
 
3336
3405
  /** Retrieve from Vertex RAG Store for grounding. */