CfnPromptVersionPropsMixin
- class aws_cdk.mixins_preview.aws_bedrock.mixins.CfnPromptVersionPropsMixin(props, *, strategy=None)
Bases:
MixinCreates a static snapshot of your prompt that can be deployed to production.
For more information, see Deploy prompts using Prompt management by creating versions in the Amazon Bedrock User Guide.
- See:
- CloudformationResource:
AWS::Bedrock::PromptVersion
- Mixin:
true
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview import mixins from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins cfn_prompt_version_props_mixin = bedrock_mixins.CfnPromptVersionPropsMixin(bedrock_mixins.CfnPromptVersionMixinProps( description="description", prompt_arn="promptArn", tags={ "tags_key": "tags" } ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::Bedrock::PromptVersion.- Parameters:
props (
Union[CfnPromptVersionMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['description', 'promptArn', 'tags']
Static Methods
- classmethod is_mixin(x)
(experimental) Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
CachePointBlockProperty
- class CfnPromptVersionPropsMixin.CachePointBlockProperty(*, type=None)
Bases:
objectDefines a section of content to be cached for reuse in subsequent API calls.
- Parameters:
type (
Optional[str]) – Specifies the type of cache point within the CachePointBlock.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins cache_point_block_property = bedrock_mixins.CfnPromptVersionPropsMixin.CachePointBlockProperty( type="type" )
Attributes
- type
Specifies the type of cache point within the CachePointBlock.
ChatPromptTemplateConfigurationProperty
- class CfnPromptVersionPropsMixin.ChatPromptTemplateConfigurationProperty(*, input_variables=None, messages=None, system=None, tool_configuration=None)
Bases:
objectContains configurations to use a prompt in a conversational format.
For more information, see Create a prompt using Prompt management .
- Parameters:
input_variables (
Union[IResolvable,Sequence[Union[IResolvable,PromptInputVariableProperty,Dict[str,Any]]],None]) – An array of the variables in the prompt template.messages (
Union[IResolvable,Sequence[Union[IResolvable,MessageProperty,Dict[str,Any]]],None]) – Contains messages in the chat for the prompt.system (
Union[IResolvable,Sequence[Union[IResolvable,SystemContentBlockProperty,Dict[str,Any]]],None]) – Contains system prompts to provide context to the model or to describe how it should behave.tool_configuration (
Union[IResolvable,ToolConfigurationProperty,Dict[str,Any],None]) – Configuration information for the tools that the model can use when generating a response.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins # any: Any # auto: Any # json: Any chat_prompt_template_configuration_property = bedrock_mixins.CfnPromptVersionPropsMixin.ChatPromptTemplateConfigurationProperty( input_variables=[bedrock_mixins.CfnPromptVersionPropsMixin.PromptInputVariableProperty( name="name" )], messages=[bedrock_mixins.CfnPromptVersionPropsMixin.MessageProperty( content=[bedrock_mixins.CfnPromptVersionPropsMixin.ContentBlockProperty( cache_point=bedrock_mixins.CfnPromptVersionPropsMixin.CachePointBlockProperty( type="type" ), text="text" )], role="role" )], system=[bedrock_mixins.CfnPromptVersionPropsMixin.SystemContentBlockProperty( cache_point=bedrock_mixins.CfnPromptVersionPropsMixin.CachePointBlockProperty( type="type" ), text="text" )], tool_configuration=bedrock_mixins.CfnPromptVersionPropsMixin.ToolConfigurationProperty( tool_choice=bedrock_mixins.CfnPromptVersionPropsMixin.ToolChoiceProperty( any=any, auto=auto, tool=bedrock_mixins.CfnPromptVersionPropsMixin.SpecificToolChoiceProperty( name="name" ) ), tools=[bedrock_mixins.CfnPromptVersionPropsMixin.ToolProperty( cache_point=bedrock_mixins.CfnPromptVersionPropsMixin.CachePointBlockProperty( type="type" ), tool_spec=bedrock_mixins.CfnPromptVersionPropsMixin.ToolSpecificationProperty( description="description", input_schema=bedrock_mixins.CfnPromptVersionPropsMixin.ToolInputSchemaProperty( json=json ), name="name" ) )] ) )
Attributes
- input_variables
An array of the variables in the prompt template.
- messages
Contains messages in the chat for the prompt.
- system
Contains system prompts to provide context to the model or to describe how it should behave.
- tool_configuration
Configuration information for the tools that the model can use when generating a response.
ContentBlockProperty
- class CfnPromptVersionPropsMixin.ContentBlockProperty(*, cache_point=None, text=None)
Bases:
objectA block of content for a message that you pass to, or receive from, a model with the Converse or ConverseStream API operations.
- Parameters:
cache_point (
Union[IResolvable,CachePointBlockProperty,Dict[str,Any],None]) – CachePoint to include in the message.text (
Optional[str]) – Text to include in the message.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins content_block_property = bedrock_mixins.CfnPromptVersionPropsMixin.ContentBlockProperty( cache_point=bedrock_mixins.CfnPromptVersionPropsMixin.CachePointBlockProperty( type="type" ), text="text" )
Attributes
- cache_point
CachePoint to include in the message.
- text
Text to include in the message.
MessageProperty
- class CfnPromptVersionPropsMixin.MessageProperty(*, content=None, role=None)
Bases:
objectA message input, or returned from, a call to Converse or ConverseStream .
- Parameters:
content (
Union[IResolvable,Sequence[Union[IResolvable,ContentBlockProperty,Dict[str,Any]]],None]) – The message content. Note the following restrictions:. - You can include up to 20 images. Each image’s size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively. - You can include up to five documents. Each document’s size must be no more than 4.5 MB. - If you include aContentBlockwith adocumentfield in the array, you must also include aContentBlockwith atextfield. - You can only include images and documents if theroleisuser.role (
Optional[str]) – The role that the message plays in the message.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins message_property = bedrock_mixins.CfnPromptVersionPropsMixin.MessageProperty( content=[bedrock_mixins.CfnPromptVersionPropsMixin.ContentBlockProperty( cache_point=bedrock_mixins.CfnPromptVersionPropsMixin.CachePointBlockProperty( type="type" ), text="text" )], role="role" )
Attributes
- content
.
You can include up to 20 images. Each image’s size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively.
You can include up to five documents. Each document’s size must be no more than 4.5 MB.
If you include a
ContentBlockwith adocumentfield in the array, you must also include aContentBlockwith atextfield.You can only include images and documents if the
roleisuser.
- See:
- Type:
The message content. Note the following restrictions
- role
The role that the message plays in the message.
PromptAgentResourceProperty
- class CfnPromptVersionPropsMixin.PromptAgentResourceProperty(*, agent_identifier=None)
Bases:
objectContains specifications for an Amazon Bedrock agent with which to use the prompt.
For more information, see Create a prompt using Prompt management and Automate tasks in your application using conversational agents .
- Parameters:
agent_identifier (
Optional[str]) – The ARN of the agent with which to use the prompt.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins prompt_agent_resource_property = bedrock_mixins.CfnPromptVersionPropsMixin.PromptAgentResourceProperty( agent_identifier="agentIdentifier" )
Attributes
- agent_identifier
The ARN of the agent with which to use the prompt.
PromptGenAiResourceProperty
- class CfnPromptVersionPropsMixin.PromptGenAiResourceProperty(*, agent=None)
Bases:
objectContains specifications for a generative AI resource with which to use the prompt.
For more information, see Create a prompt using Prompt management .
- Parameters:
agent (
Union[IResolvable,PromptAgentResourceProperty,Dict[str,Any],None]) – Specifies an Amazon Bedrock agent with which to use the prompt.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins prompt_gen_ai_resource_property = bedrock_mixins.CfnPromptVersionPropsMixin.PromptGenAiResourceProperty( agent=bedrock_mixins.CfnPromptVersionPropsMixin.PromptAgentResourceProperty( agent_identifier="agentIdentifier" ) )
Attributes
- agent
Specifies an Amazon Bedrock agent with which to use the prompt.
PromptInferenceConfigurationProperty
- class CfnPromptVersionPropsMixin.PromptInferenceConfigurationProperty(*, text=None)
Bases:
objectContains inference configurations for the prompt.
- Parameters:
text (
Union[IResolvable,PromptModelInferenceConfigurationProperty,Dict[str,Any],None]) – Contains inference configurations for a text prompt.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins prompt_inference_configuration_property = bedrock_mixins.CfnPromptVersionPropsMixin.PromptInferenceConfigurationProperty( text=bedrock_mixins.CfnPromptVersionPropsMixin.PromptModelInferenceConfigurationProperty( max_tokens=123, stop_sequences=["stopSequences"], temperature=123, top_p=123 ) )
Attributes
- text
Contains inference configurations for a text prompt.
PromptInputVariableProperty
- class CfnPromptVersionPropsMixin.PromptInputVariableProperty(*, name=None)
Bases:
objectContains information about a variable in the prompt.
- Parameters:
name (
Optional[str]) – The name of the variable.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins prompt_input_variable_property = bedrock_mixins.CfnPromptVersionPropsMixin.PromptInputVariableProperty( name="name" )
Attributes
PromptMetadataEntryProperty
- class CfnPromptVersionPropsMixin.PromptMetadataEntryProperty(*, key=None, value=None)
Bases:
objectContains a key-value pair that defines a metadata tag and value to attach to a prompt variant.
For more information, see Create a prompt using Prompt management .
- Parameters:
key (
Optional[str]) – The key of a metadata tag for a prompt variant.value (
Optional[str]) – The value of a metadata tag for a prompt variant.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins prompt_metadata_entry_property = bedrock_mixins.CfnPromptVersionPropsMixin.PromptMetadataEntryProperty( key="key", value="value" )
Attributes
- key
The key of a metadata tag for a prompt variant.
- value
The value of a metadata tag for a prompt variant.
PromptModelInferenceConfigurationProperty
- class CfnPromptVersionPropsMixin.PromptModelInferenceConfigurationProperty(*, max_tokens=None, stop_sequences=None, temperature=None, top_p=None)
Bases:
objectContains inference configurations related to model inference for a prompt.
For more information, see Inference parameters .
- Parameters:
max_tokens (
Union[int,float,None]) – The maximum number of tokens to return in the response.stop_sequences (
Optional[Sequence[str]]) – A list of strings that define sequences after which the model will stop generating.temperature (
Union[int,float,None]) – Controls the randomness of the response. Choose a lower value for more predictable outputs and a higher value for more surprising outputs.top_p (
Union[int,float,None]) – The percentage of most-likely candidates that the model considers for the next token.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins prompt_model_inference_configuration_property = bedrock_mixins.CfnPromptVersionPropsMixin.PromptModelInferenceConfigurationProperty( max_tokens=123, stop_sequences=["stopSequences"], temperature=123, top_p=123 )
Attributes
- max_tokens
The maximum number of tokens to return in the response.
- stop_sequences
A list of strings that define sequences after which the model will stop generating.
- temperature
Controls the randomness of the response.
Choose a lower value for more predictable outputs and a higher value for more surprising outputs.
- top_p
The percentage of most-likely candidates that the model considers for the next token.
PromptTemplateConfigurationProperty
- class CfnPromptVersionPropsMixin.PromptTemplateConfigurationProperty(*, chat=None, text=None)
Bases:
objectContains the message for a prompt.
For more information, see Construct and store reusable prompts with Prompt management in Amazon Bedrock .
- Parameters:
chat (
Union[IResolvable,ChatPromptTemplateConfigurationProperty,Dict[str,Any],None]) – Contains configurations to use the prompt in a conversational format.text (
Union[IResolvable,TextPromptTemplateConfigurationProperty,Dict[str,Any],None]) – Contains configurations for the text in a message for a prompt.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins # any: Any # auto: Any # json: Any prompt_template_configuration_property = bedrock_mixins.CfnPromptVersionPropsMixin.PromptTemplateConfigurationProperty( chat=bedrock_mixins.CfnPromptVersionPropsMixin.ChatPromptTemplateConfigurationProperty( input_variables=[bedrock_mixins.CfnPromptVersionPropsMixin.PromptInputVariableProperty( name="name" )], messages=[bedrock_mixins.CfnPromptVersionPropsMixin.MessageProperty( content=[bedrock_mixins.CfnPromptVersionPropsMixin.ContentBlockProperty( cache_point=bedrock_mixins.CfnPromptVersionPropsMixin.CachePointBlockProperty( type="type" ), text="text" )], role="role" )], system=[bedrock_mixins.CfnPromptVersionPropsMixin.SystemContentBlockProperty( cache_point=bedrock_mixins.CfnPromptVersionPropsMixin.CachePointBlockProperty( type="type" ), text="text" )], tool_configuration=bedrock_mixins.CfnPromptVersionPropsMixin.ToolConfigurationProperty( tool_choice=bedrock_mixins.CfnPromptVersionPropsMixin.ToolChoiceProperty( any=any, auto=auto, tool=bedrock_mixins.CfnPromptVersionPropsMixin.SpecificToolChoiceProperty( name="name" ) ), tools=[bedrock_mixins.CfnPromptVersionPropsMixin.ToolProperty( cache_point=bedrock_mixins.CfnPromptVersionPropsMixin.CachePointBlockProperty( type="type" ), tool_spec=bedrock_mixins.CfnPromptVersionPropsMixin.ToolSpecificationProperty( description="description", input_schema=bedrock_mixins.CfnPromptVersionPropsMixin.ToolInputSchemaProperty( json=json ), name="name" ) )] ) ), text=bedrock_mixins.CfnPromptVersionPropsMixin.TextPromptTemplateConfigurationProperty( cache_point=bedrock_mixins.CfnPromptVersionPropsMixin.CachePointBlockProperty( type="type" ), input_variables=[bedrock_mixins.CfnPromptVersionPropsMixin.PromptInputVariableProperty( name="name" )], text="text" ) )
Attributes
- chat
Contains configurations to use the prompt in a conversational format.
- text
Contains configurations for the text in a message for a prompt.
PromptVariantProperty
- class CfnPromptVersionPropsMixin.PromptVariantProperty(*, additional_model_request_fields=None, gen_ai_resource=None, inference_configuration=None, metadata=None, model_id=None, name=None, template_configuration=None, template_type=None)
Bases:
objectContains details about a variant of the prompt.
- Parameters:
additional_model_request_fields (
Any) – Contains model-specific inference configurations that aren’t in theinferenceConfigurationfield. To see model-specific inference parameters, see Inference request parameters and response fields for foundation models .gen_ai_resource (
Union[IResolvable,PromptGenAiResourceProperty,Dict[str,Any],None]) – Specifies a generative AI resource with which to use the prompt.inference_configuration (
Union[IResolvable,PromptInferenceConfigurationProperty,Dict[str,Any],None]) – Contains inference configurations for the prompt variant.metadata (
Union[IResolvable,Sequence[Union[IResolvable,PromptMetadataEntryProperty,Dict[str,Any]]],None]) – An array of objects, each containing a key-value pair that defines a metadata tag and value to attach to a prompt variant.model_id (
Optional[str]) – The unique identifier of the model or inference profile with which to run inference on the prompt.name (
Optional[str]) – The name of the prompt variant.template_configuration (
Union[IResolvable,PromptTemplateConfigurationProperty,Dict[str,Any],None]) – Contains configurations for the prompt template.template_type (
Optional[str]) – The type of prompt template to use.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins # additional_model_request_fields: Any # any: Any # auto: Any # json: Any prompt_variant_property = bedrock_mixins.CfnPromptVersionPropsMixin.PromptVariantProperty( additional_model_request_fields=additional_model_request_fields, gen_ai_resource=bedrock_mixins.CfnPromptVersionPropsMixin.PromptGenAiResourceProperty( agent=bedrock_mixins.CfnPromptVersionPropsMixin.PromptAgentResourceProperty( agent_identifier="agentIdentifier" ) ), inference_configuration=bedrock_mixins.CfnPromptVersionPropsMixin.PromptInferenceConfigurationProperty( text=bedrock_mixins.CfnPromptVersionPropsMixin.PromptModelInferenceConfigurationProperty( max_tokens=123, stop_sequences=["stopSequences"], temperature=123, top_p=123 ) ), metadata=[bedrock_mixins.CfnPromptVersionPropsMixin.PromptMetadataEntryProperty( key="key", value="value" )], model_id="modelId", name="name", template_configuration=bedrock_mixins.CfnPromptVersionPropsMixin.PromptTemplateConfigurationProperty( chat=bedrock_mixins.CfnPromptVersionPropsMixin.ChatPromptTemplateConfigurationProperty( input_variables=[bedrock_mixins.CfnPromptVersionPropsMixin.PromptInputVariableProperty( name="name" )], messages=[bedrock_mixins.CfnPromptVersionPropsMixin.MessageProperty( content=[bedrock_mixins.CfnPromptVersionPropsMixin.ContentBlockProperty( cache_point=bedrock_mixins.CfnPromptVersionPropsMixin.CachePointBlockProperty( type="type" ), text="text" )], role="role" )], system=[bedrock_mixins.CfnPromptVersionPropsMixin.SystemContentBlockProperty( cache_point=bedrock_mixins.CfnPromptVersionPropsMixin.CachePointBlockProperty( type="type" ), text="text" )], tool_configuration=bedrock_mixins.CfnPromptVersionPropsMixin.ToolConfigurationProperty( tool_choice=bedrock_mixins.CfnPromptVersionPropsMixin.ToolChoiceProperty( any=any, auto=auto, tool=bedrock_mixins.CfnPromptVersionPropsMixin.SpecificToolChoiceProperty( name="name" ) ), tools=[bedrock_mixins.CfnPromptVersionPropsMixin.ToolProperty( cache_point=bedrock_mixins.CfnPromptVersionPropsMixin.CachePointBlockProperty( type="type" ), tool_spec=bedrock_mixins.CfnPromptVersionPropsMixin.ToolSpecificationProperty( description="description", input_schema=bedrock_mixins.CfnPromptVersionPropsMixin.ToolInputSchemaProperty( json=json ), name="name" ) )] ) ), text=bedrock_mixins.CfnPromptVersionPropsMixin.TextPromptTemplateConfigurationProperty( cache_point=bedrock_mixins.CfnPromptVersionPropsMixin.CachePointBlockProperty( type="type" ), input_variables=[bedrock_mixins.CfnPromptVersionPropsMixin.PromptInputVariableProperty( name="name" )], text="text" ) ), template_type="templateType" )
Attributes
- additional_model_request_fields
Contains model-specific inference configurations that aren’t in the
inferenceConfigurationfield.To see model-specific inference parameters, see Inference request parameters and response fields for foundation models .
- gen_ai_resource
Specifies a generative AI resource with which to use the prompt.
- inference_configuration
Contains inference configurations for the prompt variant.
- metadata
An array of objects, each containing a key-value pair that defines a metadata tag and value to attach to a prompt variant.
- model_id
The unique identifier of the model or inference profile with which to run inference on the prompt.
- name
The name of the prompt variant.
- template_configuration
Contains configurations for the prompt template.
- template_type
The type of prompt template to use.
SpecificToolChoiceProperty
- class CfnPromptVersionPropsMixin.SpecificToolChoiceProperty(*, name=None)
Bases:
objectThe model must request a specific tool.
For example,
{"tool" : {"name" : "Your tool name"}}. For more information, see Call a tool with the Converse API in the Amazon Bedrock User Guide .. epigraph:This field is only supported by Anthropic Claude 3 models.
- Parameters:
name (
Optional[str]) – The name of the tool that the model must request.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins specific_tool_choice_property = bedrock_mixins.CfnPromptVersionPropsMixin.SpecificToolChoiceProperty( name="name" )
Attributes
- name
The name of the tool that the model must request.
SystemContentBlockProperty
- class CfnPromptVersionPropsMixin.SystemContentBlockProperty(*, cache_point=None, text=None)
Bases:
objectContains configurations for instructions to provide the model for how to handle input.
To learn more, see Using the Converse API .
- Parameters:
cache_point (
Union[IResolvable,CachePointBlockProperty,Dict[str,Any],None]) – CachePoint to include in the system prompt.text (
Optional[str]) – A system prompt for the model.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins system_content_block_property = bedrock_mixins.CfnPromptVersionPropsMixin.SystemContentBlockProperty( cache_point=bedrock_mixins.CfnPromptVersionPropsMixin.CachePointBlockProperty( type="type" ), text="text" )
Attributes
- cache_point
CachePoint to include in the system prompt.
TextPromptTemplateConfigurationProperty
- class CfnPromptVersionPropsMixin.TextPromptTemplateConfigurationProperty(*, cache_point=None, input_variables=None, text=None)
Bases:
objectContains configurations for a text prompt template.
To include a variable, enclose a word in double curly braces as in
{{variable}}.- Parameters:
cache_point (
Union[IResolvable,CachePointBlockProperty,Dict[str,Any],None]) – A cache checkpoint within a template configuration.input_variables (
Union[IResolvable,Sequence[Union[IResolvable,PromptInputVariableProperty,Dict[str,Any]]],None]) – An array of the variables in the prompt template.text (
Optional[str]) – The message for the prompt.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins text_prompt_template_configuration_property = bedrock_mixins.CfnPromptVersionPropsMixin.TextPromptTemplateConfigurationProperty( cache_point=bedrock_mixins.CfnPromptVersionPropsMixin.CachePointBlockProperty( type="type" ), input_variables=[bedrock_mixins.CfnPromptVersionPropsMixin.PromptInputVariableProperty( name="name" )], text="text" )
Attributes
- cache_point
A cache checkpoint within a template configuration.
- input_variables
An array of the variables in the prompt template.
ToolChoiceProperty
- class CfnPromptVersionPropsMixin.ToolChoiceProperty(*, any=None, auto=None, tool=None)
Bases:
objectDetermines which tools the model should request in a call to
ConverseorConverseStream.For more information, see Call a tool with the Converse API in the Amazon Bedrock User Guide.
- Parameters:
any (
Any) – The model must request at least one tool (no text is generated).auto (
Any) – (Default). The Model automatically decides if a tool should be called or whether to generate text instead.tool (
Union[IResolvable,SpecificToolChoiceProperty,Dict[str,Any],None]) – The Model must request the specified tool. Only supported by Anthropic Claude 3 and Amazon Nova models.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins # any: Any # auto: Any tool_choice_property = bedrock_mixins.CfnPromptVersionPropsMixin.ToolChoiceProperty( any=any, auto=auto, tool=bedrock_mixins.CfnPromptVersionPropsMixin.SpecificToolChoiceProperty( name="name" ) )
Attributes
- any
The model must request at least one tool (no text is generated).
- auto
(Default).
The Model automatically decides if a tool should be called or whether to generate text instead.
- tool
The Model must request the specified tool.
Only supported by Anthropic Claude 3 and Amazon Nova models.
ToolConfigurationProperty
- class CfnPromptVersionPropsMixin.ToolConfigurationProperty(*, tool_choice=None, tools=None)
Bases:
objectConfiguration information for the tools that you pass to a model.
For more information, see Tool use (function calling) in the Amazon Bedrock User Guide.
- Parameters:
tool_choice (
Union[IResolvable,ToolChoiceProperty,Dict[str,Any],None]) – If supported by model, forces the model to request a tool.tools (
Union[IResolvable,Sequence[Union[IResolvable,ToolProperty,Dict[str,Any]]],None]) – An array of tools that you want to pass to a model.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins # any: Any # auto: Any # json: Any tool_configuration_property = bedrock_mixins.CfnPromptVersionPropsMixin.ToolConfigurationProperty( tool_choice=bedrock_mixins.CfnPromptVersionPropsMixin.ToolChoiceProperty( any=any, auto=auto, tool=bedrock_mixins.CfnPromptVersionPropsMixin.SpecificToolChoiceProperty( name="name" ) ), tools=[bedrock_mixins.CfnPromptVersionPropsMixin.ToolProperty( cache_point=bedrock_mixins.CfnPromptVersionPropsMixin.CachePointBlockProperty( type="type" ), tool_spec=bedrock_mixins.CfnPromptVersionPropsMixin.ToolSpecificationProperty( description="description", input_schema=bedrock_mixins.CfnPromptVersionPropsMixin.ToolInputSchemaProperty( json=json ), name="name" ) )] )
Attributes
- tool_choice
If supported by model, forces the model to request a tool.
- tools
An array of tools that you want to pass to a model.
ToolInputSchemaProperty
- class CfnPromptVersionPropsMixin.ToolInputSchemaProperty(*, json=None)
Bases:
objectThe schema for the tool.
The top level schema type must be
object. For more information, see Call a tool with the Converse API in the Amazon Bedrock User Guide.- Parameters:
json (
Any) – The JSON schema for the tool. For more information, see JSON Schema Reference .- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins # json: Any tool_input_schema_property = bedrock_mixins.CfnPromptVersionPropsMixin.ToolInputSchemaProperty( json=json )
Attributes
- json
The JSON schema for the tool.
For more information, see JSON Schema Reference .
ToolProperty
- class CfnPromptVersionPropsMixin.ToolProperty(*, cache_point=None, tool_spec=None)
Bases:
objectInformation about a tool that you can use with the Converse API.
For more information, see Call a tool with the Converse API in the Amazon Bedrock User Guide.
- Parameters:
cache_point (
Union[IResolvable,CachePointBlockProperty,Dict[str,Any],None]) – CachePoint to include in the tool configuration.tool_spec (
Union[IResolvable,ToolSpecificationProperty,Dict[str,Any],None]) – The specfication for the tool.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins # json: Any tool_property = bedrock_mixins.CfnPromptVersionPropsMixin.ToolProperty( cache_point=bedrock_mixins.CfnPromptVersionPropsMixin.CachePointBlockProperty( type="type" ), tool_spec=bedrock_mixins.CfnPromptVersionPropsMixin.ToolSpecificationProperty( description="description", input_schema=bedrock_mixins.CfnPromptVersionPropsMixin.ToolInputSchemaProperty( json=json ), name="name" ) )
Attributes
- cache_point
CachePoint to include in the tool configuration.
- tool_spec
The specfication for the tool.
ToolSpecificationProperty
- class CfnPromptVersionPropsMixin.ToolSpecificationProperty(*, description=None, input_schema=None, name=None)
Bases:
objectThe specification for the tool.
For more information, see Call a tool with the Converse API in the Amazon Bedrock User Guide.
- Parameters:
description (
Optional[str]) – The description for the tool.input_schema (
Union[IResolvable,ToolInputSchemaProperty,Dict[str,Any],None]) – The input schema for the tool in JSON format.name (
Optional[str]) – The name for the tool.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_bedrock import mixins as bedrock_mixins # json: Any tool_specification_property = bedrock_mixins.CfnPromptVersionPropsMixin.ToolSpecificationProperty( description="description", input_schema=bedrock_mixins.CfnPromptVersionPropsMixin.ToolInputSchemaProperty( json=json ), name="name" )
Attributes
- description
The description for the tool.
- input_schema
The input schema for the tool in JSON format.