您在此处:
为摄取准备现有文件
创建元数据侧卡文件,以便搜索服务可以将现有 Amazon S3 对象与 Salesforce 文件相关联。
开始之前,请确保您拥有:
- 配置的 Amazon Bedrock Knowledge 库或 Amazon Kendra 索引。
- Amazon S3 库存报表或清单,标识要处理的现有对象。
- 创建 Lambda 函数和 Amazon S3 批处理操作作业的权限。
- 读取映射文件、源对象和现有侧卡的权限。
- 将元数据侧卡写入源存储桶的权限。
- 确定要处理的现有 S3 对象。
-
生成映射文件,将每个现有文件与其 Salesforce ContentDocumentId 和 Amazon S3 位置相关联。
请参阅为外部存储的文件生成批处理映射文件。
-
为每个现有文件创建侧车元数据文件。
元数据将文件与其 Salesforce 记录相关联。元数据要求见AWS文档中的元数据和Knowledge 库筛选。
- 将关联的 Salesforce ContentDocumentId 值添加到每个侧车。
- 验证每个侧车是否遵循 Amazon Bedrock 或 Kendra 元数据格式(如果适用)。
-
存储元数据侧卡:
- Amazon Kendra: 在源 S3 存储桶中
__sfdcroot__/__metadata__/存储。 - Amazon Bedrock: 将元数据侧卡与源对象一起存储。
- Amazon Kendra: 在源 S3 存储桶中
-
使用 Amazon S3 批处理事件调用 Lambda 函数。
有关说明,请查看使用 Amazon S3 批处理事件调用 Lambda 函数。
备注 Amazon Kendra 不会从音频、视频或图像内容生成脚本或汇总。在 Amazon Kendra 接收之前,使用适当的模型为这些文件创建可搜索的文本内容。例如,Amazon Bedrock 数据自动化。请参阅 Amazon Bedrock 数据自动化。以下示例说明了侧车更新逻辑:
1. Load mapping file 2. For each file in S3: a. Look up the salesforce content document Ids from mapping file b. Create sidecar metadata json file c. Populate the content document Ids in the json file according the correct Bedrock / Kendra format d. Make sure the metadata attribute key is "contentDocumentIds" and is an array of 15 digit Id strings - 授予 Lambda 函数对源存储桶的访问权限。
- 创建并运行 Amazon S3 批处理操作作业,该作业调用现有对象的 Lambda 函数。
- 为外部存储的文件生成批处理映射文件
通过生成将 Salesforce 文件与其 Amazon S3 位置关联的映射文件,为 Amazon Bedrock 或 Amazon Kendra 准备现有文件。只有在 Amazon S3 中有您想要搜索的现有文件时,您才能完成此任务。
