Skip to content
v2.277.0

VectorSearchRerankingConfigurationProperty Struct ​

Configuration for reranking vector search results to improve relevance.

Reranking applies additional relevance models to reorder the initial vector search results based on more sophisticated criteria.

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 vectorSearchRerankingConfigurationProperty: bedrock.CfnFlowVersion.VectorSearchRerankingConfigurationProperty = {
  type: 'type',

  // the properties below are optional
  bedrockRerankingConfiguration: {
    modelConfiguration: {
      modelArn: 'modelArn',

      // the properties below are optional
      additionalModelRequestFields: additionalModelRequestFields,
    },

    // the properties below are optional
    metadataConfiguration: {
      selectionMode: 'selectionMode',

      // the properties below are optional
      selectiveModeConfiguration: {
        fieldsToExclude: [{
          fieldName: 'fieldName',
        }],
        fieldsToInclude: [{
          fieldName: 'fieldName',
        }],
      },
    },
    numberOfRerankedResults: 123,
  },
};
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

vector_search_reranking_configuration_property = bedrock.CfnFlowVersion.VectorSearchRerankingConfigurationProperty(
    type="type",

    # the properties below are optional
    bedrock_reranking_configuration=bedrock.CfnFlowVersion.VectorSearchBedrockRerankingConfigurationProperty(
        model_configuration=bedrock.CfnFlowVersion.VectorSearchBedrockRerankingModelConfigurationProperty(
            model_arn="modelArn",

            # the properties below are optional
            additional_model_request_fields=additional_model_request_fields
        ),

        # the properties below are optional
        metadata_configuration=bedrock.CfnFlowVersion.MetadataConfigurationForRerankingProperty(
            selection_mode="selectionMode",

            # the properties below are optional
            selective_mode_configuration=bedrock.CfnFlowVersion.RerankingMetadataSelectiveModeConfigurationProperty(
                fields_to_exclude=[bedrock.CfnFlowVersion.FieldForRerankingProperty(
                    field_name="fieldName"
                )],
                fields_to_include=[bedrock.CfnFlowVersion.FieldForRerankingProperty(
                    field_name="fieldName"
                )]
            )
        ),
        number_of_reranked_results=123
    )
)
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;

VectorSearchRerankingConfigurationProperty vectorSearchRerankingConfigurationProperty = VectorSearchRerankingConfigurationProperty.builder()
        .type("type")

        // the properties below are optional
        .bedrockRerankingConfiguration(VectorSearchBedrockRerankingConfigurationProperty.builder()
                .modelConfiguration(VectorSearchBedrockRerankingModelConfigurationProperty.builder()
                        .modelArn("modelArn")

                        // the properties below are optional
                        .additionalModelRequestFields(additionalModelRequestFields)
                        .build())

                // the properties below are optional
                .metadataConfiguration(MetadataConfigurationForRerankingProperty.builder()
                        .selectionMode("selectionMode")

                        // the properties below are optional
                        .selectiveModeConfiguration(RerankingMetadataSelectiveModeConfigurationProperty.builder()
                                .fieldsToExclude(List.of(FieldForRerankingProperty.builder()
                                        .fieldName("fieldName")
                                        .build()))
                                .fieldsToInclude(List.of(FieldForRerankingProperty.builder()
                                        .fieldName("fieldName")
                                        .build()))
                                .build())
                        .build())
                .numberOfRerankedResults(123)
                .build())
        .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 vectorSearchRerankingConfigurationProperty = new VectorSearchRerankingConfigurationProperty {
    Type = "type",

    // the properties below are optional
    BedrockRerankingConfiguration = new VectorSearchBedrockRerankingConfigurationProperty {
        ModelConfiguration = new VectorSearchBedrockRerankingModelConfigurationProperty {
            ModelArn = "modelArn",

            // the properties below are optional
            AdditionalModelRequestFields = additionalModelRequestFields
        },

        // the properties below are optional
        MetadataConfiguration = new MetadataConfigurationForRerankingProperty {
            SelectionMode = "selectionMode",

            // the properties below are optional
            SelectiveModeConfiguration = new RerankingMetadataSelectiveModeConfigurationProperty {
                FieldsToExclude = new [] { new FieldForRerankingProperty {
                    FieldName = "fieldName"
                } },
                FieldsToInclude = new [] { new FieldForRerankingProperty {
                    FieldName = "fieldName"
                } }
            }
        },
        NumberOfRerankedResults = 123
    }
};
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{}

vectorSearchRerankingConfigurationProperty := &VectorSearchRerankingConfigurationProperty{
	Type: jsii.String("type"),

	// the properties below are optional
	BedrockRerankingConfiguration: &VectorSearchBedrockRerankingConfigurationProperty{
		ModelConfiguration: &VectorSearchBedrockRerankingModelConfigurationProperty{
			ModelArn: jsii.String("modelArn"),

			// the properties below are optional
			AdditionalModelRequestFields: additionalModelRequestFields,
		},

		// the properties below are optional
		MetadataConfiguration: &MetadataConfigurationForRerankingProperty{
			SelectionMode: jsii.String("selectionMode"),

			// the properties below are optional
			SelectiveModeConfiguration: &RerankingMetadataSelectiveModeConfigurationProperty{
				FieldsToExclude: []interface{}{
					&FieldForRerankingProperty{
						FieldName: jsii.String("fieldName"),
					},
				},
				FieldsToInclude: []interface{}{
					&FieldForRerankingProperty{
						FieldName: jsii.String("fieldName"),
					},
				},
			},
		},
		NumberOfRerankedResults: jsii.Number(123),
	},
}

Properties ​

bedrockRerankingConfigurationoptionalIResolvable | CfnFlowVersion.VectorSearchBedrockRerankingConfigurationPropertybedrock_reranking_configurationoptionaltyping.Union[IResolvable, VectorSearchBedrockRerankingConfigurationProperty]bedrockRerankingConfigurationoptionalIResolvableBedrockRerankingConfigurationoptionalIResolvableBedrockRerankingConfigurationoptionalinterface{}#
Configuration for using Amazon Bedrock foundation models to rerank search results.

This is required when the reranking type is set to BEDROCK.

typestringtypestrtypeStringTypestringType*stringrequired#
The type of reranking to apply to vector search results.

Currently, the only supported value is BEDROCK, which uses Amazon Bedrock foundation models for reranking.