Skip to content

Commit

Permalink
Fix incorrect total usage token
Browse files Browse the repository at this point in the history
  • Loading branch information
icodesign committed Aug 30, 2024
1 parent a61078b commit f2353ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/translate/src/translator/openai/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class OpenAITranslator implements Translator {
// Update usage
this.usage.promptTokens += usage.promptTokens;
this.usage.completionTokens += usage.completionTokens;
this.usage.totalTokens = usage.totalTokens;
this.usage.totalTokens += usage.totalTokens;

if (Object.keys(translationResponse).length === 0) {
throw new Error('Failed to receive translation response object');
Expand Down

0 comments on commit f2353ab

Please sign in to comment.