Description

This method creates an ML engine based on one of the available ML handlers.

Syntax

Here is the syntax:

db.ml_engines.insertOne(
    {
        "name": "ml_engine_name",
        "handler": "handler_name",
        "params": {
            "key": "value"
            }
    }
)

On execution, we get:

{
  acknowledged: true,
  insertedId: ObjectId("6465e96766d152ae1e247802")
}

Example

Let’s create an OpenAI engine that uses the OpenAI handler.

db.ml_engines.insertOne(
    {
        "name": "openai_engine",
        "handler": "openai",
        "params": {
            "api_key": "qqq"
            }
    }
)

On execution, we get:

{
  acknowledged: true,
  insertedId: ObjectId("6465e9d566d152ae1e247803")
}