create_knowledge_base
async
¶
create_knowledge_base(
name: Name,
role_arn: KnowledgeBaseRoleArn,
knowledge_base_configuration: KnowledgeBaseConfiguration,
*,
config_overrides: Optional[AsyncBedrockAgentClientConfig] = None,
client_token: Optional[ClientToken] = None,
description: Optional[Description] = None,
storage_configuration: Optional[StorageConfiguration] = None,
tags: Optional[TagsMap] = None,
) -> CreateKnowledgeBaseResponse
Creates a knowledge base. A knowledge base contains your data sources so that Large Language Models (LLMs) can use your data. To create a knowledge base, you must first set up your data sources and configure a supported vector store. For more information, see Set up a knowledge base.
To create a managed knowledge base, provide a managedKnowledgeBaseConfiguration during creation. For more information, see Build a managed knowledge base.
-
Provide the
nameand an optionaldescription. -
Provide the Amazon Resource Name (ARN) with permissions to create a knowledge base in the
roleArnfield. -
For managed knowledge bases, set
embeddingModelTypetoMANAGEDto use the service-managed embedding model, orCUSTOMwith anembeddingModelArnto use your own. To use your own KMS key for encryption, provide the ARN inserverSideEncryptionConfiguration. No vector store configuration is required for managed knowledge bases. -
For self-managed knowledge bases, provide the embedding model to use in the
embeddingModelArnfield in theknowledgeBaseConfigurationobject. -
For self-managed knowledge bases, provide the configuration for your vector store in the
storageConfigurationobject.-
For an Amazon OpenSearch Service database, use the
opensearchServerlessConfigurationobject. For more information, see Create a vector store in Amazon OpenSearch Service. -
For an Amazon Aurora database, use the
RdsConfigurationobject. For more information, see Create a vector store in Amazon Aurora. -
For a Pinecone database, use the
pineconeConfigurationobject. For more information, see Create a vector store in Pinecone. -
For a Redis Enterprise Cloud database, use the
redisEnterpriseCloudConfigurationobject. For more information, see Create a vector store in Redis Enterprise Cloud.
-
Parameters:
-
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) –A name for the knowledge base.
-
description(Optional[Description], default:None) –A description of the knowledge base.
-
role_arn(KnowledgeBaseRoleArn) –The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the knowledge base.
-
knowledge_base_configuration(KnowledgeBaseConfiguration) –Contains details about the embeddings model used for the knowledge base.
-
storage_configuration(Optional[StorageConfiguration], default:None) –Contains details about the configuration of the vector database used for the knowledge base.
-
tags(Optional[TagsMap], default:None) –Specify the key-value pairs for the tags that you want to attach to your knowledge base in this object.
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.
-
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
4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 | |