Skip to content

BedrockAgentRuntimeClient.get_document_content

rboto-bedrock-agent-runtime==0.4.0 · Service index · Types

Model summary (excerpt): Retrieves the content of an ingested document from a knowledge base, or of an image embedded in the document. Returns a pre-signed URL for downloading the content. Use this operation to display the source of a Retrieve result.

Install and imports

python -m pip install "rboto[bedrock-agent-runtime]==0.4.0"
from rboto import BedrockAgentRuntimeClient
from rboto_bedrock_agent_runtime.types import (
    DocumentOutputFormat,
    GetDocumentContentOutput,
    UserContext,
)

Signature

async def get_document_content(
    *,
    knowledge_base_id: str,
    data_source_id: str,
    document_id: str,
    media_id: str | None = None,
    output_format: DocumentOutputFormat | None = None,
    user_context: UserContext | None = None,
) -> GetDocumentContentOutput: ...

Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.

Arguments

Argument Required Model notes (excerpt)
knowledge_base_id Yes The unique identifier of the knowledge base that contains the document.
data_source_id Yes The unique identifier of the data source that contains the document.
document_id Yes The unique identifier of the document to retrieve content for.
media_id No The unique identifier (in UUID format) of an image embedded in the specified document. Set this parameter to the _media_id value in the metadata of the corresponding Retrieve result. If you specify this parameter, the response contains a pre-signed URL for the image instead of the document, and you must omit outputFormat or set it to RAW .
output_format No The output format for the content. You can specify one of the following values: RAW Returns the original document, or the selected image if you specify mediaId . EXTRACTED Returns parsed document text as JSON. If you omit this parameter, the default is RAW . You can't use EXTRACTED with mediaId .
user_context No Contains information about the user making the request. This is used for access control filtering to ensure that results only include documents the user is authorized to access.

Output

GetDocumentContentOutput.

Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.

Field Type Presence References
mime_type str Always present —
presigned_url str Always present —
document_content_length int | None Always present —

| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.

DocumentOutputFormat, GetDocumentContentOutput, UserContext

Follow these links for nested inputs and outputs; recursive types link back to the same type page.

Pagination and streaming

No generated paginator for this operation.

No output stream.

Errors

Import from rboto_bedrock_agent_runtime.exceptions:

AccessDeniedError, InternalServerError, ResourceNotFoundError, ThrottlingError, ValidationError.

Other service failures use the service base error; credential, transport and timeout failures use shared errors.

Service guide · Pinned model