Skip to content

batch_put_document

Operation

batch_put_document

batch_put_document(request: BatchPutDocumentInput | BatchPutDocumentInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[BatchPutDocumentInputDict]) -> BatchPutDocumentOutput

Adds one or more documents to an Amazon Q Business index.

You use this API to:

  • ingest your structured and unstructured documents and documents stored in an Amazon S3 bucket into an Amazon Q Business index.

  • add custom attributes to documents in an Amazon Q Business index.

  • attach an access control list to the documents added to an Amazon Q Business index.

You can see the progress of the deletion, and any error messages related to the process, by using CloudWatch.

Parameters:

Name Type Description Default
request BatchPutDocumentInput | BatchPutDocumentInputDict | 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[BatchPutDocumentInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
BatchPutDocumentOutput

An instance of BatchPutDocumentOutput.

batch_put_document async

batch_put_document(request: BatchPutDocumentInput | BatchPutDocumentInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[BatchPutDocumentInputDict]) -> BatchPutDocumentOutput

Adds one or more documents to an Amazon Q Business index.

You use this API to:

  • ingest your structured and unstructured documents and documents stored in an Amazon S3 bucket into an Amazon Q Business index.

  • add custom attributes to documents in an Amazon Q Business index.

  • attach an access control list to the documents added to an Amazon Q Business index.

You can see the progress of the deletion, and any error messages related to the process, by using CloudWatch.

Parameters:

Name Type Description Default
request BatchPutDocumentInput | BatchPutDocumentInputDict | 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[BatchPutDocumentInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
BatchPutDocumentOutput

An instance of BatchPutDocumentOutput.

Input

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

BatchPutDocumentInputDict

Bases: TypedDict

Dictionary form of BatchPutDocumentInput.

Attributes

application_id instance-attribute
application_id: Required[str]

The identifier of the Amazon Q Business application.

data_source_sync_id instance-attribute
data_source_sync_id: str | None

The identifier of the data source sync during which the documents were added.

documents instance-attribute

One or more documents to add to the index.

Warning

Ensure that the name of your document doesn't contain any confidential information. Amazon Q Business returns document names in chat responses and citations when relevant.

index_id instance-attribute
index_id: Required[str]

The identifier of the Amazon Q Business index to add the documents to.

role_arn instance-attribute
role_arn: str | None

The Amazon Resource Name (ARN) of an IAM role with permission to access your S3 bucket.

BatchPutDocumentInput dataclass

Bases: _SerdeShape

Dataclass for BatchPutDocumentInput structure.

Attributes

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

The identifier of the Amazon Q Business application.

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

The identifier of the data source sync during which the documents were added.

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

One or more documents to add to the index.

Warning

Ensure that the name of your document doesn't contain any confidential information. Amazon Q Business returns document names in chat responses and citations when relevant.

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

The identifier of the Amazon Q Business index to add the documents to.

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

The Amazon Resource Name (ARN) of an IAM role with permission to access your S3 bucket.

Output

BatchPutDocumentOutput dataclass

Bases: _SerdeShape

Dataclass for BatchPutDocumentOutput structure.

Attributes

failed_documents class-attribute instance-attribute
failed_documents: list[FailedDocument] | None = ...

A list of documents that were not added to the Amazon Q Business index because the document failed a validation check. Each document contains an error message that indicates why the document couldn't be added to the index.

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.