Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(construct): Support for bedrock guardrail #473

Merged
merged 20 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .projen/deps.json

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

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

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

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

const project = new awscdk.AwsCdkConstructLibrary({
author: 'Amazon Web Services - Prototyping and Cloud Engineering',
Expand Down Expand Up @@ -59,6 +59,7 @@ const project = new awscdk.AwsCdkConstructLibrary({
'typedoc',
'typedoc-plugin-markdown',
'aws-sdk-mock',
'@aws-cdk/assert',
],
deps: [
'cdk-nag',
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# CDK Generative AI Constructs V0.1.165 (2024-05-30)

Based on CDK library version 2.143.0

# CDK Generative AI Constructs V0.1.148 (2024-05-15)

Based on CDK library version 2.141.0
Expand Down
11 changes: 10 additions & 1 deletion apidocs/classes/bedrock.AgentActionGroup.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- [actionGroupState](bedrock.AgentActionGroup.md#actiongroupstate)
- [apiSchema](bedrock.AgentActionGroup.md#apischema)
- [description](bedrock.AgentActionGroup.md#description)
- [functionSchema](bedrock.AgentActionGroup.md#functionschema)
- [node](bedrock.AgentActionGroup.md#node)
- [parentActionGroupSignature](bedrock.AgentActionGroup.md#parentactiongroupsignature)
- [skipResourceInUseCheckOnDelete](bedrock.AgentActionGroup.md#skipresourceinusecheckondelete)
Expand Down Expand Up @@ -59,7 +60,7 @@ Construct.constructor

### actionGroupExecutor

• `Readonly` **actionGroupExecutor**: `undefined` \| `IFunction`
• `Readonly` **actionGroupExecutor**: `undefined` \| [`ActionGroupExecutor`](../interfaces/bedrock.ActionGroupExecutor.md)

The Lambda function containing the business logic that is carried out upon invoking the action.

Expand Down Expand Up @@ -105,6 +106,14 @@ The description.

___

### functionSchema

• `Readonly` **functionSchema**: `undefined` \| `FunctionSchemaProperty`

A list of action groups associated with the agent

___

### node

• `Readonly` **node**: `Node`
Expand Down
155 changes: 155 additions & 0 deletions apidocs/classes/bedrock.ContentPolicyConfig.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
[@cdklabs/generative-ai-cdk-constructs](../README.md) / [bedrock](../modules/bedrock.md) / ContentPolicyConfig

# Class: ContentPolicyConfig

[bedrock](../modules/bedrock.md).ContentPolicyConfig

## Hierarchy

- `Construct`

↳ **`ContentPolicyConfig`**

## Table of contents

### Constructors

- [constructor](bedrock.ContentPolicyConfig.md#constructor)

### Properties

- [contentPolicyConfigList](bedrock.ContentPolicyConfig.md#contentpolicyconfiglist)
- [node](bedrock.ContentPolicyConfig.md#node)

### Methods

- [createContentFilterConfig](bedrock.ContentPolicyConfig.md#createcontentfilterconfig)
- [createContentPolicyConfigList](bedrock.ContentPolicyConfig.md#createcontentpolicyconfiglist)
- [toString](bedrock.ContentPolicyConfig.md#tostring)
- [isConstruct](bedrock.ContentPolicyConfig.md#isconstruct)

## Constructors

### constructor

• **new ContentPolicyConfig**(`scope`, `id`, `props?`): [`ContentPolicyConfig`](bedrock.ContentPolicyConfig.md)

#### Parameters

| Name | Type |
| :------ | :------ |
| `scope` | `Construct` |
| `id` | `string` |
| `props?` | [`ContentPolicyConfigProps`](../interfaces/bedrock.ContentPolicyConfigProps.md)[] |

#### Returns

[`ContentPolicyConfig`](bedrock.ContentPolicyConfig.md)

#### Overrides

Construct.constructor

## Properties

### contentPolicyConfigList

• `Readonly` **contentPolicyConfigList**: `ContentFilterConfigProperty`[]

___

### node

• `Readonly` **node**: `Node`

The tree node.

#### Inherited from

Construct.node

## Methods

### createContentFilterConfig

▸ **createContentFilterConfig**(`prop`): `ContentFilterConfigProperty`

#### Parameters

| Name | Type |
| :------ | :------ |
| `prop` | [`ContentPolicyConfigProps`](../interfaces/bedrock.ContentPolicyConfigProps.md) |

#### Returns

`ContentFilterConfigProperty`

___

### createContentPolicyConfigList

▸ **createContentPolicyConfigList**(`props?`): `ContentFilterConfigProperty`[]

#### Parameters

| Name | Type |
| :------ | :------ |
| `props?` | [`ContentPolicyConfigProps`](../interfaces/bedrock.ContentPolicyConfigProps.md)[] |

#### Returns

`ContentFilterConfigProperty`[]

___

### toString

▸ **toString**(): `string`

Returns a string representation of this construct.

#### Returns

`string`

#### Inherited from

Construct.toString

___

### isConstruct

▸ **isConstruct**(`x`): x is Construct

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct`
instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on
disk are seen as independent, completely different libraries. As a
consequence, the class `Construct` in each copy of the `constructs` library
is seen as a different class, and an instance of one class will not test as
`instanceof` the other class. `npm install` will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the `constructs`
library can be accidentally installed, and `instanceof` will behave
unpredictably. It is safest to avoid using `instanceof`, and using
this type-testing method instead.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `x` | `any` | Any object |

#### Returns

x is Construct

true if `x` is an object created from a class which extends `Construct`.

#### Inherited from

Construct.isConstruct
Loading
Loading