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:
Archer
2023-12-04 21:37:07 +08:00
committed by GitHub
parent c3ae38df8b
commit 62e87551ac
141 changed files with 961 additions and 469 deletions

View File

@@ -1,4 +1,3 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import type { NextApiRequest, NextApiResponse } from 'next';
import { jsonRes } from '@fastgpt/service/common/response';
import { connectToDatabase } from '@/service/mongo';

View File

@@ -1,4 +1,3 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import type { NextApiRequest, NextApiResponse } from 'next';
import { jsonRes } from '@fastgpt/service/common/response';
import { connectToDatabase } from '@/service/mongo';

View File

@@ -1,11 +1,11 @@
import type { NextApiRequest, NextApiResponse } from 'next';
import { jsonRes } from '@fastgpt/service/common/response';
import { connectToDatabase } from '@/service/mongo';
import { MongoBill } from '@fastgpt/service/support/wallet/bill/schema';
import { authCert } from '@fastgpt/service/support/permission/auth/common';
import { BillSourceEnum } from '@fastgpt/global/support/wallet/bill/constants';
import { CreateTrainingBillProps } from '@fastgpt/global/support/wallet/bill/api.d';
import { getQAModel, getVectorModel } from '@/service/core/ai/model';
import { createTrainingBill } from '@fastgpt/service/support/wallet/bill/controller';
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
try {
@@ -17,30 +17,17 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const vectorModelData = getVectorModel(vectorModel);
const agentModelData = getQAModel(agentModel);
const { _id } = await MongoBill.create({
const { billId } = await createTrainingBill({
teamId,
tmbId,
appName: name,
source: BillSourceEnum.training,
list: [
{
moduleName: 'wallet.moduleName.index',
model: vectorModelData.name,
amount: 0,
tokenLen: 0
},
{
moduleName: 'wallet.moduleName.qa',
model: agentModelData.name,
amount: 0,
tokenLen: 0
}
],
total: 0
billSource: BillSourceEnum.training,
vectorModel: vectorModelData.name,
agentModel: agentModelData.name
});
jsonRes<string>(res, {
data: _id
data: billId
});
} catch (err) {
jsonRes(res, {