PromptConfigurationProperty
Contains configurations to override a prompt template in one part of an agent sequence.
For more information, see Advanced prompts .
| Source | |
|---|---|
| Type last changed |
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_bedrock as bedrock } from 'aws-cdk-lib';
declare const additionalModelRequestFields: any;
const promptConfigurationProperty: bedrock.CfnAgent.PromptConfigurationProperty = {
additionalModelRequestFields: additionalModelRequestFields,
basePromptTemplate: 'basePromptTemplate',
foundationModel: 'foundationModel',
inferenceConfiguration: {
maximumLength: 123,
stopSequences: ['stopSequences'],
temperature: 123,
topK: 123,
topP: 123,
},
parserMode: 'parserMode',
promptCreationMode: 'promptCreationMode',
promptState: 'promptState',
promptType: 'promptType',
};
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_bedrock as bedrock
# additional_model_request_fields: Any
prompt_configuration_property = bedrock.CfnAgent.PromptConfigurationProperty(
additional_model_request_fields=additional_model_request_fields,
base_prompt_template="basePromptTemplate",
foundation_model="foundationModel",
inference_configuration=bedrock.CfnAgent.InferenceConfigurationProperty(
maximum_length=123,
stop_sequences=["stopSequences"],
temperature=123,
top_k=123,
top_p=123
),
parser_mode="parserMode",
prompt_creation_mode="promptCreationMode",
prompt_state="promptState",
prompt_type="promptType"
)
// 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;
PromptConfigurationProperty promptConfigurationProperty = PromptConfigurationProperty.builder()
.additionalModelRequestFields(additionalModelRequestFields)
.basePromptTemplate("basePromptTemplate")
.foundationModel("foundationModel")
.inferenceConfiguration(InferenceConfigurationProperty.builder()
.maximumLength(123)
.stopSequences(List.of("stopSequences"))
.temperature(123)
.topK(123)
.topP(123)
.build())
.parserMode("parserMode")
.promptCreationMode("promptCreationMode")
.promptState("promptState")
.promptType("promptType")
.build();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Bedrock;
var additionalModelRequestFields;
var promptConfigurationProperty = new PromptConfigurationProperty {
AdditionalModelRequestFields = additionalModelRequestFields,
BasePromptTemplate = "basePromptTemplate",
FoundationModel = "foundationModel",
InferenceConfiguration = new InferenceConfigurationProperty {
MaximumLength = 123,
StopSequences = new [] { "stopSequences" },
Temperature = 123,
TopK = 123,
TopP = 123
},
ParserMode = "parserMode",
PromptCreationMode = "promptCreationMode",
PromptState = "promptState",
PromptType = "promptType"
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
var additionalModelRequestFields interface{}
promptConfigurationProperty := &PromptConfigurationProperty{
AdditionalModelRequestFields: additionalModelRequestFields,
BasePromptTemplate: jsii.String("basePromptTemplate"),
FoundationModel: jsii.String("foundationModel"),
InferenceConfiguration: &InferenceConfigurationProperty{
MaximumLength: jsii.Number(123),
StopSequences: []*string{
jsii.String("stopSequences"),
},
Temperature: jsii.Number(123),
TopK: jsii.Number(123),
TopP: jsii.Number(123),
},
ParserMode: jsii.String("parserMode"),
PromptCreationMode: jsii.String("promptCreationMode"),
PromptState: jsii.String("promptState"),
PromptType: jsii.String("promptType"),
}
Properties
additionalModelRequestFieldsoptionalanyadditional_model_request_fieldsoptionalAnyadditionalModelRequestFieldsoptionalObjectAdditionalModelRequestFieldsoptionalobjectAdditionalModelRequestFieldsoptionalinterface{} #For more information, see Inference request parameters and response fields for foundation models .
basePromptTemplateoptionalstringbase_prompt_templateoptionalstrbasePromptTemplateoptionalStringBasePromptTemplateoptionalstringBasePromptTemplateoptional*string #notes
You can use placeholder variables in the base prompt template to customize the prompt. For more information, see Prompt template placeholder variables . For more information, see Configure the prompt templates .
foundationModeloptionalstringfoundation_modeloptionalstrfoundationModeloptionalStringFoundationModeloptionalstringFoundationModeloptional*string #inferenceConfigurationoptionalIResolvable | CfnAgent.inference_configurationoptionaltyping.Union[IResolvable, InferenceConfigurationProperty]inferenceConfigurationoptionalIResolvableInferenceConfigurationoptionalIResolvableInferenceConfigurationoptionalinterface{} #For more information, see Inference parameters for foundation models .
parserModeoptionalstringparser_modeoptionalstrparserModeoptionalStringParserModeoptionalstringParserModeoptional*string #notes
If you set the field as OVERRIDDEN , the overrideLambda field in the PromptOverrideConfiguration must be specified with the ARN of a Lambda function.
promptCreationModeoptionalstringprompt_creation_modeoptionalstrpromptCreationModeoptionalStringPromptCreationModeoptionalstringPromptCreationModeoptional*string #Set this value to OVERRIDDEN to use the prompt that you provide in the basePromptTemplate . If you leave it as DEFAULT , the agent uses a default prompt template.
promptStateoptionalstringprompt_stateoptionalstrpromptStateoptionalStringPromptStateoptionalstringPromptStateoptional*string #notes
If you set this value to DISABLED , the agent skips that step. The default state for each promptType is as follows.
PRE_PROCESSING–ENABLEDORCHESTRATION–ENABLEDKNOWLEDGE_BASE_RESPONSE_GENERATION–ENABLEDPOST_PROCESSING–DISABLED
promptTypeoptionalstringprompt_typeoptionalstrpromptTypeoptionalStringPromptTypeoptionalstringPromptTypeoptional*string #