Skip to content

Commit 83671f8

Browse files
author
Bob Strahan
committed
Merge branch 'develop' of ssh.gitlab.aws.dev:genaiic-reusable-assets/engagement-artifacts/genaiic-idp-accelerator into develop
2 parents 900ce3e + bee64f2 commit 83671f8

File tree

28 files changed

+1861
-652
lines changed

28 files changed

+1861
-652
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,25 @@ SPDX-License-Identifier: MIT-0
1616
- Added `--no-rollback` flag to `idp-cli deploy` command to disable automatic rollback on CloudFormation stack creation failure
1717
- When enabled, failed stacks remain in `CREATE_FAILED` state instead of rolling back, allowing inspection of failed resources for troubleshooting
1818

19+
- **Add support for prompt caching for Claude Haiku 4.5**
20+
21+
- **Add support for prompt caching for for EU region models**
22+
1923
### Fixed
2024

25+
- **Analytics Agent Schema Provider - Fixed Nested Attribute Column Display**
26+
- Fixed `schema_provider.py` to correctly display leaf-level nested columns instead of showing group-level attributes
27+
28+
- **IDP Agent Companion Chat UX improvements**
29+
- Improved speed of rendering chat response by buffering the agent tool responses.
30+
- Displaying agent tool queries and results in a modal with formatted results.
31+
32+
33+
### Templates
34+
- us-west-2: `https://s3.us-west-2.amazonaws.com/aws-ml-blog-us-west-2/artifacts/genai-idp/idp-main_0.4.4.yaml`
35+
- us-east-1: `https://s3.us-east-1.amazonaws.com/aws-ml-blog-us-east-1/artifacts/genai-idp/idp-main_0.4.4.yaml`
36+
- eu-central-1: `https://s3.eu-central-1.amazonaws.com/aws-ml-blog-eu-central-1/artifacts/genai-idp/idp-main_0.4.4.yaml`
37+
2138
## [0.4.3]
2239

2340
### Fixed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.4.4-wip1
1+
0.4.4-wip2

config_library/pattern-1/lending-package-sample/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ agents:
300300
time_range_hours_default: 24
301301

302302
chat_companion:
303-
model_id: us.anthropic.claude-sonnet-4-20250514-v1:0
303+
model_id: us.anthropic.claude-haiku-4-5-20251001-v1:0
304304
pricing:
305305
- name: bda/documents-custom
306306
units:

config_library/pattern-2/bank-statement-sample/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ agents:
790790
time_range_hours_default: 24
791791

792792
chat_companion:
793-
model_id: us.anthropic.claude-sonnet-4-20250514-v1:0
793+
model_id: us.anthropic.claude-haiku-4-5-20251001-v1:0
794794
pricing:
795795
- name: textract/detect_document_text
796796
units:

config_library/pattern-2/criteria-validation/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ agents:
382382
time_range_hours_default: 24
383383

384384
chat_companion:
385-
model_id: us.anthropic.claude-sonnet-4-20250514-v1:0
385+
model_id: us.anthropic.claude-haiku-4-5-20251001-v1:0
386386
# Pricing configuration for cost tracking
387387
pricing:
388388
- name: textract/detect_document_text

config_library/pattern-2/lending-package-sample/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1813,7 +1813,7 @@ agents:
18131813
time_range_hours_default: 24
18141814

18151815
chat_companion:
1816-
model_id: us.anthropic.claude-sonnet-4-20250514-v1:0
1816+
model_id: us.anthropic.claude-haiku-4-5-20251001-v1:0
18171817
pricing:
18181818
- name: textract/detect_document_text
18191819
units:

config_library/pattern-2/rvl-cdip-package-sample-with-few-shot-examples/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,7 @@ agents:
14351435
time_range_hours_default: 24
14361436

14371437
chat_companion:
1438-
model_id: us.anthropic.claude-sonnet-4-20250514-v1:0
1438+
model_id: us.anthropic.claude-haiku-4-5-20251001-v1:0
14391439
pricing:
14401440
- name: textract/detect_document_text
14411441
units:

config_library/pattern-2/rvl-cdip-package-sample/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,7 @@ agents:
14551455
time_range_hours_default: 24
14561456

14571457
chat_companion:
1458-
model_id: us.anthropic.claude-sonnet-4-20250514-v1:0
1458+
model_id: us.anthropic.claude-haiku-4-5-20251001-v1:0
14591459
pricing:
14601460
- name: textract/detect_document_text
14611461
units:

config_library/pattern-3/rvl-cdip-package-sample/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,7 @@ agents:
13141314
time_range_hours_default: 24
13151315

13161316
chat_companion:
1317-
model_id: us.anthropic.claude-sonnet-4-20250514-v1:0
1317+
model_id: us.anthropic.claude-haiku-4-5-20251001-v1:0
13181318
pricing:
13191319
- name: textract/detect_document_text
13201320
units:

lib/idp_common_pkg/idp_common/agents/analytics/schema_provider.py

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,8 @@ def get_dynamic_document_sections_description(
273273
class_desc = schema.get("description", "No description available")
274274
table_name = f"document_sections_{_get_table_suffix(class_name)}"
275275
properties = schema.get(SCHEMA_PROPERTIES, {})
276+
# Get $defs for resolving $ref references
277+
defs = schema.get("$defs", {})
276278

277279
description += f'**`{table_name}`** (Class: "{class_name}"):\n'
278280
description += f"- **Description**: {class_desc}\n"
@@ -307,7 +309,7 @@ def get_dynamic_document_sections_description(
307309
column_count = 0 # Reset for each table
308310
prop_list = list(properties.keys())
309311
for prop_index, (prop_desc_text, columns_added) in enumerate(
310-
_walk_properties_for_columns(properties)
312+
_walk_properties_for_columns(properties, defs=defs)
311313
):
312314
description += prop_desc_text
313315
column_count += columns_added
@@ -320,8 +322,6 @@ def get_dynamic_document_sections_description(
320322
else:
321323
description += "- **Configuration-Specific Columns**: None configured\n"
322324

323-
description += "\n"
324-
325325
description += """### Column Naming Patterns:
326326
- **Simple attributes**: `inference_result.{attribute_name_lowercase}` (all strings)
327327
- **Group attributes**: `inference_result.{group_name_lowercase}.{sub_attribute_lowercase}` (all strings)
@@ -433,6 +433,7 @@ def _walk_properties_for_columns(
433433
properties: Dict[str, Any],
434434
parent_path: str = "inference_result",
435435
indent: str = " ",
436+
defs: Optional[Dict[str, Any]] = None,
436437
) -> Generator[tuple[str, int], None, None]:
437438
"""
438439
Walk JSON Schema properties and yield (column_description, count) tuples.
@@ -441,24 +442,35 @@ def _walk_properties_for_columns(
441442
properties: JSON Schema properties dict
442443
parent_path: Parent column path
443444
indent: Indentation for formatting
445+
defs: Schema definitions for resolving $ref references
444446
445447
Yields:
446448
Tuples of (description_text, columns_added_count)
447449
"""
448450
for prop_name, prop_schema in properties.items():
451+
# Handle $ref by resolving to the actual definition
452+
if "$ref" in prop_schema and defs:
453+
ref_path = prop_schema["$ref"]
454+
# Extract the definition name from the reference (e.g., "#/$defs/employer_info")
455+
if ref_path.startswith("#/$defs/"):
456+
def_name = ref_path.replace("#/$defs/", "")
457+
if def_name in defs:
458+
# Merge the referenced definition with any override fields
459+
resolved_schema = {**defs[def_name], **prop_schema}
460+
# Remove $ref from the resolved schema
461+
resolved_schema.pop("$ref", None)
462+
prop_schema = resolved_schema
463+
449464
prop_type = prop_schema.get(SCHEMA_TYPE)
450465
prop_desc = prop_schema.get(SCHEMA_DESCRIPTION, "")
451466
column_path = f"{parent_path}.{prop_name.lower()}"
452467

453468
if prop_type == TYPE_OBJECT:
454-
# Group - yield header and recurse
469+
# Group - recurse to get leaf columns only (no group header)
470+
# Groups don't become columns themselves - only leaf attributes do
455471
nested_props = prop_schema.get(SCHEMA_PROPERTIES, {})
456-
yield (
457-
f"{indent}- **{prop_name} Group** ({len(nested_props)} columns):\n",
458-
0,
459-
)
460472
yield from _walk_properties_for_columns(
461-
nested_props, column_path, indent + " "
473+
nested_props, column_path, indent, defs
462474
)
463475

464476
elif prop_type == TYPE_ARRAY:
@@ -657,6 +669,8 @@ def _get_specific_document_sections_table_info(
657669
class_name = matching_schema.get(X_AWS_IDP_DOCUMENT_TYPE, "Unknown")
658670
class_desc = matching_schema.get("description", "No description available")
659671
properties = matching_schema.get(SCHEMA_PROPERTIES, {})
672+
# Get $defs for resolving $ref references
673+
defs = matching_schema.get("$defs", {})
660674

661675
info = f"""## Document Sections Table: {table_name}
662676
@@ -678,7 +692,9 @@ def _get_specific_document_sections_table_info(
678692
"""
679693

680694
if properties:
681-
for prop_desc_text, _ in _walk_properties_for_columns(properties):
695+
for prop_desc_text, _ in _walk_properties_for_columns(
696+
properties, defs=defs
697+
):
682698
info += prop_desc_text
683699
else:
684700
info += "No configuration-specific columns defined.\n"

0 commit comments

Comments
 (0)