@firebase/ai 2.10.0-canary.ba0bc39bb → 2.10.0-canary.bfb9accdc
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/ai-public.d.ts +85 -3
- package/dist/ai.d.ts +85 -3
- package/dist/esm/index.esm.js +43 -6
- package/dist/esm/index.esm.js.map +1 -1
- package/dist/esm/src/api.d.ts +10 -2
- package/dist/esm/src/models/generative-model.d.ts +5 -0
- package/dist/esm/src/models/imagen-model.d.ts +5 -0
- package/dist/esm/src/models/template-imagen-model.d.ts +4 -1
- package/dist/esm/src/requests/imagen-image-format.d.ts +5 -0
- package/dist/esm/src/types/imagen/requests.d.ts +45 -0
- package/dist/esm/src/types/imagen/responses.d.ts +16 -0
- package/dist/index.cjs.js +43 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.node.cjs.js +43 -6
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +43 -6
- package/dist/index.node.mjs.map +1 -1
- package/dist/src/api.d.ts +10 -2
- package/dist/src/models/generative-model.d.ts +5 -0
- package/dist/src/models/imagen-model.d.ts +5 -0
- package/dist/src/models/template-imagen-model.d.ts +4 -1
- package/dist/src/requests/imagen-image-format.d.ts +5 -0
- package/dist/src/types/imagen/requests.d.ts +45 -0
- package/dist/src/types/imagen/responses.d.ts +16 -0
- package/package.json +8 -8
package/dist/esm/src/api.d.ts
CHANGED
|
@@ -76,6 +76,11 @@ export declare function getGenerativeModel(ai: AI, modelParams: ModelParams | Hy
|
|
|
76
76
|
*
|
|
77
77
|
* Only Imagen 3 models (named `imagen-3.0-*`) are supported.
|
|
78
78
|
*
|
|
79
|
+
* @deprecated All Imagen models are deprecated and will shut down as
|
|
80
|
+
* early as June 2026. As a replacement, you can
|
|
81
|
+
* {@link https://firebase.google.com/docs/ai-logic/imagen-models-migration |
|
|
82
|
+
* migrate your apps to use Gemini Image models (the "Nano Banana" models)}.
|
|
83
|
+
*
|
|
79
84
|
* @param ai - An {@link AI} instance.
|
|
80
85
|
* @param modelParams - Parameters to use when making Imagen requests.
|
|
81
86
|
* @param requestOptions - Additional options to use when making requests.
|
|
@@ -113,9 +118,12 @@ export declare function getTemplateGenerativeModel(ai: AI, requestOptions?: Requ
|
|
|
113
118
|
* Returns a {@link TemplateImagenModel} class for executing server-side
|
|
114
119
|
* Imagen templates.
|
|
115
120
|
*
|
|
121
|
+
* @deprecated All Imagen models are deprecated and will shut down as
|
|
122
|
+
* early as June 2026. As a replacement, you can
|
|
123
|
+
* {@link https://firebase.google.com/docs/ai-logic/imagen-models-migration |
|
|
124
|
+
* migrate your apps to use Gemini Image models (the "Nano Banana" models)}.
|
|
125
|
+
*
|
|
116
126
|
* @param ai - An {@link AI} instance.
|
|
117
127
|
* @param requestOptions - Additional options to use when making requests.
|
|
118
|
-
*
|
|
119
|
-
* @beta
|
|
120
128
|
*/
|
|
121
129
|
export declare function getTemplateImagenModel(ai: AI, requestOptions?: RequestOptions): TemplateImagenModel;
|
|
@@ -54,3 +54,8 @@ export declare class GenerativeModel extends AIModel {
|
|
|
54
54
|
*/
|
|
55
55
|
countTokens(request: CountTokensRequest | string | Array<string | Part>, singleRequestOptions?: SingleRequestOptions): Promise<CountTokensResponse>;
|
|
56
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Client-side validation of some common `GenerationConfig` pitfalls, in order
|
|
59
|
+
* to save the developer a wasted request.
|
|
60
|
+
*/
|
|
61
|
+
export declare function validateGenerationConfig(generationConfig: GenerationConfig): void;
|
|
@@ -37,6 +37,11 @@ import { AIModel } from './ai-model';
|
|
|
37
37
|
* }
|
|
38
38
|
* ```
|
|
39
39
|
*
|
|
40
|
+
* @deprecated All Imagen models are deprecated and will shut down as
|
|
41
|
+
* early as June 2026. As a replacement, you can
|
|
42
|
+
* {@link https://firebase.google.com/docs/ai-logic/imagen-models-migration |
|
|
43
|
+
* migrate your apps to use Gemini Image models (the "Nano Banana" models)}.
|
|
44
|
+
*
|
|
40
45
|
* @public
|
|
41
46
|
*/
|
|
42
47
|
export declare class ImagenModel extends AIModel {
|
|
@@ -22,7 +22,10 @@ import { ApiSettings } from '../types/internal';
|
|
|
22
22
|
*
|
|
23
23
|
* This class should only be instantiated with {@link getTemplateImagenModel}.
|
|
24
24
|
*
|
|
25
|
-
* @
|
|
25
|
+
* @deprecated All Imagen models are deprecated and will shut down as
|
|
26
|
+
* early as June 2026. As a replacement, you can
|
|
27
|
+
* {@link https://firebase.google.com/docs/ai-logic/imagen-models-migration |
|
|
28
|
+
* migrate your apps to use Gemini Image models (the "Nano Banana" models)}.
|
|
26
29
|
*/
|
|
27
30
|
export declare class TemplateImagenModel {
|
|
28
31
|
/**
|
|
@@ -29,6 +29,11 @@
|
|
|
29
29
|
* }
|
|
30
30
|
* ```
|
|
31
31
|
*
|
|
32
|
+
* @deprecated All Imagen models are deprecated and will shut down as
|
|
33
|
+
* early as June 2026. As a replacement, you can
|
|
34
|
+
* {@link https://firebase.google.com/docs/ai-logic/imagen-models-migration |
|
|
35
|
+
* migrate your apps to use Gemini Image models (the "Nano Banana" models)}.
|
|
36
|
+
*
|
|
32
37
|
* @public
|
|
33
38
|
*/
|
|
34
39
|
export declare class ImagenImageFormat {
|
|
@@ -18,6 +18,11 @@ import { ImagenImageFormat } from '../../requests/imagen-image-format';
|
|
|
18
18
|
/**
|
|
19
19
|
* Parameters for configuring an {@link ImagenModel}.
|
|
20
20
|
*
|
|
21
|
+
* @deprecated All Imagen models are deprecated and will shut down as
|
|
22
|
+
* early as June 2026. As a replacement, you can
|
|
23
|
+
* {@link https://firebase.google.com/docs/ai-logic/imagen-models-migration |
|
|
24
|
+
* migrate your apps to use Gemini Image models (the "Nano Banana" models)}.
|
|
25
|
+
*
|
|
21
26
|
* @public
|
|
22
27
|
*/
|
|
23
28
|
export interface ImagenModelParams {
|
|
@@ -46,6 +51,11 @@ export interface ImagenModelParams {
|
|
|
46
51
|
* See the {@link http://firebase.google.com/docs/vertex-ai/generate-images-imagen | documentation} for
|
|
47
52
|
* more details.
|
|
48
53
|
*
|
|
54
|
+
* @deprecated All Imagen models are deprecated and will shut down as
|
|
55
|
+
* early as June 2026. As a replacement, you can
|
|
56
|
+
* {@link https://firebase.google.com/docs/ai-logic/imagen-models-migration |
|
|
57
|
+
* migrate your apps to use Gemini Image models (the "Nano Banana" models)}.
|
|
58
|
+
*
|
|
49
59
|
* @public
|
|
50
60
|
*/
|
|
51
61
|
export interface ImagenGenerationConfig {
|
|
@@ -104,6 +114,11 @@ export interface ImagenGenerationConfig {
|
|
|
104
114
|
* and the {@link https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters | Responsible AI and usage guidelines}
|
|
105
115
|
* for more details.
|
|
106
116
|
*
|
|
117
|
+
* @deprecated All Imagen models are deprecated and will shut down as
|
|
118
|
+
* early as June 2026. As a replacement, you can
|
|
119
|
+
* {@link https://firebase.google.com/docs/ai-logic/imagen-models-migration |
|
|
120
|
+
* migrate your apps to use Gemini Image models (the "Nano Banana" models)}.
|
|
121
|
+
*
|
|
107
122
|
* @public
|
|
108
123
|
*/
|
|
109
124
|
export declare const ImagenSafetyFilterLevel: {
|
|
@@ -137,6 +152,11 @@ export declare const ImagenSafetyFilterLevel: {
|
|
|
137
152
|
* and the {@link https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters | Responsible AI and usage guidelines}
|
|
138
153
|
* for more details.
|
|
139
154
|
*
|
|
155
|
+
* @deprecated All Imagen models are deprecated and will shut down as
|
|
156
|
+
* early as June 2026. As a replacement, you can
|
|
157
|
+
* {@link https://firebase.google.com/docs/ai-logic/imagen-models-migration |
|
|
158
|
+
* migrate your apps to use Gemini Image models (the "Nano Banana" models)}.
|
|
159
|
+
*
|
|
140
160
|
* @public
|
|
141
161
|
*/
|
|
142
162
|
export type ImagenSafetyFilterLevel = (typeof ImagenSafetyFilterLevel)[keyof typeof ImagenSafetyFilterLevel];
|
|
@@ -146,6 +166,11 @@ export type ImagenSafetyFilterLevel = (typeof ImagenSafetyFilterLevel)[keyof typ
|
|
|
146
166
|
* See the <a href="http://firebase.google.com/docs/vertex-ai/generate-images">personGeneration</a>
|
|
147
167
|
* documentation for more details.
|
|
148
168
|
*
|
|
169
|
+
* @deprecated All Imagen models are deprecated and will shut down as
|
|
170
|
+
* early as June 2026. As a replacement, you can
|
|
171
|
+
* {@link https://firebase.google.com/docs/ai-logic/imagen-models-migration |
|
|
172
|
+
* migrate your apps to use Gemini Image models (the "Nano Banana" models)}.
|
|
173
|
+
*
|
|
149
174
|
* @public
|
|
150
175
|
*/
|
|
151
176
|
export declare const ImagenPersonFilterLevel: {
|
|
@@ -176,6 +201,11 @@ export declare const ImagenPersonFilterLevel: {
|
|
|
176
201
|
* See the <a href="http://firebase.google.com/docs/vertex-ai/generate-images">personGeneration</a>
|
|
177
202
|
* documentation for more details.
|
|
178
203
|
*
|
|
204
|
+
* @deprecated All Imagen models are deprecated and will shut down as
|
|
205
|
+
* early as June 2026. As a replacement, you can
|
|
206
|
+
* {@link https://firebase.google.com/docs/ai-logic/imagen-models-migration |
|
|
207
|
+
* migrate your apps to use Gemini Image models (the "Nano Banana" models)}.
|
|
208
|
+
*
|
|
179
209
|
* @public
|
|
180
210
|
*/
|
|
181
211
|
export type ImagenPersonFilterLevel = (typeof ImagenPersonFilterLevel)[keyof typeof ImagenPersonFilterLevel];
|
|
@@ -185,6 +215,11 @@ export type ImagenPersonFilterLevel = (typeof ImagenPersonFilterLevel)[keyof typ
|
|
|
185
215
|
* See the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation }
|
|
186
216
|
* for more details.
|
|
187
217
|
*
|
|
218
|
+
* @deprecated All Imagen models are deprecated and will shut down as
|
|
219
|
+
* early as June 2026. As a replacement, you can
|
|
220
|
+
* {@link https://firebase.google.com/docs/ai-logic/imagen-models-migration |
|
|
221
|
+
* migrate your apps to use Gemini Image models (the "Nano Banana" models)}.
|
|
222
|
+
*
|
|
188
223
|
* @public
|
|
189
224
|
*/
|
|
190
225
|
export interface ImagenSafetySettings {
|
|
@@ -207,6 +242,11 @@ export interface ImagenSafetySettings {
|
|
|
207
242
|
* See the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation }
|
|
208
243
|
* for more details and examples of the supported aspect ratios.
|
|
209
244
|
*
|
|
245
|
+
* @deprecated All Imagen models are deprecated and will shut down as
|
|
246
|
+
* early as June 2026. As a replacement, you can
|
|
247
|
+
* {@link https://firebase.google.com/docs/ai-logic/imagen-models-migration |
|
|
248
|
+
* migrate your apps to use Gemini Image models (the "Nano Banana" models)}.
|
|
249
|
+
*
|
|
210
250
|
* @public
|
|
211
251
|
*/
|
|
212
252
|
export declare const ImagenAspectRatio: {
|
|
@@ -240,6 +280,11 @@ export declare const ImagenAspectRatio: {
|
|
|
240
280
|
* See the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation }
|
|
241
281
|
* for more details and examples of the supported aspect ratios.
|
|
242
282
|
*
|
|
283
|
+
* @deprecated All Imagen models are deprecated and will shut down as
|
|
284
|
+
* early as June 2026. As a replacement, you can
|
|
285
|
+
* {@link https://firebase.google.com/docs/ai-logic/imagen-models-migration |
|
|
286
|
+
* migrate your apps to use Gemini Image models (the "Nano Banana" models)}.
|
|
287
|
+
*
|
|
243
288
|
* @public
|
|
244
289
|
*/
|
|
245
290
|
export type ImagenAspectRatio = (typeof ImagenAspectRatio)[keyof typeof ImagenAspectRatio];
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
/**
|
|
18
18
|
* An image generated by Imagen, represented as inline data.
|
|
19
19
|
*
|
|
20
|
+
* @deprecated All Imagen models are deprecated and will shut down as
|
|
21
|
+
* early as June 2026. As a replacement, you can
|
|
22
|
+
* {@link https://firebase.google.com/docs/ai-logic/imagen-models-migration |
|
|
23
|
+
* migrate your apps to use Gemini Image models (the "Nano Banana" models)}.
|
|
24
|
+
*
|
|
20
25
|
* @public
|
|
21
26
|
*/
|
|
22
27
|
export interface ImagenInlineImage {
|
|
@@ -35,6 +40,12 @@ export interface ImagenInlineImage {
|
|
|
35
40
|
* An image generated by Imagen, stored in a Cloud Storage for Firebase bucket.
|
|
36
41
|
*
|
|
37
42
|
* This feature is not available yet.
|
|
43
|
+
*
|
|
44
|
+
* @deprecated All Imagen models are deprecated and will shut down as
|
|
45
|
+
* early as June 2026. As a replacement, you can
|
|
46
|
+
* {@link https://firebase.google.com/docs/ai-logic/imagen-models-migration |
|
|
47
|
+
* migrate your apps to use Gemini Image models (the "Nano Banana" models)}.
|
|
48
|
+
*
|
|
38
49
|
* @public
|
|
39
50
|
*/
|
|
40
51
|
export interface ImagenGCSImage {
|
|
@@ -54,6 +65,11 @@ export interface ImagenGCSImage {
|
|
|
54
65
|
/**
|
|
55
66
|
* The response from a request to generate images with Imagen.
|
|
56
67
|
*
|
|
68
|
+
* @deprecated All Imagen models are deprecated and will shut down as
|
|
69
|
+
* early as June 2026. As a replacement, you can
|
|
70
|
+
* {@link https://firebase.google.com/docs/ai-logic/imagen-models-migration |
|
|
71
|
+
* migrate your apps to use Gemini Image models (the "Nano Banana" models)}.
|
|
72
|
+
*
|
|
57
73
|
* @public
|
|
58
74
|
*/
|
|
59
75
|
export interface ImagenGenerationResponse<T extends ImagenInlineImage | ImagenGCSImage> {
|
package/dist/index.cjs.js
CHANGED
|
@@ -8,7 +8,7 @@ var util = require('@firebase/util');
|
|
|
8
8
|
var logger$1 = require('@firebase/logger');
|
|
9
9
|
|
|
10
10
|
var name = "@firebase/ai";
|
|
11
|
-
var version = "2.10.0-canary.
|
|
11
|
+
var version = "2.10.0-canary.bfb9accdc";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @license
|
|
@@ -609,6 +609,11 @@ const SchemaType = {
|
|
|
609
609
|
* and the {@link https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters | Responsible AI and usage guidelines}
|
|
610
610
|
* for more details.
|
|
611
611
|
*
|
|
612
|
+
* @deprecated All Imagen models are deprecated and will shut down as
|
|
613
|
+
* early as June 2026. As a replacement, you can
|
|
614
|
+
* {@link https://firebase.google.com/docs/ai-logic/imagen-models-migration |
|
|
615
|
+
* migrate your apps to use Gemini Image models (the "Nano Banana" models)}.
|
|
616
|
+
*
|
|
612
617
|
* @public
|
|
613
618
|
*/
|
|
614
619
|
const ImagenSafetyFilterLevel = {
|
|
@@ -638,6 +643,11 @@ const ImagenSafetyFilterLevel = {
|
|
|
638
643
|
* See the <a href="http://firebase.google.com/docs/vertex-ai/generate-images">personGeneration</a>
|
|
639
644
|
* documentation for more details.
|
|
640
645
|
*
|
|
646
|
+
* @deprecated All Imagen models are deprecated and will shut down as
|
|
647
|
+
* early as June 2026. As a replacement, you can
|
|
648
|
+
* {@link https://firebase.google.com/docs/ai-logic/imagen-models-migration |
|
|
649
|
+
* migrate your apps to use Gemini Image models (the "Nano Banana" models)}.
|
|
650
|
+
*
|
|
641
651
|
* @public
|
|
642
652
|
*/
|
|
643
653
|
const ImagenPersonFilterLevel = {
|
|
@@ -671,6 +681,11 @@ const ImagenPersonFilterLevel = {
|
|
|
671
681
|
* See the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation }
|
|
672
682
|
* for more details and examples of the supported aspect ratios.
|
|
673
683
|
*
|
|
684
|
+
* @deprecated All Imagen models are deprecated and will shut down as
|
|
685
|
+
* early as June 2026. As a replacement, you can
|
|
686
|
+
* {@link https://firebase.google.com/docs/ai-logic/imagen-models-migration |
|
|
687
|
+
* migrate your apps to use Gemini Image models (the "Nano Banana" models)}.
|
|
688
|
+
*
|
|
674
689
|
* @public
|
|
675
690
|
*/
|
|
676
691
|
const ImagenAspectRatio = {
|
|
@@ -3146,8 +3161,9 @@ function validateGenerationConfig(generationConfig) {
|
|
|
3146
3161
|
}
|
|
3147
3162
|
if ((generationConfig.responseSchema != null ||
|
|
3148
3163
|
generationConfig.responseJsonSchema != null) &&
|
|
3149
|
-
generationConfig.responseMimeType) {
|
|
3150
|
-
throw new AIError(AIErrorCode.UNSUPPORTED, `responseMimeType must be set
|
|
3164
|
+
generationConfig.responseMimeType !== 'application/json') {
|
|
3165
|
+
throw new AIError(AIErrorCode.UNSUPPORTED, `responseMimeType must be set to "application/json" if` +
|
|
3166
|
+
` responseSchema or responseJsonSchema are set.`);
|
|
3151
3167
|
}
|
|
3152
3168
|
}
|
|
3153
3169
|
|
|
@@ -3579,6 +3595,11 @@ class LiveGenerativeModel extends AIModel {
|
|
|
3579
3595
|
* }
|
|
3580
3596
|
* ```
|
|
3581
3597
|
*
|
|
3598
|
+
* @deprecated All Imagen models are deprecated and will shut down as
|
|
3599
|
+
* early as June 2026. As a replacement, you can
|
|
3600
|
+
* {@link https://firebase.google.com/docs/ai-logic/imagen-models-migration |
|
|
3601
|
+
* migrate your apps to use Gemini Image models (the "Nano Banana" models)}.
|
|
3602
|
+
*
|
|
3582
3603
|
* @public
|
|
3583
3604
|
*/
|
|
3584
3605
|
class ImagenModel extends AIModel {
|
|
@@ -3910,7 +3931,10 @@ class TemplateGenerativeModel {
|
|
|
3910
3931
|
*
|
|
3911
3932
|
* This class should only be instantiated with {@link getTemplateImagenModel}.
|
|
3912
3933
|
*
|
|
3913
|
-
* @
|
|
3934
|
+
* @deprecated All Imagen models are deprecated and will shut down as
|
|
3935
|
+
* early as June 2026. As a replacement, you can
|
|
3936
|
+
* {@link https://firebase.google.com/docs/ai-logic/imagen-models-migration |
|
|
3937
|
+
* migrate your apps to use Gemini Image models (the "Nano Banana" models)}.
|
|
3914
3938
|
*/
|
|
3915
3939
|
class TemplateImagenModel {
|
|
3916
3940
|
/**
|
|
@@ -4219,6 +4243,11 @@ class AnyOfSchema extends Schema {
|
|
|
4219
4243
|
* }
|
|
4220
4244
|
* ```
|
|
4221
4245
|
*
|
|
4246
|
+
* @deprecated All Imagen models are deprecated and will shut down as
|
|
4247
|
+
* early as June 2026. As a replacement, you can
|
|
4248
|
+
* {@link https://firebase.google.com/docs/ai-logic/imagen-models-migration |
|
|
4249
|
+
* migrate your apps to use Gemini Image models (the "Nano Banana" models)}.
|
|
4250
|
+
*
|
|
4222
4251
|
* @public
|
|
4223
4252
|
*/
|
|
4224
4253
|
class ImagenImageFormat {
|
|
@@ -4719,6 +4748,11 @@ function getGenerativeModel(ai, modelParams, requestOptions) {
|
|
|
4719
4748
|
*
|
|
4720
4749
|
* Only Imagen 3 models (named `imagen-3.0-*`) are supported.
|
|
4721
4750
|
*
|
|
4751
|
+
* @deprecated All Imagen models are deprecated and will shut down as
|
|
4752
|
+
* early as June 2026. As a replacement, you can
|
|
4753
|
+
* {@link https://firebase.google.com/docs/ai-logic/imagen-models-migration |
|
|
4754
|
+
* migrate your apps to use Gemini Image models (the "Nano Banana" models)}.
|
|
4755
|
+
*
|
|
4722
4756
|
* @param ai - An {@link AI} instance.
|
|
4723
4757
|
* @param modelParams - Parameters to use when making Imagen requests.
|
|
4724
4758
|
* @param requestOptions - Additional options to use when making requests.
|
|
@@ -4769,10 +4803,13 @@ function getTemplateGenerativeModel(ai, requestOptions) {
|
|
|
4769
4803
|
* Returns a {@link TemplateImagenModel} class for executing server-side
|
|
4770
4804
|
* Imagen templates.
|
|
4771
4805
|
*
|
|
4806
|
+
* @deprecated All Imagen models are deprecated and will shut down as
|
|
4807
|
+
* early as June 2026. As a replacement, you can
|
|
4808
|
+
* {@link https://firebase.google.com/docs/ai-logic/imagen-models-migration |
|
|
4809
|
+
* migrate your apps to use Gemini Image models (the "Nano Banana" models)}.
|
|
4810
|
+
*
|
|
4772
4811
|
* @param ai - An {@link AI} instance.
|
|
4773
4812
|
* @param requestOptions - Additional options to use when making requests.
|
|
4774
|
-
*
|
|
4775
|
-
* @beta
|
|
4776
4813
|
*/
|
|
4777
4814
|
function getTemplateImagenModel(ai, requestOptions) {
|
|
4778
4815
|
return new TemplateImagenModel(ai, requestOptions);
|