Skip to content

Commit

Permalink
feat(bedrock): add default prompt router (#882)
Browse files Browse the repository at this point in the history
* feat(bedrock): add default prompt router

* feat(bedrock): syntax change

* chore(cdk): upgrade cdk version and fix build

* chore(doc): update readme

---------

Co-authored-by: krokoko <[email protected]>
  • Loading branch information
aws-rafams and krokoko authored Jan 7, 2025
1 parent 1d19647 commit 132eb07
Show file tree
Hide file tree
Showing 27 changed files with 778 additions and 30 deletions.
10 changes: 9 additions & 1 deletion .gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .npmignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .projen/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

69 changes: 69 additions & 0 deletions .projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
const GITHUB_USER = 'awslabs';
const PUBLICATION_NAMESPACE = 'cdklabs';
const PROJECT_NAME = 'generative-ai-cdk-constructs';
const CDK_VERSION: string = '2.174.0';
const CDK_VERSION: string = '2.174.1';

function camelCaseIt(input: string): string {
// Hypens and dashes to spaces and then CamelCase...
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# CDK Generative AI Constructs V0.1.289 (2025-01-08)
# CDK Generative AI Constructs V0.1.290 (2025-01-08)

Based on CDK library version 2.174.1

# CDK Generative AI Constructs V0.1.289 (2025-01-06)

Based on CDK library version 2.174.0

Expand Down
2 changes: 1 addition & 1 deletion DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Default output format [None]: json
```

- [Node](https://nodejs.org/en) >= v20.9.0
- [AWS CDK](https://github.com/aws/aws-cdk/releases/tag/v2.174.0) >= 2.174.0
- [AWS CDK](https://github.com/aws/aws-cdk/releases/tag/v2.174.1) >= 2.174.1
- [Python](https://www.python.org/downloads/) >=3.9
- [Projen](https://github.com/projen/projen) >= 0.78.8
- [Yarn](https://classic.yarnpkg.com/lang/en/docs/cli/install/) >= 1.22.19
Expand Down
8 changes: 8 additions & 0 deletions apidocs/namespaces/bedrock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
- [DataSource](classes/DataSource.md)
- [DataSourceBase](classes/DataSourceBase.md)
- [DataSourceNew](classes/DataSourceNew.md)
- [DefaultPromptRouterIdentifier](classes/DefaultPromptRouterIdentifier.md)
- [Guardrail](classes/Guardrail.md)
- [GuardrailBase](classes/GuardrailBase.md)
- [InferenceProfileBase](classes/InferenceProfileBase.md)
Expand All @@ -60,6 +61,7 @@
- [ParsingStategy](classes/ParsingStategy.md)
- [Prompt](classes/Prompt.md)
- [PromptBase](classes/PromptBase.md)
- [PromptRouter](classes/PromptRouter.md)
- [PromptVariant](classes/PromptVariant.md)
- [PromptVersion](classes/PromptVersion.md)
- [S3ApiSchema](classes/S3ApiSchema.md)
Expand Down Expand Up @@ -106,6 +108,7 @@
- [IKnowledgeBase](interfaces/IKnowledgeBase.md)
- [InferenceConfiguration](interfaces/InferenceConfiguration.md)
- [IPrompt](interfaces/IPrompt.md)
- [IPromptRouter](interfaces/IPromptRouter.md)
- [KnowledgeBaseAttributes](interfaces/KnowledgeBaseAttributes.md)
- [KnowledgeBaseProps](interfaces/KnowledgeBaseProps.md)
- [LambdaCustomTransformationProps](interfaces/LambdaCustomTransformationProps.md)
Expand All @@ -114,6 +117,7 @@
- [PromptConfiguration](interfaces/PromptConfiguration.md)
- [PromptOverrideConfiguration](interfaces/PromptOverrideConfiguration.md)
- [PromptProps](interfaces/PromptProps.md)
- [PromptRouterProps](interfaces/PromptRouterProps.md)
- [PromptVersionProps](interfaces/PromptVersionProps.md)
- [RegexFilter](interfaces/RegexFilter.md)
- [S3DataSourceAssociationProps](interfaces/S3DataSourceAssociationProps.md)
Expand All @@ -130,6 +134,10 @@
- [WebCrawlerDataSourceAssociationProps](interfaces/WebCrawlerDataSourceAssociationProps.md)
- [WebCrawlerDataSourceProps](interfaces/WebCrawlerDataSourceProps.md)

## Variables

- [REGION\_TO\_GEO\_AREA](variables/REGION_TO_GEO_AREA.md)

## Functions

- [validateInferenceConfiguration](functions/validateInferenceConfiguration.md)
Expand Down
16 changes: 14 additions & 2 deletions apidocs/namespaces/bedrock/classes/BedrockFoundationModel.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,16 +197,28 @@ The ARN of the Bedrock invokable abstraction.
***

### META\_LLAMA\_3\_2\_11B\_INSTRUCT\_V1
### META\_LLAMA\_3\_1\_70B\_INSTRUCT\_V1

> `readonly` `static` **META\_LLAMA\_3\_2\_11B\_INSTRUCT\_V1**: [`BedrockFoundationModel`](BedrockFoundationModel.md)
> `readonly` `static` **META\_LLAMA\_3\_1\_70B\_INSTRUCT\_V1**: [`BedrockFoundationModel`](BedrockFoundationModel.md)
***

### META\_LLAMA\_3\_1\_8B\_INSTRUCT\_V1

> `readonly` `static` **META\_LLAMA\_3\_1\_8B\_INSTRUCT\_V1**: [`BedrockFoundationModel`](BedrockFoundationModel.md)
*************************************************************************
META
*************************************************************************

***

### META\_LLAMA\_3\_2\_11B\_INSTRUCT\_V1

> `readonly` `static` **META\_LLAMA\_3\_2\_11B\_INSTRUCT\_V1**: [`BedrockFoundationModel`](BedrockFoundationModel.md)
***

### META\_LLAMA\_3\_2\_1B\_INSTRUCT\_V1

> `readonly` `static` **META\_LLAMA\_3\_2\_1B\_INSTRUCT\_V1**: [`BedrockFoundationModel`](BedrockFoundationModel.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[**@cdklabs/generative-ai-cdk-constructs**](../../../README.md)

***

[@cdklabs/generative-ai-cdk-constructs](../../../README.md) / [bedrock](../README.md) / DefaultPromptRouterIdentifier

# Class: DefaultPromptRouterIdentifier

Represents identifiers for default prompt routers in Bedrock

## Properties

### promptRouterId

> `readonly` **promptRouterId**: `string`
***

### routingModels

> `readonly` **routingModels**: [`BedrockFoundationModel`](BedrockFoundationModel.md)[]
***

### ANTHROPIC\_CLAUDE\_V1

> `readonly` `static` **ANTHROPIC\_CLAUDE\_V1**: [`DefaultPromptRouterIdentifier`](DefaultPromptRouterIdentifier.md)
Anthropic Claude V1 router configuration

***

### META\_LLAMA\_3\_1

> `readonly` `static` **META\_LLAMA\_3\_1**: [`DefaultPromptRouterIdentifier`](DefaultPromptRouterIdentifier.md)
Meta Llama 3.1 router configuration
Loading

0 comments on commit 132eb07

Please sign in to comment.