@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.
@@ -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. */
@@ -2327,6 +2364,28 @@ export declare class Models extends BaseModule {
2327
2364
  * ```
2328
2365
  */
2329
2366
  generateContentStream: (params: types.GenerateContentParameters) => Promise<AsyncGenerator<types.GenerateContentResponse>>;
2367
+ /**
2368
+ * Generates an image based on a text description and configuration.
2369
+ *
2370
+ * @param model - The model to use.
2371
+ * @param prompt - A text description of the image to generate.
2372
+ * @param [config] - The config for image generation.
2373
+ * @return The response from the API.
2374
+ *
2375
+ * @example
2376
+ * ```ts
2377
+ * const response = await client.models.generateImages({
2378
+ * model: 'imagen-3.0-generate-002',
2379
+ * prompt: 'Robot holding a red skateboard',
2380
+ * config: {
2381
+ * numberOfImages: 1,
2382
+ * includeRaiReason: true,
2383
+ * },
2384
+ * });
2385
+ * console.log(response?.generatedImages?.[0]?.image?.imageBytes);
2386
+ * ```
2387
+ */
2388
+ generateImages: (params: types.GenerateImagesParameters) => Promise<types.GenerateImagesResponse>;
2330
2389
  private generateContentInternal;
2331
2390
  private generateContentStreamInternal;
2332
2391
  /**
@@ -2370,7 +2429,7 @@ export declare class Models extends BaseModule {
2370
2429
  * console.log(response?.generatedImages?.[0]?.image?.imageBytes);
2371
2430
  * ```
2372
2431
  */
2373
- generateImages(params: types.GenerateImagesParameters): Promise<types.GenerateImagesResponse>;
2432
+ private generateImagesInternal;
2374
2433
  /**
2375
2434
  * Counts the number of tokens in the given contents. Multimodal input is
2376
2435
  * supported for Gemini models.
@@ -2659,6 +2718,9 @@ export declare interface SafetyAttributes {
2659
2718
  /** List of scores of each categories.
2660
2719
  */
2661
2720
  scores?: number[];
2721
+ /** Internal use only.
2722
+ */
2723
+ contentType?: string;
2662
2724
  }
2663
2725
 
2664
2726
  export declare enum SafetyFilterLevel {
@@ -2708,8 +2770,6 @@ export declare interface Schema {
2708
2770
  default?: unknown;
2709
2771
  /** Optional. Maximum length of the Type.STRING */
2710
2772
  maxLength?: string;
2711
- /** Optional. The title of the Schema. */
2712
- title?: string;
2713
2773
  /** Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING */
2714
2774
  minLength?: string;
2715
2775
  /** Optional. Minimum number of the properties for Type.OBJECT. */
@@ -2742,6 +2802,8 @@ export declare interface Schema {
2742
2802
  propertyOrdering?: string[];
2743
2803
  /** Optional. Required properties of Type.OBJECT. */
2744
2804
  required?: string[];
2805
+ /** Optional. The title of the Schema. */
2806
+ title?: string;
2745
2807
  /** Optional. The type of the data. */
2746
2808
  type?: Type;
2747
2809
  }
@@ -3007,6 +3069,8 @@ export declare interface TestTableItem {
3007
3069
  hasUnion?: boolean;
3008
3070
  /** 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. */
3009
3071
  skipInApiMode?: string;
3072
+ /** Keys to ignore when comparing the request and response. This is useful for tests that are not deterministic. */
3073
+ ignoreKeys?: string[];
3010
3074
  }
3011
3075
 
3012
3076
  /** The thinking features configuration. */
@@ -3200,6 +3264,9 @@ declare namespace types {
3200
3264
  CreateFileResponse,
3201
3265
  GetFileConfig,
3202
3266
  GetFileParameters,
3267
+ DeleteFileConfig,
3268
+ DeleteFileParameters,
3269
+ DeleteFileResponse,
3203
3270
  TestTableItem,
3204
3271
  TestTableFile,
3205
3272
  ReplayRequest,
@@ -3339,10 +3406,12 @@ export declare interface UpscaleImageParameters {
3339
3406
  config?: UpscaleImageConfig;
3340
3407
  }
3341
3408
 
3342
- /** Retrieve from Vertex AI Search datastore for grounding. See https://cloud.google.com/products/agent-builder */
3409
+ /** Retrieve from Vertex AI Search datastore or engine for grounding. datastore and engine are mutually exclusive. See https://cloud.google.com/products/agent-builder */
3343
3410
  export declare interface VertexAISearch {
3344
- /** Required. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}` */
3411
+ /** Optional. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}` */
3345
3412
  datastore?: string;
3413
+ /** Optional. Fully-qualified Vertex AI Search engine resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` */
3414
+ engine?: string;
3346
3415
  }
3347
3416
 
3348
3417
  /** Retrieve from Vertex RAG Store for grounding. */