Skip to content

Commit cac5724

Browse files
dineshSajwanDinesh Sajwangithub-actions
authored
feat(construct): added enableUserInput prop on agent (#450)
* feat(construct): added enableUserInput prop on agent * chore: self mutation Signed-off-by: github-actions <[email protected]> --------- Signed-off-by: github-actions <[email protected]> Co-authored-by: Dinesh Sajwan <[email protected]> Co-authored-by: github-actions <[email protected]>
1 parent 0c6cb31 commit cac5724

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

apidocs/interfaces/bedrock.AgentProps.md

+17
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Properties for a Bedrock Agent.
1313
- [actionGroups](bedrock.AgentProps.md#actiongroups)
1414
- [aliasName](bedrock.AgentProps.md#aliasname)
1515
- [description](bedrock.AgentProps.md#description)
16+
- [enableUserInput](bedrock.AgentProps.md#enableuserinput)
1617
- [encryptionKey](bedrock.AgentProps.md#encryptionkey)
1718
- [foundationModel](bedrock.AgentProps.md#foundationmodel)
1819
- [idleSessionTTL](bedrock.AgentProps.md#idlesessionttl)
@@ -67,6 +68,22 @@ A description of the agent.
6768

6869
___
6970

71+
### enableUserInput
72+
73+
`Optional` `Readonly` **enableUserInput**: `boolean`
74+
75+
Select whether the agent can prompt additional
76+
information from the user when it does not have
77+
enough information to respond to an utterance
78+
79+
**`Default`**
80+
81+
```ts
82+
- False
83+
```
84+
85+
___
86+
7087
### encryptionKey
7188

7289
`Optional` `Readonly` **encryptionKey**: `IKey`

src/cdk-lib/bedrock/agent.ts

+19
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,16 @@ export interface AgentProps {
235235
*/
236236
readonly actionGroups?: AgentActionGroup[];
237237

238+
239+
/**
240+
* Select whether the agent can prompt additional
241+
* information from the user when it does not have
242+
* enough information to respond to an utterance
243+
*
244+
* @default - False
245+
*/
246+
readonly enableUserInput?: boolean;
247+
238248
/**
239249
* How long sessions should be kept open for the agent.
240250
*
@@ -444,6 +454,15 @@ export class Agent extends Construct {
444454
if (props.actionGroups) {
445455
this.addActionGroups(props.actionGroups);
446456
}
457+
// To allow your agent to request the user for additional information
458+
// when trying to complete a task , add this action group
459+
if (props.enableUserInput) {
460+
this.addActionGroup(new AgentActionGroup(this, 'userInputEnabledActionGroup', {
461+
actionGroupName: 'UserInputAction',
462+
parentActionGroupSignature: 'AMAZON.UserInput',
463+
actionGroupState: 'ENABLED',
464+
}));
465+
}
447466
}
448467

449468

0 commit comments

Comments
 (0)