Skip to content

@cdklabs/genai-idp-bedrock-llm-processor

Constructs

BedrockLlmProcessor

Bedrock LLM document processor facade over UnifiedDocumentProcessor.

Delegates all processing to the unified processor using the pipeline path (non-BDA). Uses Amazon Bedrock foundation models for OCR, classification, extraction, assessment, summarization, and evaluation.

Initializers

import { BedrockLlmProcessor } from '@cdklabs/genai-idp-bedrock-llm-processor'

new BedrockLlmProcessor(scope: Construct, id: string, props: BedrockLlmProcessorProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props BedrockLlmProcessorProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
with Applies one or more mixins to this construct.
metricBedrockMaxRetriesExceeded Bedrock requests that exceeded max retries.
metricBedrockNonRetryableErrors Bedrock non-retryable errors.
metricBedrockRequestLatency Bedrock single-request latency in milliseconds.
metricBedrockRequestsFailed Failed Bedrock model invocation requests.
metricBedrockRequestsSucceeded Successful Bedrock model invocation requests.
metricBedrockRequestsTotal Total Bedrock model invocation requests.
metricBedrockRetrySuccess Bedrock requests that succeeded after retry.
metricBedrockThrottles Bedrock request throttles.
metricBedrockTotalLatency Bedrock total latency including retries in milliseconds.
metricBedrockUnexpectedErrors Bedrock unexpected errors.
metricInputDocumentPages Document pages submitted for extraction.
metricInputDocuments Documents submitted for extraction.
metricInputTokens Input tokens consumed.
metricLambdaHookRequestsFailed Failed LambdaHook invocation requests.
metricLambdaHookRequestsSucceeded Successful LambdaHook invocation requests.
metricLambdaHookRequestsTotal Total LambdaHook invocation requests.
metricOutputTokens Output tokens generated.
metricTotalTokens Total tokens used.

toString
public toString(): string

Returns a string representation of this construct.

with
public with(mixins: ...IMixin[]): IConstruct

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

mixinsRequired
  • Type: ...constructs.IMixin[]

The mixins to apply.


metricBedrockMaxRetriesExceeded
public metricBedrockMaxRetriesExceeded(props?: MetricOptions): Metric

Bedrock requests that exceeded max retries.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricBedrockNonRetryableErrors
public metricBedrockNonRetryableErrors(props?: MetricOptions): Metric

Bedrock non-retryable errors.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricBedrockRequestLatency
public metricBedrockRequestLatency(props?: MetricOptions): Metric

Bedrock single-request latency in milliseconds.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricBedrockRequestsFailed
public metricBedrockRequestsFailed(props?: MetricOptions): Metric

Failed Bedrock model invocation requests.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricBedrockRequestsSucceeded
public metricBedrockRequestsSucceeded(props?: MetricOptions): Metric

Successful Bedrock model invocation requests.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricBedrockRequestsTotal
public metricBedrockRequestsTotal(props?: MetricOptions): Metric

Total Bedrock model invocation requests.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricBedrockRetrySuccess
public metricBedrockRetrySuccess(props?: MetricOptions): Metric

Bedrock requests that succeeded after retry.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricBedrockThrottles
public metricBedrockThrottles(props?: MetricOptions): Metric

Bedrock request throttles.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricBedrockTotalLatency
public metricBedrockTotalLatency(props?: MetricOptions): Metric

Bedrock total latency including retries in milliseconds.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricBedrockUnexpectedErrors
public metricBedrockUnexpectedErrors(props?: MetricOptions): Metric

Bedrock unexpected errors.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricInputDocumentPages
public metricInputDocumentPages(props?: MetricOptions): Metric

Document pages submitted for extraction.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricInputDocuments
public metricInputDocuments(props?: MetricOptions): Metric

Documents submitted for extraction.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricInputTokens
public metricInputTokens(props?: MetricOptions): Metric

Input tokens consumed.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricLambdaHookRequestsFailed
public metricLambdaHookRequestsFailed(props?: MetricOptions): Metric

Failed LambdaHook invocation requests.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricLambdaHookRequestsSucceeded
public metricLambdaHookRequestsSucceeded(props?: MetricOptions): Metric

Successful LambdaHook invocation requests.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricLambdaHookRequestsTotal
public metricLambdaHookRequestsTotal(props?: MetricOptions): Metric

Total LambdaHook invocation requests.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricOutputTokens
public metricOutputTokens(props?: MetricOptions): Metric

Output tokens generated.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

metricTotalTokens
public metricTotalTokens(props?: MetricOptions): Metric

Total tokens used.

propsOptional
  • Type: aws-cdk-lib.aws_cloudwatch.MetricOptions

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { BedrockLlmProcessor } from '@cdklabs/genai-idp-bedrock-llm-processor'

BedrockLlmProcessor.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
environment @cdklabs/genai-idp.IProcessingEnvironment The processing environment that provides shared infrastructure and services.
maxProcessingConcurrency number The maximum number of documents that can be processed concurrently.
stateMachine aws-cdk-lib.aws_stepfunctions.IStateMachine The Step Functions state machine that orchestrates the document processing workflow.
evaluationFunction @cdklabs/genai-idp.EvaluationFunction The evaluation function if evaluation is enabled for this processor.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


environmentRequired
public readonly environment: IProcessingEnvironment;
  • Type: @cdklabs/genai-idp.IProcessingEnvironment

The processing environment that provides shared infrastructure and services.

Contains input/output buckets, tracking tables, API endpoints, and other resources needed for document processing operations.


maxProcessingConcurrencyRequired
public readonly maxProcessingConcurrency: number;
  • Type: number

The maximum number of documents that can be processed concurrently.

Controls the throughput and resource utilization of the document processing system.


stateMachineRequired
public readonly stateMachine: IStateMachine;
  • Type: aws-cdk-lib.aws_stepfunctions.IStateMachine

The Step Functions state machine that orchestrates the document processing workflow.

Manages the sequence of processing steps and handles error conditions. This state machine is triggered for each document that needs processing and coordinates the entire extraction pipeline.


evaluationFunctionOptional
public readonly evaluationFunction: EvaluationFunction;
  • Type: @cdklabs/genai-idp.EvaluationFunction

The evaluation function if evaluation is enabled for this processor.

The evaluation function is created by the ProcessingEnvironment when evaluation baseline bucket and model are provided.


Structs

BedrockLlmProcessorConfigurationDefinitionOptions

Options for configuring the Bedrock LLM processor configuration definition.

Allows customization of all processing stages via Invokable providers.

Initializer

import { BedrockLlmProcessorConfigurationDefinitionOptions } from '@cdklabs/genai-idp-bedrock-llm-processor'

const bedrockLlmProcessorConfigurationDefinitionOptions: BedrockLlmProcessorConfigurationDefinitionOptions = { ... }

Properties

Name Type Description
assessmentInvokable @cdklabs/genai-idp.Invokable Optional inference provider for the assessment stage.
classificationInvokable @cdklabs/genai-idp.Invokable Optional inference provider for the classification stage.
classificationMethod ClassificationMethod Optional classification method for document categorization.
customPromptGeneratorFunction aws-cdk-lib.aws_lambda.IFunction Optional custom prompt generator Lambda function.
evaluationModel @aws-cdk/aws-bedrock-alpha.IBedrockInvokable Optional model for the evaluation stage (Bedrock only, no LambdaHook).
extractionInvokable @cdklabs/genai-idp.Invokable Optional inference provider for the extraction stage.
ocrInvokable @cdklabs/genai-idp.Invokable Optional inference provider for the OCR stage.
summarizationInvokable @cdklabs/genai-idp.Invokable Optional inference provider for the summarization stage.

assessmentInvokableOptional
public readonly assessmentInvokable: Invokable;
  • Type: @cdklabs/genai-idp.Invokable

Optional inference provider for the assessment stage.


classificationInvokableOptional
public readonly classificationInvokable: Invokable;
  • Type: @cdklabs/genai-idp.Invokable

Optional inference provider for the classification stage.


classificationMethodOptional
public readonly classificationMethod: ClassificationMethod;

Optional classification method for document categorization.


customPromptGeneratorFunctionOptional
public readonly customPromptGeneratorFunction: IFunction;
  • Type: aws-cdk-lib.aws_lambda.IFunction

Optional custom prompt generator Lambda function.


evaluationModelOptional
public readonly evaluationModel: IBedrockInvokable;
  • Type: @aws-cdk/aws-bedrock-alpha.IBedrockInvokable

Optional model for the evaluation stage (Bedrock only, no LambdaHook).


extractionInvokableOptional
public readonly extractionInvokable: Invokable;
  • Type: @cdklabs/genai-idp.Invokable

Optional inference provider for the extraction stage.


ocrInvokableOptional
public readonly ocrInvokable: Invokable;
  • Type: @cdklabs/genai-idp.Invokable

Optional inference provider for the OCR stage.


summarizationInvokableOptional
public readonly summarizationInvokable: Invokable;
  • Type: @cdklabs/genai-idp.Invokable

Optional inference provider for the summarization stage.


BedrockLlmProcessorProps

Configuration properties for the Bedrock LLM document processor facade.

Initializer

import { BedrockLlmProcessorProps } from '@cdklabs/genai-idp-bedrock-llm-processor'

const bedrockLlmProcessorProps: BedrockLlmProcessorProps = { ... }

Properties

Name Type Description
environment @cdklabs/genai-idp.IProcessingEnvironment The processing environment that provides shared infrastructure and services.
maxProcessingConcurrency number The maximum number of documents that can be processed concurrently.
configuration IBedrockLlmProcessorConfiguration Configuration for the Bedrock LLM document processor.
configurationBucket aws-cdk-lib.aws_s3.IBucket The S3 bucket containing configuration files.

environmentRequired
public readonly environment: IProcessingEnvironment;
  • Type: @cdklabs/genai-idp.IProcessingEnvironment

The processing environment that provides shared infrastructure and services.

Contains input/output buckets, tracking tables, API endpoints, and other resources needed for document processing operations.


maxProcessingConcurrencyOptional
public readonly maxProcessingConcurrency: number;
  • Type: number
  • Default: 100 concurrent workflows

The maximum number of documents that can be processed concurrently.

Controls the throughput and resource utilization of the document processing system.


configurationRequired
public readonly configuration: IBedrockLlmProcessorConfiguration;

Configuration for the Bedrock LLM document processor.


configurationBucketRequired
public readonly configurationBucket: IBucket;
  • Type: aws-cdk-lib.aws_s3.IBucket

The S3 bucket containing configuration files.


Classes

BedrockLlmProcessorConfiguration

Configuration management for Bedrock LLM document processing.

Provides factory methods for preset configurations and custom YAML files. Delegates to UnifiedDocumentProcessorConfigurationDefinition for loading configs from the unified config library.

Initializers

import { BedrockLlmProcessorConfiguration } from '@cdklabs/genai-idp-bedrock-llm-processor'

new BedrockLlmProcessorConfiguration(definition: IBedrockLlmProcessorConfigurationDefinition)
Name Type Description
definition IBedrockLlmProcessorConfigurationDefinition The configuration definition.

definitionRequired

The configuration definition.


Methods

Name Description
bind Binds the configuration to a processor scope.

bind
public bind(scope: Construct, environment: IProcessingEnvironment): IBedrockLlmProcessorConfigurationDefinition

Binds the configuration to a processor scope.

Writes the default configuration to the configuration table.

scopeRequired
  • Type: constructs.Construct

environmentRequired
  • Type: @cdklabs/genai-idp.IProcessingEnvironment

Static Functions

Name Description
bankStatementSample No description.
docSplit No description.
fromFile No description.
healthcareMultisectionPackage No description.
lendingPackageSample No description.
lendingPackageSampleGovCloud No description.
ocrBenchmark No description.
realkieFccVerified No description.
ruleExtraction No description.
ruleValidation No description.
rvlCdip No description.
rvlCdipWithFewShotExamples No description.

bankStatementSample
import { BedrockLlmProcessorConfiguration } from '@cdklabs/genai-idp-bedrock-llm-processor'

BedrockLlmProcessorConfiguration.bankStatementSample(options?: BedrockLlmProcessorConfigurationDefinitionOptions)
optionsOptional

docSplit
import { BedrockLlmProcessorConfiguration } from '@cdklabs/genai-idp-bedrock-llm-processor'

BedrockLlmProcessorConfiguration.docSplit(options?: BedrockLlmProcessorConfigurationDefinitionOptions)
optionsOptional

fromFile
import { BedrockLlmProcessorConfiguration } from '@cdklabs/genai-idp-bedrock-llm-processor'

BedrockLlmProcessorConfiguration.fromFile(filePath: string, options?: BedrockLlmProcessorConfigurationDefinitionOptions)
filePathRequired
  • Type: string

optionsOptional

healthcareMultisectionPackage
import { BedrockLlmProcessorConfiguration } from '@cdklabs/genai-idp-bedrock-llm-processor'

BedrockLlmProcessorConfiguration.healthcareMultisectionPackage(options?: BedrockLlmProcessorConfigurationDefinitionOptions)
optionsOptional

lendingPackageSample
import { BedrockLlmProcessorConfiguration } from '@cdklabs/genai-idp-bedrock-llm-processor'

BedrockLlmProcessorConfiguration.lendingPackageSample(options?: BedrockLlmProcessorConfigurationDefinitionOptions)
optionsOptional

lendingPackageSampleGovCloud
import { BedrockLlmProcessorConfiguration } from '@cdklabs/genai-idp-bedrock-llm-processor'

BedrockLlmProcessorConfiguration.lendingPackageSampleGovCloud(options?: BedrockLlmProcessorConfigurationDefinitionOptions)
optionsOptional

ocrBenchmark
import { BedrockLlmProcessorConfiguration } from '@cdklabs/genai-idp-bedrock-llm-processor'

BedrockLlmProcessorConfiguration.ocrBenchmark(options?: BedrockLlmProcessorConfigurationDefinitionOptions)
optionsOptional

realkieFccVerified
import { BedrockLlmProcessorConfiguration } from '@cdklabs/genai-idp-bedrock-llm-processor'

BedrockLlmProcessorConfiguration.realkieFccVerified(options?: BedrockLlmProcessorConfigurationDefinitionOptions)
optionsOptional

ruleExtraction
import { BedrockLlmProcessorConfiguration } from '@cdklabs/genai-idp-bedrock-llm-processor'

BedrockLlmProcessorConfiguration.ruleExtraction(options?: BedrockLlmProcessorConfigurationDefinitionOptions)
optionsOptional

ruleValidation
import { BedrockLlmProcessorConfiguration } from '@cdklabs/genai-idp-bedrock-llm-processor'

BedrockLlmProcessorConfiguration.ruleValidation(options?: BedrockLlmProcessorConfigurationDefinitionOptions)
optionsOptional

rvlCdip
import { BedrockLlmProcessorConfiguration } from '@cdklabs/genai-idp-bedrock-llm-processor'

BedrockLlmProcessorConfiguration.rvlCdip(options?: BedrockLlmProcessorConfigurationDefinitionOptions)
optionsOptional

rvlCdipWithFewShotExamples
import { BedrockLlmProcessorConfiguration } from '@cdklabs/genai-idp-bedrock-llm-processor'

BedrockLlmProcessorConfiguration.rvlCdipWithFewShotExamples(options?: BedrockLlmProcessorConfigurationDefinitionOptions)
optionsOptional

Properties

Name Type Description
definition IBedrockLlmProcessorConfigurationDefinition The configuration definition.

definitionRequired
public readonly definition: IBedrockLlmProcessorConfigurationDefinition;

The configuration definition.


BedrockLlmProcessorConfigurationDefinition

Configuration definition for Bedrock LLM document processing.

Delegates to UnifiedDocumentProcessorConfigurationDefinition for loading configs from the unified config library. Maps bedrock-llm-specific options to unified options.

Initializers

import { BedrockLlmProcessorConfigurationDefinition } from '@cdklabs/genai-idp-bedrock-llm-processor'

new BedrockLlmProcessorConfigurationDefinition()
Name Type Description

Static Functions

Name Description
bankStatementSample No description.
docSplit No description.
fromFile No description.
healthcareMultisectionPackage No description.
lendingPackageSample No description.
lendingPackageSampleGovCloud No description.
ocrBenchmark No description.
realkieFccVerified No description.
ruleExtraction No description.
ruleValidation No description.
rvlCdip No description.
rvlCdipWithFewShotExamples No description.

bankStatementSample
import { BedrockLlmProcessorConfigurationDefinition } from '@cdklabs/genai-idp-bedrock-llm-processor'

BedrockLlmProcessorConfigurationDefinition.bankStatementSample(options?: BedrockLlmProcessorConfigurationDefinitionOptions)
optionsOptional

docSplit
import { BedrockLlmProcessorConfigurationDefinition } from '@cdklabs/genai-idp-bedrock-llm-processor'

BedrockLlmProcessorConfigurationDefinition.docSplit(options?: BedrockLlmProcessorConfigurationDefinitionOptions)
optionsOptional

fromFile
import { BedrockLlmProcessorConfigurationDefinition } from '@cdklabs/genai-idp-bedrock-llm-processor'

BedrockLlmProcessorConfigurationDefinition.fromFile(filePath: string, options?: BedrockLlmProcessorConfigurationDefinitionOptions)
filePathRequired
  • Type: string

optionsOptional

healthcareMultisectionPackage
import { BedrockLlmProcessorConfigurationDefinition } from '@cdklabs/genai-idp-bedrock-llm-processor'

BedrockLlmProcessorConfigurationDefinition.healthcareMultisectionPackage(options?: BedrockLlmProcessorConfigurationDefinitionOptions)
optionsOptional

lendingPackageSample
import { BedrockLlmProcessorConfigurationDefinition } from '@cdklabs/genai-idp-bedrock-llm-processor'

BedrockLlmProcessorConfigurationDefinition.lendingPackageSample(options?: BedrockLlmProcessorConfigurationDefinitionOptions)
optionsOptional

lendingPackageSampleGovCloud
import { BedrockLlmProcessorConfigurationDefinition } from '@cdklabs/genai-idp-bedrock-llm-processor'

BedrockLlmProcessorConfigurationDefinition.lendingPackageSampleGovCloud(options?: BedrockLlmProcessorConfigurationDefinitionOptions)
optionsOptional

ocrBenchmark
import { BedrockLlmProcessorConfigurationDefinition } from '@cdklabs/genai-idp-bedrock-llm-processor'

BedrockLlmProcessorConfigurationDefinition.ocrBenchmark(options?: BedrockLlmProcessorConfigurationDefinitionOptions)
optionsOptional

realkieFccVerified
import { BedrockLlmProcessorConfigurationDefinition } from '@cdklabs/genai-idp-bedrock-llm-processor'

BedrockLlmProcessorConfigurationDefinition.realkieFccVerified(options?: BedrockLlmProcessorConfigurationDefinitionOptions)
optionsOptional

ruleExtraction
import { BedrockLlmProcessorConfigurationDefinition } from '@cdklabs/genai-idp-bedrock-llm-processor'

BedrockLlmProcessorConfigurationDefinition.ruleExtraction(options?: BedrockLlmProcessorConfigurationDefinitionOptions)
optionsOptional

ruleValidation
import { BedrockLlmProcessorConfigurationDefinition } from '@cdklabs/genai-idp-bedrock-llm-processor'

BedrockLlmProcessorConfigurationDefinition.ruleValidation(options?: BedrockLlmProcessorConfigurationDefinitionOptions)
optionsOptional

rvlCdip
import { BedrockLlmProcessorConfigurationDefinition } from '@cdklabs/genai-idp-bedrock-llm-processor'

BedrockLlmProcessorConfigurationDefinition.rvlCdip(options?: BedrockLlmProcessorConfigurationDefinitionOptions)
optionsOptional

rvlCdipWithFewShotExamples
import { BedrockLlmProcessorConfigurationDefinition } from '@cdklabs/genai-idp-bedrock-llm-processor'

BedrockLlmProcessorConfigurationDefinition.rvlCdipWithFewShotExamples(options?: BedrockLlmProcessorConfigurationDefinitionOptions)
optionsOptional

Invokable

  • Implements: @cdklabs/genai-idp.IInvokable

Unified wrapper for Bedrock models and Lambda functions that implements IInvokable.

Use the static factory methods to create instances:

Example

// From a Bedrock model
const provider = Invokable.fromModel(model);

// From a Lambda function (LambdaHook)
const provider = Invokable.fromFunction(fn);@since[object Object]

Methods

Name Description
grantInvoke Grant the given identity permissions to invoke this resource.

grantInvoke
public grantInvoke(grantee: IGrantable): Grant

Grant the given identity permissions to invoke this resource.

granteeRequired
  • Type: aws-cdk-lib.aws_iam.IGrantable

Static Functions

Name Description
fromFunction Create an Invokable from a Lambda function (LambdaHook pattern).
fromModel Create an Invokable from a Bedrock model or inference profile.

fromFunction
import { Invokable } from '@cdklabs/genai-idp-bedrock-llm-processor'

Invokable.fromFunction(fn: IFunction)

Create an Invokable from a Lambda function (LambdaHook pattern).

fnRequired
  • Type: aws-cdk-lib.aws_lambda.IFunction

The Lambda function that implements the Converse API-compatible contract.


fromModel
import { Invokable } from '@cdklabs/genai-idp-bedrock-llm-processor'

Invokable.fromModel(model: IBedrockInvokable)

Create an Invokable from a Bedrock model or inference profile.

modelRequired
  • Type: @aws-cdk/aws-bedrock-alpha.IBedrockInvokable

The Bedrock invokable model.


Protocols

IBedrockLlmProcessor

Interface for Bedrock LLM document processor implementation.

Properties

Name Type Description
node constructs.Node The tree node.
environment @cdklabs/genai-idp.IProcessingEnvironment The processing environment that provides shared infrastructure and services.
maxProcessingConcurrency number The maximum number of documents that can be processed concurrently.
stateMachine aws-cdk-lib.aws_stepfunctions.IStateMachine The Step Functions state machine that orchestrates the document processing workflow.
evaluationFunction @cdklabs/genai-idp.EvaluationFunction The evaluation function if evaluation is enabled for this processor.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


environmentRequired
public readonly environment: IProcessingEnvironment;
  • Type: @cdklabs/genai-idp.IProcessingEnvironment

The processing environment that provides shared infrastructure and services.

Contains input/output buckets, tracking tables, API endpoints, and other resources needed for document processing operations.


maxProcessingConcurrencyRequired
public readonly maxProcessingConcurrency: number;
  • Type: number

The maximum number of documents that can be processed concurrently.

Controls the throughput and resource utilization of the document processing system.


stateMachineRequired
public readonly stateMachine: IStateMachine;
  • Type: aws-cdk-lib.aws_stepfunctions.IStateMachine

The Step Functions state machine that orchestrates the document processing workflow.

Manages the sequence of processing steps and handles error conditions. This state machine is triggered for each document that needs processing and coordinates the entire extraction pipeline.


evaluationFunctionOptional
public readonly evaluationFunction: EvaluationFunction;
  • Type: @cdklabs/genai-idp.EvaluationFunction

The evaluation function if evaluation is enabled for this processor.

The evaluation function is created by the ProcessingEnvironment when evaluation baseline bucket and model are provided.


IBedrockLlmProcessorConfiguration

Interface for Bedrock LLM document processor configuration.

Methods

Name Description
bind Binds the configuration to a processor scope.

bind
public bind(scope: Construct, environment: IProcessingEnvironment): IBedrockLlmProcessorConfigurationDefinition

Binds the configuration to a processor scope.

Writes the default configuration to the configuration table.

scopeRequired
  • Type: constructs.Construct

The construct scope for creating custom resources.


environmentRequired
  • Type: @cdklabs/genai-idp.IProcessingEnvironment

The processing environment providing the configuration function and table.


Properties

Name Type Description
definition IBedrockLlmProcessorConfigurationDefinition The configuration definition.

definitionRequired
public readonly definition: IBedrockLlmProcessorConfigurationDefinition;

The configuration definition.


IBedrockLlmProcessorConfigurationDefinition

Interface for Bedrock LLM processor configuration definition.

Exposes resolved inference providers for each processing stage.

Properties

Name Type Description
classificationMethod ClassificationMethod No description.
ocrBackend string No description.
assessmentInferenceProvider @cdklabs/genai-idp.IInvokable No description.
classificationInferenceProvider @cdklabs/genai-idp.IInvokable No description.
customPromptGenerator aws-cdk-lib.aws_lambda.IFunction No description.
evaluationModel @aws-cdk/aws-bedrock-alpha.IBedrockInvokable No description.
extractionInferenceProvider @cdklabs/genai-idp.IInvokable No description.
ocrInferenceProvider @cdklabs/genai-idp.IInvokable No description.
summarizationInferenceProvider @cdklabs/genai-idp.IInvokable No description.

classificationMethodRequired
public readonly classificationMethod: ClassificationMethod;

ocrBackendRequired
public readonly ocrBackend: string;
  • Type: string

assessmentInferenceProviderOptional
public readonly assessmentInferenceProvider: IInvokable;
  • Type: @cdklabs/genai-idp.IInvokable

classificationInferenceProviderOptional
public readonly classificationInferenceProvider: IInvokable;
  • Type: @cdklabs/genai-idp.IInvokable

customPromptGeneratorOptional
public readonly customPromptGenerator: IFunction;
  • Type: aws-cdk-lib.aws_lambda.IFunction

evaluationModelOptional
public readonly evaluationModel: IBedrockInvokable;
  • Type: @aws-cdk/aws-bedrock-alpha.IBedrockInvokable

extractionInferenceProviderOptional
public readonly extractionInferenceProvider: IInvokable;
  • Type: @cdklabs/genai-idp.IInvokable

ocrInferenceProviderOptional
public readonly ocrInferenceProvider: IInvokable;
  • Type: @cdklabs/genai-idp.IInvokable

summarizationInferenceProviderOptional
public readonly summarizationInferenceProvider: IInvokable;
  • Type: @cdklabs/genai-idp.IInvokable

IInvokable

Unified interface for any resource that can serve as an inference backend.

Abstracts over Bedrock models and Lambda functions so that processing stage constructs can grant invoke permissions without knowing the underlying type.

Methods

Name Description
grantInvoke Grant the given identity permissions to invoke this resource.

grantInvoke
public grantInvoke(grantee: IGrantable): Grant

Grant the given identity permissions to invoke this resource.

granteeRequired
  • Type: aws-cdk-lib.aws_iam.IGrantable

The principal to grant invoke permissions to.


Enums

ClassificationMethod

Defines the methods available for document classification in Pattern 2 processing.

Document classification is a critical step in the IDP workflow that determines how documents are categorized and processed. Different classification methods offer varying levels of accuracy, performance, and capabilities.

Members

Name Description
MULTIMODAL_PAGE_LEVEL_CLASSIFICATION Uses multimodal models to classify documents at the page level.
TEXTBASED_HOLISTIC_CLASSIFICATION Uses text-based analysis to classify the entire document holistically. Considers the full document text content for classification decisions.

MULTIMODAL_PAGE_LEVEL_CLASSIFICATION

Uses multimodal models to classify documents at the page level.

Analyzes both text and visual elements on each page for classification.

This method is effective for documents where each page may belong to a different document type or category. It provides high accuracy for complex layouts by considering both textual content and visual structure of each page individually.


TEXTBASED_HOLISTIC_CLASSIFICATION

Uses text-based analysis to classify the entire document holistically. Considers the full document text content for classification decisions.

This method is more efficient and cost-effective as it only processes the extracted text. It works well for text-heavy documents where the document type is consistent across all pages and visual elements are less important for classification.


InvokableType

The type of inference backend wrapped by an Invokable.

Members

Name Description
MODEL A Bedrock foundation model or inference profile.
FUNCTION A Lambda function implementing the LambdaHook contract.

MODEL

A Bedrock foundation model or inference profile.


FUNCTION

A Lambda function implementing the LambdaHook contract.