@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 +1 -1
- package/dist/genai.d.ts +21 -12
- package/dist/index.js +101 -221
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +102 -221
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.js +101 -221
- package/dist/node/index.js.map +1 -1
- package/dist/node/node.d.ts +21 -12
- package/dist/web/index.mjs +105 -221
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +21 -12
- package/package.json +1 -1
package/dist/node/node.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
|
*/
|
|
@@ -2599,6 +2598,16 @@ export declare interface RetrievalMetadata {
|
|
|
2599
2598
|
googleSearchDynamicRetrievalScore?: number;
|
|
2600
2599
|
}
|
|
2601
2600
|
|
|
2601
|
+
/** Safety attributes of a GeneratedImage or the user-provided prompt. */
|
|
2602
|
+
export declare interface SafetyAttributes {
|
|
2603
|
+
/** List of RAI categories.
|
|
2604
|
+
*/
|
|
2605
|
+
categories?: string[];
|
|
2606
|
+
/** List of scores of each categories.
|
|
2607
|
+
*/
|
|
2608
|
+
scores?: number[];
|
|
2609
|
+
}
|
|
2610
|
+
|
|
2602
2611
|
export declare enum SafetyFilterLevel {
|
|
2603
2612
|
BLOCK_LOW_AND_ABOVE = "BLOCK_LOW_AND_ABOVE",
|
|
2604
2613
|
BLOCK_MEDIUM_AND_ABOVE = "BLOCK_MEDIUM_AND_ABOVE",
|
|
@@ -2642,12 +2651,8 @@ export declare interface Schema {
|
|
|
2642
2651
|
example?: unknown;
|
|
2643
2652
|
/** Optional. Pattern of the Type.STRING to restrict a string to a regular expression. */
|
|
2644
2653
|
pattern?: string;
|
|
2645
|
-
/** Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER */
|
|
2646
|
-
minimum?: number;
|
|
2647
2654
|
/** Optional. Default value of the data. */
|
|
2648
2655
|
default?: unknown;
|
|
2649
|
-
/** Optional. The value should be validated against any (one or more) of the subschemas in the list. */
|
|
2650
|
-
anyOf?: Schema[];
|
|
2651
2656
|
/** Optional. Maximum length of the Type.STRING */
|
|
2652
2657
|
maxLength?: string;
|
|
2653
2658
|
/** Optional. The title of the Schema. */
|
|
@@ -2656,10 +2661,10 @@ export declare interface Schema {
|
|
|
2656
2661
|
minLength?: string;
|
|
2657
2662
|
/** Optional. Minimum number of the properties for Type.OBJECT. */
|
|
2658
2663
|
minProperties?: string;
|
|
2659
|
-
/** Optional. Maximum value of the Type.INTEGER and Type.NUMBER */
|
|
2660
|
-
maximum?: number;
|
|
2661
2664
|
/** Optional. Maximum number of the properties for Type.OBJECT. */
|
|
2662
2665
|
maxProperties?: string;
|
|
2666
|
+
/** Optional. The value should be validated against any (one or more) of the subschemas in the list. */
|
|
2667
|
+
anyOf?: Schema[];
|
|
2663
2668
|
/** Optional. The description of the data. */
|
|
2664
2669
|
description?: string;
|
|
2665
2670
|
/** 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"]} */
|
|
@@ -2670,8 +2675,12 @@ export declare interface Schema {
|
|
|
2670
2675
|
items?: Schema;
|
|
2671
2676
|
/** Optional. Maximum number of the elements for Type.ARRAY. */
|
|
2672
2677
|
maxItems?: string;
|
|
2678
|
+
/** Optional. Maximum value of the Type.INTEGER and Type.NUMBER */
|
|
2679
|
+
maximum?: number;
|
|
2673
2680
|
/** Optional. Minimum number of the elements for Type.ARRAY. */
|
|
2674
2681
|
minItems?: string;
|
|
2682
|
+
/** Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER */
|
|
2683
|
+
minimum?: number;
|
|
2675
2684
|
/** Optional. Indicates if the value may be null. */
|
|
2676
2685
|
nullable?: boolean;
|
|
2677
2686
|
/** Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT. */
|
|
@@ -3038,7 +3047,6 @@ declare namespace types {
|
|
|
3038
3047
|
createPartFromFunctionCall,
|
|
3039
3048
|
createPartFromFunctionResponse,
|
|
3040
3049
|
createPartFromBase64,
|
|
3041
|
-
createPartFromVideoMetadata,
|
|
3042
3050
|
createPartFromCodeExecutionResult,
|
|
3043
3051
|
createPartFromExecutableCode,
|
|
3044
3052
|
createUserContent,
|
|
@@ -3128,6 +3136,7 @@ declare namespace types {
|
|
|
3128
3136
|
GenerateImagesConfig,
|
|
3129
3137
|
GenerateImagesParameters,
|
|
3130
3138
|
Image_2 as Image,
|
|
3139
|
+
SafetyAttributes,
|
|
3131
3140
|
GeneratedImage,
|
|
3132
3141
|
GenerateImagesResponse,
|
|
3133
3142
|
GenerationConfig,
|