Skip to content

Commit d24b2af

Browse files
author
Bob Strahan
committed
Update changelog and fix test dependencies for bedrock utils
1 parent 4b884a5 commit d24b2af

File tree

3 files changed

+48
-1
lines changed

3 files changed

+48
-1
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,19 @@ SPDX-License-Identifier: MIT-0
1616
- **Automatic Integration**: Integrates with evaluation service when ground truth and predicted sections are available
1717
- **Documentation**: Guide in `lib/idp_common_pkg/idp_common/evaluation/README.md` with usage examples, metric explanations, and best practices
1818

19+
- **Caching improvements to Agentic Extraction Service**
20+
- Optimized prompt caching by caching document context (text/images) on first LLM call, reducing token costs and quota consumption
21+
22+
- **Enhanced Bedrock Retry Logic for Agentic Extraction**
23+
- New `bedrock_utils.py` module with exponential backoff and comprehensive error handling
24+
- Improves agentic extraction reliability for transient failures and rate limiting
25+
26+
- **Review Agent Model Configuration**
27+
- Added `review_agent_model` parameter to enable separate model for reviewing extraction work
28+
- Defaults to main extraction model if not specified
29+
- Configurable through Web UI extraction settings
30+
31+
1932
### Fixed
2033

2134
- **Evaluation Output URI Fields Lost Across All Patterns - causing (a) missing Page Text Confidence content in UI, (2) failed Assessment step when reprocessing document after editing classes (No module named 'fitz')**
@@ -29,6 +42,10 @@ SPDX-License-Identifier: MIT-0
2942
- **UI: Estimated Cost Panel Arrow Misalignment**
3043
- Fixed expand/contract arrow displaying above "Estimated Cost" heading
3144

45+
- **Agentic Extraction Reliability Improvements**
46+
- Updated Pydantic model serialization to use `model_dump(mode="json")` for proper JSON handling
47+
- Resolved linting issues and improved code quality across extraction modules
48+
3249
### Templates
3350
- us-west-2: `https://s3.us-west-2.amazonaws.com/aws-ml-blog-us-west-2/artifacts/genai-idp/idp-main_0.4.5.yaml`
3451
- us-east-1: `https://s3.us-east-1.amazonaws.com/aws-ml-blog-us-east-1/artifacts/genai-idp/idp-main_0.4.5.yaml`

lib/idp_common_pkg/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ test = [
142142
"ruff>=0.14.0",
143143
"deepdiff>=6.0.0", # Required for BDA blueprint service tests
144144
"datamodel-code-generator>=0.25.0", # Required for schema/pydantic generator tests
145+
"mypy-boto3-bedrock-runtime>=1.39.0", # Required for bedrock_utils tests
145146
# Evaluation module dependencies (from evaluation group)
146147
"stickler-eval==0.1.3",
147148
"genson==1.3.0",

memory-bank/activeContext.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,42 @@
22

33
## Current Task Status
44

5-
**ProcessChanges Resolver Fix & Agent Analytics Optimization**: ✅ **COMPLETED** - 2-Phase Schema Knowledge Optimization
5+
**Test Suite Dependency Fix**: ✅ **COMPLETED** - Fixed Missing Type Stubs Dependency
66

77
**Previous Tasks**:
8+
-**COMPLETED** - ProcessChanges Resolver Fix & Agent Analytics Optimization
89
-**COMPLETED** - Section Edit Mode Performance Optimization
910
-**COMPLETED** - IDP CLI Dependency Security Updates
1011
-**COMPLETED** - Service Principal GovCloud Compatibility Updates
1112

13+
## Test Suite Dependency Fix
14+
15+
Successfully resolved test collection failure caused by missing type stubs dependency for Bedrock Runtime client.
16+
17+
### Issue Identified
18+
- **Error**: `ModuleNotFoundError: No module named 'mypy_boto3_bedrock_runtime'` during test collection
19+
- **Location**: `lib/idp_common_pkg/idp_common/utils/bedrock_utils.py`
20+
- **Root Cause**: Type stubs dependency was only in `agentic-extraction` optional dependencies, not in `test` dependencies
21+
22+
### Solution Implemented
23+
- **Added Dependency**: `mypy-boto3-bedrock-runtime>=1.39.0` to test dependencies in `pyproject.toml`
24+
- **File Modified**: `lib/idp_common_pkg/pyproject.toml`
25+
- **Rationale**: The `bedrock_utils.py` module imports `mypy_boto3_bedrock_runtime` for type hints on BedrockRuntimeClient, and these type stubs are required for the `test_bedrock_utils.py` unit tests to import and run
26+
27+
### Test Results
28+
- **idp_common_pkg**: ✅ 428 passed, 20 skipped
29+
- **idp_cli**: ✅ 61 passed
30+
- **Total Time**: ~8.44 seconds
31+
- **Status**: All tests passing successfully
32+
33+
### Technical Details
34+
The type stubs package `mypy-boto3-bedrock-runtime` provides type information for boto3's bedrock-runtime client, enabling:
35+
1. Better IDE autocomplete and type checking
36+
2. Type-safe wrapper class implementation in `BedrockClientWrapper`
37+
3. Proper type hints for invoke_model, converse, and converse_stream methods
38+
39+
This dependency was already present in `agentic-extraction` dependencies but was missing from the `test` group, causing test collection to fail when importing the module.
40+
1241
## ProcessChanges Resolver Fix & Agent Analytics Optimization Overview
1342

1443
Successfully implemented comprehensive optimization techniques using a **2-phase schema knowledge approach** to dramatically improve agent analytics performance and resolve resolver failures:

0 commit comments

Comments
 (0)