Skip to content

Commit 4a2b8e3

Browse files
authored
chore: Update mistral integration to work with mistralai>=2.0.0 (#2957)
1 parent 9ea8917 commit 4a2b8e3

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

integrations/mistral/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ classifiers = [
2222
"Programming Language :: Python :: Implementation :: CPython",
2323
"Programming Language :: Python :: Implementation :: PyPy",
2424
]
25-
dependencies = ["haystack-ai>=2.22.0", "mistralai>=1.9.11,<2.0.0"]
25+
dependencies = ["haystack-ai>=2.22.0", "mistralai>=2.0.0"]
2626

2727
[project.urls]
2828
Documentation = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/mistral#readme"

integrations/mistral/src/haystack_integrations/components/converters/mistral/ocr_document_converter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
)
1111
from haystack.dataclasses import ByteStream
1212
from haystack.utils import Secret, deserialize_secrets_inplace
13-
from mistralai import Mistral
14-
from mistralai.extra import response_format_from_pydantic_model
15-
from mistralai.models import (
13+
from mistralai.client import Mistral
14+
from mistralai.client.models import (
1615
DocumentURLChunk,
1716
FileChunk,
1817
ImageURLChunk,
1918
OCRResponse,
2019
)
20+
from mistralai.extra import response_format_from_pydantic_model # type: ignore[import-untyped]
2121
from pydantic import BaseModel
2222

2323
logger = logging.getLogger(__name__)

integrations/mistral/tests/test_ocr_document_converter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from haystack import Document
99
from haystack.dataclasses import ByteStream
1010
from haystack.utils import Secret
11-
from mistralai.models import DocumentURLChunk, FileChunk, ImageURLChunk
11+
from mistralai.client.models import DocumentURLChunk, FileChunk, ImageURLChunk
1212
from pydantic import BaseModel, Field
1313

1414
from haystack_integrations.components.converters.mistral import (

0 commit comments

Comments
 (0)