mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 05:12:39 +00:00
fix: json schema parse error;fix: retraining image reset (#4757)
* i18n * fix: json schema parse error * fix: retraining image reset * update doc
This commit is contained in:
@@ -51,7 +51,7 @@ async function handler(
|
||||
if (!collection.fileId) return Promise.reject('fileId is missing');
|
||||
return {
|
||||
type: DatasetSourceReadTypeEnum.fileLocal,
|
||||
sourceId: collection.fileId
|
||||
sourceId: String(collection.fileId)
|
||||
};
|
||||
}
|
||||
if (collection.type === DatasetCollectionTypeEnum.apiFile) {
|
||||
@@ -94,6 +94,7 @@ async function handler(
|
||||
const { collectionId } = await createCollectionAndInsertData({
|
||||
dataset: collection.dataset,
|
||||
rawText,
|
||||
relatedId: collection.metadata?.relatedImgId,
|
||||
createCollectionParams: {
|
||||
...data,
|
||||
teamId: collection.teamId,
|
||||
|
@@ -95,12 +95,13 @@ async function handler(req: ApiRequestProps<SearchTestProps>): Promise<SearchTes
|
||||
});
|
||||
|
||||
// push bill
|
||||
const source = apikey ? UsageSourceEnum.api : UsageSourceEnum.fastgpt;
|
||||
const { totalPoints: embeddingTotalPoints } = pushGenerateVectorUsage({
|
||||
teamId,
|
||||
tmbId,
|
||||
inputTokens: embeddingTokens,
|
||||
model: dataset.vectorModel,
|
||||
source: apikey ? UsageSourceEnum.api : UsageSourceEnum.fastgpt,
|
||||
source,
|
||||
|
||||
...(queryExtensionResult && {
|
||||
extensionModel: queryExtensionResult.model,
|
||||
@@ -118,7 +119,8 @@ async function handler(req: ApiRequestProps<SearchTestProps>): Promise<SearchTes
|
||||
teamId,
|
||||
tmbId,
|
||||
inputTokens: reRankInputTokens,
|
||||
model: rerankModelData.model
|
||||
model: rerankModelData.model,
|
||||
source
|
||||
})
|
||||
: { totalPoints: 0 };
|
||||
|
||||
|
@@ -284,12 +284,14 @@ export const pushRerankUsage = ({
|
||||
teamId,
|
||||
tmbId,
|
||||
model,
|
||||
inputTokens
|
||||
inputTokens,
|
||||
source = UsageSourceEnum.fastgpt
|
||||
}: {
|
||||
teamId: string;
|
||||
tmbId: string;
|
||||
model: string;
|
||||
inputTokens: number;
|
||||
source?: UsageSourceEnum;
|
||||
}) => {
|
||||
const { totalPoints, modelName } = formatModelChars2Points({
|
||||
model,
|
||||
@@ -300,9 +302,9 @@ export const pushRerankUsage = ({
|
||||
createUsage({
|
||||
teamId,
|
||||
tmbId,
|
||||
appName: modelName,
|
||||
appName: i18nT('account_bill:rerank'),
|
||||
totalPoints,
|
||||
source: UsageSourceEnum.fastgpt,
|
||||
source,
|
||||
list: [
|
||||
{
|
||||
moduleName: modelName,
|
||||
|
Reference in New Issue
Block a user