Skip to content

Commit

Permalink
feat(bedrock): Implement Prompt management (#663)
Browse files Browse the repository at this point in the history
* feat(bedrock): add prompt management
  • Loading branch information
aws-rafams authored Aug 29, 2024
1 parent 1cc8b55 commit 6a135ff
Show file tree
Hide file tree
Showing 43 changed files with 2,829 additions and 1,027 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.json

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

9 changes: 9 additions & 0 deletions .gitignore

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

2 changes: 2 additions & 0 deletions .npmignore

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

10 changes: 10 additions & 0 deletions .projen/deps.json

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

84 changes: 82 additions & 2 deletions .projen/tasks.json

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

21 changes: 14 additions & 7 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const CDK_VERSION: string = '2.154.1';

function camelCaseIt(input: string): string {
// Hypens and dashes to spaces and then CamelCase...
return input.replace(/-/g, ' ').replace(/_/g, ' ').replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, function(match, _) { if (+match === 0) return ''; return match.toUpperCase(); });
return input.replace(/-/g, ' ').replace(/_/g, ' ').replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, function (match, _) { if (+match === 0) return ''; return match.toUpperCase(); });
}

const project = new awscdk.AwsCdkConstructLibrary({
Expand Down Expand Up @@ -64,6 +64,7 @@ const project = new awscdk.AwsCdkConstructLibrary({
'typedoc-plugin-markdown',
'aws-sdk-mock',
'@aws-cdk/assert',
`@aws-cdk/integ-tests-alpha@${CDK_VERSION}-alpha.0`,
],
deps: [
'cdk-nag',
Expand All @@ -80,21 +81,20 @@ const project = new awscdk.AwsCdkConstructLibrary({
npmAccess: NpmAccess.PUBLIC,

publishToPypi: {
distName: PUBLICATION_NAMESPACE+'.'+PROJECT_NAME,
module: (PUBLICATION_NAMESPACE.replace(/-/g, '_'))+'.'+(PROJECT_NAME.replace(/-/g, '_')), // PEP 8, convert hypens
distName: PUBLICATION_NAMESPACE + '.' + PROJECT_NAME,
module: (PUBLICATION_NAMESPACE.replace(/-/g, '_')) + '.' + (PROJECT_NAME.replace(/-/g, '_')), // PEP 8, convert hypens
// twineRegistryUrl: '${{ secrets.TWINE_REGISTRY_URL }}',
},

publishToNuget: {
dotNetNamespace: camelCaseIt(PUBLICATION_NAMESPACE)+'.'+camelCaseIt(PROJECT_NAME),
packageId: camelCaseIt(PUBLICATION_NAMESPACE)+'.'+camelCaseIt(PROJECT_NAME),
dotNetNamespace: camelCaseIt(PUBLICATION_NAMESPACE) + '.' + camelCaseIt(PROJECT_NAME),
packageId: camelCaseIt(PUBLICATION_NAMESPACE) + '.' + camelCaseIt(PROJECT_NAME),
},

publishToGo: {
moduleName: `github.com/${PUBLICATION_NAMESPACE}/${PROJECT_NAME}-go`,
packageName: PROJECT_NAME,
},

codeCov: true,
codeCovTokenSecret: 'CODECOV_TOKEN',

Expand All @@ -112,6 +112,7 @@ const project = new awscdk.AwsCdkConstructLibrary({
},
},
},
integrationTestAutoDiscover: true,
docgen: false,
licensed: true,
license: 'Apache-2.0',
Expand Down Expand Up @@ -147,6 +148,11 @@ if (workflowUpgradeMain) {
workflowUpgradeMain.updateJob('pr', buildUpgradeMainPRCustomJob());
}

// Update Snapshots
project.upgradeWorkflow?.postUpgradeTask.spawn(
project.tasks.tryFind('integ:snapshot-all')!,
);

// Add specific overrides https://projen.io/docs/integrations/github/#actions-versions
project.github?.actions.set('actions/checkout@v3', 'actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11'); // https://github.com/projen/projen/issues/3529
project.github?.actions.set('actions/checkout@v4', 'actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11');
Expand Down Expand Up @@ -207,6 +213,7 @@ project.eslint?.addPlugins('header');
project.eslint?.addRules({
'header/header': [2, 'header.js'],
});
project.eslint?.addRules({ 'space-infix-ops': ['error', { int32Hint: false }] });

project.eslint?.addIgnorePattern('LangchainProps.ts');
project.eslint?.addIgnorePattern('AdapterProps.ts');
Expand Down Expand Up @@ -243,7 +250,7 @@ project.addTask('generate-models-containers', {
},
{
say: 'Generate new list of models available from Jumpstart and DLC containers',
cwd: project.srcdir+'/patterns/gen-ai/aws-model-deployment-sagemaker/code-generation',
cwd: project.srcdir + '/patterns/gen-ai/aws-model-deployment-sagemaker/code-generation',
exec: 'npm run generate',
},
{
Expand Down
9 changes: 9 additions & 0 deletions apidocs/namespaces/bedrock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- [PiiEntitiesConfigAction](enumerations/PiiEntitiesConfigAction.md)
- [PromptCreationMode](enumerations/PromptCreationMode.md)
- [PromptState](enumerations/PromptState.md)
- [PromptTemplateType](enumerations/PromptTemplateType.md)
- [PromptType](enumerations/PromptType.md)
- [UKSpecific](enumerations/UKSpecific.md)
- [USASpecific](enumerations/USASpecific.md)
Expand All @@ -38,6 +39,9 @@
- [GuardrailVersion](classes/GuardrailVersion.md)
- [InlineApiSchema](classes/InlineApiSchema.md)
- [KnowledgeBase](classes/KnowledgeBase.md)
- [Prompt](classes/Prompt.md)
- [PromptVariant](classes/PromptVariant.md)
- [PromptVersion](classes/PromptVersion.md)
- [S3ApiSchema](classes/S3ApiSchema.md)
- [S3DataSource](classes/S3DataSource.md)
- [SensitiveInformationPolicyConfig](classes/SensitiveInformationPolicyConfig.md)
Expand All @@ -52,17 +56,22 @@
- [AgentProps](interfaces/AgentProps.md)
- [ApiSchemaConfig](interfaces/ApiSchemaConfig.md)
- [BedrockFoundationModelProps](interfaces/BedrockFoundationModelProps.md)
- [CommonPromptVariantProps](interfaces/CommonPromptVariantProps.md)
- [ContentPolicyConfigProps](interfaces/ContentPolicyConfigProps.md)
- [ContextualGroundingPolicyConfigProps](interfaces/ContextualGroundingPolicyConfigProps.md)
- [GuardrailConfiguration](interfaces/GuardrailConfiguration.md)
- [GuardrailProps](interfaces/GuardrailProps.md)
- [IPrompt](interfaces/IPrompt.md)
- [InferenceConfiguration](interfaces/InferenceConfiguration.md)
- [KnowledgeBaseProps](interfaces/KnowledgeBaseProps.md)
- [PromptConfiguration](interfaces/PromptConfiguration.md)
- [PromptOverrideConfiguration](interfaces/PromptOverrideConfiguration.md)
- [PromptProps](interfaces/PromptProps.md)
- [PromptVersionProps](interfaces/PromptVersionProps.md)
- [S3DataSourceProps](interfaces/S3DataSourceProps.md)
- [S3Identifier](interfaces/S3Identifier.md)
- [SensitiveInformationPolicyConfigProps](interfaces/SensitiveInformationPolicyConfigProps.md)
- [TextPromptVariantProps](interfaces/TextPromptVariantProps.md)
- [TopicProps](interfaces/TopicProps.md)

### Functions
Expand Down
Loading

0 comments on commit 6a135ff

Please sign in to comment.