amazon-bedrock-haystack 8.2.0__tar.gz → 8.3.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.
Files changed (57) hide show
  1. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/CHANGELOG.md +7 -0
  2. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/PKG-INFO +1 -1
  3. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/components/generators/amazon_bedrock/chat/chat_generator.py +8 -11
  4. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/components/generators/amazon_bedrock/chat/utils.py +4 -4
  5. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/tests/test_chat_generator.py +10 -6
  6. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/tests/test_chat_generator_utils.py +27 -0
  7. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/.gitignore +0 -0
  8. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/LICENSE.txt +0 -0
  9. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/README.md +0 -0
  10. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/examples/bedrock_ranker_example.py +0 -0
  11. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/examples/chatgenerator_example.py +0 -0
  12. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/examples/embedders_generator_with_rag_example.py +0 -0
  13. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/examples/s3_downloader_example.py +0 -0
  14. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/pydoc/config_docusaurus.yml +0 -0
  15. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/pyproject.toml +0 -0
  16. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/common/amazon_bedrock/__init__.py +0 -0
  17. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/common/amazon_bedrock/errors.py +0 -0
  18. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/common/amazon_bedrock/utils.py +0 -0
  19. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/common/py.typed +0 -0
  20. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/common/s3/__init__.py +0 -0
  21. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/common/s3/errors.py +0 -0
  22. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/common/s3/utils.py +0 -0
  23. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/components/downloaders/py.typed +0 -0
  24. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/components/downloaders/s3/__init__.py +0 -0
  25. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/components/downloaders/s3/s3_downloader.py +0 -0
  26. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/components/embedders/amazon_bedrock/__init__.py +0 -0
  27. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/components/embedders/amazon_bedrock/document_embedder.py +0 -0
  28. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/components/embedders/amazon_bedrock/document_image_embedder.py +0 -0
  29. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/components/embedders/amazon_bedrock/text_embedder.py +0 -0
  30. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/components/embedders/py.typed +0 -0
  31. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/components/generators/amazon_bedrock/__init__.py +0 -0
  32. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/components/generators/amazon_bedrock/chat/__init__.py +0 -0
  33. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/components/generators/py.typed +0 -0
  34. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/components/rankers/amazon_bedrock/__init__.py +0 -0
  35. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/components/rankers/amazon_bedrock/ranker.py +0 -0
  36. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/components/rankers/py.typed +0 -0
  37. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/components/retrievers/amazon_bedrock/__init__.py +0 -0
  38. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/components/retrievers/amazon_bedrock/knowledge_base_retriever.py +0 -0
  39. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/components/retrievers/py.typed +0 -0
  40. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/token_counters/amazon_bedrock/__init__.py +0 -0
  41. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/token_counters/amazon_bedrock/token_counter.py +0 -0
  42. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/src/haystack_integrations/token_counters/py.typed +0 -0
  43. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/tests/__init__.py +0 -0
  44. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/tests/conftest.py +0 -0
  45. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/tests/test_common_utils.py +0 -0
  46. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/tests/test_document_embedder.py +0 -0
  47. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/tests/test_document_image_embedder.py +0 -0
  48. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/tests/test_files/apple.jpg +0 -0
  49. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/tests/test_files/haystack-logo.png +0 -0
  50. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/tests/test_files/sample_pdf_1.pdf +0 -0
  51. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/tests/test_files/video.mp4 +0 -0
  52. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/tests/test_knowledge_base_retriever.py +0 -0
  53. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/tests/test_ranker.py +0 -0
  54. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/tests/test_s3_downloader.py +0 -0
  55. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/tests/test_s3_storage.py +0 -0
  56. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/tests/test_text_embedder.py +0 -0
  57. {amazon_bedrock_haystack-8.2.0 → amazon_bedrock_haystack-8.3.0}/tests/test_token_counter.py +0 -0
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [integrations/amazon_bedrock-v8.2.0] - 2026-09-24
4
+
5
+ ### 🚀 Features
6
+
7
+ - Add thinking_display flattened generation_kwarg to Anthropic and Bedrock chat generators (#3993)
8
+
9
+
3
10
  ## [integrations/amazon_bedrock-v8.1.1] - 2026-09-23
4
11
 
5
12
  ### 🐛 Bug Fixes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: amazon-bedrock-haystack
3
- Version: 8.2.0
3
+ Version: 8.3.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
@@ -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
- thinking_display = generation_kwargs.pop("thinking_display", None)
575
- if thinking_display is not None:
576
- thinking = generation_kwargs.setdefault("thinking", {})
577
- # `display` is only accepted with enabled or adaptive thinking, so it's dropped when thinking is disabled
578
- if thinking.get("type") != "disabled":
579
- thinking["display"] = thinking_display
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
 
@@ -615,10 +615,10 @@ def _convert_event_to_streaming_chunk(
615
615
  streaming_chunk = StreamingChunk(
616
616
  content="",
617
617
  index=block_idx,
618
- reasoning=ReasoningContent(
619
- reasoning_text=reasoning_text,
620
- extra=extra,
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
 
@@ -707,23 +707,27 @@ class TestAmazonBedrockChatGenerator:
707
707
  },
708
708
  ),
709
709
  (
710
- # thinking_display is dropped when thinking is disabled through a flattened kwarg
710
+ # thinking type in_between with effort
711
711
  {
712
- "adaptive_thinking_effort": "none",
712
+ "thinking_type": "in_between",
713
713
  "thinking_display": "summarized",
714
+ "output_config_effort": "high",
714
715
  },
715
716
  {
716
- "thinking": {"type": "disabled"},
717
+ "thinking": {"type": "in_between", "display": "summarized"},
718
+ "output_config": {"effort": "high"},
717
719
  },
718
720
  ),
719
721
  (
720
- # thinking_display is dropped when thinking is disabled through an explicit thinking dict
722
+ # thinking type adaptive with effort
721
723
  {
722
- "thinking": {"type": "disabled"},
724
+ "thinking_type": "adaptive",
723
725
  "thinking_display": "summarized",
726
+ "output_config_effort": "high",
724
727
  },
725
728
  {
726
- "thinking": {"type": "disabled"},
729
+ "thinking": {"type": "adaptive", "display": "summarized"},
730
+ "output_config": {"effort": "high"},
727
731
  },
728
732
  ),
729
733
  ],
@@ -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."}]}