# PromptConfigurationProperty

Struct · External

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

For more information, see [Advanced prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html) .

- Source: Generated at build time
- Type last changed: v2.183.0 · 12 Mar 2025

## Example

TypeScript:

```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:

```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:

```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();
```

C#:

```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:

```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

- `additionalModelRequestFields`: any — 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.

  For more information, see [Inference request parameters and response fields for foundation models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html) .

- `basePromptTemplate`: string — Defines the prompt template with which to replace the default prompt template.

  You can use placeholder variables in the base prompt template to customize the prompt. For more information, see [Prompt template placeholder variables](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-placeholders.html) . For more information, see [Configure the prompt templates](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts-configure.html) .

- `foundationModel`: string — The agent's foundation model.

- `inferenceConfiguration`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnAgent.InferenceConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_bedrock.CfnAgent.InferenceConfigurationProperty.html) — 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](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html) .

- `parserMode`: 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` .

  If you set the field as `OVERRIDDEN` , the `overrideLambda` field in the [PromptOverrideConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html) must be specified with the ARN of a Lambda function.

- `promptCreationMode`: 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.

- `promptState`: string — Specifies whether to allow the inline agent to carry out the step specified in the `promptType` .

  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`

- `promptType`: string — The step in the agent sequence that this prompt configuration applies to.
