From e798c29c4e5d1b78762623f0b9178ec78b2ab1bf Mon Sep 17 00:00:00 2001 From: Yoojin Ko Date: Wed, 6 Dec 2023 12:21:44 +0900 Subject: [PATCH] fix: deprecated calculate cost --- src/controllers/serviceController.ts | 3 ++- src/service.ts | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/controllers/serviceController.ts b/src/controllers/serviceController.ts index fc735ab..1c97646 100644 --- a/src/controllers/serviceController.ts +++ b/src/controllers/serviceController.ts @@ -29,7 +29,8 @@ export default class ServiceController { return await 'information of service'; } - async calculateCost(serviceName: string, requestData: string): Promise { + // FIXME(yoojin): Temporary deprecated. Need new pricing rules. + private async calculateCost(serviceName: string, requestData: string): Promise { const billingConfig = await this.ain.getValue(Path.app(serviceName).billingConfig()); const token = requestData.split(' ').length; let cost = token * billingConfig.costPerToken; diff --git a/src/service.ts b/src/service.ts index 216fae7..1c86ecf 100644 --- a/src/service.ts +++ b/src/service.ts @@ -30,7 +30,9 @@ export default class Service { * @returns {number} Estimated cost. */ async calculateCost (requestData: string) { - return await this.serviceController.calculateCost(this.serviceName, requestData); + // FIXME(yoojin): Temporary deprecated. Need new pricing rules. + // return await this.serviceController.calculateCost(this.serviceName, requestData); + return 0; } /**