PromptProps
- class aws_cdk.aws_bedrock_alpha.PromptProps(*, prompt_name, default_variant=None, description=None, kms_key=None, tags=None, variants=None)
Bases:
object
(experimental) Properties for creating a CDK managed Bedrock Prompt.
- Parameters:
prompt_name (
str
) – (experimental) The name of the prompt. This will be used as the physical name of the prompt. Allowed Pattern: ^([0-9a-zA-Z][_-]?){1,100}$default_variant (
Optional
[IPromptVariant
]) – (experimental) The Prompt Variant that will be used by default. Default: - No default variant provided.description (
Optional
[str
]) – (experimental) A description of what the prompt does. Default: - No description provided. Maximum Length: 200kms_key (
Optional
[IKey
]) – (experimental) The KMS key that the prompt is encrypted with. Default: - AWS owned and managed key.tags (
Optional
[Mapping
[str
,str
]]) – (experimental) Tags to apply to the prompt. Default: - No tags applied.variants (
Optional
[Sequence
[IPromptVariant
]]) – (experimental) The variants of your prompt. Variants can use different messages, models, or configurations so that you can compare their outputs to decide the best variant for your use case. Maximum of 1 variants. Default: - No additional variants provided.
- Stability:
experimental
- ExampleMetadata:
fixture=default infused
Example:
cmk = kms.Key(self, "cmk") # Assuming you have an existing agent and alias agent = bedrock.Agent.from_agent_attributes(self, "ImportedAgent", agent_arn="arn:aws:bedrock:region:account:agent/agent-id", role_arn="arn:aws:iam::account:role/agent-role" ) agent_alias = bedrock.AgentAlias.from_attributes(self, "ImportedAlias", alias_id="alias-id", alias_name="my-alias", agent_version="1", agent=agent ) agent_variant = bedrock.PromptVariant.agent( variant_name="agent-variant", model=bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V1_0, agent_alias=agent_alias, prompt_text="Use the agent to help with: {{task}}. Please be thorough and provide detailed explanations.", prompt_variables=["task"] ) bedrock.Prompt(self, "agentPrompt", prompt_name="agent-prompt", description="Prompt for agent interactions", default_variant=agent_variant, variants=[agent_variant], kms_key=cmk )
Attributes
- default_variant
(experimental) The Prompt Variant that will be used by default.
- Default:
No default variant provided.
- Stability:
experimental
- description
(experimental) A description of what the prompt does.
- Default:
No description provided.
Maximum Length: 200
- Stability:
experimental
- kms_key
(experimental) The KMS key that the prompt is encrypted with.
- Default:
AWS owned and managed key.
- Stability:
experimental
- prompt_name
(experimental) The name of the prompt.
This will be used as the physical name of the prompt. Allowed Pattern: ^([0-9a-zA-Z][_-]?){1,100}$
- Stability:
experimental
- tags
(experimental) Tags to apply to the prompt.
- Default:
No tags applied.
- Stability:
experimental
- variants
(experimental) The variants of your prompt.
Variants can use different messages, models, or configurations so that you can compare their outputs to decide the best variant for your use case. Maximum of 1 variants.
- Default:
No additional variants provided.
- Stability:
experimental