mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 21:13:50 +00:00
New dpcs structure and dataset i18n (#551)
* perf: check balance * md * lock way * i18n * docs * doc * i18n * update doc * feat: one link sync * feat: one link sync * feat: one link sync * feat: one link sync * feat: one link sync * feat: one link sync * feat: one link sync
This commit is contained in:
42
packages/service/support/wallet/bill/controller.ts
Normal file
42
packages/service/support/wallet/bill/controller.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { BillSourceEnum } from '@fastgpt/global/support/wallet/bill/constants';
|
||||
import { MongoBill } from './schema';
|
||||
|
||||
export const createTrainingBill = async ({
|
||||
teamId,
|
||||
tmbId,
|
||||
appName,
|
||||
billSource,
|
||||
vectorModel,
|
||||
agentModel
|
||||
}: {
|
||||
teamId: string;
|
||||
tmbId: string;
|
||||
appName: string;
|
||||
billSource: `${BillSourceEnum}`;
|
||||
vectorModel: string;
|
||||
agentModel: string;
|
||||
}) => {
|
||||
const { _id } = await MongoBill.create({
|
||||
teamId,
|
||||
tmbId,
|
||||
appName,
|
||||
source: billSource,
|
||||
list: [
|
||||
{
|
||||
moduleName: 'wallet.moduleName.index',
|
||||
model: vectorModel,
|
||||
amount: 0,
|
||||
tokenLen: 0
|
||||
},
|
||||
{
|
||||
moduleName: 'wallet.moduleName.qa',
|
||||
model: agentModel,
|
||||
amount: 0,
|
||||
tokenLen: 0
|
||||
}
|
||||
],
|
||||
total: 0
|
||||
});
|
||||
|
||||
return { billId: String(_id) };
|
||||
};
|
Reference in New Issue
Block a user