Class CfnDataSource.ChunkingConfigurationProperty.Builder
java.lang.Object
software.amazon.awscdk.services.bedrock.CfnDataSource.ChunkingConfigurationProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnDataSource.ChunkingConfigurationProperty>
- Enclosing interface:
CfnDataSource.ChunkingConfigurationProperty
@Stability(Stable)
public static final class CfnDataSource.ChunkingConfigurationProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnDataSource.ChunkingConfigurationProperty>
A builder for
CfnDataSource.ChunkingConfigurationProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.chunkingStrategy
(String chunkingStrategy) Sets the value ofCfnDataSource.ChunkingConfigurationProperty.getChunkingStrategy()
fixedSizeChunkingConfiguration
(IResolvable fixedSizeChunkingConfiguration) fixedSizeChunkingConfiguration
(CfnDataSource.FixedSizeChunkingConfigurationProperty fixedSizeChunkingConfiguration) hierarchicalChunkingConfiguration
(IResolvable hierarchicalChunkingConfiguration) hierarchicalChunkingConfiguration
(CfnDataSource.HierarchicalChunkingConfigurationProperty hierarchicalChunkingConfiguration) semanticChunkingConfiguration
(IResolvable semanticChunkingConfiguration) semanticChunkingConfiguration
(CfnDataSource.SemanticChunkingConfigurationProperty semanticChunkingConfiguration)
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
chunkingStrategy
@Stability(Stable) public CfnDataSource.ChunkingConfigurationProperty.Builder chunkingStrategy(String chunkingStrategy) Sets the value ofCfnDataSource.ChunkingConfigurationProperty.getChunkingStrategy()
- Parameters:
chunkingStrategy
- Knowledge base can split your source data into chunks. This parameter is required. A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried. You have the following options for chunking your data. If you opt forNONE
, then you may want to pre-process your files by splitting them up such that each file corresponds to a chunk.FIXED_SIZE
– Amazon Bedrock splits your source data into chunks of the approximate size that you set in thefixedSizeChunkingConfiguration
.HIERARCHICAL
– Split documents into layers of chunks where the first layer contains large chunks, and the second layer contains smaller chunks derived from the first layer.SEMANTIC
– Split documents into chunks based on groups of similar content derived with natural language processing.NONE
– Amazon Bedrock treats each file as one chunk. If you choose this option, you may want to pre-process your documents by splitting them into separate files.
- Returns:
this
-
fixedSizeChunkingConfiguration
@Stability(Stable) public CfnDataSource.ChunkingConfigurationProperty.Builder fixedSizeChunkingConfiguration(IResolvable fixedSizeChunkingConfiguration) - Parameters:
fixedSizeChunkingConfiguration
- Configurations for when you choose fixed-size chunking. If you set thechunkingStrategy
asNONE
, exclude this field.- Returns:
this
-
fixedSizeChunkingConfiguration
@Stability(Stable) public CfnDataSource.ChunkingConfigurationProperty.Builder fixedSizeChunkingConfiguration(CfnDataSource.FixedSizeChunkingConfigurationProperty fixedSizeChunkingConfiguration) - Parameters:
fixedSizeChunkingConfiguration
- Configurations for when you choose fixed-size chunking. If you set thechunkingStrategy
asNONE
, exclude this field.- Returns:
this
-
hierarchicalChunkingConfiguration
@Stability(Stable) public CfnDataSource.ChunkingConfigurationProperty.Builder hierarchicalChunkingConfiguration(IResolvable hierarchicalChunkingConfiguration) Sets the value ofCfnDataSource.ChunkingConfigurationProperty.getHierarchicalChunkingConfiguration()
- Parameters:
hierarchicalChunkingConfiguration
- 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.- Returns:
this
-
hierarchicalChunkingConfiguration
@Stability(Stable) public CfnDataSource.ChunkingConfigurationProperty.Builder hierarchicalChunkingConfiguration(CfnDataSource.HierarchicalChunkingConfigurationProperty hierarchicalChunkingConfiguration) Sets the value ofCfnDataSource.ChunkingConfigurationProperty.getHierarchicalChunkingConfiguration()
- Parameters:
hierarchicalChunkingConfiguration
- 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.- Returns:
this
-
semanticChunkingConfiguration
@Stability(Stable) public CfnDataSource.ChunkingConfigurationProperty.Builder semanticChunkingConfiguration(IResolvable semanticChunkingConfiguration) - Parameters:
semanticChunkingConfiguration
- Settings for semantic document chunking for a data source. Semantic chunking splits a document into into smaller documents based on groups of similar content derived from the text with natural language processing.- Returns:
this
-
semanticChunkingConfiguration
@Stability(Stable) public CfnDataSource.ChunkingConfigurationProperty.Builder semanticChunkingConfiguration(CfnDataSource.SemanticChunkingConfigurationProperty semanticChunkingConfiguration) - Parameters:
semanticChunkingConfiguration
- Settings for semantic document chunking for a data source. Semantic chunking splits a document into into smaller documents based on groups of similar content derived from the text with natural language processing.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnDataSource.ChunkingConfigurationProperty>
- Returns:
- a new instance of
CfnDataSource.ChunkingConfigurationProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-