getKnowledgeBaseDocuments method

Future<GetKnowledgeBaseDocumentsResponse> getKnowledgeBaseDocuments({
  1. required String dataSourceId,
  2. required List<DocumentIdentifier> documentIdentifiers,
  3. required String knowledgeBaseId,
})

Retrieves specific documents from a data source that is connected to a knowledge base. For more information, see Ingest changes directly into a knowledge base in the Amazon Bedrock User Guide.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter dataSourceId : The unique identifier of the data source that contains the documents.

Parameter documentIdentifiers : A list of objects, each of which contains information to identify a document for which to retrieve information.

Parameter knowledgeBaseId : The unique identifier of the knowledge base that is connected to the data source.

Implementation

Future<GetKnowledgeBaseDocumentsResponse> getKnowledgeBaseDocuments({
  required String dataSourceId,
  required List<DocumentIdentifier> documentIdentifiers,
  required String knowledgeBaseId,
}) async {
  final $payload = <String, dynamic>{
    'documentIdentifiers': documentIdentifiers,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/knowledgebases/${Uri.encodeComponent(knowledgeBaseId)}/datasources/${Uri.encodeComponent(dataSourceId)}/documents/getDocuments',
    exceptionFnMap: _exceptionFns,
  );
  return GetKnowledgeBaseDocumentsResponse.fromJson(response);
}