Class: AWSCDK::Bedrock::CfnFlowVersion::VectorSearchBedrockRerankingConfigurationProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
bedrock/cfn_flow_version.rb

Overview

Configuration for using Amazon Bedrock foundation models to rerank Knowledge Base vector search results.

This enables more sophisticated relevance ranking using large language models.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model_configuration:, metadata_configuration: nil, number_of_reranked_results: nil) ⇒ VectorSearchBedrockRerankingConfigurationProperty

Returns a new instance of VectorSearchBedrockRerankingConfigurationProperty.

Parameters:



2549
2550
2551
2552
2553
2554
2555
2556
# File 'bedrock/cfn_flow_version.rb', line 2549

def initialize(model_configuration:, metadata_configuration: nil, number_of_reranked_results: nil)
  @model_configuration = model_configuration.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnFlowVersion::VectorSearchBedrockRerankingModelConfigurationProperty.new(**model_configuration.transform_keys(&:to_sym)) : model_configuration
  Jsii::Type.check_type(@model_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmbkZsb3dWZXJzaW9uLlZlY3RvclNlYXJjaEJlZHJvY2tSZXJhbmtpbmdNb2RlbENvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19")), "modelConfiguration")
  @metadata_configuration = .is_a?(Hash) ? ::AWSCDK::Bedrock::CfnFlowVersion::MetadataConfigurationForRerankingProperty.new(**.transform_keys(&:to_sym)) : 
  Jsii::Type.check_type(@metadata_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmbkZsb3dWZXJzaW9uLk1ldGFkYXRhQ29uZmlndXJhdGlvbkZvclJlcmFua2luZ1Byb3BlcnR5In1dfX0=")), "metadataConfiguration") unless @metadata_configuration.nil?
  @number_of_reranked_results = number_of_reranked_results
  Jsii::Type.check_type(@number_of_reranked_results, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "numberOfRerankedResults") unless @number_of_reranked_results.nil?
end

Instance Attribute Details

#metadata_configurationAWSCDK::IResolvable, ... (readonly)

Configuration for how document metadata should be used during the reranking process.

This determines which metadata fields are included when reordering search results.



2571
2572
2573
# File 'bedrock/cfn_flow_version.rb', line 2571

def 
  @metadata_configuration
end

#model_configurationAWSCDK::IResolvable, AWSCDK::Bedrock::CfnFlowVersion::VectorSearchBedrockRerankingModelConfigurationProperty (readonly)

Configuration for the Amazon Bedrock foundation model used for reranking.

This includes the model ARN and any additional request fields required by the model.



2564
2565
2566
# File 'bedrock/cfn_flow_version.rb', line 2564

def model_configuration
  @model_configuration
end

#number_of_reranked_resultsNumeric? (readonly)

The maximum number of results to rerank.

This limits how many of the initial vector search results will be processed by the reranking model. A smaller number improves performance but may exclude potentially relevant results.



2578
2579
2580
# File 'bedrock/cfn_flow_version.rb', line 2578

def number_of_reranked_results
  @number_of_reranked_results
end

Class Method Details

.jsii_propertiesObject



2580
2581
2582
2583
2584
2585
2586
# File 'bedrock/cfn_flow_version.rb', line 2580

def self.jsii_properties
  {
    :model_configuration => "modelConfiguration",
    :metadata_configuration => "metadataConfiguration",
    :number_of_reranked_results => "numberOfRerankedResults",
  }
end

Instance Method Details

#to_jsiiObject



2588
2589
2590
2591
2592
2593
2594
2595
2596
# File 'bedrock/cfn_flow_version.rb', line 2588

def to_jsii
  result = {}
  result.merge!({
    "modelConfiguration" => @model_configuration,
    "metadataConfiguration" => @metadata_configuration,
    "numberOfRerankedResults" => @number_of_reranked_results,
  })
  result.compact
end