Skip to content

Commit 80231df

Browse files
authored
feat: bedrock agent custom resources and constructs (#207)
* feat(aoss-vectors): constructs and index custom resource * feat(bedrock): custom resources provider and lambda * feat(bedrock): foundation model class * feat(bedrock): kb backed by opensearch * feat(bedrock): s3 data source * feat(bedrock): agent construct * fix(bedrock): conform to unit tests * fix(bedrock): permissions corrections * feat(bedrock): knowledge base is taggable * chore(utils): split generatePhysicalName and refactor * chore(opensearch): refactor into cdk-lib * chore(cdk-lib): reexport index and fix jsii issues * chore(bedrock): remove unneeded model classes * chore(bedrock): rename custom-resource-provider * feat(bedrock): vector store and index creation is optional * chore(bedrock): use consistent instruction prop for kb * fix(bedrock): agent requires instruction prop * fix(bedrock): only create kb association policy if there is a kb * feat(bedrock): addAlias and remove default alias * chore(apidoc): typedoc for api docs * fix(bedrock): agent alias properties * chore(cdk-libs): overview docs * fix(apidocs): remove git source links * chore(apidocs): post merge doc generation
1 parent 99ddf75 commit 80231df

File tree

103 files changed

+24790
-88
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+24790
-88
lines changed

.projen/deps.json

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projen/tasks.json

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projenrc.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ const project = new awscdk.AwsCdkConstructLibrary({
5353
'husky',
5454
'pinst',
5555
'@mrgrain/jsii-struct-builder',
56+
'typedoc',
57+
'typedoc-plugin-markdown',
5658
],
5759
deps: ['cdk-nag'],
5860

@@ -191,4 +193,9 @@ project.addTask('generate-models-containers', {
191193
],
192194
});
193195

196+
const postCompile = project.tasks.tryFind('post-compile');
197+
if (postCompile) {
198+
postCompile.exec('npx typedoc --plugin typedoc-plugin-markdown --out apidocs --readme none --categoryOrder "Namespaces,Classes,Interfaces,*" --disableSources ./src/index.ts');
199+
}
200+
194201
project.synth();

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ The following constructs are available in the library:
7878
| [SageMaker model deployment (Jumpstart)](./src/patterns/gen-ai/aws-model-deployment-sagemaker/README_jumpstart.md) | Deploy a foundation model from Amazon SageMaker JumpStart to an Amazon SageMaker endpoint. | Amazon SageMaker |
7979
| [SageMaker model deployment (Hugging Face)](./src/patterns/gen-ai/aws-model-deployment-sagemaker/README_hugging_face.md) | Deploy a foundation model from Hugging Face to an Amazon SageMaker endpoint. | Amazon SageMaker |
8080
| [SageMaker model deployment (Custom)](./src/patterns/gen-ai/aws-model-deployment-sagemaker/README_custom_sagemaker_endpoint.md) | Deploy a foundation model from an S3 location to an Amazon SageMaker endpoint. | Amazon SageMaker |
81+
| [Amazon Bedrock](./src/cdk-lib/bedrock/README.md) | CDK L2 Constructs for Amazon Bedrock | Amazon Bedrock, Amazon OpenSearch Serverless, AWS Lambda |
82+
| [Amazon OpenSearch Serverless Vector Collection](./src/cdk-lib/opensearchserverless/README.md) | CDK L2 Constructs to create a vector collection | Amazon OpenSearch Vector Index |
83+
| [Amazon OpenSearch Vector Index](./src/cdk-lib/opensearch-vectorindex/README.md) | CDK L1 Custom Resource to create a vector index | Amazon OpenSearch Serverless, AWS Lambda |
8184

8285
# Sample Use Cases
8386

apidocs/.nojekyll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.

apidocs/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
@cdklabs/generative-ai-cdk-constructs
2+
3+
# @cdklabs/generative-ai-cdk-constructs
4+
5+
## Table of contents
6+
7+
### Namespaces
8+
9+
- [bedrock](modules/bedrock.md)
10+
- [opensearch\_vectorindex](modules/opensearch_vectorindex.md)
11+
- [opensearchserverless](modules/opensearchserverless.md)
12+
13+
### Classes
14+
15+
- [ContainerImage](classes/ContainerImage.md)
16+
- [CustomSageMakerEndpoint](classes/CustomSageMakerEndpoint.md)
17+
- [DeepLearningContainerImage](classes/DeepLearningContainerImage.md)
18+
- [HuggingFaceSageMakerEndpoint](classes/HuggingFaceSageMakerEndpoint.md)
19+
- [JumpStartModel](classes/JumpStartModel.md)
20+
- [JumpStartSageMakerEndpoint](classes/JumpStartSageMakerEndpoint.md)
21+
- [LangchainCommonDepsLayer](classes/LangchainCommonDepsLayer.md)
22+
- [LangchainCommonLayer](classes/LangchainCommonLayer.md)
23+
- [QaAppsyncOpensearch](classes/QaAppsyncOpensearch.md)
24+
- [RagAppsyncStepfnOpensearch](classes/RagAppsyncStepfnOpensearch.md)
25+
- [SageMakerEndpointBase](classes/SageMakerEndpointBase.md)
26+
- [SageMakerInstanceType](classes/SageMakerInstanceType.md)
27+
- [SummarizationAppsyncStepfn](classes/SummarizationAppsyncStepfn.md)
28+
29+
### Interfaces
30+
31+
- [AdapterProps](interfaces/AdapterProps.md)
32+
- [ContainerImageConfig](interfaces/ContainerImageConfig.md)
33+
- [CustomSageMakerEndpointProps](interfaces/CustomSageMakerEndpointProps.md)
34+
- [IHuggingFaceSageMakerEndpointProps](interfaces/IHuggingFaceSageMakerEndpointProps.md)
35+
- [IInstanceAliase](interfaces/IInstanceAliase.md)
36+
- [IInstanceValiant](interfaces/IInstanceValiant.md)
37+
- [IJumpStartModelSpec](interfaces/IJumpStartModelSpec.md)
38+
- [IJumpStartSageMakerEndpointProps](interfaces/IJumpStartSageMakerEndpointProps.md)
39+
- [LangchainLayerProps](interfaces/LangchainLayerProps.md)
40+
- [LangchainProps](interfaces/LangchainProps.md)
41+
- [QaAppsyncOpensearchProps](interfaces/QaAppsyncOpensearchProps.md)
42+
- [RagAppsyncStepfnOpensearchProps](interfaces/RagAppsyncStepfnOpensearchProps.md)
43+
- [SummarizationAppsyncStepfnProps](interfaces/SummarizationAppsyncStepfnProps.md)
44+
45+
### Variables
46+
47+
- [version](README.md#version)
48+
49+
## Variables
50+
51+
### version
52+
53+
`Const` **version**: `any`
54+
55+
The version of this package

apidocs/classes/ContainerImage.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
[@cdklabs/generative-ai-cdk-constructs](../README.md) / ContainerImage
2+
3+
# Class: ContainerImage
4+
5+
https://github.com/aws/deep-learning-containers/blob/master/available_images.md
6+
7+
## Hierarchy
8+
9+
- **`ContainerImage`**
10+
11+
[`DeepLearningContainerImage`](DeepLearningContainerImage.md)
12+
13+
## Table of contents
14+
15+
### Constructors
16+
17+
- [constructor](ContainerImage.md#constructor)
18+
19+
### Methods
20+
21+
- [bind](ContainerImage.md#bind)
22+
- [fromAsset](ContainerImage.md#fromasset)
23+
- [fromEcrRepository](ContainerImage.md#fromecrrepository)
24+
25+
## Constructors
26+
27+
### constructor
28+
29+
**new ContainerImage**(): [`ContainerImage`](ContainerImage.md)
30+
31+
#### Returns
32+
33+
[`ContainerImage`](ContainerImage.md)
34+
35+
## Methods
36+
37+
### bind
38+
39+
**bind**(`scope`, `grantable`): [`ContainerImageConfig`](../interfaces/ContainerImageConfig.md)
40+
41+
#### Parameters
42+
43+
| Name | Type |
44+
| :------ | :------ |
45+
| `scope` | `Construct` |
46+
| `grantable` | `IGrantable` |
47+
48+
#### Returns
49+
50+
[`ContainerImageConfig`](../interfaces/ContainerImageConfig.md)
51+
52+
___
53+
54+
### fromAsset
55+
56+
**fromAsset**(`directory`, `options?`): [`ContainerImage`](ContainerImage.md)
57+
58+
#### Parameters
59+
60+
| Name | Type |
61+
| :------ | :------ |
62+
| `directory` | `string` |
63+
| `options` | `DockerImageAssetOptions` |
64+
65+
#### Returns
66+
67+
[`ContainerImage`](ContainerImage.md)
68+
69+
___
70+
71+
### fromEcrRepository
72+
73+
**fromEcrRepository**(`repository`, `tag?`): [`ContainerImage`](ContainerImage.md)
74+
75+
#### Parameters
76+
77+
| Name | Type | Default value |
78+
| :------ | :------ | :------ |
79+
| `repository` | `IRepository` | `undefined` |
80+
| `tag` | `string` | `'latest'` |
81+
82+
#### Returns
83+
84+
[`ContainerImage`](ContainerImage.md)

0 commit comments

Comments
 (0)