Skip to content

Ingest Knowledge Base Documents

bedrockagent_ingest_knowledge_base_documents R Documentation

Ingests documents directly into the knowledge base that is connected to the data source

Description

Ingests documents directly into the knowledge base that is connected to the data source. The dataSourceType specified in the content for each document must match the type of the data source that you specify in the header. For more information, see Ingest documents into a knowledge base in real-time in the Amazon Bedrock User Guide.

Usage

bedrockagent_ingest_knowledge_base_documents(clientToken, dataSourceId,
  documents, knowledgeBaseId)

Arguments

clientToken

A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency.

dataSourceId

[required] The unique identifier of the data source connected to the knowledge base that you're adding documents to.

documents

[required] A list of objects, each of which contains information about the documents to add.

knowledgeBaseId

[required] The unique identifier of the knowledge base to ingest the documents into.

Value

A list with the following syntax:

list(
  documentDetails = list(
    list(
      dataSourceId = "string",
      identifier = list(
        custom = list(
          id = "string"
        ),
        dataSourceType = "CUSTOM"|"S3",
        s3 = list(
          uri = "string"
        )
      ),
      knowledgeBaseId = "string",
      status = "INDEXED"|"PARTIALLY_INDEXED"|"PENDING"|"FAILED"|"METADATA_PARTIALLY_INDEXED"|"METADATA_UPDATE_FAILED"|"IGNORED"|"NOT_FOUND"|"STARTING"|"IN_PROGRESS"|"DELETING"|"DELETE_IN_PROGRESS",
      statusReason = "string",
      updatedAt = as.POSIXct(
        "2015-01-01"
      )
    )
  )
)

Request syntax

svc$ingest_knowledge_base_documents(
  clientToken = "string",
  dataSourceId = "string",
  documents = list(
    list(
      content = list(
        custom = list(
          customDocumentIdentifier = list(
            id = "string"
          ),
          inlineContent = list(
            byteContent = list(
              data = raw,
              mimeType = "string"
            ),
            textContent = list(
              data = "string"
            ),
            type = "BYTE"|"TEXT"
          ),
          s3Location = list(
            bucketOwnerAccountId = "string",
            uri = "string"
          ),
          sourceType = "IN_LINE"|"S3_LOCATION"
        ),
        dataSourceType = "CUSTOM"|"S3",
        s3 = list(
          s3Location = list(
            uri = "string"
          )
        )
      ),
      metadata = list(
        inlineAttributes = list(
          list(
            key = "string",
            value = list(
              booleanValue = TRUE|FALSE,
              numberValue = 123.0,
              stringListValue = list(
                "string"
              ),
              stringValue = "string",
              type = "BOOLEAN"|"NUMBER"|"STRING"|"STRING_LIST"
            )
          )
        ),
        s3Location = list(
          bucketOwnerAccountId = "string",
          uri = "string"
        ),
        type = "IN_LINE_ATTRIBUTE"|"S3_LOCATION"
      )
    )
  ),
  knowledgeBaseId = "string"
)