UNPKG

@gaiot/apis

Version:

aiot apis

439 lines (438 loc) 9.59 kB
import { PageQueryParams } from '../base'; import { ISessionPrompt } from '../cvforce/model'; export interface IDataSetResult { pageNo: number; pageSize: number; numResults: number; totalResults: number; recordList: IDataSet[]; } export interface IDataSet { createdAt: string; creator: string; deletedAt: string; description: string; icon: string; id: string; markType: string; name: string; org: string; tenantCode: string; updatedAt: string; ocrMarkTmpl: "StructKVCOCR" | "BasicOCR" | "TableOCR" | "DetectionOCR"; llmMarkTmpl: string; llmResponseSort: string; operator: IOperator; level: number; } export interface IOperator { creatorName: string; creatorUserName: string; updaterName: string; updaterUserName: string; } export interface ISegment { segment_id: number; segment_name: string; segment_describe: string; file_num: number; label_list: string[]; } export interface IDataSetParams { name?: string; markType?: string; description?: string; icon?: string; level?: number; } export interface IVersion { id: string; datasetId: string; samplesSizeKb: number; samplesCount: number; no: string; parentId: string; description: string; freezeHistory: boolean; creator: string; createdAt: number; updatedAt: number; modifier: string; existLabelSam?: boolean; subsectionCount: number; subsectionFiles: string[]; unSubsectionFiles: string[]; effectSamCount: number; versionAsyncTask: IPicsZipResult; } export interface IAM { endpoints: string[]; accessKey: string; secretKey: string; bucket: string; prefix: string; region: string; expiredAt: number; useSSL: boolean; } export interface IVersionParam { no: string; parentId: string; description: string; freezeHistory: boolean; creator: string; } export interface ILabel { label: string; count: number; id: string; color: string; threshold?: number; } export interface Label { id: string; label: string; color: string; createdAt: number; updatedAt: number; } export interface EditLabelParams { label: string; } export interface CreateLabelParams { labels: EditLabelParams[]; } export interface ITextContent { instruction: string; input: string; output: string; uuid?: string; } export declare enum SubsectionStatus { inital = 0, success = 1, processing = 2, failed = 3 } export interface ISample { id: string; versionId: string; fileUrl: string; labels: TInfer[]; fileKey: string; createdAt: string; updatedAt: string; creator: string; modifier: string; ocrJson: any; textContent: ITextContent; fileName: string; charactersCount: number; fileSize: number; statusSubsection: SubsectionStatus; countSubsection: number; recordId: string; metadata?: { charactersCount?: string; originKey?: string; fileName: string; oriUrl: string; }; sampleFileName: { name: string; oriSize: number; originalName: string; }; operator: IOperator; confirmStatus?: number; } export interface sampleParams { samples: SampleSigleParams | SampleSigleParams[] | ISampleTextParams[] | sampleFileParams[]; confirmStatus?: number; } export interface TInferBase { id: string; label?: string; } export interface SampleSigleParams { labels: TInferBase[]; fileKey: string; sampleFileName?: { name: string; }; } export interface sampleFileParams { fileKey: string; sampleFileName?: { name: string; }; fileSize: number; } export interface ISampleTextParams { id?: string; textContent: ITextContent; } export interface ISampleFileParams { id?: string; sampleFileName?: { name: string; }; } export interface IMarkType { key: string; name: string; icon?: string; sort: number; } export interface IProxy { key: string; salt: string; prefix: string; } export interface TInfer { id: string; label: string; box: any; shapeType?: string; uuid?: string; type?: string; catagoryId?: string; words?: string; cell?: { rowIdx: number; colIdx: number; rowSpan: number; colSpan: number; }; } export interface Deduplication { duplicated: string[]; unduplicated: string[]; duplicatedDS: string[]; duplicatedMd5: string[]; } export interface Category { id: string; name: string; createdAt?: number; updatedAt?: number; } export interface ILlmSamplePostParams { fileUrls?: string[]; markTmpl?: string; fileSizes?: number[]; fileName?: string; } export interface ILlmSamplePatchParams { size?: number; count?: number; fileName?: string; } export interface ILlmSample { id: string; fileName: string; success: number; fail: number; repetition: number; maxLengthLlm: number; } export interface Addition { key: string; value: string; sort: number; } export interface ILlmSampleSubsection { id: string; content: string; sectionNo: number; additionInfo?: Addition[]; } export interface ISubsectionParams { fileUrls?: string[]; regex: string; sampleId?: string; } export interface ISubsectionSample { url: string; message: string; isSuccess: boolean; } export interface GenerateParams { newDatasetId: string; newVersionId: string; oldDatasetId: string; oldVersionId: string; oldSampleId: string; oldRecordId?: string; promptVariables?: ISessionPrompt[]; application?: ISimpleApp; resourceToken?: string; } export interface GenerateRecord { id: string; oldDatasetId: string; oldVersionId: string; oldSampleId: string; newDatasetId: string; newVersionId: string; newSampleId: string; status: number; message: string; sectionCount: number; qaCount: number; taskId: string; allSectionCount: number; promptVariables: ISessionPrompt[]; application: ISimpleApp; } export declare enum GenerateStatus { inital = 0, processing = 1, paused = 2, failed = 3, done = 4 } export interface ILlmSampleV2ListParams { labels: string; pageNo: number; pageSize: number; } export interface ILlmSampleV2PostParams { fileUrls?: string[]; content?: ILlmContent[]; } export interface ILlmContent { prompt: string; response: string[][]; } export interface ILlmSampleV2 { id: string; versionId: string; md5Sum: string; labels: { creator: string; import: string; mark: boolean; }; annotations: { document: string; file: string; lineNo: number; }; content: ILlmContent[]; createdAt: string; updatedAt: string; deletedAt: string; creator: string; updater: string; } export interface IPostLlmSampleV2 { id: string; success: number; fail: number; repetition: number; maxLengthLlm: number; failFile: string; } export interface ISimpleApp { id: string; name: string; appType?: string; } export interface SampleQueryParams extends PageQueryParams { labels?: string | string[]; confirmStatus?: number; searchName?: string; } export interface ILabelList { id: string; label: string; datasetId: string; createdAt: string; updatedAt: string; deletedAt: string; creator: string; } export interface IPicsZipResult { taskId: string; state: string; lastTaskResult: string; zipUrls: string; process: number; type: number; versionId: string; } export interface ILastResult { count: number; failedCount: number; repeatCount: number; successCount: number; formatErrorCount: number; } export declare enum UploadZipsStatus { Pending = "PENDING",//等待处理 Started = "STARTED",//处理中 Failure = "FAILURE",//处理失败 Success = "SUCCESS",//处理成功 Abort = "ABORT" } export interface IPrelabelTaskParams { serviceId: string; serviceName: string; data: string; confidence: number; } export interface IPreLabelTask { taskId: string; state: string; lastTaskResult: string; process: number; type: number; params: IPrelabelTaskParams; } export declare enum PreLabelTaskStatus { Pending = "PENDING",//等待处理 Started = "STARTED",//处理中 Success = "SUCCESS",//处理成功 Failure = "FAILURE " } export declare enum IDatasetLevel { all = 0, general = 1, major = 2 } export interface IGetDatasetParams { name?: string; pageNo: number; pageSize: number; markType?: string; subMarkTmpl?: string; llmResponseSort?: string; creator?: string; markTypeArr?: string[]; level?: number; } export interface IDataSetCoptTaskParams { targetDsType: string; newDsName?: string; newDsDescription?: string; existDsId?: string; existVerId?: string; } export interface IDataSetCoptTask { task_id: string; state: PreLabelTaskStatus; params: { targetDsType: string; newDsName: string; newDsDescription: string; existDsId: string; existVerId: string; }; } export interface IPagination { current: number; pageSize: number; total?: number; type?: string; }