mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 05:12:39 +00:00

* feat: add feishu & yuque dataset (#3379) * feat: add feishu & yuque dataset * fix ts * fix ts * move type position * fix * fix: merge interface * fix * feat: dingtalk sso support (#3408) * fix: optional sso state * feat: dingtalk bot * feat: dingtalk sso login * chore: move i18n to user namespace * feat: dingtalk bot integration (#3415) * feat: dingtalk bot integration * docs: config dingtalk bot * feat:sear XNG服务 (#3413) * feat:sear XNG服务 * 补充了courseUrl * 添加了官方文档 * 错误时返回情况修正了一下 * Tracks (#3420) * feat: node intro * feat: add domain track * dingding sso login * perf: api dataset code and add doc * feat: tracks * feat: searXNG plugins * fix: ts * feat: delete node tracks (#3423) * fix: dingtalk bot GET verification (#3424) * 4.8.16 test: fix: plugin inputs render;fix: ui offset (#3426) * fix: ui offset * perf: dingding talk * fix: plugin inputs render * feat: menu all folder (#3429) * fix: recall code --------- Co-authored-by: heheer <heheer@sealos.io> Co-authored-by: a.e. <49438478+I-Info@users.noreply.github.com> Co-authored-by: Jiangween <145003935+Jiangween@users.noreply.github.com>
141 lines
3.7 KiB
TypeScript
141 lines
3.7 KiB
TypeScript
import { DatasetDataIndexItemType, DatasetSchemaType } from './type';
|
|
import { TrainingModeEnum, DatasetCollectionTypeEnum } from './constants';
|
|
import type { LLMModelItemType } from '../ai/model.d';
|
|
import { ParentIdType } from 'common/parentFolder/type';
|
|
|
|
/* ================= dataset ===================== */
|
|
export type DatasetUpdateBody = {
|
|
id: string;
|
|
parentId?: ParentIdType;
|
|
name?: string;
|
|
avatar?: string;
|
|
intro?: string;
|
|
agentModel?: LLMModelItemType;
|
|
status?: DatasetSchemaType['status'];
|
|
|
|
websiteConfig?: DatasetSchemaType['websiteConfig'];
|
|
externalReadUrl?: DatasetSchemaType['externalReadUrl'];
|
|
defaultPermission?: DatasetSchemaType['defaultPermission'];
|
|
apiServer?: DatasetSchemaType['apiServer'];
|
|
yuqueServer?: DatasetSchemaType['yuqueServer'];
|
|
feishuServer?: DatasetSchemaType['feishuServer'];
|
|
|
|
// sync schedule
|
|
autoSync?: boolean;
|
|
};
|
|
|
|
/* ================= collection ===================== */
|
|
export type DatasetCollectionChunkMetadataType = {
|
|
parentId?: string;
|
|
trainingType?: TrainingModeEnum;
|
|
chunkSize?: number;
|
|
chunkSplitter?: string;
|
|
qaPrompt?: string;
|
|
metadata?: Record<string, any>;
|
|
};
|
|
|
|
// create collection params
|
|
export type CreateDatasetCollectionParams = DatasetCollectionChunkMetadataType & {
|
|
datasetId: string;
|
|
name: string;
|
|
type: DatasetCollectionTypeEnum;
|
|
|
|
fileId?: string;
|
|
rawLink?: string;
|
|
externalFileId?: string;
|
|
externalFileUrl?: string;
|
|
apiFileId?: string;
|
|
|
|
rawTextLength?: number;
|
|
hashRawText?: string;
|
|
|
|
tags?: string[];
|
|
|
|
createTime?: Date;
|
|
updateTime?: Date;
|
|
nextSyncTime?: Date;
|
|
};
|
|
|
|
export type ApiCreateDatasetCollectionParams = DatasetCollectionChunkMetadataType & {
|
|
datasetId: string;
|
|
tags?: string[];
|
|
};
|
|
export type TextCreateDatasetCollectionParams = ApiCreateDatasetCollectionParams & {
|
|
name: string;
|
|
text: string;
|
|
};
|
|
export type LinkCreateDatasetCollectionParams = ApiCreateDatasetCollectionParams & {
|
|
link: string;
|
|
};
|
|
export type ApiDatasetCreateDatasetCollectionParams = ApiCreateDatasetCollectionParams & {
|
|
name: string;
|
|
apiFileId: string;
|
|
};
|
|
export type FileIdCreateDatasetCollectionParams = ApiCreateDatasetCollectionParams & {
|
|
fileId: string;
|
|
};
|
|
export type reTrainingDatasetFileCollectionParams = DatasetCollectionChunkMetadataType & {
|
|
datasetId: string;
|
|
collectionId: string;
|
|
};
|
|
export type FileCreateDatasetCollectionParams = ApiCreateDatasetCollectionParams & {
|
|
fileMetadata?: Record<string, any>;
|
|
collectionMetadata?: Record<string, any>;
|
|
};
|
|
export type CsvTableCreateDatasetCollectionParams = {
|
|
datasetId: string;
|
|
parentId?: string;
|
|
fileId: string;
|
|
};
|
|
export type ExternalFileCreateDatasetCollectionParams = ApiCreateDatasetCollectionParams & {
|
|
externalFileId?: string;
|
|
externalFileUrl: string;
|
|
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;
|
|
collection_id: string;
|
|
score: number;
|
|
};
|
|
export type PushDatasetDataChunkProps = {
|
|
q: string; // embedding content
|
|
a?: string; // bonus content
|
|
chunkIndex?: number;
|
|
indexes?: Omit<DatasetDataIndexItemType, 'dataId'>[];
|
|
};
|
|
|
|
export type PostWebsiteSyncParams = {
|
|
datasetId: string;
|
|
billId: string;
|
|
};
|
|
|
|
export type PushDatasetDataProps = {
|
|
collectionId: string;
|
|
data: PushDatasetDataChunkProps[];
|
|
trainingMode: TrainingModeEnum;
|
|
prompt?: string;
|
|
billId?: string;
|
|
};
|
|
export type PushDatasetDataResponse = {
|
|
insertLen: number;
|
|
};
|