create_data_source
async
¶
create_data_source(
knowledge_base_id: Id,
name: Name,
data_source_configuration: DataSourceConfiguration,
*,
config_overrides: Optional[AsyncBedrockAgentClientConfig] = None,
client_token: Optional[ClientToken] = None,
description: Optional[Description] = None,
data_deletion_policy: Optional[DataDeletionPolicy] = None,
server_side_encryption_configuration: Optional[
ServerSideEncryptionConfiguration
] = None,
vector_ingestion_configuration: Optional[VectorIngestionConfiguration] = None,
) -> CreateDataSourceResponse
Connects a knowledge base to a data source. You specify the configuration for the specific data source service in the dataSourceConfiguration field.
You can't change the chunkingConfiguration after you create the data source connector.
Parameters:
-
knowledge_base_id(Id) –The unique identifier of the knowledge base to which to add the data source.
-
client_token(Optional[ClientToken], default: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.
-
name(Name) –The name of the data source.
-
description(Optional[Description], default:None) –A description of the data source.
-
data_source_configuration(DataSourceConfiguration) –The connection configuration for the data source.
-
data_deletion_policy(Optional[DataDeletionPolicy], default:None) –The data deletion policy for the data source.
You can set the data deletion policy to:
-
DELETE: Deletes all data from your data source that’s converted into vector embeddings upon deletion of a knowledge base or data source resource. Note that the vector store itself is not deleted, only the data. This flag is ignored if an Amazon Web Services account is deleted.
-
RETAIN: Retains all data from your data source that’s converted into vector embeddings upon deletion of a knowledge base or data source resource. Note that the vector store itself is not deleted if you delete a knowledge base or data source resource.
For managed knowledge bases, the only supported option is
DELETE, which is also the default. -
-
server_side_encryption_configuration(Optional[ServerSideEncryptionConfiguration], default:None) –Contains details about the server-side encryption for the data source.
-
vector_ingestion_configuration(Optional[VectorIngestionConfiguration], default:None) –Contains details about how to ingest the documents in the data source.
Raises:
-
AccessDeniedException–The request is denied because of missing access permissions.
-
ConflictException–There was a conflict performing an operation.
-
InternalServerException–An internal server error occurred. Retry your request.
-
ResourceNotFoundException–The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
-
ServiceQuotaExceededException–The number of requests exceeds the service quota. Resubmit your request later.
-
ThrottlingException–The number of requests exceeds the limit. Resubmit your request later.
-
ValidationException–Input validation failed. Check your request parameters and retry the request.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_bedrock_agent/_services/async_bedrock_agent.py
2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 | |