@@ -272,11 +272,11 @@ declare namespace admin {
272
272
function messaging ( app ?: admin . app . App ) : admin . messaging . Messaging ;
273
273
274
274
/**
275
- * Gets the {@link admin.ml .MachineLearning `MachineLearning`} service for the
275
+ * Gets the {@link admin.machineLearning .MachineLearning `MachineLearning`} service for the
276
276
* default app or a given app.
277
277
*
278
278
* `admin.machineLearning()` can be called with no arguments to access the
279
- * default app's {@link admin.machineLearing .MachineLearning
279
+ * default app's {@link admin.machineLearning .MachineLearning
280
280
* `MachineLearning`} service or as `admin.machineLearning(app)` to access
281
281
* the {@link admin.machineLearning.MachineLearning `MachineLearning`}
282
282
* service associated with a specific app.
@@ -5208,52 +5208,124 @@ declare namespace admin.machineLearning {
5208
5208
* Interface representing options for listing Models.
5209
5209
*/
5210
5210
interface ListModelsOptions {
5211
+ /**
5212
+ * An expression that specifies how to filter the results.
5213
+ *
5214
+ * Examples:
5215
+ *
5216
+ * ```
5217
+ * display_name = your_model
5218
+ * display_name : experimental_*
5219
+ * tags: face_detector AND tags: experimental
5220
+ * state.published = true
5221
+ * ```
5222
+ *
5223
+ * See https://firebase.google.com/docs/ml-kit/manage-hosted-models#list_your_projects_models
5224
+ */
5211
5225
filter ?: string ;
5226
+
5227
+ /** The number of results to return in each page. */
5212
5228
pageSize ?: number ;
5229
+
5230
+ /** A token that specifies the result page to return. */
5213
5231
pageToken ?: string ;
5214
5232
}
5215
5233
5216
5234
/** Response object for a listModels operation. */
5217
5235
interface ListModelsResult {
5236
+ /** A list of models in your project. */
5218
5237
readonly models : Model [ ] ;
5238
+
5239
+ /**
5240
+ * A token you can use to retrieve the next page of results. If null, the
5241
+ * current page is the final page.
5242
+ */
5219
5243
readonly pageToken ?: string ;
5220
5244
}
5221
5245
5222
5246
/**
5223
- * A TFLite Model output object
5247
+ * A TensorFlow Lite Model output object
5224
5248
*/
5225
5249
interface TFLiteModel {
5250
+ /** The size of the model. */
5226
5251
readonly sizeBytes : number ;
5227
5252
5253
+ /** The URI from which the model was originally provided to Firebase. */
5228
5254
readonly gcsTfliteUri ?: string ;
5229
5255
}
5230
5256
5231
5257
/**
5232
5258
* A Firebase ML Model input object
5233
5259
*/
5234
5260
interface ModelOptions {
5261
+ /** A name for the model. This is the name you use from your app to load the model. */
5235
5262
displayName ?: string ;
5263
+
5264
+ /** Tags for easier model management. */
5236
5265
tags ?: string [ ] ;
5237
5266
5267
+ /**
5268
+ * An object containing the URI of the model in Cloud Storage.
5269
+ *
5270
+ * Example: `tfliteModel: { gcsTfliteUri: 'gs://your-bucket/your-model.tflite' }`
5271
+ */
5238
5272
tfliteModel ?: { gcsTfliteUri : string ; } ;
5239
5273
}
5240
5274
5241
5275
/**
5242
5276
* A Firebase ML Model output object
5243
5277
*/
5244
5278
interface Model {
5279
+ /** The ID of the model. */
5245
5280
readonly modelId : string ;
5281
+
5282
+ /** The model's name. This is the name you use from your app to load the model. */
5246
5283
readonly displayName : string ;
5284
+
5285
+ /** The model's tags. */
5247
5286
readonly tags ?: string [ ] ;
5287
+
5288
+ /** The timestamp of the model's creation. */
5248
5289
readonly createTime : string ;
5290
+
5291
+ /** The timestamp of the model's most recent update. */
5249
5292
readonly updateTime : string ;
5293
+
5294
+ /** Error message when model validation fails. */
5250
5295
readonly validationError ?: string ;
5296
+
5297
+ /** True if the model is published. */
5251
5298
readonly published : boolean ;
5299
+
5300
+ /**
5301
+ * The ETag identifier of the current version of the model. This value
5302
+ * changes whenever you update any of the model's properties.
5303
+ */
5252
5304
readonly etag : string ;
5305
+
5306
+ /**
5307
+ * The hash of the model's `tflite` file. This value changes only when
5308
+ * you upload a new TensorFlow Lite model.
5309
+ */
5253
5310
readonly modelHash ?: string ;
5311
+
5312
+ /**
5313
+ * True if the model is locked by a server-side operation. You can't make
5314
+ * changes to a locked model. See {@link waitForUnlocked `waitForUnlocked()`}.
5315
+ */
5254
5316
readonly locked : boolean ;
5317
+
5318
+ /**
5319
+ * Wait for the model to be unlocked.
5320
+ *
5321
+ * @param {number } maxTimeSeconds The maximum time in seconds to wait.
5322
+ *
5323
+ * @return {Promise<void> } A promise that resolves when the model is unlocked
5324
+ * or the maximum wait time has passed.
5325
+ */
5255
5326
waitForUnlocked ( maxTimeSeconds ?: number ) : Promise < void > ;
5256
5327
5328
+ /** Metadata about the model's TensorFlow Lite model file. */
5257
5329
readonly tfliteModel ?: TFLiteModel ;
5258
5330
}
5259
5331
@@ -5264,6 +5336,10 @@ declare namespace admin.machineLearning {
5264
5336
* [`admin.machineLearning()`](admin.machineLearning#machineLearning).
5265
5337
*/
5266
5338
interface MachineLearning {
5339
+ /**
5340
+ * The {@link admin.app.App} associated with the current `MachineLearning`
5341
+ * service instance.
5342
+ */
5267
5343
app : admin . app . App ;
5268
5344
5269
5345
/**
@@ -5278,7 +5354,7 @@ declare namespace admin.machineLearning {
5278
5354
/**
5279
5355
* Updates a model in Firebase ML.
5280
5356
*
5281
- * @param {string } modelId The id of the model to update.
5357
+ * @param {string } modelId The ID of the model to update.
5282
5358
* @param {ModelOptions } model The model fields to update.
5283
5359
*
5284
5360
* @return {Promise<Model> } A Promise fulfilled with the updated model.
@@ -5288,7 +5364,7 @@ declare namespace admin.machineLearning {
5288
5364
/**
5289
5365
* Publishes a model in Firebase ML.
5290
5366
*
5291
- * @param {string } modelId The id of the model to publish.
5367
+ * @param {string } modelId The ID of the model to publish.
5292
5368
*
5293
5369
* @return {Promise<Model> } A Promise fulfilled with the published model.
5294
5370
*/
@@ -5297,7 +5373,7 @@ declare namespace admin.machineLearning {
5297
5373
/**
5298
5374
* Unpublishes a model in Firebase ML.
5299
5375
*
5300
- * @param {string } modelId The id of the model to unpublish.
5376
+ * @param {string } modelId The ID of the model to unpublish.
5301
5377
*
5302
5378
* @return {Promise<Model> } A Promise fulfilled with the unpublished model.
5303
5379
*/
@@ -5306,9 +5382,9 @@ declare namespace admin.machineLearning {
5306
5382
/**
5307
5383
* Gets a model from Firebase ML.
5308
5384
*
5309
- * @param {string } modelId The id of the model to get.
5385
+ * @param {string } modelId The ID of the model to get.
5310
5386
*
5311
- * @return {Promise<Model> } A Promise fulfilled with the unpublished model.
5387
+ * @return {Promise<Model> } A Promise fulfilled with the model object .
5312
5388
*/
5313
5389
getModel ( modelId : string ) : Promise < Model > ;
5314
5390
@@ -5317,17 +5393,17 @@ declare namespace admin.machineLearning {
5317
5393
*
5318
5394
* @param {ListModelsOptions } options The listing options.
5319
5395
*
5320
- * @return {Promise<{models: Model[], pageToken?: string} > } A promise that
5396
+ * @return {Promise<ListModelsResult > } A promise that
5321
5397
* resolves with the current (filtered) list of models and the next page
5322
5398
* token. For the last page, an empty list of models and no page token
5323
- * are returned.
5399
+ * are returned.
5324
5400
*/
5325
5401
listModels ( options ?: ListModelsOptions ) : Promise < ListModelsResult > ;
5326
5402
5327
5403
/**
5328
5404
* Deletes a model from Firebase ML.
5329
5405
*
5330
- * @param {string } modelId The id of the model to delete.
5406
+ * @param {string } modelId The ID of the model to delete.
5331
5407
*/
5332
5408
deleteModel ( modelId : string ) : Promise < void > ;
5333
5409
}
0 commit comments