@firebase/ai 2.5.0-canary.6abe52967 → 2.5.0-canary.f06cbf99b

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.
@@ -216,6 +216,8 @@ export declare abstract class Backend {
216
216
  * @param type - The backend type.
217
217
  */
218
218
  protected constructor(type: BackendType);
219
+ /* Excluded from this release type: _getModelPath */
220
+ /* Excluded from this release type: _getTemplatePath */
219
221
  }
220
222
 
221
223
  /**
@@ -1076,6 +1078,28 @@ export declare function getImagenModel(ai: AI, modelParams: ImagenModelParams, r
1076
1078
  */
1077
1079
  export declare function getLiveGenerativeModel(ai: AI, modelParams: LiveModelParams): LiveGenerativeModel;
1078
1080
 
1081
+ /**
1082
+ * Returns a {@link TemplateGenerativeModel} class for executing server-side
1083
+ * templates.
1084
+ *
1085
+ * @param ai - An {@link AI} instance.
1086
+ * @param requestOptions - Additional options to use when making requests.
1087
+ *
1088
+ * @beta
1089
+ */
1090
+ export declare function getTemplateGenerativeModel(ai: AI, requestOptions?: RequestOptions): TemplateGenerativeModel;
1091
+
1092
+ /**
1093
+ * Returns a {@link TemplateImagenModel} class for executing server-side
1094
+ * Imagen templates.
1095
+ *
1096
+ * @param ai - An {@link AI} instance.
1097
+ * @param requestOptions - Additional options to use when making requests.
1098
+ *
1099
+ * @beta
1100
+ */
1101
+ export declare function getTemplateImagenModel(ai: AI, requestOptions?: RequestOptions): TemplateImagenModel;
1102
+
1079
1103
  /**
1080
1104
  * Configuration class for the Gemini Developer API.
1081
1105
  *
@@ -1089,6 +1113,8 @@ export declare class GoogleAIBackend extends Backend {
1089
1113
  * Creates a configuration object for the Gemini Developer API backend.
1090
1114
  */
1091
1115
  constructor();
1116
+ /* Excluded from this release type: _getModelPath */
1117
+ /* Excluded from this release type: _getTemplatePath */
1092
1118
  }
1093
1119
 
1094
1120
  /* Excluded from this release type: GoogleAICitationMetadata */
@@ -2922,6 +2948,79 @@ export declare class StringSchema extends Schema {
2922
2948
  /* Excluded from this release type: toJSON */
2923
2949
  }
2924
2950
 
2951
+ /**
2952
+ * {@link GenerativeModel} APIs that execute on a server-side template.
2953
+ *
2954
+ * This class should only be instantiated with {@link getTemplateGenerativeModel}.
2955
+ *
2956
+ * @beta
2957
+ */
2958
+ export declare class TemplateGenerativeModel {
2959
+ /* Excluded from this release type: _apiSettings */
2960
+ /**
2961
+ * Additional options to use when making requests.
2962
+ */
2963
+ requestOptions?: RequestOptions;
2964
+ /**
2965
+ * @hideconstructor
2966
+ */
2967
+ constructor(ai: AI, requestOptions?: RequestOptions);
2968
+ /**
2969
+ * Makes a single non-streaming call to the model and returns an object
2970
+ * containing a single {@link GenerateContentResponse}.
2971
+ *
2972
+ * @param templateId - The ID of the server-side template to execute.
2973
+ * @param templateVariables - A key-value map of variables to populate the
2974
+ * template with.
2975
+ *
2976
+ * @beta
2977
+ */
2978
+ generateContent(templateId: string, templateVariables: object): Promise<GenerateContentResult>;
2979
+ /**
2980
+ * Makes a single streaming call to the model and returns an object
2981
+ * containing an iterable stream that iterates over all chunks in the
2982
+ * streaming response as well as a promise that returns the final aggregated
2983
+ * response.
2984
+ *
2985
+ * @param templateId - The ID of the server-side template to execute.
2986
+ * @param templateVariables - A key-value map of variables to populate the
2987
+ * template with.
2988
+ *
2989
+ * @beta
2990
+ */
2991
+ generateContentStream(templateId: string, templateVariables: object): Promise<GenerateContentStreamResult>;
2992
+ }
2993
+
2994
+ /**
2995
+ * Class for Imagen model APIs that execute on a server-side template.
2996
+ *
2997
+ * This class should only be instantiated with {@link getTemplateImagenModel}.
2998
+ *
2999
+ * @beta
3000
+ */
3001
+ export declare class TemplateImagenModel {
3002
+ /* Excluded from this release type: _apiSettings */
3003
+ /**
3004
+ * Additional options to use when making requests.
3005
+ */
3006
+ requestOptions?: RequestOptions;
3007
+ /**
3008
+ * @hideconstructor
3009
+ */
3010
+ constructor(ai: AI, requestOptions?: RequestOptions);
3011
+ /**
3012
+ * Makes a single call to the model and returns an object containing a single
3013
+ * {@link ImagenGenerationResponse}.
3014
+ *
3015
+ * @param templateId - The ID of the server-side template to execute.
3016
+ * @param templateVariables - A key-value map of variables to populate the
3017
+ * template with.
3018
+ *
3019
+ * @beta
3020
+ */
3021
+ generateImages(templateId: string, templateVariables: object): Promise<ImagenGenerationResponse<ImagenInlineImage>>;
3022
+ }
3023
+
2925
3024
  /**
2926
3025
  * Content part interface if the part represents a text string.
2927
3026
  * @public
@@ -3162,6 +3261,8 @@ export declare class VertexAIBackend extends Backend {
3162
3261
  * for a list of supported locations.
3163
3262
  */
3164
3263
  constructor(location?: string);
3264
+ /* Excluded from this release type: _getModelPath */
3265
+ /* Excluded from this release type: _getTemplatePath */
3165
3266
  }
3166
3267
 
3167
3268
  /**
package/dist/ai.d.ts CHANGED
@@ -256,6 +256,14 @@ export declare abstract class Backend {
256
256
  * @param type - The backend type.
257
257
  */
258
258
  protected constructor(type: BackendType);
259
+ /**
260
+ * @internal
261
+ */
262
+ abstract _getModelPath(project: string, model: string): string;
263
+ /**
264
+ * @internal
265
+ */
266
+ abstract _getTemplatePath(project: string, templateId: string): string;
259
267
  }
260
268
 
261
269
  /**
@@ -1137,6 +1145,28 @@ export declare function getImagenModel(ai: AI, modelParams: ImagenModelParams, r
1137
1145
  */
1138
1146
  export declare function getLiveGenerativeModel(ai: AI, modelParams: LiveModelParams): LiveGenerativeModel;
1139
1147
 
1148
+ /**
1149
+ * Returns a {@link TemplateGenerativeModel} class for executing server-side
1150
+ * templates.
1151
+ *
1152
+ * @param ai - An {@link AI} instance.
1153
+ * @param requestOptions - Additional options to use when making requests.
1154
+ *
1155
+ * @beta
1156
+ */
1157
+ export declare function getTemplateGenerativeModel(ai: AI, requestOptions?: RequestOptions): TemplateGenerativeModel;
1158
+
1159
+ /**
1160
+ * Returns a {@link TemplateImagenModel} class for executing server-side
1161
+ * Imagen templates.
1162
+ *
1163
+ * @param ai - An {@link AI} instance.
1164
+ * @param requestOptions - Additional options to use when making requests.
1165
+ *
1166
+ * @beta
1167
+ */
1168
+ export declare function getTemplateImagenModel(ai: AI, requestOptions?: RequestOptions): TemplateImagenModel;
1169
+
1140
1170
  /**
1141
1171
  * Configuration class for the Gemini Developer API.
1142
1172
  *
@@ -1150,6 +1180,14 @@ export declare class GoogleAIBackend extends Backend {
1150
1180
  * Creates a configuration object for the Gemini Developer API backend.
1151
1181
  */
1152
1182
  constructor();
1183
+ /**
1184
+ * @internal
1185
+ */
1186
+ _getModelPath(project: string, model: string): string;
1187
+ /**
1188
+ * @internal
1189
+ */
1190
+ _getTemplatePath(project: string, templateId: string): string;
1153
1191
  }
1154
1192
 
1155
1193
  /**
@@ -3064,6 +3102,85 @@ export declare class StringSchema extends Schema {
3064
3102
  toJSON(): SchemaRequest;
3065
3103
  }
3066
3104
 
3105
+ /**
3106
+ * {@link GenerativeModel} APIs that execute on a server-side template.
3107
+ *
3108
+ * This class should only be instantiated with {@link getTemplateGenerativeModel}.
3109
+ *
3110
+ * @beta
3111
+ */
3112
+ export declare class TemplateGenerativeModel {
3113
+ /**
3114
+ * @internal
3115
+ */
3116
+ _apiSettings: ApiSettings;
3117
+ /**
3118
+ * Additional options to use when making requests.
3119
+ */
3120
+ requestOptions?: RequestOptions;
3121
+ /**
3122
+ * @hideconstructor
3123
+ */
3124
+ constructor(ai: AI, requestOptions?: RequestOptions);
3125
+ /**
3126
+ * Makes a single non-streaming call to the model and returns an object
3127
+ * containing a single {@link GenerateContentResponse}.
3128
+ *
3129
+ * @param templateId - The ID of the server-side template to execute.
3130
+ * @param templateVariables - A key-value map of variables to populate the
3131
+ * template with.
3132
+ *
3133
+ * @beta
3134
+ */
3135
+ generateContent(templateId: string, templateVariables: object): Promise<GenerateContentResult>;
3136
+ /**
3137
+ * Makes a single streaming call to the model and returns an object
3138
+ * containing an iterable stream that iterates over all chunks in the
3139
+ * streaming response as well as a promise that returns the final aggregated
3140
+ * response.
3141
+ *
3142
+ * @param templateId - The ID of the server-side template to execute.
3143
+ * @param templateVariables - A key-value map of variables to populate the
3144
+ * template with.
3145
+ *
3146
+ * @beta
3147
+ */
3148
+ generateContentStream(templateId: string, templateVariables: object): Promise<GenerateContentStreamResult>;
3149
+ }
3150
+
3151
+ /**
3152
+ * Class for Imagen model APIs that execute on a server-side template.
3153
+ *
3154
+ * This class should only be instantiated with {@link getTemplateImagenModel}.
3155
+ *
3156
+ * @beta
3157
+ */
3158
+ export declare class TemplateImagenModel {
3159
+ /**
3160
+ * @internal
3161
+ */
3162
+ _apiSettings: ApiSettings;
3163
+ /**
3164
+ * Additional options to use when making requests.
3165
+ */
3166
+ requestOptions?: RequestOptions;
3167
+ /**
3168
+ * @hideconstructor
3169
+ */
3170
+ constructor(ai: AI, requestOptions?: RequestOptions);
3171
+ /**
3172
+ * Makes a single call to the model and returns an object containing a single
3173
+ * {@link ImagenGenerationResponse}.
3174
+ *
3175
+ * @param templateId - The ID of the server-side template to execute.
3176
+ * @param templateVariables - A key-value map of variables to populate the
3177
+ * template with.
3178
+ *
3179
+ * @beta
3180
+ */
3181
+ generateImages(templateId: string, templateVariables: object): Promise<ImagenGenerationResponse<ImagenInlineImage>>;
3182
+ }
3183
+
3067
3184
  /**
3068
3185
  * Content part interface if the part represents a text string.
3069
3186
  * @public
@@ -3307,6 +3424,14 @@ export declare class VertexAIBackend extends Backend {
3307
3424
  * for a list of supported locations.
3308
3425
  */
3309
3426
  constructor(location?: string);
3427
+ /**
3428
+ * @internal
3429
+ */
3430
+ _getModelPath(project: string, model: string): string;
3431
+ /**
3432
+ * @internal
3433
+ */
3434
+ _getTemplatePath(project: string, templateId: string): string;
3310
3435
  }
3311
3436
 
3312
3437
  /**