mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-25 06:14:06 +00:00
4.8.10 test (#2433)
* perf: node template ui * perf: select tool path load error * pay i18n * i18n * perf: oneapi code * perf: doc * node templates * perf: usage table role * feat: count vector total by datasetId * perf: user select tip and tempalte market ui * i18n * perf: sso config tip
This commit is contained in:
@@ -20,6 +20,7 @@ export const deleteDatasetDataVector = Vector.delete;
|
||||
export const recallFromVectorStore = Vector.embRecall;
|
||||
export const getVectorDataByTime = Vector.getVectorDataByTime;
|
||||
export const getVectorCountByTeamId = Vector.getVectorCountByTeamId;
|
||||
export const getVectorCountByDatasetId = Vector.getVectorCountByDatasetId;
|
||||
|
||||
export const insertDatasetDataVector = async ({
|
||||
model,
|
||||
|
@@ -297,6 +297,20 @@ export class MilvusCtrl {
|
||||
|
||||
return total;
|
||||
};
|
||||
getVectorCountByDatasetId = async (teamId: string, datasetId: string) => {
|
||||
const client = await this.getClient();
|
||||
|
||||
const result = await client.query({
|
||||
collection_name: DatasetVectorTableName,
|
||||
output_fields: ['count(*)'],
|
||||
filter: `(teamId == "${String(teamId)}") and (dataset == "${String(datasetId)}")`
|
||||
});
|
||||
|
||||
const total = result.data?.[0]?.['count(*)'] as number;
|
||||
|
||||
return total;
|
||||
};
|
||||
|
||||
getVectorDataByTime = async (start: Date, end: Date) => {
|
||||
const client = await this.getClient();
|
||||
const startTimestamp = new Date(start).getTime();
|
||||
|
@@ -205,13 +205,6 @@ export class PgVectorCtrl {
|
||||
});
|
||||
}
|
||||
};
|
||||
getVectorCountByTeamId = async (teamId: string) => {
|
||||
const total = await PgClient.count(DatasetVectorTableName, {
|
||||
where: [['team_id', String(teamId)]]
|
||||
});
|
||||
|
||||
return total;
|
||||
};
|
||||
getVectorDataByTime = async (start: Date, end: Date) => {
|
||||
const { rows } = await PgClient.query<{
|
||||
id: string;
|
||||
@@ -230,4 +223,18 @@ export class PgVectorCtrl {
|
||||
datasetId: item.dataset_id
|
||||
}));
|
||||
};
|
||||
getVectorCountByTeamId = async (teamId: string) => {
|
||||
const total = await PgClient.count(DatasetVectorTableName, {
|
||||
where: [['team_id', String(teamId)]]
|
||||
});
|
||||
|
||||
return total;
|
||||
};
|
||||
getVectorCountByDatasetId = async (teamId: string, datasetId: string) => {
|
||||
const total = await PgClient.count(DatasetVectorTableName, {
|
||||
where: [['team_id', String(teamId)], 'and', ['dataset_id', String(datasetId)]]
|
||||
});
|
||||
|
||||
return total;
|
||||
};
|
||||
}
|
||||
|
@@ -112,7 +112,7 @@ export const dispatchChatCompletion = async (props: ChatProps): Promise<ChatResp
|
||||
systemPrompt,
|
||||
stringQuoteText
|
||||
}),
|
||||
(async () => {
|
||||
(() => {
|
||||
// censor model and system key
|
||||
if (modelConstantsData.censor && !user.openaiAccount?.key) {
|
||||
return postTextCensor({
|
||||
|
@@ -469,7 +469,7 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
||||
|
||||
// start process width initInput
|
||||
const entryNodes = runtimeNodes.filter((item) => item.isEntry);
|
||||
console.log(runtimeEdges);
|
||||
|
||||
// reset entry
|
||||
// runtimeNodes.forEach((item) => {
|
||||
// item.isEntry = false;
|
||||
|
Reference in New Issue
Block a user