Skip to content
This repository was archived by the owner on Mar 6, 2024. It is now read-only.

Commit 8a97be3

Browse files
committed
don't track token costs
1 parent d02b092 commit 8a97be3

File tree

2 files changed

+19
-39
lines changed

2 files changed

+19
-39
lines changed

dist/index.js

Lines changed: 19 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bot.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import './fetch-polyfill.js'
22
import {Options} from './options.js'
3-
import * as tokenizer from './tokenizer.js'
43
import * as core from '@actions/core'
54
import {
65
ChatGPTAPI,
@@ -50,16 +49,13 @@ export class Bot {
5049
}
5150

5251
chat = async (message: string, ids: Ids): Promise<[string, Ids]> => {
53-
const tokens = tokenizer.get_token_count(message)
54-
console.time(`chatgpt ${tokens} tokens cost`)
5552
let new_ids: Ids = {}
5653
let response = ''
5754
try {
5855
;[response, new_ids] = await this.chat_(message, ids)
5956
} catch (e: any) {
6057
core.warning(`Failed to chat: ${e}, backtrace: ${e.stack}`)
6158
} finally {
62-
console.timeEnd(`chatgpt ${tokens} tokens cost`)
6359
return [response, new_ids]
6460
}
6561
}

0 commit comments

Comments
 (0)