Skip to content
v2.278.0

PromptConfigurationProperty ​

Struct External

Contains configurations to override a prompt template in one part of an agent sequence.

For more information, see Advanced prompts .

Example ​

ts
// 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',
};
python
# 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"
)
java
// 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();
csharp
// 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"
};
go
// 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{} #
If the Converse or ConverseStream operations support the model, `additionalModelRequestFields` contains additional inference parameters, beyond the base set of inference parameters in the `inferenceConfiguration` field.
basePromptTemplateoptionalstringbase_prompt_templateoptionalstrbasePromptTemplateoptionalStringBasePromptTemplateoptionalstringBasePromptTemplateoptional*string #
Defines the prompt template with which to replace the default prompt template.
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 #
The agent's foundation model.
inferenceConfigurationoptionalIResolvable | CfnAgent.InferenceConfigurationPropertyinference_configurationoptionaltyping.Union[IResolvable, InferenceConfigurationProperty]inferenceConfigurationoptionalIResolvableInferenceConfigurationoptionalIResolvableInferenceConfigurationoptionalinterface{} #
Contains inference parameters to use when the agent invokes a foundation model in the part of the agent sequence defined by the `promptType` .

For more information, see Inference parameters for foundation models .

parserModeoptionalstringparser_modeoptionalstrparserModeoptionalStringParserModeoptionalstringParserModeoptional*string #
Specifies whether to override the default parser Lambda function when parsing the raw foundation model output in the part of the agent sequence defined by the `promptType` .
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 #
Specifies whether to override the default prompt template for this `promptType` .

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 #
Specifies whether to allow the inline agent to carry out the step specified in the `promptType` .
notes

If you set this value to DISABLED , the agent skips that step. The default state for each promptType is as follows.

  • PRE_PROCESSING – ENABLED
  • ORCHESTRATION – ENABLED
  • KNOWLEDGE_BASE_RESPONSE_GENERATION – ENABLED
  • POST_PROCESSING – DISABLED
promptTypeoptionalstringprompt_typeoptionalstrpromptTypeoptionalStringPromptTypeoptionalstringPromptTypeoptional*string #
The step in the agent sequence that this prompt configuration applies to.