mirror of
https://github.com/vastxie/99AI.git
synced 2025-09-18 01:36:37 +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,
|
onProgress: null,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
let prompt_tokens = response.prompt_tokens || 0;
|
let { usage } = response === null || response === void 0 ? void 0 : response.detail;
|
||||||
let completion_tokens = response.completion_tokens || 0;
|
const { prompt_tokens = 0, completion_tokens = 0, total_tokens = 0 } = usage;
|
||||||
let total_tokens = response.total_tokens || 0;
|
|
||||||
let charge = deduct;
|
let charge = deduct;
|
||||||
if (isTokenBased === true) {
|
if (isTokenBased === true) {
|
||||||
charge = Math.ceil((deduct * total_tokens) / tokenFeeRatio);
|
charge = Math.ceil((deduct * total_tokens) / tokenFeeRatio);
|
||||||
|
Loading…
Reference in New Issue
Block a user