Skip to main content

document_contents

Creates, updates, deletes, gets or lists a document_contents resource.

Overview

Namedocument_contents
TypeResource
Idaws.bedrock_agent_runtime.document_contents

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
document_content_lengthinteger (int64)The size of the document content in bytes available at the pre-signed URL.
mime_typestringThe MIME type of the document content. For RAW format, this is the original file type (for example, application/pdf). For EXTRACTED format, this is always application/json.
presigned_urlstringA pre-signed URL for downloading the document content. The URL expires after 5 minutes.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_document_contentselectdata_source_id, document_id, knowledge_base_id, regionRetrieves the content of an ingested document from a knowledge base. Returns a pre-signed URL for secure document access.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
data_source_idstringThe unique identifier of the data source that contains the document.
document_idstringThe unique identifier of the document to retrieve content for.
knowledge_base_idstringThe unique identifier of the knowledge base that contains the document.
regionstringAWS region (default: us-east-1)

SELECT examples

Retrieves the content of an ingested document from a knowledge base. Returns a pre-signed URL for secure document access.

SELECT
document_content_length,
mime_type,
presigned_url
FROM aws.bedrock_agent_runtime.document_contents
WHERE data_source_id = '{{ data_source_id }}' -- required
AND document_id = '{{ document_id }}' -- required
AND knowledge_base_id = '{{ knowledge_base_id }}' -- required
AND region = '{{ region }}' -- required
;