nvidia-haystack 2.0.0__tar.gz → 3.0.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 (37) hide show
  1. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/CHANGELOG.md +15 -0
  2. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/PKG-INFO +2 -3
  3. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/pyproject.toml +1 -2
  4. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/src/haystack_integrations/components/embedders/nvidia/document_embedder.py +2 -17
  5. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/src/haystack_integrations/components/embedders/nvidia/text_embedder.py +2 -17
  6. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/src/haystack_integrations/components/rankers/nvidia/ranker.py +2 -15
  7. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/src/haystack_integrations/components/rankers/nvidia/truncate.py +1 -1
  8. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/tests/test_document_embedder.py +3 -21
  9. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/tests/test_ranker.py +5 -20
  10. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/tests/test_text_embedder.py +3 -16
  11. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/.gitignore +0 -0
  12. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/LICENSE.txt +0 -0
  13. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/README.md +0 -0
  14. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/examples/chat_generator_with_structured_outputs.py +0 -0
  15. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/pydoc/config_docusaurus.yml +0 -0
  16. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/src/haystack_integrations/components/embedders/nvidia/__init__.py +0 -0
  17. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/src/haystack_integrations/components/embedders/nvidia/truncate.py +0 -0
  18. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/src/haystack_integrations/components/embedders/py.typed +0 -0
  19. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/src/haystack_integrations/components/generators/nvidia/__init__.py +0 -0
  20. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/src/haystack_integrations/components/generators/nvidia/chat/__init__.py +0 -0
  21. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/src/haystack_integrations/components/generators/nvidia/chat/chat_generator.py +0 -0
  22. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/src/haystack_integrations/components/generators/py.typed +0 -0
  23. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/src/haystack_integrations/components/rankers/nvidia/__init__.py +0 -0
  24. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/src/haystack_integrations/components/rankers/py.typed +0 -0
  25. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/src/haystack_integrations/utils/nvidia/__init__.py +0 -0
  26. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/src/haystack_integrations/utils/nvidia/client.py +0 -0
  27. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/src/haystack_integrations/utils/nvidia/models.py +0 -0
  28. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/src/haystack_integrations/utils/nvidia/nim_backend.py +0 -0
  29. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/src/haystack_integrations/utils/nvidia/utils.py +0 -0
  30. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/src/haystack_integrations/utils/py.typed +0 -0
  31. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/tests/__init__.py +0 -0
  32. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/tests/conftest.py +0 -0
  33. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/tests/test_base_url.py +0 -0
  34. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/tests/test_embedding_truncate_mode.py +0 -0
  35. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/tests/test_nim_backend.py +0 -0
  36. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/tests/test_nvidia_chat_generator.py +0 -0
  37. {nvidia_haystack-2.0.0 → nvidia_haystack-3.0.0}/tests/test_utils.py +0 -0
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [integrations/nvidia-v2.0.0] - 2026-09-08
4
+
5
+ ### 🚀 Features
6
+
7
+ - [**breaking**] Nvidia - add `close` method; change the default models (#3930)
8
+
9
+ ### ⚙️ CI
10
+
11
+ - Improve changelog generation; fix existing changelogs (#3883)
12
+
13
+ ### 🧹 Chores
14
+
15
+ - [**breaking**] Remove deprecated `NvidiaGenerator` (use `NvidiaChatGenerator` instead) (#3891)
16
+
17
+
3
18
  ## [integrations/nvidia-v1.4.0] - 2026-08-11
4
19
 
5
20
  ### 🐛 Bug Fixes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: nvidia-haystack
3
- Version: 2.0.0
3
+ Version: 3.0.0
4
4
  Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/nvidia#readme
5
5
  Project-URL: Issues, https://github.com/deepset-ai/haystack-core-integrations/issues
6
6
  Project-URL: Source, https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/nvidia
@@ -10,14 +10,13 @@ License-File: LICENSE.txt
10
10
  Classifier: Development Status :: 4 - Beta
11
11
  Classifier: License :: OSI Approved :: Apache Software License
12
12
  Classifier: Programming Language :: Python
13
- Classifier: Programming Language :: Python :: 3.10
14
13
  Classifier: Programming Language :: Python :: 3.11
15
14
  Classifier: Programming Language :: Python :: 3.12
16
15
  Classifier: Programming Language :: Python :: 3.13
17
16
  Classifier: Programming Language :: Python :: 3.14
18
17
  Classifier: Programming Language :: Python :: Implementation :: CPython
19
18
  Classifier: Programming Language :: Python :: Implementation :: PyPy
20
- Requires-Python: >=3.10
19
+ Requires-Python: >=3.11
21
20
  Requires-Dist: haystack-ai>=3.0.0
22
21
  Requires-Dist: requests>=2.25.0
23
22
  Requires-Dist: tqdm>=4.21.0
@@ -7,7 +7,7 @@ name = "nvidia-haystack"
7
7
  dynamic = ["version"]
8
8
  description = ''
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,7 +15,6 @@ 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",
@@ -7,8 +7,8 @@ import warnings
7
7
  from dataclasses import replace
8
8
  from typing import Any
9
9
 
10
- from haystack import Document, component, default_from_dict, default_to_dict, logging
11
- from haystack.utils import Secret, deserialize_secrets_inplace
10
+ from haystack import Document, component, default_to_dict, logging
11
+ from haystack.utils import Secret
12
12
  from tqdm import tqdm
13
13
 
14
14
  from haystack_integrations.components.embedders.nvidia.truncate import EmbeddingTruncateMode
@@ -189,21 +189,6 @@ class NvidiaDocumentEmbedder:
189
189
  """
190
190
  return self.backend.models() if self.backend else []
191
191
 
192
- @classmethod
193
- def from_dict(cls, data: dict[str, Any]) -> "NvidiaDocumentEmbedder":
194
- """
195
- Deserializes the component from a dictionary.
196
-
197
- :param data:
198
- The dictionary to deserialize from.
199
- :returns:
200
- The deserialized component.
201
- """
202
- init_parameters = data.get("init_parameters", {})
203
- if init_parameters:
204
- deserialize_secrets_inplace(data["init_parameters"], keys=["api_key"])
205
- return default_from_dict(cls, data)
206
-
207
192
  def _prepare_texts_to_embed(self, documents: list[Document]) -> list[str]:
208
193
  texts_to_embed = []
209
194
  for doc in documents:
@@ -6,8 +6,8 @@ import os
6
6
  import warnings
7
7
  from typing import Any
8
8
 
9
- from haystack import component, default_from_dict, default_to_dict, logging
10
- from haystack.utils import Secret, deserialize_secrets_inplace
9
+ from haystack import component, default_to_dict, logging
10
+ from haystack.utils import Secret
11
11
 
12
12
  from haystack_integrations.components.embedders.nvidia.truncate import EmbeddingTruncateMode
13
13
  from haystack_integrations.utils.nvidia import DEFAULT_API_URL, Client, Model, NimBackend, url_validation
@@ -174,21 +174,6 @@ class NvidiaTextEmbedder:
174
174
  """
175
175
  return self.backend.models() if self.backend else []
176
176
 
177
- @classmethod
178
- def from_dict(cls, data: dict[str, Any]) -> "NvidiaTextEmbedder":
179
- """
180
- Deserializes the component from a dictionary.
181
-
182
- :param data:
183
- The dictionary to deserialize from.
184
- :returns:
185
- The deserialized component.
186
- """
187
- init_parameters = data.get("init_parameters", {})
188
- if init_parameters:
189
- deserialize_secrets_inplace(data["init_parameters"], keys=["api_key"])
190
- return default_from_dict(cls, data)
191
-
192
177
  @component.output_types(embedding=list[float], meta=dict[str, Any])
193
178
  def run(self, text: str) -> dict[str, list[float] | dict[str, Any]]:
194
179
  """
@@ -6,8 +6,8 @@ import os
6
6
  from dataclasses import replace
7
7
  from typing import Any
8
8
 
9
- from haystack import Document, component, default_from_dict, default_to_dict
10
- from haystack.utils import Secret, deserialize_secrets_inplace
9
+ from haystack import Document, component, default_to_dict
10
+ from haystack.utils import Secret
11
11
 
12
12
  from haystack_integrations.components.rankers.nvidia.truncate import RankerTruncateMode
13
13
  from haystack_integrations.utils.nvidia import DEFAULT_API_URL, Client, NimBackend, is_hosted, url_validation
@@ -144,19 +144,6 @@ class NvidiaRanker:
144
144
  timeout=self.timeout,
145
145
  )
146
146
 
147
- @classmethod
148
- def from_dict(cls, data: dict[str, Any]) -> "NvidiaRanker":
149
- """
150
- Deserialize the ranker from a dictionary.
151
-
152
- :param data: A dictionary containing the ranker's attributes.
153
- :returns: The deserialized ranker.
154
- """
155
- init_parameters = data.get("init_parameters", {})
156
- if init_parameters:
157
- deserialize_secrets_inplace(data["init_parameters"], keys=["api_key"])
158
- return default_from_dict(cls, data)
159
-
160
147
  def warm_up(self) -> None:
161
148
  """
162
149
  Initialize the ranker.
@@ -5,7 +5,7 @@
5
5
  from enum import Enum
6
6
 
7
7
 
8
- class RankerTruncateMode(str, Enum):
8
+ class RankerTruncateMode(str, Enum): # noqa: UP042 # StrEnum would change str() of this public enum
9
9
  """
10
10
  Specifies how inputs to the NVIDIA ranker components are truncated.
11
11
 
@@ -7,6 +7,7 @@ from unittest.mock import patch
7
7
 
8
8
  import pytest
9
9
  from haystack import Document
10
+ from haystack.core.serialization import component_from_dict
10
11
  from haystack.utils import Secret
11
12
 
12
13
  from haystack_integrations.components.embedders.nvidia import EmbeddingTruncateMode, NvidiaDocumentEmbedder
@@ -125,7 +126,7 @@ class TestSerialization:
125
126
  "timeout": 45.0,
126
127
  },
127
128
  }
128
- component = NvidiaDocumentEmbedder.from_dict(data)
129
+ component = component_from_dict(NvidiaDocumentEmbedder, data, name="component")
129
130
  assert component.model == "nvidia/nv-embedqa-e5-v5"
130
131
  assert component.api_url == "https://example.com/v1"
131
132
  assert component.prefix == "prefix"
@@ -136,26 +137,7 @@ class TestSerialization:
136
137
  assert component.embedding_separator == " | "
137
138
  assert component.truncate == EmbeddingTruncateMode.START
138
139
  assert component.timeout == 45.0
139
-
140
- def test_from_dict_defaults(self, monkeypatch):
141
- monkeypatch.setenv("NVIDIA_API_KEY", "fake-api-key")
142
- data = {
143
- "type": "haystack_integrations.components.embedders.nvidia.document_embedder.NvidiaDocumentEmbedder",
144
- "init_parameters": {},
145
- }
146
- component = NvidiaDocumentEmbedder.from_dict(data)
147
- ## updating this as model set to None as the warm_up is not done
148
- ## default model will be set post warm_up()
149
- assert component.model is None
150
- assert component.api_url == DEFAULT_API_URL
151
- assert component.prefix == ""
152
- assert component.suffix == ""
153
- assert component.batch_size == 32
154
- assert component.progress_bar
155
- assert component.meta_fields_to_embed == []
156
- assert component.embedding_separator == "\n"
157
- assert component.truncate is None
158
- assert component.timeout == 60.0
140
+ assert component.api_key == Secret.from_env_var("NVIDIA_API_KEY")
159
141
 
160
142
 
161
143
  class TestComponentLifecycle:
@@ -9,6 +9,7 @@ from unittest.mock import patch
9
9
 
10
10
  import pytest
11
11
  from haystack import Document
12
+ from haystack.core.serialization import component_from_dict
12
13
  from haystack.utils import Secret
13
14
 
14
15
  from haystack_integrations.components.rankers.nvidia import NvidiaRanker
@@ -63,7 +64,8 @@ class TestSerialization:
63
64
  }
64
65
 
65
66
  def test_from_dict(self) -> None:
66
- client = NvidiaRanker.from_dict(
67
+ client = component_from_dict(
68
+ NvidiaRanker,
67
69
  {
68
70
  "type": "haystack_integrations.components.rankers.nvidia.ranker.NvidiaRanker",
69
71
  "init_parameters": {
@@ -78,7 +80,8 @@ class TestSerialization:
78
80
  "embedding_separator": "\n",
79
81
  "timeout": 45.0,
80
82
  },
81
- }
83
+ },
84
+ name="client",
82
85
  )
83
86
  assert client.model == "nvidia/nv-rerankqa-mistral-4b-v3"
84
87
  assert client.top_k == 5
@@ -91,24 +94,6 @@ class TestSerialization:
91
94
  assert client.embedding_separator == "\n"
92
95
  assert client.timeout == 45.0
93
96
 
94
- def test_from_dict_defaults(self) -> None:
95
- client = NvidiaRanker.from_dict(
96
- {
97
- "type": "haystack_integrations.components.rankers.nvidia.ranker.NvidiaRanker",
98
- "init_parameters": {},
99
- }
100
- )
101
- assert client.model is None
102
- assert client.top_k == 5
103
- assert client.truncate is None
104
- assert client.api_url == "https://integrate.api.nvidia.com/v1"
105
- assert client.api_key == Secret.from_env_var("NVIDIA_API_KEY")
106
- assert client.query_prefix == ""
107
- assert client.document_prefix == ""
108
- assert client.meta_fields_to_embed == []
109
- assert client.embedding_separator == "\n"
110
- assert client.timeout == 60.0
111
-
112
97
 
113
98
  class TestComponentLifecycle:
114
99
  def test_key_resolved_at_warm_up_not_init(self, monkeypatch):
@@ -6,6 +6,7 @@ import os
6
6
  from unittest.mock import patch
7
7
 
8
8
  import pytest
9
+ from haystack.core.serialization import component_from_dict
9
10
  from haystack.utils import Secret
10
11
 
11
12
  from haystack_integrations.components.embedders.nvidia import EmbeddingTruncateMode, NvidiaTextEmbedder
@@ -97,28 +98,14 @@ class TestSerialization:
97
98
  "timeout": 10.0,
98
99
  },
99
100
  }
100
- component = NvidiaTextEmbedder.from_dict(data)
101
+ component = component_from_dict(NvidiaTextEmbedder, data, name="component")
101
102
  assert component.model == "nvolveqa_40k"
102
103
  assert component.api_url == "https://example.com/v1"
103
104
  assert component.prefix == "prefix"
104
105
  assert component.suffix == "suffix"
105
106
  assert component.truncate == EmbeddingTruncateMode.START
106
107
  assert component.timeout == 10.0
107
-
108
- def test_from_dict_defaults(self, monkeypatch):
109
- monkeypatch.setenv("NVIDIA_API_KEY", "fake-api-key")
110
- data = {
111
- "type": "haystack_integrations.components.embedders.nvidia.text_embedder.NvidiaTextEmbedder",
112
- "init_parameters": {},
113
- }
114
- component = NvidiaTextEmbedder.from_dict(data)
115
- ## updating this as model set to None as the warm_up is not done
116
- ## default model will be set post warm_up()
117
- assert component.model is None
118
- assert component.api_url == DEFAULT_API_URL
119
- assert component.prefix == ""
120
- assert component.suffix == ""
121
- assert component.truncate is None
108
+ assert component.api_key == Secret.from_env_var("NVIDIA_API_KEY")
122
109
 
123
110
 
124
111
  class TestComponentLifecycle: