import { type DifyConfig } from '../config'; import { Metadata } from '../types'; /** * 元数据管理模块 * 用于管理知识库文档和文本段的元数据 */ /** * 为文档添加元数据 * @param options 添加元数据的选项 * @param config 可选配置对象 * @returns 添加的元数据对象 * @throws {MetadataError} 当API调用失败时抛出错误 */ export declare function addDocumentMetadata(options: { document_id: string; key: string; value: string; type?: 'string' | 'number' | 'boolean' | 'array' | 'object'; }, config?: Partial): Promise; /** * 为文本段添加元数据 * @param options 添加元数据的选项 * @param config 可选配置对象 * @returns 添加的元数据对象 * @throws {MetadataError} 当API调用失败时抛出错误 */ export declare function addSegmentMetadata(options: { segment_id: string; key: string; value: string; type?: 'string' | 'number' | 'boolean' | 'array' | 'object'; }, config?: Partial): Promise; /** * 获取文档的元数据列表 * @param documentId 文档ID * @param config 可选配置对象 * @returns 元数据对象数组 * @throws {MetadataError} 当API调用失败时抛出错误 */ export declare function getDocumentMetadata(documentId: string, config?: Partial): Promise; /** * 获取文本段的元数据列表 * @param segmentId 文本段ID * @param config 可选配置对象 * @returns 元数据对象数组 * @throws {MetadataError} 当API调用失败时抛出错误 */ export declare function getSegmentMetadata(segmentId: string, config?: Partial): Promise; /** * 更新文档元数据 * @param options 更新元数据的选项 * @param config 可选配置对象 * @returns 更新后的元数据对象 * @throws {MetadataError} 当API调用失败时抛出错误 */ export declare function updateDocumentMetadata(options: { document_id: string; metadata_id: string; key?: string; value?: string; type?: 'string' | 'number' | 'boolean' | 'array' | 'object'; }, config?: Partial): Promise; /** * 更新文本段元数据 * @param options 更新元数据的选项 * @param config 可选配置对象 * @returns 更新后的元数据对象 * @throws {MetadataError} 当API调用失败时抛出错误 */ export declare function updateSegmentMetadata(options: { segment_id: string; metadata_id: string; key?: string; value?: string; type?: 'string' | 'number' | 'boolean' | 'array' | 'object'; }, config?: Partial): Promise; /** * 删除文档元数据 * @param options 删除元数据的选项 * @param config 可选配置对象 * @returns 删除操作的结果 * @throws {MetadataError} 当API调用失败时抛出错误 */ export declare function deleteDocumentMetadata(options: { document_id: string; metadata_id: string; }, config?: Partial): Promise<{ success: boolean; message: string; }>; /** * 删除文本段元数据 * @param options 删除元数据的选项 * @param config 可选配置对象 * @returns 删除操作的结果 * @throws {MetadataError} 当API调用失败时抛出错误 */ export declare function deleteSegmentMetadata(options: { segment_id: string; metadata_id: string; }, config?: Partial): Promise<{ success: boolean; message: string; }>; /** * 批量添加文档元数据 * @param options 批量添加元数据的选项 * @param config 可选配置对象 * @returns 添加的元数据对象数组 * @throws {MetadataError} 当API调用失败时抛出错误 */ export declare function addDocumentMetadataBatch(options: { document_id: string; metadata: Array<{ key: string; value: string; type?: 'string' | 'number' | 'boolean' | 'array' | 'object'; }>; }, config?: Partial): Promise; /** * 批量添加文本段元数据 * @param options 批量添加元数据的选项 * @param config 可选配置对象 * @returns 添加的元数据对象数组 * @throws {MetadataError} 当API调用失败时抛出错误 */ export declare function addSegmentMetadataBatch(options: { segment_id: string; metadata: Array<{ key: string; value: string; type?: 'string' | 'number' | 'boolean' | 'array' | 'object'; }>; }, config?: Partial): Promise; /** * 根据元数据键值对搜索文档 * @param options 搜索选项 * @param config 可选配置对象 * @returns 匹配的文档列表 * @throws {MetadataError} 当API调用失败时抛出错误 */ export declare function searchDocumentsByMetadata(options: { dataset_id: string; metadata_key: string; metadata_value: string; operator?: 'equals' | 'contains' | 'starts_with' | 'ends_with'; }, config?: Partial): Promise; /** * 根据元数据键值对搜索文本段 * @param options 搜索选项 * @param config 可选配置对象 * @returns 匹配的文本段列表 * @throws {MetadataError} 当API调用失败时抛出错误 */ export declare function searchSegmentsByMetadata(options: { dataset_id: string; metadata_key: string; metadata_value: string; operator?: 'equals' | 'contains' | 'starts_with' | 'ends_with'; }, config?: Partial): Promise; //# sourceMappingURL=metadata-management.d.ts.map