Class: AWSCDK::Wisdom::CfnKnowledgeBase::FixedSizeChunkingConfigurationProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
wisdom/cfn_knowledge_base.rb

Overview

Configurations for when you choose fixed-size chunking.

If you set the chunking_strategy as NONE , exclude this field.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(max_tokens:, overlap_percentage:) ⇒ FixedSizeChunkingConfigurationProperty

Returns a new instance of FixedSizeChunkingConfigurationProperty.

Parameters:

  • max_tokens (Numeric)

    The maximum number of tokens to include in a chunk.

  • overlap_percentage (Numeric)

    The percentage of overlap between adjacent chunks of a data source.



857
858
859
860
861
862
# File 'wisdom/cfn_knowledge_base.rb', line 857

def initialize(max_tokens:, overlap_percentage:)
  @max_tokens = max_tokens
  Jsii::Type.check_type(@max_tokens, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxTokens")
  @overlap_percentage = overlap_percentage
  Jsii::Type.check_type(@overlap_percentage, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "overlapPercentage")
end

Instance Attribute Details

#max_tokensNumeric (readonly)

The maximum number of tokens to include in a chunk.



868
869
870
# File 'wisdom/cfn_knowledge_base.rb', line 868

def max_tokens
  @max_tokens
end

#overlap_percentageNumeric (readonly)

The percentage of overlap between adjacent chunks of a data source.



873
874
875
# File 'wisdom/cfn_knowledge_base.rb', line 873

def overlap_percentage
  @overlap_percentage
end

Class Method Details

.jsii_propertiesObject



875
876
877
878
879
880
# File 'wisdom/cfn_knowledge_base.rb', line 875

def self.jsii_properties
  {
    :max_tokens => "maxTokens",
    :overlap_percentage => "overlapPercentage",
  }
end

Instance Method Details

#to_jsiiObject



882
883
884
885
886
887
888
889
# File 'wisdom/cfn_knowledge_base.rb', line 882

def to_jsii
  result = {}
  result.merge!({
    "maxTokens" => @max_tokens,
    "overlapPercentage" => @overlap_percentage,
  })
  result.compact
end