amazon-bedrock-haystack 6.1.0__tar.gz → 6.2.0__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-6.1.0 → amazon_bedrock_haystack-6.2.0}/CHANGELOG.md +13 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/PKG-INFO +1 -1
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/src/haystack_integrations/components/generators/amazon_bedrock/chat/chat_generator.py +28 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/src/haystack_integrations/components/generators/amazon_bedrock/generator.py +10 -7
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/tests/test_chat_generator.py +16 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/tests/test_generator.py +19 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/.gitignore +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/LICENSE.txt +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/README.md +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/examples/bedrock_ranker_example.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/examples/chatgenerator_example.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/examples/embedders_generator_with_rag_example.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/examples/s3_downloader_example.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/pydoc/config_docusaurus.yml +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/pyproject.toml +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/src/haystack_integrations/common/amazon_bedrock/__init__.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/src/haystack_integrations/common/amazon_bedrock/errors.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/src/haystack_integrations/common/amazon_bedrock/utils.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/src/haystack_integrations/common/py.typed +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/src/haystack_integrations/common/s3/__init__.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/src/haystack_integrations/common/s3/errors.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/src/haystack_integrations/common/s3/utils.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/src/haystack_integrations/components/downloaders/py.typed +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/src/haystack_integrations/components/downloaders/s3/__init__.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/src/haystack_integrations/components/downloaders/s3/s3_downloader.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/src/haystack_integrations/components/embedders/amazon_bedrock/__init__.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/src/haystack_integrations/components/embedders/amazon_bedrock/document_embedder.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/src/haystack_integrations/components/embedders/amazon_bedrock/document_image_embedder.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/src/haystack_integrations/components/embedders/amazon_bedrock/text_embedder.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/src/haystack_integrations/components/embedders/py.typed +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/src/haystack_integrations/components/generators/amazon_bedrock/__init__.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/src/haystack_integrations/components/generators/amazon_bedrock/adapters.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/src/haystack_integrations/components/generators/amazon_bedrock/chat/__init__.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/src/haystack_integrations/components/generators/amazon_bedrock/chat/utils.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/src/haystack_integrations/components/generators/py.typed +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/src/haystack_integrations/components/rankers/amazon_bedrock/__init__.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/src/haystack_integrations/components/rankers/amazon_bedrock/ranker.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/src/haystack_integrations/components/rankers/py.typed +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/tests/__init__.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/tests/conftest.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/tests/test_chat_generator_utils.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/tests/test_document_embedder.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/tests/test_document_image_embedder.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/tests/test_files/apple.jpg +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/tests/test_files/haystack-logo.png +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/tests/test_files/sample_pdf_1.pdf +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/tests/test_ranker.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/tests/test_s3_downloader.py +0 -0
- {amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/tests/test_text_embedder.py +0 -0
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [integrations/amazon_bedrock-v6.1.1] - 2026-01-13
|
|
4
|
+
|
|
5
|
+
### 🌀 Miscellaneous
|
|
6
|
+
|
|
7
|
+
- Fix: support global and regional inference profiles in `AmazonBedrockGenerator` (#2725)
|
|
8
|
+
|
|
9
|
+
## [integrations/amazon_bedrock-v6.1.0] - 2026-01-13
|
|
10
|
+
|
|
11
|
+
### 🐛 Bug Fixes
|
|
12
|
+
|
|
13
|
+
- AmazonBedrockDocumentEmbedder to not modify Documents in place (#2174) (#2702)
|
|
14
|
+
|
|
15
|
+
|
|
3
16
|
## [integrations/amazon_bedrock-v6.0.0] - 2026-01-09
|
|
4
17
|
|
|
5
18
|
### 🧹 Chores
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: amazon-bedrock-haystack
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.2.0
|
|
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
|
|
@@ -372,6 +372,8 @@ class AmazonBedrockChatGenerator:
|
|
|
372
372
|
merged_kwargs = self.generation_kwargs.copy()
|
|
373
373
|
merged_kwargs.update(generation_kwargs)
|
|
374
374
|
|
|
375
|
+
merged_kwargs = self._resolve_flattened_generation_kwargs(merged_kwargs)
|
|
376
|
+
|
|
375
377
|
# Extract known inference parameters
|
|
376
378
|
# See https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InferenceConfiguration.html
|
|
377
379
|
inference_config = {
|
|
@@ -419,6 +421,32 @@ class AmazonBedrockChatGenerator:
|
|
|
419
421
|
|
|
420
422
|
return params, callback
|
|
421
423
|
|
|
424
|
+
def _resolve_flattened_generation_kwargs(self, generation_kwargs: dict[str, Any]) -> dict[str, Any]:
|
|
425
|
+
generation_kwargs = generation_kwargs.copy()
|
|
426
|
+
if "disable_parallel_tool_use" in generation_kwargs:
|
|
427
|
+
disable_parallel_tool_use = generation_kwargs.pop("disable_parallel_tool_use")
|
|
428
|
+
tool_choice = generation_kwargs.setdefault("tool_choice", {})
|
|
429
|
+
tool_choice["disable_parallel_tool_use"] = disable_parallel_tool_use
|
|
430
|
+
|
|
431
|
+
if "parallel_tool_use" in generation_kwargs:
|
|
432
|
+
parallel_tool_use = generation_kwargs.pop("parallel_tool_use")
|
|
433
|
+
disable_parallel_tool_use = not parallel_tool_use
|
|
434
|
+
tool_choice = generation_kwargs.setdefault("tool_choice", {})
|
|
435
|
+
tool_choice["disable_parallel_tool_use"] = disable_parallel_tool_use
|
|
436
|
+
|
|
437
|
+
if "tool_choice_type" in generation_kwargs:
|
|
438
|
+
tool_choice_type = generation_kwargs.pop("tool_choice_type")
|
|
439
|
+
tool_choice = generation_kwargs.setdefault("tool_choice", {})
|
|
440
|
+
tool_choice["type"] = tool_choice_type
|
|
441
|
+
|
|
442
|
+
if "thinking_budget_tokens" in generation_kwargs:
|
|
443
|
+
thinking_budget_tokens = generation_kwargs.pop("thinking_budget_tokens")
|
|
444
|
+
thinking = generation_kwargs.setdefault("thinking", {})
|
|
445
|
+
thinking["budget_tokens"] = thinking_budget_tokens
|
|
446
|
+
thinking["type"] = "enabled"
|
|
447
|
+
|
|
448
|
+
return generation_kwargs
|
|
449
|
+
|
|
422
450
|
@component.output_types(replies=list[ChatMessage])
|
|
423
451
|
def run(
|
|
424
452
|
self,
|
|
@@ -63,14 +63,17 @@ class AmazonBedrockGenerator:
|
|
|
63
63
|
supports Amazon Bedrock.
|
|
64
64
|
"""
|
|
65
65
|
|
|
66
|
+
# Regex pattern for supported AWS Bedrock region prefixes
|
|
67
|
+
_REGION_PREFIX_PATTERN = r"((?:global|us-gov|us|eu|apac|au|ca|jp)\.)?"
|
|
68
|
+
|
|
66
69
|
SUPPORTED_MODEL_PATTERNS: ClassVar[dict[str, type[BedrockModelAdapter]]] = {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
rf"{_REGION_PREFIX_PATTERN}amazon.titan-text.*": AmazonTitanAdapter,
|
|
71
|
+
rf"{_REGION_PREFIX_PATTERN}ai21.j2.*": AI21LabsJurassic2Adapter,
|
|
72
|
+
rf"{_REGION_PREFIX_PATTERN}cohere.command-[^r].*": CohereCommandAdapter,
|
|
73
|
+
rf"{_REGION_PREFIX_PATTERN}cohere.command-r.*": CohereCommandRAdapter,
|
|
74
|
+
rf"{_REGION_PREFIX_PATTERN}anthropic.claude.*": AnthropicClaudeAdapter,
|
|
75
|
+
rf"{_REGION_PREFIX_PATTERN}meta.llama.*": MetaLlamaAdapter,
|
|
76
|
+
rf"{_REGION_PREFIX_PATTERN}mistral.*": MistralAdapter,
|
|
74
77
|
}
|
|
75
78
|
|
|
76
79
|
SUPPORTED_MODEL_FAMILIES: ClassVar[dict[str, type[BedrockModelAdapter]]] = {
|
{amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/tests/test_chat_generator.py
RENAMED
|
@@ -409,6 +409,22 @@ class TestAmazonBedrockChatGenerator:
|
|
|
409
409
|
]
|
|
410
410
|
}
|
|
411
411
|
|
|
412
|
+
def test_prepare_request_params_with_flattened_generation_kwargs(self, mock_boto3_session, set_env_variables):
|
|
413
|
+
generator = AmazonBedrockChatGenerator(model="anthropic.claude-3-5-sonnet-20240620-v1:0")
|
|
414
|
+
request_params, _ = generator._prepare_request_params(
|
|
415
|
+
messages=[ChatMessage.from_user("What's the capital of France?")],
|
|
416
|
+
generation_kwargs={
|
|
417
|
+
"parallel_tool_use": False,
|
|
418
|
+
"tool_choice_type": "any",
|
|
419
|
+
"thinking_budget_tokens": 1024,
|
|
420
|
+
},
|
|
421
|
+
)
|
|
422
|
+
|
|
423
|
+
assert request_params["additionalModelRequestFields"] == {
|
|
424
|
+
"tool_choice": {"disable_parallel_tool_use": True, "type": "any"},
|
|
425
|
+
"thinking": {"budget_tokens": 1024, "type": "enabled"},
|
|
426
|
+
}
|
|
427
|
+
|
|
412
428
|
|
|
413
429
|
# In the CI, those tests are skipped if AWS Authentication fails
|
|
414
430
|
@pytest.mark.integration
|
|
@@ -129,6 +129,11 @@ def test_constructor_with_empty_model():
|
|
|
129
129
|
("anthropic.claude-v2", AnthropicClaudeAdapter),
|
|
130
130
|
("eu.anthropic.claude-v1", AnthropicClaudeAdapter), # cross-region inference
|
|
131
131
|
("us.anthropic.claude-v2", AnthropicClaudeAdapter), # cross-region inference
|
|
132
|
+
("global.anthropic.claude-v2", AnthropicClaudeAdapter),
|
|
133
|
+
("us-gov.anthropic.claude-v1", AnthropicClaudeAdapter),
|
|
134
|
+
("apac.anthropic.claude-v2", AnthropicClaudeAdapter),
|
|
135
|
+
("au.anthropic.claude-v1", AnthropicClaudeAdapter),
|
|
136
|
+
("jp.anthropic.claude-v1", AnthropicClaudeAdapter),
|
|
132
137
|
("anthropic.claude-instant-v1", AnthropicClaudeAdapter),
|
|
133
138
|
("anthropic.claude-super-v5", AnthropicClaudeAdapter), # artificial
|
|
134
139
|
("cohere.command-text-v14", CohereCommandAdapter),
|
|
@@ -207,6 +212,20 @@ def test_get_model_adapter_auto_detect_family_fails():
|
|
|
207
212
|
AmazonBedrockGenerator.get_model_adapter(model="arn:123435423")
|
|
208
213
|
|
|
209
214
|
|
|
215
|
+
@pytest.mark.parametrize(
|
|
216
|
+
"model",
|
|
217
|
+
[
|
|
218
|
+
"invalid.anthropic.claude-v2",
|
|
219
|
+
"xyz.meta.llama2-13b-chat-v1",
|
|
220
|
+
"fake-region.mistral.mistral-7b-instruct-v0:2",
|
|
221
|
+
"global.us.anthropic.claude-v2",
|
|
222
|
+
],
|
|
223
|
+
)
|
|
224
|
+
def test_get_model_adapter_with_invalid_region_prefix(model: str):
|
|
225
|
+
with pytest.raises(AmazonBedrockConfigurationError):
|
|
226
|
+
AmazonBedrockGenerator.get_model_adapter(model=model)
|
|
227
|
+
|
|
228
|
+
|
|
210
229
|
def test_get_model_adapter_model_family_over_auto_detection():
|
|
211
230
|
"""
|
|
212
231
|
Test that the model_family is used over auto-detection
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/examples/bedrock_ranker_example.py
RENAMED
|
File without changes
|
{amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/examples/chatgenerator_example.py
RENAMED
|
File without changes
|
|
File without changes
|
{amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/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
|
{amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/tests/test_chat_generator_utils.py
RENAMED
|
File without changes
|
{amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/tests/test_document_embedder.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/tests/test_files/haystack-logo.png
RENAMED
|
File without changes
|
{amazon_bedrock_haystack-6.1.0 → amazon_bedrock_haystack-6.2.0}/tests/test_files/sample_pdf_1.pdf
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|