diff --git a/src/controllers/serviceController.ts b/src/controllers/serviceController.ts index 64c580b..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; @@ -71,7 +72,7 @@ export default class ServiceController { return await this.ain.getValue(creditHistoryPath) as creditHistories; } - async request(serviceName: string, requestData: string) : Promise { + async request(serviceName: string, requestData: any) : Promise { this.isRunning(serviceName); const result = await new Promise(async (resolve, reject) => { const requestKey = Date.now(); diff --git a/src/service.ts b/src/service.ts index 6caae0b..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; } /** @@ -76,7 +78,7 @@ export default class Service { * @param {string} requestData String data for request to service. * @returns {string} Response data from service. */ - async request(requestData: string) { + async request(requestData: any) { this.isLoggedIn(); return await this.serviceController.request(this.serviceName, requestData); }