anthropic-haystack 6.2.0__tar.gz → 6.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 (29) hide show
  1. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/CHANGELOG.md +7 -0
  2. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/PKG-INFO +1 -1
  3. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/src/haystack_integrations/components/generators/anthropic/chat/chat_generator.py +8 -11
  4. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/tests/test_chat_generator.py +10 -6
  5. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/.gitignore +0 -0
  6. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/LICENSE.txt +0 -0
  7. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/README.md +0 -0
  8. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/example/documentation_rag_with_claude.py +0 -0
  9. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/example/prompt_caching.py +0 -0
  10. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/pydoc/config_docusaurus.yml +0 -0
  11. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/pyproject.toml +0 -0
  12. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/src/haystack_integrations/components/generators/anthropic/__init__.py +0 -0
  13. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/src/haystack_integrations/components/generators/anthropic/chat/__init__.py +0 -0
  14. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/src/haystack_integrations/components/generators/anthropic/chat/foundry_chat_generator.py +0 -0
  15. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/src/haystack_integrations/components/generators/anthropic/chat/utils.py +0 -0
  16. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/src/haystack_integrations/components/generators/anthropic/chat/vertex_chat_generator.py +0 -0
  17. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/src/haystack_integrations/components/generators/py.typed +0 -0
  18. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/src/haystack_integrations/token_counters/anthropic/__init__.py +0 -0
  19. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/src/haystack_integrations/token_counters/anthropic/token_counter.py +0 -0
  20. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/src/haystack_integrations/token_counters/py.typed +0 -0
  21. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/tests/__init__.py +0 -0
  22. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/tests/conftest.py +0 -0
  23. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/tests/test_chat_generator_async.py +0 -0
  24. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/tests/test_files/apple.jpg +0 -0
  25. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/tests/test_files/sample_pdf_3.pdf +0 -0
  26. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/tests/test_foundry_chat_generator.py +0 -0
  27. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/tests/test_token_counter.py +0 -0
  28. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/tests/test_utils.py +0 -0
  29. {anthropic_haystack-6.2.0 → anthropic_haystack-6.3.0}/tests/test_vertex_chat_generator.py +0 -0
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [integrations/anthropic-v6.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/anthropic-v6.1.0] - 2026-09-22
4
11
 
5
12
  ### 🐛 Bug Fixes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: anthropic-haystack
3
- Version: 6.2.0
3
+ Version: 6.3.0
4
4
  Summary: An integration of Anthropic Claude models into the Haystack framework.
5
5
  Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/anthropic#readme
6
6
  Project-URL: Issues, https://github.com/deepset-ai/haystack-core-integrations/issues
@@ -369,11 +369,6 @@ class AnthropicChatGenerator:
369
369
  tool_choice["disable_parallel_tool_use"] = disable_parallel_tool_use
370
370
  tool_choice.setdefault("type", "auto") # default value
371
371
 
372
- tool_choice_type = generation_kwargs.pop("tool_choice_type", None)
373
- if tool_choice_type is not None:
374
- tool_choice = generation_kwargs.setdefault("tool_choice", {})
375
- tool_choice["type"] = tool_choice_type
376
-
377
372
  thinking_budget_tokens = generation_kwargs.pop("thinking_budget_tokens", None)
378
373
  if thinking_budget_tokens is not None:
379
374
  thinking = generation_kwargs.setdefault("thinking", {})
@@ -390,12 +385,14 @@ class AnthropicChatGenerator:
390
385
  output_config = generation_kwargs.setdefault("output_config", {})
391
386
  output_config["effort"] = adaptive_thinking_effort
392
387
 
393
- thinking_display = generation_kwargs.pop("thinking_display", None)
394
- if thinking_display is not None:
395
- thinking = generation_kwargs.setdefault("thinking", {})
396
- # `display` is only accepted with enabled or adaptive thinking, so it's dropped when thinking is disabled
397
- if thinking.get("type") != "disabled":
398
- thinking["display"] = thinking_display
388
+ for nested_name in ("tool_choice", "thinking", "output_config"):
389
+ prefix = f"{nested_name}_"
390
+ for key in [k for k in generation_kwargs if k.startswith(prefix)]:
391
+ value = generation_kwargs.pop(key)
392
+ if value is not None:
393
+ nested_key = key[len(prefix) :]
394
+ nested_dict = generation_kwargs.setdefault(nested_name, {})
395
+ nested_dict[nested_key] = value
399
396
 
400
397
  return generation_kwargs
401
398
 
@@ -539,23 +539,27 @@ class TestRun:
539
539
  },
540
540
  ),
541
541
  (
542
- # thinking_display is dropped when thinking is disabled through a flattened kwarg
542
+ # thinking type in_between with effort
543
543
  {
544
- "adaptive_thinking_effort": "none",
544
+ "thinking_type": "in_between",
545
545
  "thinking_display": "summarized",
546
+ "output_config_effort": "high",
546
547
  },
547
548
  {
548
- "thinking": {"type": "disabled"},
549
+ "thinking": {"type": "in_between", "display": "summarized"},
550
+ "output_config": {"effort": "high"},
549
551
  },
550
552
  ),
551
553
  (
552
- # thinking_display is dropped when thinking is disabled through an explicit thinking dict
554
+ # thinking type adaptive with effort
553
555
  {
554
- "thinking": {"type": "disabled"},
556
+ "thinking_type": "adaptive",
555
557
  "thinking_display": "summarized",
558
+ "output_config_effort": "high",
556
559
  },
557
560
  {
558
- "thinking": {"type": "disabled"},
561
+ "thinking": {"type": "adaptive", "display": "summarized"},
562
+ "output_config": {"effort": "high"},
559
563
  },
560
564
  ),
561
565
  ],