amazon-bedrock-haystack 8.2.0__tar.gz → 8.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/CHANGELOG.md +13 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/PKG-INFO +1 -1
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/components/generators/amazon_bedrock/chat/chat_generator.py +8 -11
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/components/generators/amazon_bedrock/chat/utils.py +6 -6
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/tests/test_chat_generator.py +18 -9
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/tests/test_chat_generator_utils.py +42 -15
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/.gitignore +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/LICENSE.txt +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/README.md +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/examples/bedrock_ranker_example.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/examples/chatgenerator_example.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/examples/embedders_generator_with_rag_example.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/examples/s3_downloader_example.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/pydoc/config_docusaurus.yml +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/pyproject.toml +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/common/amazon_bedrock/__init__.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/common/amazon_bedrock/errors.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/common/amazon_bedrock/utils.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/common/py.typed +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/common/s3/__init__.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/common/s3/errors.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/common/s3/utils.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/components/downloaders/py.typed +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/components/downloaders/s3/__init__.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/components/downloaders/s3/s3_downloader.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/components/embedders/amazon_bedrock/__init__.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/components/embedders/amazon_bedrock/document_embedder.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/components/embedders/amazon_bedrock/document_image_embedder.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/components/embedders/amazon_bedrock/text_embedder.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/components/embedders/py.typed +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/components/generators/amazon_bedrock/__init__.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/components/generators/amazon_bedrock/chat/__init__.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/components/generators/py.typed +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/components/rankers/amazon_bedrock/__init__.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/components/rankers/amazon_bedrock/ranker.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/components/rankers/py.typed +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/components/retrievers/amazon_bedrock/__init__.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/components/retrievers/amazon_bedrock/knowledge_base_retriever.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/components/retrievers/py.typed +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/token_counters/amazon_bedrock/__init__.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/token_counters/amazon_bedrock/token_counter.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/src/haystack_integrations/token_counters/py.typed +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/tests/__init__.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/tests/conftest.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/tests/test_common_utils.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/tests/test_document_embedder.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/tests/test_document_image_embedder.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/tests/test_files/apple.jpg +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/tests/test_files/haystack-logo.png +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/tests/test_files/sample_pdf_1.pdf +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/tests/test_files/video.mp4 +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/tests/test_knowledge_base_retriever.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/tests/test_ranker.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/tests/test_s3_downloader.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/tests/test_s3_storage.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/tests/test_text_embedder.py +0 -0
- {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/tests/test_token_counter.py +0 -0
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [integrations/amazon_bedrock-v8.3.0] - 2026-10-01
|
|
4
|
+
|
|
5
|
+
### 🚜 Refactor
|
|
6
|
+
|
|
7
|
+
- Generalize flattened generation_kwargs for tool_choice/thinking/output_config (#4028)
|
|
8
|
+
|
|
9
|
+
## [integrations/amazon_bedrock-v8.2.0] - 2026-09-24
|
|
10
|
+
|
|
11
|
+
### 🚀 Features
|
|
12
|
+
|
|
13
|
+
- Add thinking_display flattened generation_kwarg to Anthropic and Bedrock chat generators (#3993)
|
|
14
|
+
|
|
15
|
+
|
|
3
16
|
## [integrations/amazon_bedrock-v8.1.1] - 2026-09-23
|
|
4
17
|
|
|
5
18
|
### 🐛 Bug Fixes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: amazon-bedrock-haystack
|
|
3
|
-
Version: 8.
|
|
3
|
+
Version: 8.3.1
|
|
4
4
|
Summary: An integration of AWS S3 and Bedrock as a Downloader and Generator components.
|
|
5
5
|
Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/amazon_bedrock#readme
|
|
6
6
|
Project-URL: Issues, https://github.com/deepset-ai/haystack-core-integrations/issues
|
|
@@ -550,11 +550,6 @@ class AmazonBedrockChatGenerator:
|
|
|
550
550
|
tool_choice["disable_parallel_tool_use"] = disable_parallel_tool_use
|
|
551
551
|
tool_choice.setdefault("type", "auto") # default value
|
|
552
552
|
|
|
553
|
-
tool_choice_type = generation_kwargs.pop("tool_choice_type", None)
|
|
554
|
-
if tool_choice_type is not None:
|
|
555
|
-
tool_choice = generation_kwargs.setdefault("tool_choice", {})
|
|
556
|
-
tool_choice["type"] = tool_choice_type
|
|
557
|
-
|
|
558
553
|
thinking_budget_tokens = generation_kwargs.pop("thinking_budget_tokens", None)
|
|
559
554
|
if thinking_budget_tokens is not None:
|
|
560
555
|
thinking = generation_kwargs.setdefault("thinking", {})
|
|
@@ -571,12 +566,14 @@ class AmazonBedrockChatGenerator:
|
|
|
571
566
|
output_config = generation_kwargs.setdefault("output_config", {})
|
|
572
567
|
output_config["effort"] = adaptive_thinking_effort
|
|
573
568
|
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
569
|
+
for nested_name in ("tool_choice", "thinking", "output_config"):
|
|
570
|
+
prefix = f"{nested_name}_"
|
|
571
|
+
for key in [k for k in generation_kwargs if k.startswith(prefix)]:
|
|
572
|
+
value = generation_kwargs.pop(key)
|
|
573
|
+
if value is not None:
|
|
574
|
+
nested_key = key[len(prefix) :]
|
|
575
|
+
nested_dict = generation_kwargs.setdefault(nested_name, {})
|
|
576
|
+
nested_dict[nested_key] = value
|
|
580
577
|
|
|
581
578
|
return generation_kwargs
|
|
582
579
|
|
|
@@ -478,7 +478,7 @@ def _parse_completion_response(response_body: dict[str, Any], model: str) -> lis
|
|
|
478
478
|
"total_tokens": response_body.get("usage", {}).get("totalTokens", 0),
|
|
479
479
|
"cache_read_input_tokens": response_body.get("usage", {}).get("cacheReadInputTokens", 0),
|
|
480
480
|
"cache_write_input_tokens": response_body.get("usage", {}).get("cacheWriteInputTokens", 0),
|
|
481
|
-
"cache_details": response_body.get("usage", {}).get("
|
|
481
|
+
"cache_details": response_body.get("usage", {}).get("cacheDetails", []),
|
|
482
482
|
},
|
|
483
483
|
}
|
|
484
484
|
# guardrail trace
|
|
@@ -615,10 +615,10 @@ def _convert_event_to_streaming_chunk(
|
|
|
615
615
|
streaming_chunk = StreamingChunk(
|
|
616
616
|
content="",
|
|
617
617
|
index=block_idx,
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
618
|
+
# redactedContent-only deltas have no text or signature, skip them like the non-streaming path
|
|
619
|
+
reasoning=ReasoningContent(reasoning_text=reasoning_text, extra=extra)
|
|
620
|
+
if reasoning_text or extra
|
|
621
|
+
else None,
|
|
622
622
|
meta=base_meta,
|
|
623
623
|
)
|
|
624
624
|
|
|
@@ -642,7 +642,7 @@ def _convert_event_to_streaming_chunk(
|
|
|
642
642
|
"total_tokens": usage.get("totalTokens", 0),
|
|
643
643
|
"cache_read_input_tokens": usage.get("cacheReadInputTokens", 0),
|
|
644
644
|
"cache_write_input_tokens": usage.get("cacheWriteInputTokens", 0),
|
|
645
|
-
"cache_details": usage.get("cacheDetails",
|
|
645
|
+
"cache_details": usage.get("cacheDetails", []),
|
|
646
646
|
}
|
|
647
647
|
if "trace" in event_meta:
|
|
648
648
|
chunk_meta["trace"] = event_meta["trace"]
|
{amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/tests/test_chat_generator.py
RENAMED
|
@@ -80,7 +80,8 @@ MODELS_TO_TEST_WITH_THINKING_TOOLS_STREAMING = [
|
|
|
80
80
|
"global.anthropic.claude-sonnet-4-6",
|
|
81
81
|
]
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
# smallest Claude model; Claude models report cache writes split by TTL
|
|
84
|
+
MODELS_TO_TEST_WITH_PROMPT_CACHING = ["global.anthropic.claude-haiku-4-5-20251001-v1:0"]
|
|
84
85
|
|
|
85
86
|
|
|
86
87
|
def hello_world():
|
|
@@ -707,23 +708,27 @@ class TestAmazonBedrockChatGenerator:
|
|
|
707
708
|
},
|
|
708
709
|
),
|
|
709
710
|
(
|
|
710
|
-
#
|
|
711
|
+
# thinking type in_between with effort
|
|
711
712
|
{
|
|
712
|
-
"
|
|
713
|
+
"thinking_type": "in_between",
|
|
713
714
|
"thinking_display": "summarized",
|
|
715
|
+
"output_config_effort": "high",
|
|
714
716
|
},
|
|
715
717
|
{
|
|
716
|
-
"thinking": {"type": "
|
|
718
|
+
"thinking": {"type": "in_between", "display": "summarized"},
|
|
719
|
+
"output_config": {"effort": "high"},
|
|
717
720
|
},
|
|
718
721
|
),
|
|
719
722
|
(
|
|
720
|
-
#
|
|
723
|
+
# thinking type adaptive with effort
|
|
721
724
|
{
|
|
722
|
-
"
|
|
725
|
+
"thinking_type": "adaptive",
|
|
723
726
|
"thinking_display": "summarized",
|
|
727
|
+
"output_config_effort": "high",
|
|
724
728
|
},
|
|
725
729
|
{
|
|
726
|
-
"thinking": {"type": "
|
|
730
|
+
"thinking": {"type": "adaptive", "display": "summarized"},
|
|
731
|
+
"output_config": {"effort": "high"},
|
|
727
732
|
},
|
|
728
733
|
),
|
|
729
734
|
],
|
|
@@ -1622,8 +1627,9 @@ class TestAmazonBedrockChatGeneratorInference:
|
|
|
1622
1627
|
|
|
1623
1628
|
system_message = ChatMessage.from_system("Always respond with: 'Life is beautiful' (and nothing else).")
|
|
1624
1629
|
|
|
1630
|
+
# Claude Haiku 4.5 caches only prompts of at least 4,096 tokens
|
|
1625
1631
|
user_message = ChatMessage.from_user(
|
|
1626
|
-
"User message that should be long enough to cache. " *
|
|
1632
|
+
"User message that should be long enough to cache. " * 450,
|
|
1627
1633
|
meta={"cachePoint": {"type": "default"}},
|
|
1628
1634
|
)
|
|
1629
1635
|
messages = [system_message, user_message]
|
|
@@ -1636,7 +1642,10 @@ class TestAmazonBedrockChatGeneratorInference:
|
|
|
1636
1642
|
# tests run in parallel based on the workflow matrix, so this request should either hit the cache (read tokens)
|
|
1637
1643
|
# or populate it (write tokens)
|
|
1638
1644
|
assert usage["cache_read_input_tokens"] > 1000 or usage["cache_write_input_tokens"] > 1000
|
|
1639
|
-
|
|
1645
|
+
if usage["cache_write_input_tokens"] > 0:
|
|
1646
|
+
# a cache point without `ttl` uses the default 5-minute TTL
|
|
1647
|
+
expected = [{"ttl": "5m", "inputTokens": usage["cache_write_input_tokens"]}]
|
|
1648
|
+
assert usage["cache_details"] == expected, f"Unexpected usage stats: {usage}"
|
|
1640
1649
|
|
|
1641
1650
|
@pytest.mark.parametrize("model_name", MODELS_TO_TEST_WITH_TOOLS[:1]) # just one model is enough
|
|
1642
1651
|
@pytest.mark.skipif(ToolInvoker is None, reason="ToolInvoker is not available in the installed haystack-ai version")
|
{amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/tests/test_chat_generator_utils.py
RENAMED
|
@@ -768,8 +768,8 @@ class TestAmazonBedrockChatGeneratorUtils:
|
|
|
768
768
|
"outputTokens": 20,
|
|
769
769
|
"totalTokens": 30,
|
|
770
770
|
"cacheReadInputTokens": 1000,
|
|
771
|
-
"cacheWriteInputTokens":
|
|
772
|
-
"cacheDetails": {},
|
|
771
|
+
"cacheWriteInputTokens": 1500,
|
|
772
|
+
"cacheDetails": [{"ttl": "5m", "inputTokens": 500}, {"ttl": "1h", "inputTokens": 1000}],
|
|
773
773
|
},
|
|
774
774
|
}
|
|
775
775
|
|
|
@@ -785,8 +785,8 @@ class TestAmazonBedrockChatGeneratorUtils:
|
|
|
785
785
|
"completion_tokens": 20,
|
|
786
786
|
"total_tokens": 30,
|
|
787
787
|
"cache_read_input_tokens": 1000,
|
|
788
|
-
"cache_write_input_tokens":
|
|
789
|
-
"cache_details": {},
|
|
788
|
+
"cache_write_input_tokens": 1500,
|
|
789
|
+
"cache_details": [{"ttl": "5m", "inputTokens": 500}, {"ttl": "1h", "inputTokens": 1000}],
|
|
790
790
|
},
|
|
791
791
|
"index": 0,
|
|
792
792
|
}
|
|
@@ -828,7 +828,7 @@ class TestAmazonBedrockChatGeneratorUtils:
|
|
|
828
828
|
"total_tokens": 40,
|
|
829
829
|
"cache_read_input_tokens": 0,
|
|
830
830
|
"cache_write_input_tokens": 0,
|
|
831
|
-
"cache_details":
|
|
831
|
+
"cache_details": [],
|
|
832
832
|
},
|
|
833
833
|
"index": 0,
|
|
834
834
|
}
|
|
@@ -872,7 +872,7 @@ class TestAmazonBedrockChatGeneratorUtils:
|
|
|
872
872
|
"total_tokens": 60,
|
|
873
873
|
"cache_read_input_tokens": 0,
|
|
874
874
|
"cache_write_input_tokens": 0,
|
|
875
|
-
"cache_details":
|
|
875
|
+
"cache_details": [],
|
|
876
876
|
},
|
|
877
877
|
"index": 0,
|
|
878
878
|
}
|
|
@@ -951,7 +951,7 @@ class TestAmazonBedrockChatGeneratorUtils:
|
|
|
951
951
|
"total_tokens": 500,
|
|
952
952
|
"cache_read_input_tokens": 0,
|
|
953
953
|
"cache_write_input_tokens": 0,
|
|
954
|
-
"cache_details":
|
|
954
|
+
"cache_details": [],
|
|
955
955
|
},
|
|
956
956
|
},
|
|
957
957
|
)
|
|
@@ -1006,7 +1006,7 @@ class TestAmazonBedrockChatGeneratorUtils:
|
|
|
1006
1006
|
"totalTokens": 558,
|
|
1007
1007
|
"cacheReadInputTokens": 0,
|
|
1008
1008
|
"cacheWriteInputTokens": 0,
|
|
1009
|
-
"cacheDetails":
|
|
1009
|
+
"cacheDetails": [],
|
|
1010
1010
|
},
|
|
1011
1011
|
"metrics": {"latencyMs": 4811},
|
|
1012
1012
|
}
|
|
@@ -1040,7 +1040,7 @@ class TestAmazonBedrockChatGeneratorUtils:
|
|
|
1040
1040
|
"total_tokens": 558,
|
|
1041
1041
|
"cache_read_input_tokens": 0,
|
|
1042
1042
|
"cache_write_input_tokens": 0,
|
|
1043
|
-
"cache_details":
|
|
1043
|
+
"cache_details": [],
|
|
1044
1044
|
},
|
|
1045
1045
|
},
|
|
1046
1046
|
)
|
|
@@ -1121,7 +1121,7 @@ class TestAmazonBedrockChatGeneratorUtils:
|
|
|
1121
1121
|
"total_tokens": 0,
|
|
1122
1122
|
"cache_read_input_tokens": 0,
|
|
1123
1123
|
"cache_write_input_tokens": 0,
|
|
1124
|
-
"cache_details":
|
|
1124
|
+
"cache_details": [],
|
|
1125
1125
|
},
|
|
1126
1126
|
"trace": trace,
|
|
1127
1127
|
}
|
|
@@ -1372,7 +1372,7 @@ class TestAmazonBedrockChatGeneratorUtils:
|
|
|
1372
1372
|
"total_tokens": 435,
|
|
1373
1373
|
"cache_read_input_tokens": 0,
|
|
1374
1374
|
"cache_write_input_tokens": 0,
|
|
1375
|
-
"cache_details":
|
|
1375
|
+
"cache_details": [],
|
|
1376
1376
|
},
|
|
1377
1377
|
},
|
|
1378
1378
|
)
|
|
@@ -1479,7 +1479,7 @@ class TestAmazonBedrockChatGeneratorUtils:
|
|
|
1479
1479
|
"total_tokens": 435,
|
|
1480
1480
|
"cache_read_input_tokens": 0,
|
|
1481
1481
|
"cache_write_input_tokens": 0,
|
|
1482
|
-
"cache_details":
|
|
1482
|
+
"cache_details": [],
|
|
1483
1483
|
},
|
|
1484
1484
|
},
|
|
1485
1485
|
component_info=c_info,
|
|
@@ -1657,7 +1657,7 @@ class TestAmazonBedrockChatGeneratorUtils:
|
|
|
1657
1657
|
"total_tokens": 516,
|
|
1658
1658
|
"cache_read_input_tokens": 0,
|
|
1659
1659
|
"cache_write_input_tokens": 0,
|
|
1660
|
-
"cache_details":
|
|
1660
|
+
"cache_details": [],
|
|
1661
1661
|
},
|
|
1662
1662
|
"completion_start_time": ANY,
|
|
1663
1663
|
},
|
|
@@ -1841,7 +1841,7 @@ class TestAmazonBedrockChatGeneratorUtils:
|
|
|
1841
1841
|
"total_tokens": 449,
|
|
1842
1842
|
"cache_read_input_tokens": 0,
|
|
1843
1843
|
"cache_write_input_tokens": 0,
|
|
1844
|
-
"cache_details":
|
|
1844
|
+
"cache_details": [],
|
|
1845
1845
|
},
|
|
1846
1846
|
"completion_start_time": ANY,
|
|
1847
1847
|
},
|
|
@@ -1929,7 +1929,7 @@ class TestAmazonBedrockChatGeneratorUtils:
|
|
|
1929
1929
|
"total_tokens": 0,
|
|
1930
1930
|
"cache_read_input_tokens": 0,
|
|
1931
1931
|
"cache_write_input_tokens": 0,
|
|
1932
|
-
"cache_details":
|
|
1932
|
+
"cache_details": [],
|
|
1933
1933
|
},
|
|
1934
1934
|
"trace": trace,
|
|
1935
1935
|
},
|
|
@@ -2296,3 +2296,30 @@ class TestAmazonBedrockChatGeneratorUtils:
|
|
|
2296
2296
|
chunk = _convert_event_to_streaming_chunk(event_str, model, component_info)
|
|
2297
2297
|
assert chunk.tool_calls is not None
|
|
2298
2298
|
assert chunk.tool_calls[0].arguments == '{"city": "Berlin"}'
|
|
2299
|
+
|
|
2300
|
+
def test_parse_streaming_response_redacted_reasoning_is_not_replayed(self):
|
|
2301
|
+
# OpenAI models on Bedrock (e.g. GPT-6) stream reasoning only as redactedContent
|
|
2302
|
+
model = "us.openai.gpt-6-sol"
|
|
2303
|
+
type_ = (
|
|
2304
|
+
"haystack_integrations.components.generators.amazon_bedrock.chat.chat_generator.AmazonBedrockChatGenerator"
|
|
2305
|
+
)
|
|
2306
|
+
events = [
|
|
2307
|
+
{"messageStart": {"role": "assistant"}},
|
|
2308
|
+
{
|
|
2309
|
+
"contentBlockDelta": {
|
|
2310
|
+
"delta": {"reasoningContent": {"redactedContent": b"rsn_abc"}},
|
|
2311
|
+
"contentBlockIndex": 0,
|
|
2312
|
+
}
|
|
2313
|
+
},
|
|
2314
|
+
{"contentBlockStop": {"contentBlockIndex": 0}},
|
|
2315
|
+
{"contentBlockDelta": {"delta": {"text": "No."}, "contentBlockIndex": 1}},
|
|
2316
|
+
{"contentBlockStop": {"contentBlockIndex": 1}},
|
|
2317
|
+
{"messageStop": {"stopReason": "end_turn"}},
|
|
2318
|
+
]
|
|
2319
|
+
|
|
2320
|
+
replies = _parse_streaming_response(events, lambda chunk: None, model, ComponentInfo(type=type_))
|
|
2321
|
+
|
|
2322
|
+
assert replies[0].text == "No."
|
|
2323
|
+
assert replies[0].reasoning is None
|
|
2324
|
+
formatted_message = _format_messages([replies[0]])[1][0]
|
|
2325
|
+
assert formatted_message == {"role": "assistant", "content": [{"text": "No."}]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/examples/bedrock_ranker_example.py
RENAMED
|
File without changes
|
{amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/examples/chatgenerator_example.py
RENAMED
|
File without changes
|
|
File without changes
|
{amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/examples/s3_downloader_example.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/tests/test_document_embedder.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/tests/test_files/haystack-logo.png
RENAMED
|
File without changes
|
{amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.1}/tests/test_files/sample_pdf_1.pdf
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|