Skip to content

Commit

Permalink
fix: deprecated calculate cost
Browse files Browse the repository at this point in the history
  • Loading branch information
yoojinko committed Dec 6, 2023
1 parent b5d7c60 commit e798c29
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/controllers/serviceController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export default class ServiceController {
return await 'information of service';
}

async calculateCost(serviceName: string, requestData: string): Promise<number> {
// FIXME(yoojin): Temporary deprecated. Need new pricing rules.
private async calculateCost(serviceName: string, requestData: string): Promise<number> {
const billingConfig = await this.ain.getValue(Path.app(serviceName).billingConfig());
const token = requestData.split(' ').length;
let cost = token * billingConfig.costPerToken;
Expand Down
4 changes: 3 additions & 1 deletion src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit e798c29

Please sign in to comment.