Skip to content

Commit

Permalink
Merge pull request #50 from ainize-team/feat/woojae/modelCheck
Browse files Browse the repository at this point in the history
feat: model check
  • Loading branch information
akastercomcom authored Sep 20, 2023
2 parents ee5a97f + 9cdc4b2 commit 53c04e7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/ainize.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as NodeCache from "node-cache";
import Middleware from "./middlewares/middleware";
import { DEFAULT_BILLING_CONFIG, getBlockChainEndpoint } from "./constants";
import { DEFAULT_BILLING_CONFIG, Path, getBlockChainEndpoint } from "./constants";
import Handler from "./handlers/handler";
import AppController from "./controllers/appController";
import Model from "./model";
Expand Down Expand Up @@ -66,7 +66,12 @@ export default class Ainize {
return this.model(modelName);
}

model(modelName: string): Model {
async model(modelName: string): Promise<Model> {
const modelPath = Path.app(modelName).root();
const modelData = await this.ain.getValue(modelPath);
if(!modelData) {
throw new Error("Model not found");
}
return new Model(modelName);
}

Expand Down

0 comments on commit 53c04e7

Please sign in to comment.