From 860e59c94bcbe8529b48125081a0dfd93b43eafe Mon Sep 17 00:00:00 2001 From: Niharika Goulikar Date: Sat, 19 Oct 2024 09:50:12 +0000 Subject: [PATCH] Added configure function --- src/ml_engines/ml_engine.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ml_engines/ml_engine.ts b/src/ml_engines/ml_engine.ts index 4cdbfaa..dbfa2e7 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. @@ -35,6 +36,18 @@ export default class MLEngine { this.connection_data = connection_data; } + /** + * 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); + } + /** Deletes this mlEngine. * @throws {MindsDbError} - Something went wrong deleting the mlEngine. */