amazon-bedrock-haystack 6.1.1__tar.gz → 6.2.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-6.1.1 → amazon_bedrock_haystack-6.2.1}/CHANGELOG.md +13 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/PKG-INFO +1 -1
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/src/haystack_integrations/components/generators/amazon_bedrock/chat/chat_generator.py +32 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/tests/test_chat_generator.py +63 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/.gitignore +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/LICENSE.txt +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/README.md +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/examples/bedrock_ranker_example.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/examples/chatgenerator_example.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/examples/embedders_generator_with_rag_example.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/examples/s3_downloader_example.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/pydoc/config_docusaurus.yml +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/pyproject.toml +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/src/haystack_integrations/common/amazon_bedrock/__init__.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/src/haystack_integrations/common/amazon_bedrock/errors.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/src/haystack_integrations/common/amazon_bedrock/utils.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/src/haystack_integrations/common/py.typed +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/src/haystack_integrations/common/s3/__init__.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/src/haystack_integrations/common/s3/errors.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/src/haystack_integrations/common/s3/utils.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/src/haystack_integrations/components/downloaders/py.typed +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/src/haystack_integrations/components/downloaders/s3/__init__.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/src/haystack_integrations/components/downloaders/s3/s3_downloader.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/src/haystack_integrations/components/embedders/amazon_bedrock/__init__.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/src/haystack_integrations/components/embedders/amazon_bedrock/document_embedder.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/src/haystack_integrations/components/embedders/amazon_bedrock/document_image_embedder.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/src/haystack_integrations/components/embedders/amazon_bedrock/text_embedder.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/src/haystack_integrations/components/embedders/py.typed +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/src/haystack_integrations/components/generators/amazon_bedrock/__init__.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/src/haystack_integrations/components/generators/amazon_bedrock/adapters.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/src/haystack_integrations/components/generators/amazon_bedrock/chat/__init__.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/src/haystack_integrations/components/generators/amazon_bedrock/chat/utils.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/src/haystack_integrations/components/generators/amazon_bedrock/generator.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/src/haystack_integrations/components/generators/py.typed +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/src/haystack_integrations/components/rankers/amazon_bedrock/__init__.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/src/haystack_integrations/components/rankers/amazon_bedrock/ranker.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/src/haystack_integrations/components/rankers/py.typed +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/tests/__init__.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/tests/conftest.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/tests/test_chat_generator_utils.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/tests/test_document_embedder.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/tests/test_document_image_embedder.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/tests/test_files/apple.jpg +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/tests/test_files/haystack-logo.png +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/tests/test_files/sample_pdf_1.pdf +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/tests/test_generator.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/tests/test_ranker.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/tests/test_s3_downloader.py +0 -0
- {amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/tests/test_text_embedder.py +0 -0
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [integrations/amazon_bedrock-v6.2.0] - 2026-01-13
|
|
4
|
+
|
|
5
|
+
### 🚀 Features
|
|
6
|
+
|
|
7
|
+
- Support flattened generation_kwargs with AmazonBedrockChatGenerator (#2741)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## [integrations/amazon_bedrock-v6.1.1] - 2026-01-13
|
|
11
|
+
|
|
12
|
+
### 🌀 Miscellaneous
|
|
13
|
+
|
|
14
|
+
- Fix: support global and regional inference profiles in `AmazonBedrockGenerator` (#2725)
|
|
15
|
+
|
|
3
16
|
## [integrations/amazon_bedrock-v6.1.0] - 2026-01-13
|
|
4
17
|
|
|
5
18
|
### 🐛 Bug Fixes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: amazon-bedrock-haystack
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.2.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
|
|
@@ -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,36 @@ 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
|
+
|
|
427
|
+
disable_parallel_tool_use = generation_kwargs.pop("disable_parallel_tool_use", None)
|
|
428
|
+
parallel_tool_use = generation_kwargs.pop("parallel_tool_use", None)
|
|
429
|
+
|
|
430
|
+
if disable_parallel_tool_use is not None and parallel_tool_use is not None:
|
|
431
|
+
msg = "Cannot set both disable_parallel_tool_use and parallel_tool_use"
|
|
432
|
+
raise ValueError(msg)
|
|
433
|
+
elif parallel_tool_use is not None:
|
|
434
|
+
disable_parallel_tool_use = not parallel_tool_use
|
|
435
|
+
|
|
436
|
+
if disable_parallel_tool_use is not None:
|
|
437
|
+
tool_choice = generation_kwargs.setdefault("tool_choice", {})
|
|
438
|
+
tool_choice["disable_parallel_tool_use"] = disable_parallel_tool_use
|
|
439
|
+
tool_choice.setdefault("type", "auto") # default value
|
|
440
|
+
|
|
441
|
+
tool_choice_type = generation_kwargs.pop("tool_choice_type", None)
|
|
442
|
+
if tool_choice_type is not None:
|
|
443
|
+
tool_choice = generation_kwargs.setdefault("tool_choice", {})
|
|
444
|
+
tool_choice["type"] = tool_choice_type
|
|
445
|
+
|
|
446
|
+
thinking_budget_tokens = generation_kwargs.pop("thinking_budget_tokens", None)
|
|
447
|
+
if thinking_budget_tokens is not None:
|
|
448
|
+
thinking = generation_kwargs.setdefault("thinking", {})
|
|
449
|
+
thinking["budget_tokens"] = thinking_budget_tokens
|
|
450
|
+
thinking.setdefault("type", "enabled")
|
|
451
|
+
|
|
452
|
+
return generation_kwargs
|
|
453
|
+
|
|
422
454
|
@component.output_types(replies=list[ChatMessage])
|
|
423
455
|
def run(
|
|
424
456
|
self,
|
{amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/tests/test_chat_generator.py
RENAMED
|
@@ -409,6 +409,69 @@ class TestAmazonBedrockChatGenerator:
|
|
|
409
409
|
]
|
|
410
410
|
}
|
|
411
411
|
|
|
412
|
+
@pytest.mark.parametrize(
|
|
413
|
+
"generation_kwargs,additional_model_request_fields",
|
|
414
|
+
[
|
|
415
|
+
(
|
|
416
|
+
{
|
|
417
|
+
"parallel_tool_use": False,
|
|
418
|
+
"tool_choice_type": "any",
|
|
419
|
+
"thinking_budget_tokens": 1024,
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
"tool_choice": {"disable_parallel_tool_use": True, "type": "any"},
|
|
423
|
+
"thinking": {"budget_tokens": 1024, "type": "enabled"},
|
|
424
|
+
},
|
|
425
|
+
),
|
|
426
|
+
(
|
|
427
|
+
{
|
|
428
|
+
"parallel_tool_use": True,
|
|
429
|
+
"tool_choice_type": "all",
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
"tool_choice": {"disable_parallel_tool_use": False, "type": "all"},
|
|
433
|
+
},
|
|
434
|
+
),
|
|
435
|
+
(
|
|
436
|
+
{
|
|
437
|
+
"parallel_tool_use": True,
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"tool_choice": {"disable_parallel_tool_use": False, "type": "auto"},
|
|
441
|
+
},
|
|
442
|
+
),
|
|
443
|
+
(
|
|
444
|
+
{
|
|
445
|
+
"disable_parallel_tool_use": True,
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
"tool_choice": {"disable_parallel_tool_use": True, "type": "auto"},
|
|
449
|
+
},
|
|
450
|
+
),
|
|
451
|
+
(
|
|
452
|
+
{
|
|
453
|
+
"thinking_budget_tokens": None,
|
|
454
|
+
"parallel_tool_use": None,
|
|
455
|
+
"tool_choice_type": None,
|
|
456
|
+
},
|
|
457
|
+
{},
|
|
458
|
+
),
|
|
459
|
+
],
|
|
460
|
+
)
|
|
461
|
+
def test_prepare_request_params_with_flattened_generation_kwargs(
|
|
462
|
+
self, mock_boto3_session, set_env_variables, generation_kwargs, additional_model_request_fields
|
|
463
|
+
):
|
|
464
|
+
generator = AmazonBedrockChatGenerator(model="anthropic.claude-3-5-sonnet-20240620-v1:0")
|
|
465
|
+
request_params, _ = generator._prepare_request_params(
|
|
466
|
+
messages=[ChatMessage.from_user("What's the capital of France?")],
|
|
467
|
+
generation_kwargs=generation_kwargs,
|
|
468
|
+
)
|
|
469
|
+
|
|
470
|
+
if not additional_model_request_fields:
|
|
471
|
+
assert "additionalModelRequestFields" not in request_params
|
|
472
|
+
else:
|
|
473
|
+
assert request_params["additionalModelRequestFields"] == additional_model_request_fields
|
|
474
|
+
|
|
412
475
|
|
|
413
476
|
# In the CI, those tests are skipped if AWS Authentication fails
|
|
414
477
|
@pytest.mark.integration
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/examples/bedrock_ranker_example.py
RENAMED
|
File without changes
|
{amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/examples/chatgenerator_example.py
RENAMED
|
File without changes
|
|
File without changes
|
{amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.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
|
{amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/tests/test_chat_generator_utils.py
RENAMED
|
File without changes
|
{amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/tests/test_document_embedder.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/tests/test_files/haystack-logo.png
RENAMED
|
File without changes
|
{amazon_bedrock_haystack-6.1.1 → amazon_bedrock_haystack-6.2.1}/tests/test_files/sample_pdf_1.pdf
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|