mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
Collection tag (#2266)
* feat: collection metadata filter (#2211) * feat: add dataset collection tags (#2231) * dataset page * workflow page * move * fix * add plus filter * fix * fix * fix * perf: collection tag code * fix: collection tags (#2249) * fix * fix * fix tags of dataset page * fix tags of workflow page * doc * add comments * fix: collection tags (#2264) * fix: metadata filter * feat: search filter --------- Co-authored-by: heheer <1239331448@qq.com> Co-authored-by: heheer <heheer@sealos.io>
This commit is contained in:
17
packages/global/core/dataset/api.d.ts
vendored
17
packages/global/core/dataset/api.d.ts
vendored
@@ -74,6 +74,23 @@ export type ExternalFileCreateDatasetCollectionParams = ApiCreateDatasetCollecti
|
||||
filename?: string;
|
||||
};
|
||||
|
||||
/* ================= tag ===================== */
|
||||
export type CreateDatasetCollectionTagParams = {
|
||||
datasetId: string;
|
||||
tag: string;
|
||||
};
|
||||
export type AddTagsToCollectionsParams = {
|
||||
originCollectionIds: string[];
|
||||
collectionIds: string[];
|
||||
datasetId: string;
|
||||
tag: string;
|
||||
};
|
||||
export type UpdateDatasetCollectionTagParams = {
|
||||
datasetId: string;
|
||||
tagId: string;
|
||||
tag: string;
|
||||
};
|
||||
|
||||
/* ================= data ===================== */
|
||||
export type PgSearchRawType = {
|
||||
id: string;
|
||||
|
18
packages/global/core/dataset/type.d.ts
vendored
18
packages/global/core/dataset/type.d.ts
vendored
@@ -69,6 +69,13 @@ export type DatasetCollectionSchemaType = {
|
||||
};
|
||||
};
|
||||
|
||||
export type DatasetCollectionTagsSchemaType = {
|
||||
_id: string;
|
||||
teamId: string;
|
||||
datasetId: string;
|
||||
tag: string;
|
||||
};
|
||||
|
||||
export type DatasetDataIndexItemType = {
|
||||
defaultIndex: boolean;
|
||||
dataId: string; // pg data id
|
||||
@@ -144,6 +151,17 @@ export type DatasetItemType = Omit<DatasetSchemaType, 'vectorModel' | 'agentMode
|
||||
permission: DatasetPermission;
|
||||
};
|
||||
|
||||
/* ================= tag ===================== */
|
||||
export type DatasetTagType = {
|
||||
_id: string;
|
||||
tag: string;
|
||||
};
|
||||
|
||||
export type TagUsageType = {
|
||||
tagId: string;
|
||||
collections: string[];
|
||||
};
|
||||
|
||||
/* ================= collection ===================== */
|
||||
export type DatasetCollectionItemType = CollectionWithDatasetType & {
|
||||
sourceName: string;
|
||||
|
@@ -85,6 +85,7 @@ export enum NodeInputKeyEnum {
|
||||
datasetSearchUsingExtensionQuery = 'datasetSearchUsingExtensionQuery',
|
||||
datasetSearchExtensionModel = 'datasetSearchExtensionModel',
|
||||
datasetSearchExtensionBg = 'datasetSearchExtensionBg',
|
||||
collectionFilterMatch = 'collectionFilterMatch',
|
||||
|
||||
// concat dataset
|
||||
datasetQuoteList = 'system_datasetQuoteList',
|
||||
|
@@ -90,6 +90,25 @@ export const DatasetSearchModule: FlowNodeTemplateType = {
|
||||
{
|
||||
...Input_Template_UserChatInput,
|
||||
toolDescription: '需要检索的内容'
|
||||
},
|
||||
{
|
||||
key: NodeInputKeyEnum.collectionFilterMatch,
|
||||
renderTypeList: [FlowNodeInputTypeEnum.JSONEditor, FlowNodeInputTypeEnum.reference],
|
||||
label: '集合元数据过滤',
|
||||
valueType: WorkflowIOValueTypeEnum.object,
|
||||
isPro: true,
|
||||
description: `目前支持标签和创建时间过滤,需按照以下格式填写:
|
||||
{
|
||||
"tags": {
|
||||
"$and": ["标签 1","标签 2"],
|
||||
"$or": ["有 $and 标签时,and 生效,or 不生效"]
|
||||
},
|
||||
"createTime": {
|
||||
"$gte": "YYYY-MM-DD HH:mm 格式即可,集合的创建时间大于该时间",
|
||||
"$lte": "YYYY-MM-DD HH:mm 格式即可,集合的创建时间小于该时间,可和 $gte 共同使用"
|
||||
}
|
||||
}
|
||||
`
|
||||
}
|
||||
],
|
||||
outputs: [
|
||||
|
1
packages/global/core/workflow/type/io.d.ts
vendored
1
packages/global/core/workflow/type/io.d.ts
vendored
@@ -52,6 +52,7 @@ export type FlowNodeInputItemType = InputComponentPropsType & {
|
||||
|
||||
// render components params
|
||||
canEdit?: boolean; // dynamic inputs
|
||||
isPro?: boolean; // Pro version field
|
||||
};
|
||||
|
||||
export type FlowNodeOutputItemType = {
|
||||
|
Reference in New Issue
Block a user