Interface CfnPrompt.PromptVariantProperty
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
CfnPrompt.PromptVariantProperty.Jsii$Proxy
- Enclosing class:
CfnPrompt
@Stability(Stable)
public static interface CfnPrompt.PromptVariantProperty
extends software.amazon.jsii.JsiiSerializable
Contains details about a variant of the prompt.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.bedrock.*;
Object additionalModelRequestFields;
Object any;
Object auto;
Object json;
PromptVariantProperty promptVariantProperty = PromptVariantProperty.builder()
.name("name")
.templateConfiguration(PromptTemplateConfigurationProperty.builder()
.chat(ChatPromptTemplateConfigurationProperty.builder()
.messages(List.of(MessageProperty.builder()
.content(List.of(ContentBlockProperty.builder()
.cachePoint(CachePointBlockProperty.builder()
.type("type")
.build())
.text("text")
.build()))
.role("role")
.build()))
// the properties below are optional
.inputVariables(List.of(PromptInputVariableProperty.builder()
.name("name")
.build()))
.system(List.of(SystemContentBlockProperty.builder()
.cachePoint(CachePointBlockProperty.builder()
.type("type")
.build())
.text("text")
.build()))
.toolConfiguration(ToolConfigurationProperty.builder()
.tools(List.of(ToolProperty.builder()
.cachePoint(CachePointBlockProperty.builder()
.type("type")
.build())
.toolSpec(ToolSpecificationProperty.builder()
.inputSchema(ToolInputSchemaProperty.builder()
.json(json)
.build())
.name("name")
// the properties below are optional
.description("description")
.build())
.build()))
// the properties below are optional
.toolChoice(ToolChoiceProperty.builder()
.any(any)
.auto(auto)
.tool(SpecificToolChoiceProperty.builder()
.name("name")
.build())
.build())
.build())
.build())
.text(TextPromptTemplateConfigurationProperty.builder()
.cachePoint(CachePointBlockProperty.builder()
.type("type")
.build())
.inputVariables(List.of(PromptInputVariableProperty.builder()
.name("name")
.build()))
.text("text")
.textS3Location(TextS3LocationProperty.builder()
.bucket("bucket")
.key("key")
// the properties below are optional
.version("version")
.build())
.build())
.build())
.templateType("templateType")
// the properties below are optional
.additionalModelRequestFields(additionalModelRequestFields)
.genAiResource(PromptGenAiResourceProperty.builder()
.agent(PromptAgentResourceProperty.builder()
.agentIdentifier("agentIdentifier")
.build())
.build())
.inferenceConfiguration(PromptInferenceConfigurationProperty.builder()
.text(PromptModelInferenceConfigurationProperty.builder()
.maxTokens(123)
.stopSequences(List.of("stopSequences"))
.temperature(123)
.topP(123)
.build())
.build())
.metadata(List.of(PromptMetadataEntryProperty.builder()
.key("key")
.value("value")
.build()))
.modelId("modelId")
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forCfnPrompt.PromptVariantPropertystatic final classAn implementation forCfnPrompt.PromptVariantProperty -
Method Summary
Modifier and TypeMethodDescriptionbuilder()default ObjectContains model-specific inference configurations that aren't in theinferenceConfigurationfield.default ObjectSpecifies a generative AI resource with which to use the prompt.default ObjectContains inference configurations for the prompt variant.default ObjectAn array of objects, each containing a key-value pair that defines a metadata tag and value to attach to a prompt variant.default StringThe unique identifier of the model or inference profile with which to run inference on the prompt.getName()The name of the prompt variant.Contains configurations for the prompt template.The type of prompt template to use.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getName
The name of the prompt variant.- See Also:
-
getTemplateConfiguration
Contains configurations for the prompt template.Returns union: either
IResolvableorCfnPrompt.PromptTemplateConfigurationProperty- See Also:
-
getTemplateType
The type of prompt template to use.- See Also:
-
getAdditionalModelRequestFields
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 .
- See Also:
-
getGenAiResource
Specifies a generative AI resource with which to use the prompt.Returns union: either
IResolvableorCfnPrompt.PromptGenAiResourceProperty- See Also:
-
getInferenceConfiguration
Contains inference configurations for the prompt variant.Returns union: either
IResolvableorCfnPrompt.PromptInferenceConfigurationProperty- See Also:
-
getMetadata
An array of objects, each containing a key-value pair that defines a metadata tag and value to attach to a prompt variant.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnPrompt.PromptMetadataEntryProperty>- See Also:
-
getModelId
The unique identifier of the model or inference profile with which to run inference on the prompt.- See Also:
-
builder
-