import { CommonResponse, CommonResponseAffectedCount, TencentCloudVectorAffectedCount, TencentCloudVectorResponse } from "./TCommon"; export type CollectMetricType = "COSINE" | "IP" | "L2"; export type EmbeddingLanguage = "zh" | "en" | "multi"; export type CollectionChroma = { id: string; collection: string; fields: any; }; export type CollectionCreateReq = { database: string; collection: string; description: string; indexFields: string[]; embeddingLanguage?: EmbeddingLanguage; enableWordsEmbedding?: boolean; metricType?: CollectMetricType; appendTitleToChunk?: boolean; appendKeywordsToChunk?: boolean; }; export type CollectionCreateReqTencentCloudVector = { database: string; collection: string; description?: string; replicaNum: 0 | 1 | 2; shardNum: number; embedding?: { field?: string; vectorField?: "vector"; model?: CollectionCreateTencentVoctorEmbeddingModel; }; indexes: CollectionCreateTencentVoctorIndex[]; }; export type CollectionCreateTencentVoctorEmbeddingModel = "bge-base-zh" | "m3e-base" | "e5-large-v2" | "text2vec-large-chinese" | "multilingual-e5-base"; export type CollectionCreateTencentVoctorIndex = { fieldName: string; fieldType: "string"; indexType: "filter"; } | { fieldName: "id"; fieldType: "string"; indexType: "primaryKey"; } | { fieldName: "vector"; fieldType: "vector"; indexType: "HNSW"; metricType: CollectMetricType; dimension?: number; params: { "M": 16; "efConstruction": 200; }; }; export type CollectionViewCreateReqTencentCloudVector = { database: string; collectionView: string; description?: string; embedding: { language: EmbeddingLanguage; enableWordsEmbedding?: boolean; }; splitterPreprocess?: { appendTitleToChunk?: boolean; appendKeywordsToChunk?: boolean; }; indexes: { fieldName: string; fieldType: "string"; indexType: "filter"; }[]; }; export type CollectionCreateRes = CommonResponse & CommonResponseAffectedCount & { collection?: CollectionChroma; }; export type CollectionListReq = { database: string; }; export type CollectionInfoTencentVector = { database: string; collection: string; description: string; documentCount: number; alias: string[]; replicaNum: number; shareNum: number; createTime: string; embedding: { field: string; vectorField: string; model: string; status: string; }; indexes: CollectionCreateTencentVoctorIndex[]; indexestatus: { status: string; statusTime: string; }; }; export type CollectionViewTencentVector = { database: string; collectionView: string; description: string; embedding: { language: EmbeddingLanguage; enableWordsEmbedding?: boolean; }; splitterPreprocess?: { appendTitleToChunk?: boolean; appendKeywordsToChunk?: boolean; }; indexes: { fieldName: string; fieldType: "string"; indexType: "filter"; }[]; alias: string[]; stats: { indexedDocumentSets: number; totalDocumentSets: number; unIndexedDocumentSets: number; }; }; export type CollectionListRes = TencentCloudVectorResponse & { collections: CollectionInfoTencentVector[] | CollectionViewTencentVector[] | CollectionChroma[]; }; export type CollectionDropReq = { database: string; collection: string; }; export type CollectionViewDropReq = { database: string; collectionView: string; }; export type CollectionDropRes = TencentCloudVectorResponse & TencentCloudVectorAffectedCount; export type CollectionDescribeReq = { database: string; collection: string; }; export type CollectionViewDescribeReq = { database: string; collectionView: string; }; export type CollectionDescribeRes = TencentCloudVectorResponse & { collection?: CollectionInfoTencentVector | CollectionChroma; }; export type CollectionTruncateReq = { database: string; collection: string; }; export type CollectionViewTruncateReq = { database: string; collectionView: string; }; export type CollectionTruncateRes = TencentCloudVectorResponse & TencentCloudVectorAffectedCount;