Skip to content

Retrieves the content of an ingested document from a knowledge base

Description

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

Usage

bedrockagentruntime_get_document_content(dataSourceId, documentId,
  knowledgeBaseId, outputFormat, userContext)

Arguments

  • dataSourceId

[required] The unique identifier of the data source that contains the document.

  • documentId

[required] The unique identifier of the document to retrieve content for.

  • knowledgeBaseId

[required] The unique identifier of the knowledge base that contains the document.

  • outputFormat

The output format for the document content. RAW returns the original file. EXTRACTED returns parsed text as JSON. Defaults to RAW.

  • userContext

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.

Value

A list with the following syntax:

list(
  documentContentLength = 123,
  mimeType = "string",
  presignedUrl = "string"
)

Request syntax

svc$get_document_content(
  dataSourceId = "string",
  documentId = "string",
  knowledgeBaseId = "string",
  outputFormat = "RAW"|"EXTRACTED",
  userContext = list(
    userId = "string"
  )
)