- 新しい順
- 投票が多い順
- コメントが多い順
1年以上前のブログなのであまり参考にならないかもしれませんが、metadata.jsonで対応している型にlistは含まれていないようです。
https://aws.amazon.com/jp/blogs/news/knowledge-bases-for-amazon-bedrock-now-supports-metadata-filtering-to-improve-retrieval-accuracy/
メタデータフィルタリング機能を使用するには、ソースデータファイルと同じ名前に .metadata.json のサフィックスを付けたメタデータファイルをソースデータファイルと一緒に提供する必要があります。メタデータは文字列、数値、ブール値のいずれかです。以下は、メタデータファイルの例です。
When using Amazon S3 Vectors with Amazon Bedrock Knowledge Bases, there appears to be a discrepancy between the metadata types supported by S3 Vectors generally and what's accepted when using CSV files with metadata.json for Knowledge Base ingestion.
While S3 Vectors does support string, number, boolean, and list types for metadata filtering, when using the CSV ingestion method with a metadata.json file for Knowledge Bases, the metadata values should be simple strings, numbers, or booleans - not lists.
The error you're encountering is because in your metadata.json file, you're trying to define "originalkey" as an array/list with ["string"], but this format isn't supported for CSV metadata ingestion in Knowledge Bases.
Instead, you should format your metadata attribute as a simple string value:
"metadataAttributes": {
"originalkey": "string"
}
When working with CSV files for Knowledge Base ingestion, the metadata fields are treated as string values associated with each chunk. The metadata.json file provides hints to the knowledge base on how to treat each column in the CSV, but the values themselves need to be simple data types rather than lists.
If you need to use array operations for filtering (like $in or $nin operators), those would be used during query time against properly formatted metadata, not during the definition of the metadata structure itself.
Sources
Include metadata in a data source to improve knowledge base query - Amazon Bedrock
Metadata filtering - Amazon Simple Storage Service
How to avoid generating individual metadata.json files when ingesting documents into Amazon Knowledge Base? | AWS re:Post

情報ありがとうございます。