@google/genai 0.3.1 → 0.4.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/README.md CHANGED
@@ -157,7 +157,7 @@ The submodules bundle together related API methods:
157
157
  ## Samples
158
158
 
159
159
  More samples can be found in the
160
- [github samples directory](https://github.com/google-gemini/generative-ai-js/tree/main/samples).
160
+ [github samples directory](https://github.com/google-gemini/generative-ai-js/tree/main/sdk-samples).
161
161
 
162
162
 
163
163
  ### Streaming
package/dist/genai.d.ts CHANGED
@@ -704,11 +704,6 @@ export declare function createPartFromText(text: string): Part;
704
704
  */
705
705
  export declare function createPartFromUri(uri: string, mimeType: string): Part;
706
706
 
707
- /**
708
- * Creates a `Part` object from the `startOffset` and `endOffset` of a `VideoMetadata` object.
709
- */
710
- export declare function createPartFromVideoMetadata(startOffset: string, endOffset: string): Part;
711
-
712
707
  /**
713
708
  * Creates a `Content` object with a user role from a `PartListUnion` object or `string`.
714
709
  */
@@ -1341,6 +1336,10 @@ export declare interface GeneratedImage {
1341
1336
  response.
1342
1337
  */
1343
1338
  raiFilteredReason?: string;
1339
+ /** Safety attributes of the image. Lists of RAI categories and their
1340
+ scores of each content.
1341
+ */
1342
+ safetyAttributes?: SafetyAttributes;
1344
1343
  /** The rewritten prompt used for the image generation if the prompt
1345
1344
  enhancer is enabled.
1346
1345
  */
@@ -2596,6 +2595,16 @@ export declare interface RetrievalMetadata {
2596
2595
  googleSearchDynamicRetrievalScore?: number;
2597
2596
  }
2598
2597
 
2598
+ /** Safety attributes of a GeneratedImage or the user-provided prompt. */
2599
+ export declare interface SafetyAttributes {
2600
+ /** List of RAI categories.
2601
+ */
2602
+ categories?: string[];
2603
+ /** List of scores of each categories.
2604
+ */
2605
+ scores?: number[];
2606
+ }
2607
+
2599
2608
  export declare enum SafetyFilterLevel {
2600
2609
  BLOCK_LOW_AND_ABOVE = "BLOCK_LOW_AND_ABOVE",
2601
2610
  BLOCK_MEDIUM_AND_ABOVE = "BLOCK_MEDIUM_AND_ABOVE",
@@ -2639,12 +2648,8 @@ export declare interface Schema {
2639
2648
  example?: unknown;
2640
2649
  /** Optional. Pattern of the Type.STRING to restrict a string to a regular expression. */
2641
2650
  pattern?: string;
2642
- /** Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER */
2643
- minimum?: number;
2644
2651
  /** Optional. Default value of the data. */
2645
2652
  default?: unknown;
2646
- /** Optional. The value should be validated against any (one or more) of the subschemas in the list. */
2647
- anyOf?: Schema[];
2648
2653
  /** Optional. Maximum length of the Type.STRING */
2649
2654
  maxLength?: string;
2650
2655
  /** Optional. The title of the Schema. */
@@ -2653,10 +2658,10 @@ export declare interface Schema {
2653
2658
  minLength?: string;
2654
2659
  /** Optional. Minimum number of the properties for Type.OBJECT. */
2655
2660
  minProperties?: string;
2656
- /** Optional. Maximum value of the Type.INTEGER and Type.NUMBER */
2657
- maximum?: number;
2658
2661
  /** Optional. Maximum number of the properties for Type.OBJECT. */
2659
2662
  maxProperties?: string;
2663
+ /** Optional. The value should be validated against any (one or more) of the subschemas in the list. */
2664
+ anyOf?: Schema[];
2660
2665
  /** Optional. The description of the data. */
2661
2666
  description?: string;
2662
2667
  /** Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:["101", "201", "301"]} */
@@ -2667,8 +2672,12 @@ export declare interface Schema {
2667
2672
  items?: Schema;
2668
2673
  /** Optional. Maximum number of the elements for Type.ARRAY. */
2669
2674
  maxItems?: string;
2675
+ /** Optional. Maximum value of the Type.INTEGER and Type.NUMBER */
2676
+ maximum?: number;
2670
2677
  /** Optional. Minimum number of the elements for Type.ARRAY. */
2671
2678
  minItems?: string;
2679
+ /** Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER */
2680
+ minimum?: number;
2672
2681
  /** Optional. Indicates if the value may be null. */
2673
2682
  nullable?: boolean;
2674
2683
  /** Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT. */
@@ -3035,7 +3044,6 @@ declare namespace types {
3035
3044
  createPartFromFunctionCall,
3036
3045
  createPartFromFunctionResponse,
3037
3046
  createPartFromBase64,
3038
- createPartFromVideoMetadata,
3039
3047
  createPartFromCodeExecutionResult,
3040
3048
  createPartFromExecutableCode,
3041
3049
  createUserContent,
@@ -3125,6 +3133,7 @@ declare namespace types {
3125
3133
  GenerateImagesConfig,
3126
3134
  GenerateImagesParameters,
3127
3135
  Image_2 as Image,
3136
+ SafetyAttributes,
3128
3137
  GeneratedImage,
3129
3138
  GenerateImagesResponse,
3130
3139
  GenerationConfig,