anthropic-haystack 7.0.0__tar.gz → 8.0.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.
Files changed (29) hide show
  1. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/CHANGELOG.md +26 -0
  2. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/PKG-INFO +3 -3
  3. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/pyproject.toml +2 -2
  4. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/src/haystack_integrations/components/generators/anthropic/chat/chat_generator.py +3 -3
  5. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/src/haystack_integrations/components/generators/anthropic/chat/foundry_chat_generator.py +4 -4
  6. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/src/haystack_integrations/components/generators/anthropic/chat/utils.py +5 -4
  7. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/.gitignore +0 -0
  8. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/LICENSE.txt +0 -0
  9. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/README.md +0 -0
  10. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/example/documentation_rag_with_claude.py +0 -0
  11. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/example/prompt_caching.py +0 -0
  12. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/pydoc/config_docusaurus.yml +0 -0
  13. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/src/haystack_integrations/components/generators/anthropic/__init__.py +0 -0
  14. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/src/haystack_integrations/components/generators/anthropic/chat/__init__.py +0 -0
  15. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/src/haystack_integrations/components/generators/anthropic/chat/vertex_chat_generator.py +0 -0
  16. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/src/haystack_integrations/components/generators/py.typed +0 -0
  17. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/src/haystack_integrations/token_counters/anthropic/__init__.py +0 -0
  18. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/src/haystack_integrations/token_counters/anthropic/token_counter.py +0 -0
  19. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/src/haystack_integrations/token_counters/py.typed +0 -0
  20. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/tests/__init__.py +0 -0
  21. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/tests/conftest.py +0 -0
  22. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/tests/test_chat_generator.py +0 -0
  23. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/tests/test_chat_generator_async.py +0 -0
  24. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/tests/test_files/apple.jpg +0 -0
  25. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/tests/test_files/sample_pdf_3.pdf +0 -0
  26. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/tests/test_foundry_chat_generator.py +0 -0
  27. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/tests/test_token_counter.py +0 -0
  28. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/tests/test_utils.py +0 -0
  29. {anthropic_haystack-7.0.0 → anthropic_haystack-8.0.1}/tests/test_vertex_chat_generator.py +0 -0
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## [integrations/anthropic-v8.0.0] - 2026-10-16
4
+
5
+ ### 📚 Documentation
6
+
7
+ - Use Microsoft Foundry naming in AnthropicFoundryChatGenerator docstrings (#4093)
8
+
9
+ ### 🧪 Testing
10
+
11
+ - Test compatible integrations with Python 3.15; update pyproject (#4104)
12
+
13
+ ### 🧹 Chores
14
+
15
+ - [**breaking**] Drop Python 3.10 support (#4105)
16
+
17
+
18
+ ## [integrations/anthropic-v7.0.0] - 2026-10-12
19
+
20
+ ### 🐛 Bug Fixes
21
+
22
+ - [**breaking**] Forward full usage in Anthropic streaming responses (#4089)
23
+
24
+ ### 🧹 Chores
25
+
26
+ - Drop redundant deserialize_secrets_inplace calls in integrations requiring haystack-ai>=2.23 (#4058)
27
+
28
+
3
29
  ## [integrations/anthropic-v6.3.0] - 2026-10-01
4
30
 
5
31
  ### 🚜 Refactor
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: anthropic-haystack
3
- Version: 7.0.0
3
+ Version: 8.0.1
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
@@ -11,14 +11,14 @@ License-File: LICENSE.txt
11
11
  Classifier: Development Status :: 4 - Beta
12
12
  Classifier: License :: OSI Approved :: Apache Software License
13
13
  Classifier: Programming Language :: Python
14
- Classifier: Programming Language :: Python :: 3.10
15
14
  Classifier: Programming Language :: Python :: 3.11
16
15
  Classifier: Programming Language :: Python :: 3.12
17
16
  Classifier: Programming Language :: Python :: 3.13
18
17
  Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Programming Language :: Python :: 3.15
19
19
  Classifier: Programming Language :: Python :: Implementation :: CPython
20
20
  Classifier: Programming Language :: Python :: Implementation :: PyPy
21
- Requires-Python: >=3.10
21
+ Requires-Python: >=3.11
22
22
  Requires-Dist: anthropic>=0.74.0
23
23
  Requires-Dist: haystack-ai>=3.0.0
24
24
  Description-Content-Type: text/markdown
@@ -7,7 +7,7 @@ name = "anthropic-haystack"
7
7
  dynamic = ["version"]
8
8
  description = 'An integration of Anthropic Claude models into the Haystack framework.'
9
9
  readme = "README.md"
10
- requires-python = ">=3.10"
10
+ requires-python = ">=3.11"
11
11
  license = "Apache-2.0"
12
12
  keywords = []
13
13
  authors = [{ name = "deepset GmbH", email = "info@deepset.ai" }]
@@ -15,11 +15,11 @@ classifiers = [
15
15
  "License :: OSI Approved :: Apache Software License",
16
16
  "Development Status :: 4 - Beta",
17
17
  "Programming Language :: Python",
18
- "Programming Language :: Python :: 3.10",
19
18
  "Programming Language :: Python :: 3.11",
20
19
  "Programming Language :: Python :: 3.12",
21
20
  "Programming Language :: Python :: 3.13",
22
21
  "Programming Language :: Python :: 3.14",
22
+ "Programming Language :: Python :: 3.15",
23
23
  "Programming Language :: Python :: Implementation :: CPython",
24
24
  "Programming Language :: Python :: Implementation :: PyPy",
25
25
  ]
@@ -1,5 +1,5 @@
1
1
  import inspect
2
- from datetime import datetime, timezone
2
+ from datetime import UTC, datetime
3
3
  from typing import Any, ClassVar
4
4
 
5
5
  from haystack import component, default_from_dict, default_to_dict, logging
@@ -441,7 +441,7 @@ class AnthropicChatGenerator:
441
441
  reasoning = _process_reasoning_contents(chunks)
442
442
 
443
443
  completion.meta.update(
444
- {"received_at": datetime.now(timezone.utc).isoformat(), "model": model},
444
+ {"received_at": datetime.now(UTC).isoformat(), "model": model},
445
445
  )
446
446
 
447
447
  # `completion.meta["usage"]` is the usage of the last message_delta chunk
@@ -527,7 +527,7 @@ class AnthropicChatGenerator:
527
527
  reasoning = _process_reasoning_contents(chunks)
528
528
 
529
529
  completion.meta.update(
530
- {"received_at": datetime.now(timezone.utc).isoformat(), "model": model},
530
+ {"received_at": datetime.now(UTC).isoformat(), "model": model},
531
531
  )
532
532
 
533
533
  # `completion.meta["usage"]` is the usage of the last message_delta chunk
@@ -31,11 +31,11 @@ logger = logging.getLogger(__name__)
31
31
  @component
32
32
  class AnthropicFoundryChatGenerator(AnthropicChatGenerator):
33
33
  """
34
- Enables text generation using Anthropic's Claude models via Azure Foundry.
34
+ Enables text generation using Anthropic's Claude models via Microsoft Foundry.
35
35
 
36
- A variety of Claude models (Opus, Sonnet, Haiku, and others) are available through Azure Foundry.
36
+ A variety of Claude models (Opus, Sonnet, Haiku, and others) are available through Microsoft Foundry.
37
37
 
38
- To use AnthropicFoundryChatGenerator, you must have an Azure subscription with Foundry enabled
38
+ To use AnthropicFoundryChatGenerator, you must have an Azure subscription with Microsoft Foundry enabled
39
39
  and the desired Anthropic model deployed in your Foundry resource.
40
40
 
41
41
  For more details, refer to the [Anthropic Foundry documentation](https://github.com/anthropics/anthropic-sdk-python/blob/main/src/anthropic/lib/foundry.md).
@@ -90,7 +90,7 @@ class AnthropicFoundryChatGenerator(AnthropicChatGenerator):
90
90
  "claude-haiku-4-5",
91
91
  ]
92
92
  """A non-exhaustive list of chat models supported by this component.
93
- The actual availability depends on your Azure Foundry resource configuration."""
93
+ The actual availability depends on your Microsoft Foundry resource configuration."""
94
94
 
95
95
  def __init__(
96
96
  self,
@@ -272,7 +272,7 @@ def _convert_messages_to_anthropic_format(
272
272
  # ignore: blk is an untyped block dict, not a TypedDict declaring cache_control
273
273
  blk["cache_control"] = cache_control # type: ignore[typeddict-unknown-key]
274
274
  break
275
- anthropic_non_system_messages.append(MessageParam(role="assistant", content=content))
275
+ anthropic_non_system_messages.append({"role": "assistant", "content": content})
276
276
  i += 1
277
277
  continue
278
278
 
@@ -351,11 +351,12 @@ def _convert_messages_to_anthropic_format(
351
351
 
352
352
  # Anthropic only supports assistant and user roles in messages. User role is also used for tool messages.
353
353
  # System messages are passed separately.
354
- role: Literal["assistant"] | Literal["user"] = "user"
354
+ anthropic_message: MessageParam
355
355
  if message._role == ChatRole.ASSISTANT:
356
- role = "assistant"
356
+ anthropic_message = {"role": "assistant", "content": content}
357
+ else:
358
+ anthropic_message = {"role": "user", "content": content}
357
359
 
358
- anthropic_message = MessageParam(role=role, content=content)
359
360
  anthropic_non_system_messages.append(anthropic_message)
360
361
  i += 1
361
362