You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,21 @@ SPDX-License-Identifier: MIT-0
5
5
6
6
## [Unreleased]
7
7
8
+
### Added
9
+
10
+
11
+
8
12
## [0.3.12]
9
13
10
14
### Added
11
15
16
+
-**Custom Prompt Generator Lambda Support for Patterns 2 & 3**
17
+
- Added `custom_prompt_lambda_arn` configuration field to enable injection of custom business logic into extraction processing
18
+
-**Key Features**: Lambda interface with all template placeholders (DOCUMENT_TEXT, DOCUMENT_CLASS, ATTRIBUTE_NAMES_AND_DESCRIPTIONS, DOCUMENT_IMAGE), URI-based image handling for JSON serialization, comprehensive error handling with fail-fast behavior, scoped IAM permissions requiring GENAIIDP-* function naming
19
+
-**Use Cases**: Document type-specific processing rules, integration with external systems for customer configurations, conditional processing based on document content, regulatory compliance and industry-specific requirements
20
+
-**Demo Resources**: Interactive notebook demonstration (`step3_extraction_with_custom_lambda.ipynb`), SAM deployment template for demo Lambda function, comprehensive documentation and examples in `notebooks/examples/demo-lambda/`
21
+
-**Benefits**: Custom business logic without core code changes, backward compatible (existing deployments unchanged), robust JSON serialization handling all object types, complete observability with detailed logging
22
+
12
23
-**Refactored Document Classification Service for Enhanced Boundary Detection**
13
24
- Consolidated `multimodalPageLevelClassification` and the experimental `multimodalPageBoundaryClassification` (from v0.3.11) into a single enhanced `multimodalPageLevelClassification` method
14
25
- Implemented BIO-like sequence segmentation with document boundary indicators: "start" (new document) and "continue" (same document)
Copy file name to clipboardExpand all lines: docs/extraction.md
+206Lines changed: 206 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -226,6 +226,212 @@ extraction:
226
226
4. **Handle OCR Limitations**: Use images to fill gaps where OCR may miss visual-only content
227
227
5. **Consider Document Types**: Different document types benefit from different image placement strategies
228
228
229
+
## Custom Prompt Generator Lambda Functions
230
+
231
+
The extraction service supports custom Lambda functions for advanced prompt generation, allowing you to inject custom business logic into the extraction process while leveraging the existing IDP infrastructure.
232
+
233
+
### Overview
234
+
235
+
Custom prompt generator Lambda functions enable:
236
+
237
+
- **Document type-specific processing** with specialized extraction logic
238
+
- **Integration with external systems** for dynamic configuration retrieval
239
+
- **Conditional processing** based on document content analysis
240
+
- **Regulatory compliance** with industry-specific prompt requirements
241
+
- **Multi-tenant customization** for different customer requirements
242
+
243
+
### Configuration
244
+
245
+
Add the `custom_prompt_lambda_arn` field to your extraction configuration:
Create your production Lambda with business-specific logic and deploy with appropriate IAM permissions.
403
+
404
+
### Use Cases
405
+
406
+
**Financial Services:**
407
+
- Regulatory compliance prompts for different financial products
408
+
- Multi-currency transaction handling with exchange rate awareness
409
+
- Customer-specific formatting for different banking institutions
410
+
411
+
**Healthcare:**
412
+
- HIPAA compliance with privacy-focused prompts
413
+
- Medical terminology enhancement for clinical documents
414
+
- Provider-specific templates for different healthcare systems
415
+
416
+
**Legal:**
417
+
- Jurisdiction-specific legal language processing
418
+
- Contract type specialization (NDAs, service agreements, etc.)
419
+
- Compliance requirements for regulatory documents
420
+
421
+
**Insurance:**
422
+
- Policy type customization for different insurance products
423
+
- Claims processing with adjuster-specific requirements
424
+
- Risk assessment integration with underwriting systems
425
+
426
+
### Security and Compliance
427
+
428
+
-**Scoped IAM Permissions**: Only Lambda functions with `GENAIIDP-*` naming can be invoked
429
+
-**Audit Trail**: All Lambda invocations are logged for security monitoring
430
+
-**Input Validation**: Lambda response structure is validated before use
431
+
-**Fail-Safe Operation**: Lambda failures cause extraction to fail rather than continue with potentially incorrect prompts
432
+
433
+
For complete examples and deployment instructions, see `notebooks/examples/demo-lambda/README.md`.
434
+
229
435
## Using CachePoint for Extraction
230
436
231
437
CachePoint is a feature of select Bedrock models that caches partial computations to improve performance and reduce costs. When used with extraction, it provides:
0 commit comments