firebase-admin.machine-learning package

Firebase Machine Learning.

Functions

Function Description
getMachineLearning(app) Gets the MachineLearning service for the default app or a given app.getMachineLearning() can be called with no arguments to access the default app's MachineLearning service or as getMachineLearning(app) to access the MachineLearning service associated with a specific app.

Classes

Class Description
MachineLearning The Firebase MachineLearning service interface.
Model A Firebase ML Model output object.

Interfaces

Interface Description
GcsTfliteModelOptions
ListModelsOptions Interface representing options for listing Models.
ListModelsResult Response object for a listModels operation.
ModelOptionsBase Firebase ML Model input objects
TFLiteModel A TensorFlow Lite Model output object

Type Aliases

Type Alias Description
ModelOptions

getMachineLearning(app)

Gets the MachineLearning service for the default app or a given app.

getMachineLearning() can be called with no arguments to access the default app's MachineLearning service or as getMachineLearning(app) to access the MachineLearning service associated with a specific app.

Signature:

export declare function getMachineLearning(app?: App): MachineLearning;

Parameters

Parameter Type Description
app App Optional app whose MachineLearning service to return. If not provided, the default MachineLearning service will be returned.

Returns:

MachineLearning

The default MachineLearning service if no app is provided or the MachineLearning service associated with the provided app.

Example 1

// Get the MachineLearning service for the default app
const defaultMachineLearning = getMachineLearning();

Example 2

// Get the MachineLearning service for a given app
const otherMachineLearning = getMachineLearning(otherApp);

ModelOptions

Signature:

export type ModelOptions = ModelOptionsBase | GcsTfliteModelOptions;