mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-01 03:48:24 +00:00
Add whisper and tts ui (#484)
Co-authored-by: heheer <71265218+newfish-cmyk@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { BillSourceEnum } from '@fastgpt/global/support/wallet/bill/constants';
|
||||
import { BillSourceEnum, PRICE_SCALE } from '@fastgpt/global/support/wallet/bill/constants';
|
||||
import { getAudioSpeechModel, getQAModel } from '@/service/core/ai/model';
|
||||
import type { ChatHistoryItemResType } from '@fastgpt/global/core/chat/api.d';
|
||||
import { formatPrice } from '@fastgpt/global/support/wallet/bill/tools';
|
||||
@@ -205,3 +205,37 @@ export function pushAudioSpeechBill({
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
export function pushWhisperBill({
|
||||
teamId,
|
||||
tmbId,
|
||||
duration
|
||||
}: {
|
||||
teamId: string;
|
||||
tmbId: string;
|
||||
duration: number;
|
||||
}) {
|
||||
const modelData = global.whisperModel;
|
||||
|
||||
if (!modelData) return;
|
||||
|
||||
const total = ((modelData.price * duration) / 60) * PRICE_SCALE;
|
||||
|
||||
const name = 'wallet.bill.Whisper';
|
||||
|
||||
createBill({
|
||||
teamId,
|
||||
tmbId,
|
||||
appName: name,
|
||||
total,
|
||||
source: BillSourceEnum.fastgpt,
|
||||
list: [
|
||||
{
|
||||
moduleName: name,
|
||||
amount: total,
|
||||
model: modelData.name,
|
||||
tokenLen: duration
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user