# HierarchicalChunkingConfigurationProperty

Struct · External

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.

- Source: Generated at build time
- Type last changed: v2.172.0 · 7 Dec 2024

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_wisdom as wisdom } from 'aws-cdk-lib';
const hierarchicalChunkingConfigurationProperty: wisdom.CfnKnowledgeBase.HierarchicalChunkingConfigurationProperty = {
  levelConfigurations: [{
    maxTokens: 123,
  }],
  overlapTokens: 123,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_wisdom as wisdom

hierarchical_chunking_configuration_property = wisdom.CfnKnowledgeBase.HierarchicalChunkingConfigurationProperty(
    level_configurations=[wisdom.CfnKnowledgeBase.HierarchicalChunkingLevelConfigurationProperty(
        max_tokens=123
    )],
    overlap_tokens=123
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.wisdom.*;

HierarchicalChunkingConfigurationProperty hierarchicalChunkingConfigurationProperty = HierarchicalChunkingConfigurationProperty.builder()
        .levelConfigurations(List.of(HierarchicalChunkingLevelConfigurationProperty.builder()
                .maxTokens(123)
                .build()))
        .overlapTokens(123)
        .build();
```

C#:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Wisdom;

var hierarchicalChunkingConfigurationProperty = new HierarchicalChunkingConfigurationProperty {
    LevelConfigurations = new [] { new HierarchicalChunkingLevelConfigurationProperty {
        MaxTokens = 123
    } },
    OverlapTokens = 123
};
```

Go:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

hierarchicalChunkingConfigurationProperty := &HierarchicalChunkingConfigurationProperty{
	LevelConfigurations: []interface{}{
		&HierarchicalChunkingLevelConfigurationProperty{
			MaxTokens: jsii.Number(123),
		},
	},
	OverlapTokens: jsii.Number(123),
}
```

## Properties

- `levelConfigurations`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnKnowledgeBase.HierarchicalChunkingLevelConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_wisdom.CfnKnowledgeBase.HierarchicalChunkingLevelConfigurationProperty.html)[] (required) — Token settings for each layer.

- `overlapTokens`: number (required) — The number of tokens to repeat across chunks in the same layer.
