# PromptOverrideConfigurationProperty

Contains configurations to override prompts in different parts 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.139.0 · 24 Apr 2024

## 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 promptOverrideConfigurationProperty: bedrock.CfnAgent.PromptOverrideConfigurationProperty = {
  promptConfigurations: [{
    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 properties below are optional
  overrideLambda: 'overrideLambda',
};
```

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_override_configuration_property = bedrock.CfnAgent.PromptOverrideConfigurationProperty(
    prompt_configurations=[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 properties below are optional
    override_lambda="overrideLambda"
)
```

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;

PromptOverrideConfigurationProperty promptOverrideConfigurationProperty = PromptOverrideConfigurationProperty.builder()
        .promptConfigurations(List.of(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()))

        // the properties below are optional
        .overrideLambda("overrideLambda")
        .build();
```

C# / .NET:

```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 promptOverrideConfigurationProperty = new PromptOverrideConfigurationProperty {
    PromptConfigurations = new [] { 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"
    } },

    // the properties below are optional
    OverrideLambda = "overrideLambda"
};
```

Golang:

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

promptOverrideConfigurationProperty := &PromptOverrideConfigurationProperty{
	PromptConfigurations: []interface{}{
		&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"),
		},
	},

	// the properties below are optional
	OverrideLambda: jsii.String("overrideLambda"),
}
```

## Properties

- `overrideLambda`: string — The ARN of the Lambda function to use when parsing the raw foundation model output in parts of the agent sequence.

  If you specify this field, at least one of the `promptConfigurations` must contain a `parserMode` value that is set to `OVERRIDDEN` . For more information, see [Parser Lambda function in Amazon Bedrock Agents](https://docs.aws.amazon.com/bedrock/latest/userguide/lambda-parser.html) .

- `promptConfigurations`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnAgent.PromptConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_bedrock.CfnAgent.PromptConfigurationProperty.html)[] (required) — 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) .
