mistral-haystack 2.0.0__tar.gz → 2.1.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.0.0 → mistral_haystack-2.1.0}/CHANGELOG.md +20 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/PKG-INFO +1 -1
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/examples/indexing_ocr_pipeline.py +6 -1
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/examples/indexing_pipeline.py +6 -2
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/examples/streaming_chat_with_rag.py +6 -1
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/src/haystack_integrations/components/converters/mistral/ocr_document_converter.py +17 -13
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/tests/test_ocr_document_converter.py +2 -2
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/.gitignore +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/LICENSE.txt +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/README.md +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/examples/chat_generator_with_structured_output.py +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/pydoc/config_docusaurus.yml +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/pyproject.toml +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/src/haystack_integrations/components/converters/mistral/__init__.py +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/src/haystack_integrations/components/converters/py.typed +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/src/haystack_integrations/components/embedders/mistral/__init__.py +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/src/haystack_integrations/components/embedders/mistral/document_embedder.py +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/src/haystack_integrations/components/embedders/mistral/text_embedder.py +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/src/haystack_integrations/components/embedders/py.typed +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/src/haystack_integrations/components/generators/mistral/__init__.py +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/src/haystack_integrations/components/generators/mistral/chat/__init__.py +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/src/haystack_integrations/components/generators/mistral/chat/chat_generator.py +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/src/haystack_integrations/components/generators/py.typed +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/tests/__init__.py +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/tests/conftest.py +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/tests/test_mistral_chat_generator.py +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/tests/test_mistral_chat_generator_async.py +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/tests/test_mistral_document_embedder.py +0 -0
- {mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/tests/test_mistral_text_embedder.py +0 -0
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [integrations/mistral-v2.0.0] - 2026-09-08
|
|
4
|
+
|
|
5
|
+
### 🚀 Features
|
|
6
|
+
|
|
7
|
+
- [**breaking**] Mistral - add lifecycle handling (#3929)
|
|
8
|
+
|
|
9
|
+
### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
- Fix new issues raised by ruff 0.16.0 (#3670)
|
|
12
|
+
- Standardize license files (#3771)
|
|
13
|
+
|
|
14
|
+
### 🧪 Testing
|
|
15
|
+
|
|
16
|
+
- Fix Mistral test due to new OpenAI SDK release (#3879)
|
|
17
|
+
|
|
18
|
+
### 🧹 Chores
|
|
19
|
+
|
|
20
|
+
- Clarify how generation_kwargs passed in run are handled (#3805)
|
|
21
|
+
|
|
22
|
+
|
|
3
23
|
## [integrations/mistral-v1.5.0] - 2026-07-06
|
|
4
24
|
|
|
5
25
|
### 🐛 Bug Fixes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: mistral-haystack
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.1.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
|
|
@@ -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")]
|
|
@@ -100,10 +105,10 @@ class MistralOCRDocumentConverter:
|
|
|
100
105
|
"""
|
|
101
106
|
|
|
102
107
|
SUPPORTED_MODELS: ClassVar[list[str]] = [
|
|
103
|
-
"mistral-ocr-
|
|
108
|
+
"mistral-ocr-3-0",
|
|
109
|
+
"mistral-ocr-4-0",
|
|
110
|
+
"mistral-ocr-4-1",
|
|
104
111
|
"mistral-ocr-latest",
|
|
105
|
-
"mistral-ocr-2503",
|
|
106
|
-
"mistral-ocr-2505",
|
|
107
112
|
]
|
|
108
113
|
"""A list of models supported by Mistral AI
|
|
109
114
|
see [Mistral AI docs](https://docs.mistral.ai/getting-started/models) for more information
|
|
@@ -112,7 +117,7 @@ class MistralOCRDocumentConverter:
|
|
|
112
117
|
def __init__(
|
|
113
118
|
self,
|
|
114
119
|
api_key: Secret = Secret.from_env_var("MISTRAL_API_KEY"),
|
|
115
|
-
model: str = "mistral-ocr-
|
|
120
|
+
model: str = "mistral-ocr-4-1",
|
|
116
121
|
include_image_base64: bool = False,
|
|
117
122
|
pages: list[int] | None = None,
|
|
118
123
|
image_limit: int | None = None,
|
|
@@ -125,8 +130,7 @@ class MistralOCRDocumentConverter:
|
|
|
125
130
|
:param api_key:
|
|
126
131
|
The Mistral API key. Defaults to the MISTRAL_API_KEY environment variable.
|
|
127
132
|
:param model:
|
|
128
|
-
The OCR model to use.
|
|
129
|
-
See more: https://docs.mistral.ai/getting-started/models/models_overview/
|
|
133
|
+
The OCR model to use. See more: https://docs.mistral.ai/getting-started/models/models_overview/
|
|
130
134
|
:param include_image_base64:
|
|
131
135
|
If True, includes base64 encoded images in the response.
|
|
132
136
|
This may significantly increase response size and processing time.
|
|
@@ -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.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
|
{mistral_haystack-2.0.0 → mistral_haystack-2.1.0}/tests/test_mistral_chat_generator_async.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|