Skip to content

Commit

Permalink
chore(bedrock): agent refactoring (#833)
Browse files Browse the repository at this point in the history
* refactor(bedrock): agents refactoring

---------

Signed-off-by: Alain Krok <[email protected]>
Co-authored-by: Alain Krok <[email protected]>
  • Loading branch information
aws-rafams and krokoko authored Jan 9, 2025
1 parent 53fb37b commit 87617a4
Show file tree
Hide file tree
Showing 81 changed files with 6,979 additions and 3,318 deletions.
8 changes: 8 additions & 0 deletions .gitignore

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

1 change: 1 addition & 0 deletions .npmignore

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.

Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,27 @@ List of supported versions of PostgreSQL for Aurora cluster.
### AURORA\_POSTGRESQL\_V15\_5

> `readonly` **AURORA\_POSTGRESQL\_V15\_5**: `AuroraPostgresEngineVersion` = `rds.AuroraPostgresEngineVersion.VER_15_5`
### AURORA\_POSTGRESQL\_V15\_6

> `readonly` **AURORA\_POSTGRESQL\_V15\_6**: `AuroraPostgresEngineVersion` = `rds.AuroraPostgresEngineVersion.VER_15_6`
### AURORA\_POSTGRESQL\_V15\_7

> `readonly` **AURORA\_POSTGRESQL\_V15\_7**: `AuroraPostgresEngineVersion` = `rds.AuroraPostgresEngineVersion.VER_15_7`
### AURORA\_POSTGRESQL\_V15\_8

> `readonly` **AURORA\_POSTGRESQL\_V15\_8**: `AuroraPostgresEngineVersion` = `rds.AuroraPostgresEngineVersion.VER_15_8`
### AURORA\_POSTGRESQL\_V16\_1

> `readonly` **AURORA\_POSTGRESQL\_V16\_1**: `AuroraPostgresEngineVersion` = `rds.AuroraPostgresEngineVersion.VER_16_1`
### AURORA\_POSTGRESQL\_V16\_2

> `readonly` **AURORA\_POSTGRESQL\_V16\_2**: `AuroraPostgresEngineVersion` = `rds.AuroraPostgresEngineVersion.VER_16_2`
### AURORA\_POSTGRESQL\_V16\_3

> `readonly` **AURORA\_POSTGRESQL\_V16\_3**: `AuroraPostgresEngineVersion` = `rds.AuroraPostgresEngineVersion.VER_16_3`
28 changes: 12 additions & 16 deletions apidocs/namespaces/bedrock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

## Enumerations

- [AgentStepType](enumerations/AgentStepType.md)
- [ChatMessageRole](enumerations/ChatMessageRole.md)
- [ConfluenceDataSourceAuthType](enumerations/ConfluenceDataSourceAuthType.md)
- [ConfluenceObjectType](enumerations/ConfluenceObjectType.md)
Expand All @@ -25,11 +26,7 @@
- [GuardrailAction](enumerations/GuardrailAction.md)
- [InferenceProfileType](enumerations/InferenceProfileType.md)
- [ManagedWordFilterType](enumerations/ManagedWordFilterType.md)
- [ParserMode](enumerations/ParserMode.md)
- [PromptCreationMode](enumerations/PromptCreationMode.md)
- [PromptState](enumerations/PromptState.md)
- [PromptTemplateType](enumerations/PromptTemplateType.md)
- [PromptType](enumerations/PromptType.md)
- [SalesforceDataSourceAuthType](enumerations/SalesforceDataSourceAuthType.md)
- [SalesforceObjectType](enumerations/SalesforceObjectType.md)
- [SharePointDataSourceAuthType](enumerations/SharePointDataSourceAuthType.md)
Expand All @@ -38,9 +35,12 @@

## Classes

- [ActionGroupExecutor](classes/ActionGroupExecutor.md)
- [Agent](classes/Agent.md)
- [AgentActionGroup](classes/AgentActionGroup.md)
- [AgentAlias](classes/AgentAlias.md)
- [AgentAliasBase](classes/AgentAliasBase.md)
- [AgentBase](classes/AgentBase.md)
- [ApiSchema](classes/ApiSchema.md)
- [ApplicationInferenceProfile](classes/ApplicationInferenceProfile.md)
- [BedrockFoundationModel](classes/BedrockFoundationModel.md)
Expand All @@ -58,9 +58,11 @@
- [InferenceProfileBase](classes/InferenceProfileBase.md)
- [InlineApiSchema](classes/InlineApiSchema.md)
- [KnowledgeBase](classes/KnowledgeBase.md)
- [ParentActionGroupSignature](classes/ParentActionGroupSignature.md)
- [ParsingStategy](classes/ParsingStategy.md)
- [Prompt](classes/Prompt.md)
- [PromptBase](classes/PromptBase.md)
- [PromptOverrideConfiguration](classes/PromptOverrideConfiguration.md)
- [PromptRouter](classes/PromptRouter.md)
- [PromptVariant](classes/PromptVariant.md)
- [PromptVersion](classes/PromptVersion.md)
Expand All @@ -74,13 +76,12 @@

## Interfaces

- [ActionGroupExecutor](interfaces/ActionGroupExecutor.md)
- [AddAgentAliasProps](interfaces/AddAgentAliasProps.md)
- [AgentActionGroupProps](interfaces/AgentActionGroupProps.md)
- [AgentAliasAttributes](interfaces/AgentAliasAttributes.md)
- [AgentAliasProps](interfaces/AgentAliasProps.md)
- [AgentAttributes](interfaces/AgentAttributes.md)
- [AgentPromptVariantProps](interfaces/AgentPromptVariantProps.md)
- [AgentProps](interfaces/AgentProps.md)
- [ApiSchemaConfig](interfaces/ApiSchemaConfig.md)
- [ApplicationInferenceProfileAttributes](interfaces/ApplicationInferenceProfileAttributes.md)
- [ApplicationInferenceProfileProps](interfaces/ApplicationInferenceProfileProps.md)
- [BedrockFoundationModelProps](interfaces/BedrockFoundationModelProps.md)
Expand All @@ -93,13 +94,14 @@
- [ContextualGroundingFilter](interfaces/ContextualGroundingFilter.md)
- [CrawlingFilters](interfaces/CrawlingFilters.md)
- [CrossRegionInferenceProfileProps](interfaces/CrossRegionInferenceProfileProps.md)
- [CustomParserProps](interfaces/CustomParserProps.md)
- [CustomTopicProps](interfaces/CustomTopicProps.md)
- [DataSourceAssociationProps](interfaces/DataSourceAssociationProps.md)
- [FoundationModelParsingStategyProps](interfaces/FoundationModelParsingStategyProps.md)
- [GuardrailAttributes](interfaces/GuardrailAttributes.md)
- [GuardrailConfiguration](interfaces/GuardrailConfiguration.md)
- [GuardrailProps](interfaces/GuardrailProps.md)
- [HierarchicalChunkingProps](interfaces/HierarchicalChunkingProps.md)
- [IAgent](interfaces/IAgent.md)
- [IAgentAlias](interfaces/IAgentAlias.md)
- [IDataSource](interfaces/IDataSource.md)
- [IGuardrail](interfaces/IGuardrail.md)
Expand All @@ -114,15 +116,14 @@
- [LambdaCustomTransformationProps](interfaces/LambdaCustomTransformationProps.md)
- [PIIFilter](interfaces/PIIFilter.md)
- [PromptAttributes](interfaces/PromptAttributes.md)
- [PromptConfiguration](interfaces/PromptConfiguration.md)
- [PromptOverrideConfiguration](interfaces/PromptOverrideConfiguration.md)
- [PromptProps](interfaces/PromptProps.md)
- [PromptRouterProps](interfaces/PromptRouterProps.md)
- [PromptStepConfiguration](interfaces/PromptStepConfiguration.md)
- [PromptStepConfigurationCustomParser](interfaces/PromptStepConfigurationCustomParser.md)
- [PromptVersionProps](interfaces/PromptVersionProps.md)
- [RegexFilter](interfaces/RegexFilter.md)
- [S3DataSourceAssociationProps](interfaces/S3DataSourceAssociationProps.md)
- [S3DataSourceProps](interfaces/S3DataSourceProps.md)
- [S3Identifier](interfaces/S3Identifier.md)
- [SalesforceCrawlingFilters](interfaces/SalesforceCrawlingFilters.md)
- [SalesforceDataSourceAssociationProps](interfaces/SalesforceDataSourceAssociationProps.md)
- [SalesforceDataSourceProps](interfaces/SalesforceDataSourceProps.md)
Expand All @@ -137,8 +138,3 @@
## Variables

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

## Functions

- [validateInferenceConfiguration](functions/validateInferenceConfiguration.md)
- [validatePromptOverrideConfiguration](functions/validatePromptOverrideConfiguration.md)
82 changes: 82 additions & 0 deletions apidocs/namespaces/bedrock/classes/ActionGroupExecutor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
[**@cdklabs/generative-ai-cdk-constructs**](../../../README.md)

***

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

# Class: ActionGroupExecutor

Defines how fulfillment of the action group is handled after the necessary
information has been elicited from the user.
Valid executors are:
- Lambda function
- Return Control

## See

https://docs.aws.amazon.com/bedrock/latest/userguide/action-handle.html

## Properties

### customControl?

> `readonly` `optional` **customControl**: `string`
***

### lambdaFunction?

> `readonly` `optional` **lambdaFunction**: `IFunction`
***

### RETURN\_CONTROL

> `readonly` `static` **RETURN\_CONTROL**: [`ActionGroupExecutor`](ActionGroupExecutor.md)
Returns the action group invocation results directly in the InvokeAgent response.
The information and parameters can be sent to your own systems to yield results.

#### See

https://docs.aws.amazon.com/bedrock/latest/userguide/agents-returncontrol.html

## Methods

### \_render()

> **\_render**(): `ActionGroupExecutorProperty`
**`Internal`**

Format as CFN properties

This is an internal core function and should not be called directly.

#### Returns

`ActionGroupExecutorProperty`

***

### fromlambdaFunction()

> `static` **fromlambdaFunction**(`lambdaFunction`): [`ActionGroupExecutor`](ActionGroupExecutor.md)
Defines an action group with a Lambda function containing the business logic.

#### Parameters

##### lambdaFunction

`IFunction`

Lambda function to be called by the action group.

#### Returns

[`ActionGroupExecutor`](ActionGroupExecutor.md)

#### See

https://docs.aws.amazon.com/bedrock/latest/userguide/agents-lambda.html
Loading

0 comments on commit 87617a4

Please sign in to comment.