Skip to content

Commit

Permalink
Merge pull request #80 from Niharika0104/Fixes-47
Browse files Browse the repository at this point in the history
Added configure function
  • Loading branch information
mpacheco12 authored Nov 26, 2024
2 parents c6c4b5a + 56adc53 commit ebf2856
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/ml_engines/ml_engine.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import MLEngineApiClient from './ml_enginesApiClient';
import { Readable } from 'stream';

/**
* Represents a MindsDB mlEngine and all supported operations.
Expand Down Expand Up @@ -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<MLEngine>} - Newly created mlEngine.
* @throws {MindsDbError} - Something went wrong creating the mlEngine.
*/
async configure(codeFilePath:string | Readable,modulesFilePath:string | Readable,type:'venv' | 'inhouse'): Promise<void> {
await this.mlEnginesApiClient.createMLEngine(this.name,codeFilePath,modulesFilePath,type);
}


/* Lists all mlEngines for the user.
* @returns {Promise<Array<MLEngine>>} - List of all mlEngines.
*/
async list(): Promise<Array<MLEngine>> {
return this.mlEnginesApiClient.getAllMLEngines();
}


/**
* Removes a specified mlEngine by its name.
* @param {string} mlEngineName - The name of the mlEngine to remove.
Expand All @@ -53,6 +67,7 @@ export default class MLEngine {
await this.mlEnginesApiClient.deleteMLEngine(mlEngineName);
}


/** Deletes this mlEngine.
* @throws {MindsDbError} - Something went wrong deleting the mlEngine.
*/
Expand Down

0 comments on commit ebf2856

Please sign in to comment.