mistral-haystack 2.1.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.
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/CHANGELOG.md +14 -0
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/PKG-INFO +3 -3
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/pyproject.toml +2 -2
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/src/haystack_integrations/components/converters/mistral/ocr_document_converter.py +5 -16
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/src/haystack_integrations/components/generators/mistral/chat/chat_generator.py +11 -25
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/tests/test_ocr_document_converter.py +3 -29
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/.gitignore +0 -0
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/LICENSE.txt +0 -0
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/README.md +0 -0
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/examples/chat_generator_with_structured_output.py +0 -0
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/examples/indexing_ocr_pipeline.py +0 -0
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/examples/indexing_pipeline.py +0 -0
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/examples/streaming_chat_with_rag.py +0 -0
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/pydoc/config_docusaurus.yml +0 -0
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/src/haystack_integrations/components/converters/mistral/__init__.py +0 -0
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/src/haystack_integrations/components/converters/py.typed +0 -0
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/src/haystack_integrations/components/embedders/mistral/__init__.py +0 -0
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/src/haystack_integrations/components/embedders/mistral/document_embedder.py +0 -0
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/src/haystack_integrations/components/embedders/mistral/text_embedder.py +0 -0
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/src/haystack_integrations/components/embedders/py.typed +0 -0
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/src/haystack_integrations/components/generators/mistral/__init__.py +0 -0
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/src/haystack_integrations/components/generators/mistral/chat/__init__.py +0 -0
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/src/haystack_integrations/components/generators/py.typed +0 -0
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/tests/__init__.py +0 -0
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/tests/conftest.py +0 -0
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/tests/test_mistral_chat_generator.py +0 -0
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/tests/test_mistral_chat_generator_async.py +0 -0
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/tests/test_mistral_document_embedder.py +0 -0
- {mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/tests/test_mistral_text_embedder.py +0 -0
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [integrations/mistral-v2.1.1] - 2026-10-07
|
|
4
|
+
|
|
5
|
+
### 🧹 Chores
|
|
6
|
+
|
|
7
|
+
- Update Mistral SUPPORTED_MODELS lists (#4066)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## [integrations/mistral-v2.1.0] - 2026-09-25
|
|
11
|
+
|
|
12
|
+
### 🧹 Chores
|
|
13
|
+
|
|
14
|
+
- MistralOCRDocumentConverter - replace retired default model with Mistral OCR 4.1 (#4002)
|
|
15
|
+
|
|
16
|
+
|
|
3
17
|
## [integrations/mistral-v2.0.0] - 2026-09-08
|
|
4
18
|
|
|
5
19
|
### 🚀 Features
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: mistral-haystack
|
|
3
|
-
Version:
|
|
3
|
+
Version: 3.0.0
|
|
4
4
|
Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/mistral#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/mistral
|
|
@@ -10,14 +10,14 @@ 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
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
18
18
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
19
19
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
20
|
-
Requires-Python: >=3.
|
|
20
|
+
Requires-Python: >=3.11
|
|
21
21
|
Requires-Dist: haystack-ai>=3.0.0
|
|
22
22
|
Requires-Dist: mistralai!=2.4.6,>=2.0.0
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
@@ -7,7 +7,7 @@ name = "mistral-haystack"
|
|
|
7
7
|
dynamic = ["version"]
|
|
8
8
|
description = ''
|
|
9
9
|
readme = "README.md"
|
|
10
|
-
requires-python = ">=3.
|
|
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
|
]
|
|
@@ -7,13 +7,13 @@ import re
|
|
|
7
7
|
from pathlib import Path
|
|
8
8
|
from typing import Any, ClassVar
|
|
9
9
|
|
|
10
|
-
from haystack import Document, component,
|
|
10
|
+
from haystack import Document, component, default_to_dict, logging
|
|
11
11
|
from haystack.components.converters.utils import (
|
|
12
12
|
get_bytestream_from_source,
|
|
13
13
|
normalize_metadata,
|
|
14
14
|
)
|
|
15
15
|
from haystack.dataclasses import ByteStream
|
|
16
|
-
from haystack.utils import Secret
|
|
16
|
+
from haystack.utils import Secret
|
|
17
17
|
from mistralai.client import Mistral
|
|
18
18
|
from mistralai.client.models import (
|
|
19
19
|
DocumentURLChunk,
|
|
@@ -105,8 +105,10 @@ class MistralOCRDocumentConverter:
|
|
|
105
105
|
"""
|
|
106
106
|
|
|
107
107
|
SUPPORTED_MODELS: ClassVar[list[str]] = [
|
|
108
|
+
"mistral-ocr-2512",
|
|
109
|
+
"mistral-ocr-3",
|
|
108
110
|
"mistral-ocr-3-0",
|
|
109
|
-
"mistral-ocr-4
|
|
111
|
+
"mistral-ocr-4",
|
|
110
112
|
"mistral-ocr-4-1",
|
|
111
113
|
"mistral-ocr-latest",
|
|
112
114
|
]
|
|
@@ -184,19 +186,6 @@ class MistralOCRDocumentConverter:
|
|
|
184
186
|
cleanup_uploaded_files=self.cleanup_uploaded_files,
|
|
185
187
|
)
|
|
186
188
|
|
|
187
|
-
@classmethod
|
|
188
|
-
def from_dict(cls, data: dict[str, Any]) -> "MistralOCRDocumentConverter":
|
|
189
|
-
"""
|
|
190
|
-
Deserializes the component from a dictionary.
|
|
191
|
-
|
|
192
|
-
:param data:
|
|
193
|
-
Dictionary to deserialize from.
|
|
194
|
-
:returns:
|
|
195
|
-
Deserialized component.
|
|
196
|
-
"""
|
|
197
|
-
deserialize_secrets_inplace(data["init_parameters"], keys=["api_key"])
|
|
198
|
-
return default_from_dict(cls, data)
|
|
199
|
-
|
|
200
189
|
@component.output_types(documents=list[Document], raw_mistral_response=list[dict[str, Any]])
|
|
201
190
|
def run(
|
|
202
191
|
self,
|
|
@@ -110,7 +110,7 @@ class MistralChatGenerator(OpenAIChatGenerator):
|
|
|
110
110
|
- **Streaming Support**: Supports streaming responses from the Mistral API Chat Completion endpoint.
|
|
111
111
|
- **Customizability**: Supports all parameters supported by the Mistral API Chat Completion endpoint.
|
|
112
112
|
- **Reasoning Support**: Extracts reasoning/thinking content from models that support it
|
|
113
|
-
(e.g.,
|
|
113
|
+
(e.g., Mistral Small 4 with `reasoning_effort`, Mistral Medium 3.5, Mistral Large 4) and stores it in the
|
|
114
114
|
`ReasoningContent` field on `ChatMessage`.
|
|
115
115
|
|
|
116
116
|
This component uses the ChatMessage format for structuring both input and output,
|
|
@@ -158,49 +158,35 @@ class MistralChatGenerator(OpenAIChatGenerator):
|
|
|
158
158
|
"""
|
|
159
159
|
|
|
160
160
|
SUPPORTED_MODELS: ClassVar[list[str]] = [
|
|
161
|
-
"mistral-medium-2505",
|
|
162
|
-
"mistral-medium-2508",
|
|
163
161
|
"mistral-medium-latest",
|
|
164
162
|
"mistral-medium",
|
|
163
|
+
"mistral-medium-2604",
|
|
164
|
+
"mistral-medium-3",
|
|
165
|
+
"mistral-medium-3-5",
|
|
166
|
+
"mistral-medium-3.5",
|
|
165
167
|
"mistral-vibe-cli-with-tools",
|
|
166
|
-
"open-mistral-nemo",
|
|
167
|
-
"open-mistral-nemo-2407",
|
|
168
|
-
"mistral-tiny-2407",
|
|
169
|
-
"mistral-tiny-latest",
|
|
170
168
|
"codestral-2508",
|
|
171
169
|
"codestral-latest",
|
|
172
|
-
"
|
|
170
|
+
"mistral-code-latest",
|
|
171
|
+
"mistral-code-fim-latest",
|
|
173
172
|
"mistral-vibe-cli-latest",
|
|
174
|
-
"devstral-medium-latest",
|
|
175
|
-
"devstral-latest",
|
|
176
|
-
"mistral-small-2506",
|
|
177
173
|
"mistral-small-latest",
|
|
178
|
-
"
|
|
179
|
-
"
|
|
174
|
+
"mistral-small-2603",
|
|
175
|
+
"mistral-vibe-cli-fast",
|
|
180
176
|
"magistral-medium-latest",
|
|
181
|
-
"magistral-small-2509",
|
|
182
177
|
"magistral-small-latest",
|
|
183
178
|
"voxtral-small-2507",
|
|
184
179
|
"voxtral-small-latest",
|
|
185
180
|
"mistral-large-2512",
|
|
186
181
|
"mistral-large-latest",
|
|
182
|
+
"mistral-large-4",
|
|
183
|
+
"mistral-large-4-0",
|
|
187
184
|
"ministral-3b-2512",
|
|
188
185
|
"ministral-3b-latest",
|
|
189
186
|
"ministral-8b-2512",
|
|
190
187
|
"ministral-8b-latest",
|
|
191
188
|
"ministral-14b-2512",
|
|
192
189
|
"ministral-14b-latest",
|
|
193
|
-
"mistral-large-2411",
|
|
194
|
-
"pixtral-large-2411",
|
|
195
|
-
"pixtral-large-latest",
|
|
196
|
-
"mistral-large-pixtral-2411",
|
|
197
|
-
"devstral-small-2507",
|
|
198
|
-
"devstral-medium-2507",
|
|
199
|
-
"labs-devstral-small-2512",
|
|
200
|
-
"devstral-small-latest",
|
|
201
|
-
"voxtral-mini-2507",
|
|
202
|
-
"voxtral-mini-latest",
|
|
203
|
-
"voxtral-mini-2602",
|
|
204
190
|
]
|
|
205
191
|
"""A list of models supported by Mistral AI
|
|
206
192
|
see [Mistral AI docs](https://docs.mistral.ai/getting-started/models) for more information
|
|
@@ -6,6 +6,7 @@ from unittest.mock import MagicMock, patch
|
|
|
6
6
|
|
|
7
7
|
import pytest
|
|
8
8
|
from haystack import Document
|
|
9
|
+
from haystack.core.serialization import component_from_dict
|
|
9
10
|
from haystack.dataclasses import ByteStream
|
|
10
11
|
from haystack.utils import Secret
|
|
11
12
|
from mistralai.client.models import DocumentURLChunk, FileChunk, ImageURLChunk
|
|
@@ -111,34 +112,6 @@ class TestSerialization:
|
|
|
111
112
|
},
|
|
112
113
|
}
|
|
113
114
|
|
|
114
|
-
def test_from_dict(self, monkeypatch):
|
|
115
|
-
monkeypatch.setenv("MISTRAL_API_KEY", "test-api-key")
|
|
116
|
-
converter_dict = {
|
|
117
|
-
"type": self.CLASS_TYPE,
|
|
118
|
-
"init_parameters": {
|
|
119
|
-
"api_key": {
|
|
120
|
-
"env_vars": ["MISTRAL_API_KEY"],
|
|
121
|
-
"strict": True,
|
|
122
|
-
"type": "env_var",
|
|
123
|
-
},
|
|
124
|
-
"model": "mistral-ocr-2505",
|
|
125
|
-
"include_image_base64": False,
|
|
126
|
-
"pages": None,
|
|
127
|
-
"image_limit": None,
|
|
128
|
-
"image_min_size": None,
|
|
129
|
-
"cleanup_uploaded_files": True,
|
|
130
|
-
},
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
converter = MistralOCRDocumentConverter.from_dict(converter_dict)
|
|
134
|
-
|
|
135
|
-
assert converter.model == "mistral-ocr-2505"
|
|
136
|
-
assert converter.include_image_base64 is False
|
|
137
|
-
assert converter.pages is None
|
|
138
|
-
assert converter.image_limit is None
|
|
139
|
-
assert converter.image_min_size is None
|
|
140
|
-
assert converter.cleanup_uploaded_files is True
|
|
141
|
-
|
|
142
115
|
def test_from_dict_with_custom_parameters(self, monkeypatch):
|
|
143
116
|
monkeypatch.setenv("MISTRAL_API_KEY", "test-api-key")
|
|
144
117
|
converter_dict = {
|
|
@@ -158,7 +131,7 @@ class TestSerialization:
|
|
|
158
131
|
},
|
|
159
132
|
}
|
|
160
133
|
|
|
161
|
-
converter = MistralOCRDocumentConverter
|
|
134
|
+
converter = component_from_dict(MistralOCRDocumentConverter, converter_dict, name="converter")
|
|
162
135
|
|
|
163
136
|
assert converter.model == "mistral-ocr-custom"
|
|
164
137
|
assert converter.include_image_base64 is True
|
|
@@ -166,6 +139,7 @@ class TestSerialization:
|
|
|
166
139
|
assert converter.image_limit == 10
|
|
167
140
|
assert converter.image_min_size == 100
|
|
168
141
|
assert converter.cleanup_uploaded_files is False
|
|
142
|
+
assert converter.api_key == Secret.from_env_var("MISTRAL_API_KEY")
|
|
169
143
|
|
|
170
144
|
|
|
171
145
|
class TestComponentLifecycle:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/examples/chat_generator_with_structured_output.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
|
{mistral_haystack-2.1.0 → mistral_haystack-3.0.0}/tests/test_mistral_chat_generator_async.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|