mirror of
https://github.com/vastxie/99AI.git
synced 2024-11-15 19:22:29 +08:00
修复后台不显示token计费的bug
This commit is contained in:
parent
96e7829eda
commit
ab959cb1e9
5
dist/modules/chatgpt/chatgpt.service.js
vendored
5
dist/modules/chatgpt/chatgpt.service.js
vendored
|
@ -321,9 +321,8 @@ let ChatgptService = class ChatgptService {
|
|||
onProgress: null,
|
||||
});
|
||||
}
|
||||
let prompt_tokens = response.prompt_tokens || 0;
|
||||
let completion_tokens = response.completion_tokens || 0;
|
||||
let total_tokens = response.total_tokens || 0;
|
||||
let { usage } = response === null || response === void 0 ? void 0 : response.detail;
|
||||
const { prompt_tokens = 0, completion_tokens = 0, total_tokens = 0 } = usage;
|
||||
let charge = deduct;
|
||||
if (isTokenBased === true) {
|
||||
charge = Math.ceil((deduct * total_tokens) / tokenFeeRatio);
|
||||
|
|
Loading…
Reference in New Issue
Block a user