-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat(bedrockprompt): add prompt management to bedrock agents #34754
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
Merged
Merged
Changes from 21 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
6070433
feat(prompt): add prompt management for bedrock agent
00d04e0
feat(bedrockprompt): add integ test case and update readme
4ac3f2e
feat(bedrockprompt): updated documentation for rosetta
8af394a
Merge branch 'main' into bedrock_prompts
dineshSajwan 90d2eb7
feat(bedrockprompt): remove readme files
3a56a53
feat(bedrockprompt): remove integ test snapshots
d7f97dc
feat(prompt): updated integ snapshot
c317949
Merge branch 'main' into bedrock_prompts
dineshSajwan fff512e
feat(prompt): updated integ snapshot
c91d58d
feat(prompt): updated integ snapshot
e7eff9d
Merge branch 'main' into bedrock_prompts
dineshSajwan 670ebb2
Merge branch 'main' into bedrock_prompts
dineshSajwan 23f290c
fix(prompt): code review comments
c5da21c
fix(prompt): deleting agent snapshot to fix buid issues
1d18066
fix(prompt): updated yarn deps
2abbb7e
fix(prompt): updated integ test
0c7e28e
Merge branch 'main' into bedrock_prompts
dineshSajwan 69e8ffa
fix(prompt): updated readme for rosetta issues
ce8e827
fix(prompts): removed duplicate file
228ef7a
Merge branch 'main' into bedrock_prompts
dineshSajwan e58c45a
fix(prompt): removed l1 refrences
45ae2e7
chore(prompt): implemented code review comments
8e749a6
Merge branch 'main' into bedrock_prompts
dineshSajwan e8ecbb4
Merge branch 'main' into bedrock_prompts
mergify[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
packages/@aws-cdk/aws-bedrock-alpha/bedrock/prompts/agent-prompt-variant.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| import { CommonPromptVariantProps, PromptTemplateType, IPromptVariant } from './prompt-variant'; | ||
| import { IAgentAlias } from '../agents/agent-alias'; | ||
| import { PromptTemplateConfiguration } from './prompt-template-configuration'; | ||
| import { PromptGenAiResource } from './prompt-genai-resource'; | ||
|
|
||
| /** | ||
| * Properties for creating an agent prompt variant. | ||
| */ | ||
| export interface AgentPromptVariantProps extends CommonPromptVariantProps { | ||
| /** | ||
| * An alias pointing to the agent version to be used. | ||
| */ | ||
| readonly agentAlias: IAgentAlias; | ||
|
|
||
| /** | ||
| * The text prompt. Variables are used by enclosing its name with double curly braces | ||
| * as in `{{variable_name}}`. | ||
| */ | ||
| readonly promptText: string; | ||
| } | ||
|
|
||
| /** | ||
| * Creates an agent prompt template variant. | ||
| * | ||
| * @param props - Properties for the agent prompt variant | ||
| * @returns A PromptVariant configured for agent interactions | ||
| */ | ||
| export function createAgentPromptVariant(props: AgentPromptVariantProps): IPromptVariant { | ||
| return { | ||
| name: props.variantName, | ||
| templateType: PromptTemplateType.TEXT, | ||
| genAiResource: PromptGenAiResource.agent({ | ||
| agentAlias: props.agentAlias, | ||
| }), | ||
| templateConfiguration: PromptTemplateConfiguration.text({ | ||
| inputVariables: props.promptVariables, | ||
| text: props.promptText, | ||
| }), | ||
| }; | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.