# ParsingConfigurationProperty

Settings for parsing document contents.

If you exclude this field, the default parser converts the contents of each document into text before splitting it into chunks. Specify the parsing strategy to use in the `parsingStrategy` field and include the relevant configuration, or omit it to use the Amazon Bedrock default parser. For more information, see [Parsing options for your data source](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-advanced-parsing.html) .

> If you specify `BEDROCK_DATA_AUTOMATION` or `BEDROCK_FOUNDATION_MODEL` and it fails to parse a file, the Amazon Bedrock default parser will be used instead.

- Source: Generated at build time
- Type last changed: v2.174.0 · 4 Jan 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_bedrock as bedrock } from 'aws-cdk-lib';
const parsingConfigurationProperty: bedrock.CfnDataSource.ParsingConfigurationProperty = {
  parsingStrategy: 'parsingStrategy',

  // the properties below are optional
  bedrockDataAutomationConfiguration: {
    parsingModality: 'parsingModality',
  },
  bedrockFoundationModelConfiguration: {
    modelArn: 'modelArn',

    // the properties below are optional
    parsingModality: 'parsingModality',
    parsingPrompt: {
      parsingPromptText: 'parsingPromptText',
    },
  },
};
```

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_bedrock as bedrock

parsing_configuration_property = bedrock.CfnDataSource.ParsingConfigurationProperty(
    parsing_strategy="parsingStrategy",

    # the properties below are optional
    bedrock_data_automation_configuration=bedrock.CfnDataSource.BedrockDataAutomationConfigurationProperty(
        parsing_modality="parsingModality"
    ),
    bedrock_foundation_model_configuration=bedrock.CfnDataSource.BedrockFoundationModelConfigurationProperty(
        model_arn="modelArn",

        # the properties below are optional
        parsing_modality="parsingModality",
        parsing_prompt=bedrock.CfnDataSource.ParsingPromptProperty(
            parsing_prompt_text="parsingPromptText"
        )
    )
)
```

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.bedrock.*;

ParsingConfigurationProperty parsingConfigurationProperty = ParsingConfigurationProperty.builder()
        .parsingStrategy("parsingStrategy")

        // the properties below are optional
        .bedrockDataAutomationConfiguration(BedrockDataAutomationConfigurationProperty.builder()
                .parsingModality("parsingModality")
                .build())
        .bedrockFoundationModelConfiguration(BedrockFoundationModelConfigurationProperty.builder()
                .modelArn("modelArn")

                // the properties below are optional
                .parsingModality("parsingModality")
                .parsingPrompt(ParsingPromptProperty.builder()
                        .parsingPromptText("parsingPromptText")
                        .build())
                .build())
        .build();
```

C# / .NET:

```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.Bedrock;

var parsingConfigurationProperty = new ParsingConfigurationProperty {
    ParsingStrategy = "parsingStrategy",

    // the properties below are optional
    BedrockDataAutomationConfiguration = new BedrockDataAutomationConfigurationProperty {
        ParsingModality = "parsingModality"
    },
    BedrockFoundationModelConfiguration = new BedrockFoundationModelConfigurationProperty {
        ModelArn = "modelArn",

        // the properties below are optional
        ParsingModality = "parsingModality",
        ParsingPrompt = new ParsingPromptProperty {
            ParsingPromptText = "parsingPromptText"
        }
    }
};
```

Golang:

```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"

parsingConfigurationProperty := &ParsingConfigurationProperty{
	ParsingStrategy: jsii.String("parsingStrategy"),

	// the properties below are optional
	BedrockDataAutomationConfiguration: &BedrockDataAutomationConfigurationProperty{
		ParsingModality: jsii.String("parsingModality"),
	},
	BedrockFoundationModelConfiguration: &BedrockFoundationModelConfigurationProperty{
		ModelArn: jsii.String("modelArn"),

		// the properties below are optional
		ParsingModality: jsii.String("parsingModality"),
		ParsingPrompt: &ParsingPromptProperty{
			ParsingPromptText: jsii.String("parsingPromptText"),
		},
	},
}
```

## Properties

- `bedrockDataAutomationConfiguration`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnDataSource.BedrockDataAutomationConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_bedrock.CfnDataSource.BedrockDataAutomationConfigurationProperty.html) — If you specify `BEDROCK_DATA_AUTOMATION` as the parsing strategy for ingesting your data source, use this object to modify configurations for using the Amazon Bedrock Data Automation parser.

- `bedrockFoundationModelConfiguration`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnDataSource.BedrockFoundationModelConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_bedrock.CfnDataSource.BedrockFoundationModelConfigurationProperty.html) — If you specify `BEDROCK_FOUNDATION_MODEL` as the parsing strategy for ingesting your data source, use this object to modify configurations for using a foundation model to parse documents.

- `parsingStrategy`: string (required) — The parsing strategy for the data source.
