mistral-haystack 2.0.0__tar.gz → 2.1.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.
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/CHANGELOG.md +27 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/PKG-INFO +1 -1
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/examples/indexing_ocr_pipeline.py +6 -1
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/examples/indexing_pipeline.py +6 -2
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/examples/streaming_chat_with_rag.py +6 -1
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/src/haystack_integrations/components/converters/mistral/ocr_document_converter.py +18 -12
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/src/haystack_integrations/components/generators/mistral/chat/chat_generator.py +11 -25
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/tests/test_ocr_document_converter.py +2 -2
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/.gitignore +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/LICENSE.txt +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/README.md +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/examples/chat_generator_with_structured_output.py +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/pydoc/config_docusaurus.yml +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/pyproject.toml +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/src/haystack_integrations/components/converters/mistral/__init__.py +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/src/haystack_integrations/components/converters/py.typed +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/src/haystack_integrations/components/embedders/mistral/__init__.py +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/src/haystack_integrations/components/embedders/mistral/document_embedder.py +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/src/haystack_integrations/components/embedders/mistral/text_embedder.py +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/src/haystack_integrations/components/embedders/py.typed +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/src/haystack_integrations/components/generators/mistral/__init__.py +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/src/haystack_integrations/components/generators/mistral/chat/__init__.py +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/src/haystack_integrations/components/generators/py.typed +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/tests/__init__.py +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/tests/conftest.py +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/tests/test_mistral_chat_generator.py +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/tests/test_mistral_chat_generator_async.py +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/tests/test_mistral_document_embedder.py +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/tests/test_mistral_text_embedder.py +0 -0
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [integrations/mistral-v2.1.0] - 2026-09-25
|
|
4
|
+
|
|
5
|
+
### 🧹 Chores
|
|
6
|
+
|
|
7
|
+
- MistralOCRDocumentConverter - replace retired default model with Mistral OCR 4.1 (#4002)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## [integrations/mistral-v2.0.0] - 2026-09-08
|
|
11
|
+
|
|
12
|
+
### 🚀 Features
|
|
13
|
+
|
|
14
|
+
- [**breaking**] Mistral - add lifecycle handling (#3929)
|
|
15
|
+
|
|
16
|
+
### 🐛 Bug Fixes
|
|
17
|
+
|
|
18
|
+
- Fix new issues raised by ruff 0.16.0 (#3670)
|
|
19
|
+
- Standardize license files (#3771)
|
|
20
|
+
|
|
21
|
+
### 🧪 Testing
|
|
22
|
+
|
|
23
|
+
- Fix Mistral test due to new OpenAI SDK release (#3879)
|
|
24
|
+
|
|
25
|
+
### 🧹 Chores
|
|
26
|
+
|
|
27
|
+
- Clarify how generation_kwargs passed in run are handled (#3805)
|
|
28
|
+
|
|
29
|
+
|
|
3
30
|
## [integrations/mistral-v1.5.0] - 2026-07-06
|
|
4
31
|
|
|
5
32
|
### 🐛 Bug Fixes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: mistral-haystack
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.1.1
|
|
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
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2025-present deepset GmbH <info@deepset.ai>
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
1
5
|
# To run this example, you will need to:
|
|
2
6
|
# 1. Set a `MISTRAL_API_KEY` environment variable
|
|
3
7
|
# 2. Place a PDF file named `sample.pdf` in the same directory as this script
|
|
8
|
+
# 3. Run this example from that directory
|
|
4
9
|
#
|
|
5
10
|
# This example demonstrates OCR document processing with structured annotations,
|
|
6
11
|
# embedding the extracted documents using Mistral embeddings, and storing them
|
|
@@ -13,7 +18,7 @@
|
|
|
13
18
|
from haystack import Pipeline
|
|
14
19
|
from haystack.components.writers import DocumentWriter
|
|
15
20
|
from haystack.document_stores.in_memory import InMemoryDocumentStore
|
|
16
|
-
from mistralai.models import DocumentURLChunk
|
|
21
|
+
from mistralai.client.models import DocumentURLChunk
|
|
17
22
|
from pydantic import BaseModel, Field
|
|
18
23
|
|
|
19
24
|
from haystack_integrations.components.converters.mistral.ocr_document_converter import (
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
1
|
+
# SPDX-FileCopyrightText: 2024-present deepset GmbH <info@deepset.ai>
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
# To run this example, set the `MISTRAL_API_KEY` environment variable
|
|
6
|
+
# and install `trafilatura`, used by HTMLToDocument: `pip install trafilatura`
|
|
3
7
|
|
|
4
8
|
from haystack import Pipeline
|
|
5
9
|
from haystack.components.converters import HTMLToDocument
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# SPDX-FileCopyrightText: 2024-present deepset GmbH <info@deepset.ai>
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
# To run this example, set the `MISTRAL_API_KEY` environment variable
|
|
6
|
+
# and install `trafilatura`, used by HTMLToDocument: `pip install trafilatura`.
|
|
2
7
|
# This example streams chat replies to the console.
|
|
3
8
|
|
|
4
9
|
from haystack import Pipeline
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2025-present deepset GmbH <info@deepset.ai>
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
1
5
|
import json
|
|
2
6
|
import re
|
|
3
7
|
from pathlib import Path
|
|
@@ -46,12 +50,12 @@ class MistralOCRDocumentConverter:
|
|
|
46
50
|
**Usage Example:**
|
|
47
51
|
```python
|
|
48
52
|
from haystack.utils import Secret
|
|
49
|
-
from haystack_integrations.mistral import MistralOCRDocumentConverter
|
|
50
|
-
from mistralai.models import DocumentURLChunk, ImageURLChunk, FileChunk
|
|
53
|
+
from haystack_integrations.components.converters.mistral import MistralOCRDocumentConverter
|
|
54
|
+
from mistralai.client.models import DocumentURLChunk, ImageURLChunk, FileChunk
|
|
51
55
|
|
|
52
56
|
converter = MistralOCRDocumentConverter(
|
|
53
57
|
api_key=Secret.from_env_var("MISTRAL_API_KEY"),
|
|
54
|
-
model="mistral-ocr-
|
|
58
|
+
model="mistral-ocr-latest"
|
|
55
59
|
)
|
|
56
60
|
|
|
57
61
|
# Process multiple sources
|
|
@@ -68,8 +72,9 @@ class MistralOCRDocumentConverter:
|
|
|
68
72
|
|
|
69
73
|
**Structured Output Example:**
|
|
70
74
|
```python
|
|
75
|
+
from mistralai.client.models import DocumentURLChunk
|
|
71
76
|
from pydantic import BaseModel, Field
|
|
72
|
-
from haystack_integrations.mistral import MistralOCRDocumentConverter
|
|
77
|
+
from haystack_integrations.components.converters.mistral import MistralOCRDocumentConverter
|
|
73
78
|
|
|
74
79
|
# Define schema for structured image annotations
|
|
75
80
|
class ImageAnnotation(BaseModel):
|
|
@@ -80,11 +85,11 @@ class MistralOCRDocumentConverter:
|
|
|
80
85
|
# Define schema for structured document annotations
|
|
81
86
|
class DocumentAnnotation(BaseModel):
|
|
82
87
|
language: str = Field(..., description="Primary language of the document")
|
|
83
|
-
chapter_titles:
|
|
84
|
-
urls:
|
|
88
|
+
chapter_titles: list[str] = Field(..., description="Detected chapter or section titles")
|
|
89
|
+
urls: list[str] = Field(..., description="URLs found in the text")
|
|
85
90
|
|
|
86
91
|
converter = MistralOCRDocumentConverter(
|
|
87
|
-
model="mistral-ocr-
|
|
92
|
+
model="mistral-ocr-latest",
|
|
88
93
|
)
|
|
89
94
|
|
|
90
95
|
sources = [DocumentURLChunk(document_url="https://example.com/report.pdf")]
|
|
@@ -101,9 +106,11 @@ class MistralOCRDocumentConverter:
|
|
|
101
106
|
|
|
102
107
|
SUPPORTED_MODELS: ClassVar[list[str]] = [
|
|
103
108
|
"mistral-ocr-2512",
|
|
109
|
+
"mistral-ocr-3",
|
|
110
|
+
"mistral-ocr-3-0",
|
|
111
|
+
"mistral-ocr-4",
|
|
112
|
+
"mistral-ocr-4-1",
|
|
104
113
|
"mistral-ocr-latest",
|
|
105
|
-
"mistral-ocr-2503",
|
|
106
|
-
"mistral-ocr-2505",
|
|
107
114
|
]
|
|
108
115
|
"""A list of models supported by Mistral AI
|
|
109
116
|
see [Mistral AI docs](https://docs.mistral.ai/getting-started/models) for more information
|
|
@@ -112,7 +119,7 @@ class MistralOCRDocumentConverter:
|
|
|
112
119
|
def __init__(
|
|
113
120
|
self,
|
|
114
121
|
api_key: Secret = Secret.from_env_var("MISTRAL_API_KEY"),
|
|
115
|
-
model: str = "mistral-ocr-
|
|
122
|
+
model: str = "mistral-ocr-4-1",
|
|
116
123
|
include_image_base64: bool = False,
|
|
117
124
|
pages: list[int] | None = None,
|
|
118
125
|
image_limit: int | None = None,
|
|
@@ -125,8 +132,7 @@ class MistralOCRDocumentConverter:
|
|
|
125
132
|
:param api_key:
|
|
126
133
|
The Mistral API key. Defaults to the MISTRAL_API_KEY environment variable.
|
|
127
134
|
:param model:
|
|
128
|
-
The OCR model to use.
|
|
129
|
-
See more: https://docs.mistral.ai/getting-started/models/models_overview/
|
|
135
|
+
The OCR model to use. See more: https://docs.mistral.ai/getting-started/models/models_overview/
|
|
130
136
|
:param include_image_base64:
|
|
131
137
|
If True, includes base64 encoded images in the response.
|
|
132
138
|
This may significantly increase response size and processing time.
|
|
@@ -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
|
|
@@ -29,7 +29,7 @@ class TestInitialization:
|
|
|
29
29
|
converter = MistralOCRDocumentConverter()
|
|
30
30
|
|
|
31
31
|
assert converter.api_key == Secret.from_env_var("MISTRAL_API_KEY")
|
|
32
|
-
assert converter.model == "mistral-ocr-
|
|
32
|
+
assert converter.model == "mistral-ocr-4-1"
|
|
33
33
|
assert converter.include_image_base64 is False
|
|
34
34
|
assert converter.pages is None
|
|
35
35
|
assert converter.image_limit is None
|
|
@@ -72,7 +72,7 @@ class TestSerialization:
|
|
|
72
72
|
"strict": True,
|
|
73
73
|
"type": "env_var",
|
|
74
74
|
},
|
|
75
|
-
"model": "mistral-ocr-
|
|
75
|
+
"model": "mistral-ocr-4-1",
|
|
76
76
|
"include_image_base64": False,
|
|
77
77
|
"pages": None,
|
|
78
78
|
"image_limit": None,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/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
|
{mistral_haystack-2.0.0 → mistral_haystack-2.1.1}/tests/test_mistral_chat_generator_async.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|