Skip to content

ingest_knowledge_base_documents

Operation

ingest_knowledge_base_documents

ingest_knowledge_base_documents(request: IngestKnowledgeBaseDocumentsInput | IngestKnowledgeBaseDocumentsInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[IngestKnowledgeBaseDocumentsInputDict]) -> IngestKnowledgeBaseDocumentsOutput

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 changes directly into a knowledge base in the Amazon Bedrock User Guide.

Parameters:

Name Type Description Default
request IngestKnowledgeBaseDocumentsInput | IngestKnowledgeBaseDocumentsInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[IngestKnowledgeBaseDocumentsInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
IngestKnowledgeBaseDocumentsOutput

An instance of IngestKnowledgeBaseDocumentsOutput.

ingest_knowledge_base_documents async

ingest_knowledge_base_documents(request: IngestKnowledgeBaseDocumentsInput | IngestKnowledgeBaseDocumentsInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[IngestKnowledgeBaseDocumentsInputDict]) -> IngestKnowledgeBaseDocumentsOutput

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 changes directly into a knowledge base in the Amazon Bedrock User Guide.

Parameters:

Name Type Description Default
request IngestKnowledgeBaseDocumentsInput | IngestKnowledgeBaseDocumentsInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[IngestKnowledgeBaseDocumentsInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
IngestKnowledgeBaseDocumentsOutput

An instance of IngestKnowledgeBaseDocumentsOutput.

Input

Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.

IngestKnowledgeBaseDocumentsInputDict

Bases: TypedDict

Dictionary form of IngestKnowledgeBaseDocumentsInput.

Attributes

client_token instance-attribute
client_token: str | None

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.

This field is autopopulated if not provided.

data_source_id instance-attribute
data_source_id: Required[str]

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

documents instance-attribute

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

knowledge_base_id instance-attribute
knowledge_base_id: Required[str]

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

IngestKnowledgeBaseDocumentsInput dataclass

Bases: _SerdeShape

Dataclass for IngestKnowledgeBaseDocumentsInput structure.

Attributes

client_token class-attribute instance-attribute
client_token: str | None = ...

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.

This field is autopopulated if not provided.

data_source_id class-attribute instance-attribute
data_source_id: str | None = ...

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

documents class-attribute instance-attribute
documents: list[KnowledgeBaseDocument] | None = ...

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

knowledge_base_id class-attribute instance-attribute
knowledge_base_id: str | None = ...

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

Output

IngestKnowledgeBaseDocumentsOutput dataclass

Bases: _SerdeShape

Dataclass for IngestKnowledgeBaseDocumentsOutput structure.

Attributes

document_details class-attribute instance-attribute
document_details: list[KnowledgeBaseDocumentDetail] | None = ...

A list of objects, each of which contains information about the documents that were ingested.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.