diff --git a/src/ml_engines/ml_engine.ts b/src/ml_engines/ml_engine.ts index c751a52..1685d2e 100644 --- a/src/ml_engines/ml_engine.ts +++ b/src/ml_engines/ml_engine.ts @@ -1,4 +1,5 @@ import MLEngineApiClient from './ml_enginesApiClient'; +import { Readable } from 'stream'; /** * Represents a MindsDB mlEngine and all supported operations. @@ -36,13 +37,26 @@ export default class MLEngine { } /** - * Lists all mlEngines for the user. + * Creates a mlEngine with the given name, engine, and parameters. + * @param {string | Readable} [codeFilePath] - Path to the code file or Readable of to be used for the mlEngine. + * @param {string | Readable} [modulesFilePath] - Path to the modules file or Readable of to be used for the mlEngine. + * @param {string} [type] - Type of the mlEngine to be created. + * @returns {Promise} - Newly created mlEngine. + * @throws {MindsDbError} - Something went wrong creating the mlEngine. + */ + async configure(codeFilePath:string | Readable,modulesFilePath:string | Readable,type:'venv' | 'inhouse'): Promise { + await this.mlEnginesApiClient.createMLEngine(this.name,codeFilePath,modulesFilePath,type); + } + + + /* Lists all mlEngines for the user. * @returns {Promise>} - List of all mlEngines. */ async list(): Promise> { return this.mlEnginesApiClient.getAllMLEngines(); } + /** * Removes a specified mlEngine by its name. * @param {string} mlEngineName - The name of the mlEngine to remove. @@ -53,6 +67,7 @@ export default class MLEngine { await this.mlEnginesApiClient.deleteMLEngine(mlEngineName); } + /** Deletes this mlEngine. * @throws {MindsDbError} - Something went wrong deleting the mlEngine. */