Class: AWSCDK::Bedrock::CfnFlow::VectorSearchBedrockRerankingConfigurationProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
bedrock/cfn_flow.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:



2781
2782
2783
2784
2785
2786
2787
2788
# File 'bedrock/cfn_flow.rb', line 2781

def initialize(model_configuration:, metadata_configuration: nil, number_of_reranked_results: nil)
  @model_configuration = model_configuration.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnFlow::VectorSearchBedrockRerankingModelConfigurationProperty.new(**model_configuration.transform_keys(&:to_sym)) : model_configuration
  Jsii::Type.check_type(@model_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmbkZsb3cuVmVjdG9yU2VhcmNoQmVkcm9ja1JlcmFua2luZ01vZGVsQ29uZmlndXJhdGlvblByb3BlcnR5In1dfX0=")), "modelConfiguration")
  @metadata_configuration = .is_a?(Hash) ? ::AWSCDK::Bedrock::CfnFlow::MetadataConfigurationForRerankingProperty.new(**.transform_keys(&:to_sym)) : 
  Jsii::Type.check_type(@metadata_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmbkZsb3cuTWV0YWRhdGFDb25maWd1cmF0aW9uRm9yUmVyYW5raW5nUHJvcGVydHkifV19fQ==")), "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.



2803
2804
2805
# File 'bedrock/cfn_flow.rb', line 2803

def 
  @metadata_configuration
end

#model_configurationAWSCDK::IResolvable, AWSCDK::Bedrock::CfnFlow::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.



2796
2797
2798
# File 'bedrock/cfn_flow.rb', line 2796

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.



2810
2811
2812
# File 'bedrock/cfn_flow.rb', line 2810

def number_of_reranked_results
  @number_of_reranked_results
end

Class Method Details

.jsii_propertiesObject



2812
2813
2814
2815
2816
2817
2818
# File 'bedrock/cfn_flow.rb', line 2812

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

Instance Method Details

#to_jsiiObject



2820
2821
2822
2823
2824
2825
2826
2827
2828
# File 'bedrock/cfn_flow.rb', line 2820

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