Class: AWSCDK::Bedrock::CfnDataSource::HierarchicalChunkingConfigurationProperty

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

Overview

Settings for hierarchical document chunking for a data source.

Hierarchical chunking splits documents into layers of chunks where the first layer contains large chunks, and the second layer contains smaller chunks derived from the first layer.

You configure the number of tokens to overlap, or repeat across adjacent chunks. For example, if you set overlap tokens to 60, the last 60 tokens in the first chunk are also included at the beginning of the second chunk. For each layer, you must also configure the maximum number of tokens in a chunk.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(level_configurations:, overlap_tokens:) ⇒ HierarchicalChunkingConfigurationProperty

Returns a new instance of HierarchicalChunkingConfigurationProperty.

Parameters:



1395
1396
1397
1398
1399
1400
# File 'bedrock/cfn_data_source.rb', line 1395

def initialize(level_configurations:, overlap_tokens:)
  @level_configurations = level_configurations
  Jsii::Type.check_type(@level_configurations, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9jay5DZm5EYXRhU291cmNlLkhpZXJhcmNoaWNhbENodW5raW5nTGV2ZWxDb25maWd1cmF0aW9uUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "levelConfigurations")
  @overlap_tokens = overlap_tokens
  Jsii::Type.check_type(@overlap_tokens, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "overlapTokens")
end

Instance Attribute Details

#overlap_tokensNumeric (readonly)

The number of tokens to repeat across chunks in the same layer.



1411
1412
1413
# File 'bedrock/cfn_data_source.rb', line 1411

def overlap_tokens
  @overlap_tokens
end

Class Method Details

.jsii_propertiesObject



1413
1414
1415
1416
1417
1418
# File 'bedrock/cfn_data_source.rb', line 1413

def self.jsii_properties
  {
    :level_configurations => "levelConfigurations",
    :overlap_tokens => "overlapTokens",
  }
end

Instance Method Details

#to_jsiiObject



1420
1421
1422
1423
1424
1425
1426
1427
# File 'bedrock/cfn_data_source.rb', line 1420

def to_jsii
  result = {}
  result.merge!({
    "levelConfigurations" => @level_configurations,
    "overlapTokens" => @overlap_tokens,
  })
  result.compact
end