Skip to content

Retrieve

bedrockagentruntime_retrieve R Documentation

Queries a knowledge base and retrieves information from it

Description

Queries a knowledge base and retrieves information from it.

Usage

bedrockagentruntime_retrieve(guardrailConfiguration, knowledgeBaseId,
  nextToken, retrievalConfiguration, retrievalQuery)

Arguments

guardrailConfiguration

Guardrail settings.

knowledgeBaseId

[required] The unique identifier of the knowledge base to query.

nextToken

If there are more results than can fit in the response, the response returns a nextToken. Use this token in the nextToken field of another request to retrieve the next batch of results.

retrievalConfiguration

Contains configurations for the knowledge base query and retrieval process. For more information, see Query configurations.

retrievalQuery

[required] Contains the query to send the knowledge base.

Value

A list with the following syntax:

list(
  guardrailAction = "INTERVENED"|"NONE",
  nextToken = "string",
  retrievalResults = list(
    list(
      content = list(
        byteContent = "string",
        row = list(
          list(
            columnName = "string",
            columnValue = "string",
            type = "BLOB"|"BOOLEAN"|"DOUBLE"|"NULL"|"LONG"|"STRING"
          )
        ),
        text = "string",
        type = "TEXT"|"IMAGE"|"ROW"
      ),
      location = list(
        confluenceLocation = list(
          url = "string"
        ),
        customDocumentLocation = list(
          id = "string"
        ),
        kendraDocumentLocation = list(
          uri = "string"
        ),
        s3Location = list(
          uri = "string"
        ),
        salesforceLocation = list(
          url = "string"
        ),
        sharePointLocation = list(
          url = "string"
        ),
        sqlLocation = list(
          query = "string"
        ),
        type = "S3"|"WEB"|"CONFLUENCE"|"SALESFORCE"|"SHAREPOINT"|"CUSTOM"|"KENDRA"|"SQL",
        webLocation = list(
          url = "string"
        )
      ),
      metadata = list(
        list()
      ),
      score = 123.0
    )
  )
)

Request syntax

svc$retrieve(
  guardrailConfiguration = list(
    guardrailId = "string",
    guardrailVersion = "string"
  ),
  knowledgeBaseId = "string",
  nextToken = "string",
  retrievalConfiguration = list(
    vectorSearchConfiguration = list(
      filter = list(
        andAll = list(
          list()
        ),
        equals = list(
          key = "string",
          value = list()
        ),
        greaterThan = list(
          key = "string",
          value = list()
        ),
        greaterThanOrEquals = list(
          key = "string",
          value = list()
        ),
        in = list(
          key = "string",
          value = list()
        ),
        lessThan = list(
          key = "string",
          value = list()
        ),
        lessThanOrEquals = list(
          key = "string",
          value = list()
        ),
        listContains = list(
          key = "string",
          value = list()
        ),
        notEquals = list(
          key = "string",
          value = list()
        ),
        notIn = list(
          key = "string",
          value = list()
        ),
        orAll = list(
          list()
        ),
        startsWith = list(
          key = "string",
          value = list()
        ),
        stringContains = list(
          key = "string",
          value = list()
        )
      ),
      implicitFilterConfiguration = list(
        metadataAttributes = list(
          list(
            description = "string",
            key = "string",
            type = "STRING"|"NUMBER"|"BOOLEAN"|"STRING_LIST"
          )
        ),
        modelArn = "string"
      ),
      numberOfResults = 123,
      overrideSearchType = "HYBRID"|"SEMANTIC",
      rerankingConfiguration = list(
        bedrockRerankingConfiguration = list(
          metadataConfiguration = list(
            selectionMode = "SELECTIVE"|"ALL",
            selectiveModeConfiguration = list(
              fieldsToExclude = list(
                list(
                  fieldName = "string"
                )
              ),
              fieldsToInclude = list(
                list(
                  fieldName = "string"
                )
              )
            )
          ),
          modelConfiguration = list(
            additionalModelRequestFields = list(
              list()
            ),
            modelArn = "string"
          ),
          numberOfRerankedResults = 123
        ),
        type = "BEDROCK_RERANKING_MODEL"
      )
    )
  ),
  retrievalQuery = list(
    text = "string"
  )
)