mistralai 1.9.10__py3-none-any.whl → 1.9.11__py3-none-any.whl
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.
- mistralai/_version.py +3 -3
- mistralai/accesses.py +43 -108
- mistralai/agents.py +29 -68
- mistralai/audio.py +8 -3
- mistralai/basesdk.py +15 -5
- mistralai/batch.py +6 -3
- mistralai/beta.py +10 -5
- mistralai/chat.py +29 -68
- mistralai/classifiers.py +57 -144
- mistralai/conversations.py +143 -352
- mistralai/documents.py +137 -356
- mistralai/embeddings.py +15 -36
- mistralai/files.py +47 -176
- mistralai/fim.py +29 -68
- mistralai/fine_tuning.py +6 -3
- mistralai/jobs.py +49 -158
- mistralai/libraries.py +71 -178
- mistralai/mistral_agents.py +71 -180
- mistralai/mistral_jobs.py +41 -128
- mistralai/models/__init__.py +25 -3
- mistralai/models/httpvalidationerror.py +11 -6
- mistralai/models/mistralerror.py +26 -0
- mistralai/models/no_response_error.py +13 -0
- mistralai/models/responsevalidationerror.py +25 -0
- mistralai/models/sdkerror.py +30 -14
- mistralai/models_.py +71 -204
- mistralai/ocr.py +15 -36
- mistralai/sdk.py +15 -2
- mistralai/transcriptions.py +17 -56
- mistralai/utils/__init__.py +18 -5
- mistralai/utils/eventstreaming.py +10 -0
- mistralai/utils/serializers.py +3 -2
- mistralai/utils/unmarshal_json_response.py +24 -0
- {mistralai-1.9.10.dist-info → mistralai-1.9.11.dist-info}/METADATA +61 -30
- {mistralai-1.9.10.dist-info → mistralai-1.9.11.dist-info}/RECORD +37 -33
- {mistralai-1.9.10.dist-info → mistralai-1.9.11.dist-info}/WHEEL +1 -1
- {mistralai-1.9.10.dist-info → mistralai-1.9.11.dist-info/licenses}/LICENSE +0 -0
mistralai/transcriptions.py
CHANGED
|
@@ -5,6 +5,7 @@ from mistralai import models, utils
|
|
|
5
5
|
from mistralai._hooks import HookContext
|
|
6
6
|
from mistralai.types import OptionalNullable, UNSET
|
|
7
7
|
from mistralai.utils import eventstreaming, get_security_from_env
|
|
8
|
+
from mistralai.utils.unmarshal_json_response import unmarshal_json_response
|
|
8
9
|
from typing import List, Mapping, Optional, Union
|
|
9
10
|
|
|
10
11
|
|
|
@@ -103,26 +104,15 @@ class Transcriptions(BaseSDK):
|
|
|
103
104
|
)
|
|
104
105
|
|
|
105
106
|
if utils.match_response(http_res, "200", "application/json"):
|
|
106
|
-
return
|
|
107
|
+
return unmarshal_json_response(models.TranscriptionResponse, http_res)
|
|
107
108
|
if utils.match_response(http_res, "4XX", "*"):
|
|
108
109
|
http_res_text = utils.stream_to_text(http_res)
|
|
109
|
-
raise models.SDKError(
|
|
110
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
111
|
-
)
|
|
110
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
112
111
|
if utils.match_response(http_res, "5XX", "*"):
|
|
113
112
|
http_res_text = utils.stream_to_text(http_res)
|
|
114
|
-
raise models.SDKError(
|
|
115
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
116
|
-
)
|
|
113
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
117
114
|
|
|
118
|
-
|
|
119
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
120
|
-
raise models.SDKError(
|
|
121
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
122
|
-
http_res.status_code,
|
|
123
|
-
http_res_text,
|
|
124
|
-
http_res,
|
|
125
|
-
)
|
|
115
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
126
116
|
|
|
127
117
|
async def complete_async(
|
|
128
118
|
self,
|
|
@@ -216,26 +206,15 @@ class Transcriptions(BaseSDK):
|
|
|
216
206
|
)
|
|
217
207
|
|
|
218
208
|
if utils.match_response(http_res, "200", "application/json"):
|
|
219
|
-
return
|
|
209
|
+
return unmarshal_json_response(models.TranscriptionResponse, http_res)
|
|
220
210
|
if utils.match_response(http_res, "4XX", "*"):
|
|
221
211
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
222
|
-
raise models.SDKError(
|
|
223
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
224
|
-
)
|
|
212
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
225
213
|
if utils.match_response(http_res, "5XX", "*"):
|
|
226
214
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
227
|
-
raise models.SDKError(
|
|
228
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
229
|
-
)
|
|
215
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
230
216
|
|
|
231
|
-
|
|
232
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
233
|
-
raise models.SDKError(
|
|
234
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
235
|
-
http_res.status_code,
|
|
236
|
-
http_res_text,
|
|
237
|
-
http_res,
|
|
238
|
-
)
|
|
217
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
239
218
|
|
|
240
219
|
def stream(
|
|
241
220
|
self,
|
|
@@ -337,26 +316,17 @@ class Transcriptions(BaseSDK):
|
|
|
337
316
|
return eventstreaming.EventStream(
|
|
338
317
|
http_res,
|
|
339
318
|
lambda raw: utils.unmarshal_json(raw, models.TranscriptionStreamEvents),
|
|
319
|
+
client_ref=self,
|
|
340
320
|
)
|
|
341
321
|
if utils.match_response(http_res, "4XX", "*"):
|
|
342
322
|
http_res_text = utils.stream_to_text(http_res)
|
|
343
|
-
raise models.SDKError(
|
|
344
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
345
|
-
)
|
|
323
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
346
324
|
if utils.match_response(http_res, "5XX", "*"):
|
|
347
325
|
http_res_text = utils.stream_to_text(http_res)
|
|
348
|
-
raise models.SDKError(
|
|
349
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
350
|
-
)
|
|
326
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
351
327
|
|
|
352
|
-
content_type = http_res.headers.get("Content-Type")
|
|
353
328
|
http_res_text = utils.stream_to_text(http_res)
|
|
354
|
-
raise models.SDKError(
|
|
355
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
356
|
-
http_res.status_code,
|
|
357
|
-
http_res_text,
|
|
358
|
-
http_res,
|
|
359
|
-
)
|
|
329
|
+
raise models.SDKError("Unexpected response received", http_res, http_res_text)
|
|
360
330
|
|
|
361
331
|
async def stream_async(
|
|
362
332
|
self,
|
|
@@ -458,23 +428,14 @@ class Transcriptions(BaseSDK):
|
|
|
458
428
|
return eventstreaming.EventStreamAsync(
|
|
459
429
|
http_res,
|
|
460
430
|
lambda raw: utils.unmarshal_json(raw, models.TranscriptionStreamEvents),
|
|
431
|
+
client_ref=self,
|
|
461
432
|
)
|
|
462
433
|
if utils.match_response(http_res, "4XX", "*"):
|
|
463
434
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
464
|
-
raise models.SDKError(
|
|
465
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
466
|
-
)
|
|
435
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
467
436
|
if utils.match_response(http_res, "5XX", "*"):
|
|
468
437
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
469
|
-
raise models.SDKError(
|
|
470
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
471
|
-
)
|
|
438
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
472
439
|
|
|
473
|
-
content_type = http_res.headers.get("Content-Type")
|
|
474
440
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
475
|
-
raise models.SDKError(
|
|
476
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
477
|
-
http_res.status_code,
|
|
478
|
-
http_res_text,
|
|
479
|
-
http_res,
|
|
480
|
-
)
|
|
441
|
+
raise models.SDKError("Unexpected response received", http_res, http_res_text)
|
mistralai/utils/__init__.py
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from typing import TYPE_CHECKING
|
|
4
4
|
from importlib import import_module
|
|
5
|
+
import builtins
|
|
6
|
+
import sys
|
|
5
7
|
|
|
6
8
|
if TYPE_CHECKING:
|
|
7
9
|
from .annotations import get_discriminator
|
|
@@ -161,6 +163,18 @@ _dynamic_imports: dict[str, str] = {
|
|
|
161
163
|
}
|
|
162
164
|
|
|
163
165
|
|
|
166
|
+
def dynamic_import(modname, retries=3):
|
|
167
|
+
for attempt in range(retries):
|
|
168
|
+
try:
|
|
169
|
+
return import_module(modname, __package__)
|
|
170
|
+
except KeyError:
|
|
171
|
+
# Clear any half-initialized module and retry
|
|
172
|
+
sys.modules.pop(modname, None)
|
|
173
|
+
if attempt == retries - 1:
|
|
174
|
+
break
|
|
175
|
+
raise KeyError(f"Failed to import module '{modname}' after {retries} attempts")
|
|
176
|
+
|
|
177
|
+
|
|
164
178
|
def __getattr__(attr_name: str) -> object:
|
|
165
179
|
module_name = _dynamic_imports.get(attr_name)
|
|
166
180
|
if module_name is None:
|
|
@@ -169,9 +183,8 @@ def __getattr__(attr_name: str) -> object:
|
|
|
169
183
|
)
|
|
170
184
|
|
|
171
185
|
try:
|
|
172
|
-
module =
|
|
173
|
-
|
|
174
|
-
return result
|
|
186
|
+
module = dynamic_import(module_name)
|
|
187
|
+
return getattr(module, attr_name)
|
|
175
188
|
except ImportError as e:
|
|
176
189
|
raise ImportError(
|
|
177
190
|
f"Failed to import {attr_name} from {module_name}: {e}"
|
|
@@ -183,5 +196,5 @@ def __getattr__(attr_name: str) -> object:
|
|
|
183
196
|
|
|
184
197
|
|
|
185
198
|
def __dir__():
|
|
186
|
-
lazy_attrs = list(_dynamic_imports.keys())
|
|
187
|
-
return sorted(lazy_attrs)
|
|
199
|
+
lazy_attrs = builtins.list(_dynamic_imports.keys())
|
|
200
|
+
return builtins.sorted(lazy_attrs)
|
|
@@ -17,6 +17,9 @@ T = TypeVar("T")
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
class EventStream(Generic[T]):
|
|
20
|
+
# Holds a reference to the SDK client to avoid it being garbage collected
|
|
21
|
+
# and cause termination of the underlying httpx client.
|
|
22
|
+
client_ref: Optional[object]
|
|
20
23
|
response: httpx.Response
|
|
21
24
|
generator: Generator[T, None, None]
|
|
22
25
|
|
|
@@ -25,9 +28,11 @@ class EventStream(Generic[T]):
|
|
|
25
28
|
response: httpx.Response,
|
|
26
29
|
decoder: Callable[[str], T],
|
|
27
30
|
sentinel: Optional[str] = None,
|
|
31
|
+
client_ref: Optional[object] = None,
|
|
28
32
|
):
|
|
29
33
|
self.response = response
|
|
30
34
|
self.generator = stream_events(response, decoder, sentinel)
|
|
35
|
+
self.client_ref = client_ref
|
|
31
36
|
|
|
32
37
|
def __iter__(self):
|
|
33
38
|
return self
|
|
@@ -43,6 +48,9 @@ class EventStream(Generic[T]):
|
|
|
43
48
|
|
|
44
49
|
|
|
45
50
|
class EventStreamAsync(Generic[T]):
|
|
51
|
+
# Holds a reference to the SDK client to avoid it being garbage collected
|
|
52
|
+
# and cause termination of the underlying httpx client.
|
|
53
|
+
client_ref: Optional[object]
|
|
46
54
|
response: httpx.Response
|
|
47
55
|
generator: AsyncGenerator[T, None]
|
|
48
56
|
|
|
@@ -51,9 +59,11 @@ class EventStreamAsync(Generic[T]):
|
|
|
51
59
|
response: httpx.Response,
|
|
52
60
|
decoder: Callable[[str], T],
|
|
53
61
|
sentinel: Optional[str] = None,
|
|
62
|
+
client_ref: Optional[object] = None,
|
|
54
63
|
):
|
|
55
64
|
self.response = response
|
|
56
65
|
self.generator = stream_events_async(response, decoder, sentinel)
|
|
66
|
+
self.client_ref = client_ref
|
|
57
67
|
|
|
58
68
|
def __aiter__(self):
|
|
59
69
|
return self
|
mistralai/utils/serializers.py
CHANGED
|
@@ -192,7 +192,9 @@ def is_union(obj: object) -> bool:
|
|
|
192
192
|
"""
|
|
193
193
|
Returns True if the given object is a typing.Union or typing_extensions.Union.
|
|
194
194
|
"""
|
|
195
|
-
return any(
|
|
195
|
+
return any(
|
|
196
|
+
obj is typing_obj for typing_obj in _get_typing_objects_by_name_of("Union")
|
|
197
|
+
)
|
|
196
198
|
|
|
197
199
|
|
|
198
200
|
def stream_to_text(stream: httpx.Response) -> str:
|
|
@@ -245,4 +247,3 @@ def _get_typing_objects_by_name_of(name: str) -> Tuple[Any, ...]:
|
|
|
245
247
|
f"Neither typing nor typing_extensions has an object called {name!r}"
|
|
246
248
|
)
|
|
247
249
|
return result
|
|
248
|
-
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from typing import Any, Optional
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from .serializers import unmarshal_json
|
|
8
|
+
from mistralai import models
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def unmarshal_json_response(
|
|
12
|
+
typ: Any, http_res: httpx.Response, body: Optional[str] = None
|
|
13
|
+
) -> Any:
|
|
14
|
+
if body is None:
|
|
15
|
+
body = http_res.text
|
|
16
|
+
try:
|
|
17
|
+
return unmarshal_json(body, typ)
|
|
18
|
+
except Exception as e:
|
|
19
|
+
raise models.ResponseValidationError(
|
|
20
|
+
"Response validation failed",
|
|
21
|
+
http_res,
|
|
22
|
+
e,
|
|
23
|
+
body,
|
|
24
|
+
) from e
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: mistralai
|
|
3
|
-
Version: 1.9.
|
|
3
|
+
Version: 1.9.11
|
|
4
4
|
Summary: Python Client SDK for the Mistral AI API.
|
|
5
|
+
License-File: LICENSE
|
|
5
6
|
Author: Mistral
|
|
6
7
|
Requires-Python: >=3.9
|
|
7
8
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -10,6 +11,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
10
11
|
Classifier: Programming Language :: Python :: 3.11
|
|
11
12
|
Classifier: Programming Language :: Python :: 3.12
|
|
12
13
|
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
13
15
|
Provides-Extra: agents
|
|
14
16
|
Provides-Extra: gcp
|
|
15
17
|
Requires-Dist: authlib (>=1.5.2,<2.0) ; extra == "agents"
|
|
@@ -87,7 +89,15 @@ Mistral AI API: Our Chat Completion and Embeddings APIs specification. Create yo
|
|
|
87
89
|
>
|
|
88
90
|
> Once a Python version reaches its [official end of life date](https://devguide.python.org/versions/), a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated.
|
|
89
91
|
|
|
90
|
-
The SDK can be installed with
|
|
92
|
+
The SDK can be installed with *uv*, *pip*, or *poetry* package managers.
|
|
93
|
+
|
|
94
|
+
### uv
|
|
95
|
+
|
|
96
|
+
*uv* is a fast Python package installer and resolver, designed as a drop-in replacement for pip and pip-tools. It's recommended for its speed and modern Python tooling capabilities.
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
uv add mistralai
|
|
100
|
+
```
|
|
91
101
|
|
|
92
102
|
### PIP
|
|
93
103
|
|
|
@@ -179,7 +189,7 @@ with Mistral(
|
|
|
179
189
|
|
|
180
190
|
</br>
|
|
181
191
|
|
|
182
|
-
The same SDK client can also be used to make
|
|
192
|
+
The same SDK client can also be used to make asynchronous requests by importing asyncio.
|
|
183
193
|
```python
|
|
184
194
|
# Asynchronous Example
|
|
185
195
|
import asyncio
|
|
@@ -230,7 +240,7 @@ with Mistral(
|
|
|
230
240
|
|
|
231
241
|
</br>
|
|
232
242
|
|
|
233
|
-
The same SDK client can also be used to make
|
|
243
|
+
The same SDK client can also be used to make asynchronous requests by importing asyncio.
|
|
234
244
|
```python
|
|
235
245
|
# Asynchronous Example
|
|
236
246
|
import asyncio
|
|
@@ -281,7 +291,7 @@ with Mistral(
|
|
|
281
291
|
|
|
282
292
|
</br>
|
|
283
293
|
|
|
284
|
-
The same SDK client can also be used to make
|
|
294
|
+
The same SDK client can also be used to make asynchronous requests by importing asyncio.
|
|
285
295
|
```python
|
|
286
296
|
# Asynchronous Example
|
|
287
297
|
import asyncio
|
|
@@ -332,7 +342,7 @@ with Mistral(
|
|
|
332
342
|
|
|
333
343
|
</br>
|
|
334
344
|
|
|
335
|
-
The same SDK client can also be used to make
|
|
345
|
+
The same SDK client can also be used to make asynchronous requests by importing asyncio.
|
|
336
346
|
```python
|
|
337
347
|
# Asynchronous Example
|
|
338
348
|
import asyncio
|
|
@@ -709,27 +719,20 @@ with Mistral(
|
|
|
709
719
|
<!-- Start Error Handling [errors] -->
|
|
710
720
|
## Error Handling
|
|
711
721
|
|
|
712
|
-
|
|
722
|
+
[`MistralError`](https://github.com/mistralai/client-python/blob/master/./src/mistralai/models/mistralerror.py) is the base class for all HTTP error responses. It has the following properties:
|
|
713
723
|
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
|
717
|
-
|
|
718
|
-
|
|
|
719
|
-
|
|
|
720
|
-
|
|
|
721
|
-
|
|
|
722
|
-
|
|
723
|
-
When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `list_async` method may raise the following exceptions:
|
|
724
|
-
|
|
725
|
-
| Error Type | Status Code | Content Type |
|
|
726
|
-
| -------------------------- | ----------- | ---------------- |
|
|
727
|
-
| models.HTTPValidationError | 422 | application/json |
|
|
728
|
-
| models.SDKError | 4XX, 5XX | \*/\* |
|
|
724
|
+
| Property | Type | Description |
|
|
725
|
+
| ------------------ | ---------------- | --------------------------------------------------------------------------------------- |
|
|
726
|
+
| `err.message` | `str` | Error message |
|
|
727
|
+
| `err.status_code` | `int` | HTTP response status code eg `404` |
|
|
728
|
+
| `err.headers` | `httpx.Headers` | HTTP response headers |
|
|
729
|
+
| `err.body` | `str` | HTTP body. Can be empty string if no body is returned. |
|
|
730
|
+
| `err.raw_response` | `httpx.Response` | Raw HTTP response |
|
|
731
|
+
| `err.data` | | Optional. Some errors may contain structured data. [See Error Classes](https://github.com/mistralai/client-python/blob/master/#error-classes). |
|
|
729
732
|
|
|
730
733
|
### Example
|
|
731
|
-
|
|
732
734
|
```python
|
|
735
|
+
import mistralai
|
|
733
736
|
from mistralai import Mistral, models
|
|
734
737
|
import os
|
|
735
738
|
|
|
@@ -745,13 +748,41 @@ with Mistral(
|
|
|
745
748
|
# Handle response
|
|
746
749
|
print(res)
|
|
747
750
|
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
751
|
+
|
|
752
|
+
except models.MistralError as e:
|
|
753
|
+
# The base class for HTTP error responses
|
|
754
|
+
print(e.message)
|
|
755
|
+
print(e.status_code)
|
|
756
|
+
print(e.body)
|
|
757
|
+
print(e.headers)
|
|
758
|
+
print(e.raw_response)
|
|
759
|
+
|
|
760
|
+
# Depending on the method different errors may be thrown
|
|
761
|
+
if isinstance(e, models.HTTPValidationError):
|
|
762
|
+
print(e.data.detail) # Optional[List[mistralai.ValidationError]]
|
|
754
763
|
```
|
|
764
|
+
|
|
765
|
+
### Error Classes
|
|
766
|
+
**Primary error:**
|
|
767
|
+
* [`MistralError`](https://github.com/mistralai/client-python/blob/master/./src/mistralai/models/mistralerror.py): The base class for HTTP error responses.
|
|
768
|
+
|
|
769
|
+
<details><summary>Less common errors (6)</summary>
|
|
770
|
+
|
|
771
|
+
<br />
|
|
772
|
+
|
|
773
|
+
**Network errors:**
|
|
774
|
+
* [`httpx.RequestError`](https://www.python-httpx.org/exceptions/#httpx.RequestError): Base class for request errors.
|
|
775
|
+
* [`httpx.ConnectError`](https://www.python-httpx.org/exceptions/#httpx.ConnectError): HTTP client was unable to make a request to a server.
|
|
776
|
+
* [`httpx.TimeoutException`](https://www.python-httpx.org/exceptions/#httpx.TimeoutException): HTTP request timed out.
|
|
777
|
+
|
|
778
|
+
|
|
779
|
+
**Inherit from [`MistralError`](https://github.com/mistralai/client-python/blob/master/./src/mistralai/models/mistralerror.py)**:
|
|
780
|
+
* [`HTTPValidationError`](https://github.com/mistralai/client-python/blob/master/./src/mistralai/models/httpvalidationerror.py): Validation Error. Status code `422`. Applicable to 47 of 68 methods.*
|
|
781
|
+
* [`ResponseValidationError`](https://github.com/mistralai/client-python/blob/master/./src/mistralai/models/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute.
|
|
782
|
+
|
|
783
|
+
</details>
|
|
784
|
+
|
|
785
|
+
\* Check [the method documentation](https://github.com/mistralai/client-python/blob/master/#available-resources-and-operations) to see if the error is applicable.
|
|
755
786
|
<!-- End Error Handling [errors] -->
|
|
756
787
|
|
|
757
788
|
<!-- Start Server Selection [server] -->
|
|
@@ -150,20 +150,20 @@ mistralai/_hooks/deprecation_warning.py,sha256=eyEOf7-o9uqqNWJnufD2RXp3dYrGV4in9
|
|
|
150
150
|
mistralai/_hooks/registration.py,sha256=ML0W-XbE4WYdJ4eGks_XxF2aLCJTaIWjQATFGzFwvyU,861
|
|
151
151
|
mistralai/_hooks/sdkhooks.py,sha256=s-orhdvnV89TmI3QiPC2LWQtYeM9RrsG1CTll-fYZmQ,2559
|
|
152
152
|
mistralai/_hooks/types.py,sha256=70IiFr5bfsJYafuDkXQWVfl6nY4dQkA5SZoEBCircqs,3047
|
|
153
|
-
mistralai/_version.py,sha256=
|
|
154
|
-
mistralai/accesses.py,sha256=
|
|
155
|
-
mistralai/agents.py,sha256=
|
|
153
|
+
mistralai/_version.py,sha256=8kc5k7W235peyQAaPdBdv4GxQ-luYP6Y_KQ48jCfekU,464
|
|
154
|
+
mistralai/accesses.py,sha256=UR0B7oDj9V_Cwjr2Gdsd2tOxn-F-6JNt7k6oQKqnVZE,25152
|
|
155
|
+
mistralai/agents.py,sha256=BecOIccxvDAACJHiSfMgp9M2IlLyqcV7qDkTDkm2MQM,32822
|
|
156
156
|
mistralai/async_client.py,sha256=KUdYxIIqoD6L7vB0EGwUR6lQ0NK5iCTHjnLVR9CVcJY,355
|
|
157
|
-
mistralai/audio.py,sha256=
|
|
158
|
-
mistralai/basesdk.py,sha256=
|
|
159
|
-
mistralai/batch.py,sha256=
|
|
160
|
-
mistralai/beta.py,sha256=
|
|
161
|
-
mistralai/chat.py,sha256=
|
|
162
|
-
mistralai/classifiers.py,sha256=
|
|
157
|
+
mistralai/audio.py,sha256=lcY7rl0YcXURe4q6tz4tufmnBQ_6ONRwyxSDDJCRowM,724
|
|
158
|
+
mistralai/basesdk.py,sha256=Zs5Gsl2V1rMClCUi7UYBVKigeontRyDo_tkqUj8Zdww,12194
|
|
159
|
+
mistralai/batch.py,sha256=wHfwQYrnxpEK5sbyhx8LjPYU9k7x_6osn_g1DSQma4Q,631
|
|
160
|
+
mistralai/beta.py,sha256=PeJFa12AW777S2B3h3Cc8ia_0pYW97_R7GmTA5TSnIQ,1178
|
|
161
|
+
mistralai/chat.py,sha256=jO4GTk-qhYXg1Tb9mThJACKNMNlGnZheUNo3c2EIiiI,40719
|
|
162
|
+
mistralai/classifiers.py,sha256=x1gYwzatFuT4HJc4qgYkTMvfAfcQ8E_FpKQ3RCD4TJk,31236
|
|
163
163
|
mistralai/client.py,sha256=hrPg-LciKMKiascF0WbRRmqQyCv1lb2yDh6j-aaKVNo,509
|
|
164
|
-
mistralai/conversations.py,sha256=
|
|
165
|
-
mistralai/documents.py,sha256=
|
|
166
|
-
mistralai/embeddings.py,sha256=
|
|
164
|
+
mistralai/conversations.py,sha256=cvhyBpZFmu3a4TKC63-IUBfEl3C8uPfFXJ4wPuwvvfc,104286
|
|
165
|
+
mistralai/documents.py,sha256=HmNqKlNipj_W4y_9oeRCTkv-bOZ50ZfENbxhPV29baw,78367
|
|
166
|
+
mistralai/embeddings.py,sha256=VjbCQD_XJINh7LzID0_hUfhjarapf8Lyke0zHGDd3Ag,8964
|
|
167
167
|
mistralai/extra/README.md,sha256=BTS9fy0ijkiUP7ZVoFQ7FVBxHtXIXqucYZyy_ucFjo4,1739
|
|
168
168
|
mistralai/extra/__init__.py,sha256=8DsU_omYYadqcwlmBOoakBwkWKcSohwLmtB8v-jkn2M,392
|
|
169
169
|
mistralai/extra/exceptions.py,sha256=4EEygCfdsniYiroHEFVSVDqerQZkpRG027mlJXvMqns,428
|
|
@@ -184,15 +184,15 @@ mistralai/extra/tests/test_utils.py,sha256=VesGDR_IiE6u0iY7yOi1iERd7esdJgi2aL4xZ
|
|
|
184
184
|
mistralai/extra/utils/__init__.py,sha256=SExo5t_hx0ybiQhVJIG3r3hOA-Pfny3lIO_WsqNXlN8,116
|
|
185
185
|
mistralai/extra/utils/_pydantic_helper.py,sha256=_mzrbZGU07M96CzcxgjcV25NtIGu5EUfotaN8NDUoFc,883
|
|
186
186
|
mistralai/extra/utils/response_format.py,sha256=uDNpvOHhk2se3JTXweWYMbnkyOcOqhMe2yxZ2lYNe1k,913
|
|
187
|
-
mistralai/files.py,sha256=
|
|
188
|
-
mistralai/fim.py,sha256=
|
|
189
|
-
mistralai/fine_tuning.py,sha256=
|
|
187
|
+
mistralai/files.py,sha256=mbN6gwQdXh0kNslvE6YKLt8K3w3F_ZiNVC8P4BReMp4,42035
|
|
188
|
+
mistralai/fim.py,sha256=YwkRwUj7P1Tww8OJeRwVMzzy9kyh1sFqiZkRCqbd64Q,26985
|
|
189
|
+
mistralai/fine_tuning.py,sha256=0f6Yq0h3bRvQq7NI6M7TpnRkLcXZOqEFf2qS0XE9TbU,607
|
|
190
190
|
mistralai/httpclient.py,sha256=Eu73urOAiZQtdUIyOUnPccxCiBbWEKrXG-JrRG3SLM4,3946
|
|
191
|
-
mistralai/jobs.py,sha256=
|
|
192
|
-
mistralai/libraries.py,sha256=
|
|
193
|
-
mistralai/mistral_agents.py,sha256=
|
|
194
|
-
mistralai/mistral_jobs.py,sha256=
|
|
195
|
-
mistralai/models/__init__.py,sha256=
|
|
191
|
+
mistralai/jobs.py,sha256=o962f9AgS7RxlRGuY74VOs8eHczCz1WwfAzfNDJhbTo,43543
|
|
192
|
+
mistralai/libraries.py,sha256=57IjAilAQU7eKvyWQsH442nsGPA5iGhZf8b3J0hJGuE,37530
|
|
193
|
+
mistralai/mistral_agents.py,sha256=MV3dHNOWlh3Ccxd7Xxx6pq0tl68rnbyiSXmEf5sk5XA,42379
|
|
194
|
+
mistralai/mistral_jobs.py,sha256=Md7D2j2kL9cPAyfsX5NHijxbojzQz55Vfxd3O50O600,29022
|
|
195
|
+
mistralai/models/__init__.py,sha256=zTho_orLtrxI0uiuG8ai_QxsPNUFJLb43XrDkMml_Rs,98200
|
|
196
196
|
mistralai/models/agent.py,sha256=kM3lPW08V5B3CfBuIFZrEYAyClECj0Ial7-cQztfGmA,4191
|
|
197
197
|
mistralai/models/agentconversation.py,sha256=-vqTZ116MNx4JRs9N6cabsGXn4tILg_JP3JcL-iJpK0,2092
|
|
198
198
|
mistralai/models/agentcreationrequest.py,sha256=VdCCQEnBVfZU2m1EtRy5vEm_zsPIGPGLF21TXKjOm7E,3958
|
|
@@ -312,7 +312,7 @@ mistralai/models/functionresultentry.py,sha256=sw-E0j_bQgQo2KdmzL4KHoGfo1LUYcHaq
|
|
|
312
312
|
mistralai/models/functiontool.py,sha256=dtVRauH6JGbvOeaFnWjxjDS0h2jbZbnmIQEGx3CczvU,548
|
|
313
313
|
mistralai/models/githubrepositoryin.py,sha256=wCo1N8F69CSQu_5tP1XQHYmJ093K7LIAcXTD1xQVgP8,1708
|
|
314
314
|
mistralai/models/githubrepositoryout.py,sha256=vTiNoCE62eF0rfg-259UWJZJC7uZK-tSwlDp6i4IYs0,1721
|
|
315
|
-
mistralai/models/httpvalidationerror.py,sha256=
|
|
315
|
+
mistralai/models/httpvalidationerror.py,sha256=YU4h-8UXELg43sbuNOQ7s8t4sQ65JfqdUKBSV8qBP2A,728
|
|
316
316
|
mistralai/models/imagegenerationtool.py,sha256=VCN82DgLJm9ZwvxYsOfRW8WzBAcSoEy2hB823BsPFqg,493
|
|
317
317
|
mistralai/models/imageurl.py,sha256=9ItYx55HH71XsElJVt7kuVfGJ4YvcTNUDKank8-r9h8,1371
|
|
318
318
|
mistralai/models/imageurlchunk.py,sha256=yHgdAi_jOw-e5aXd4Dlr7YCtJcyw-W3QYol8-MAAT1Y,994
|
|
@@ -365,12 +365,14 @@ mistralai/models/messageoutputcontentchunks.py,sha256=dlnavt4P-mTTYdb80ovuF6cRhv
|
|
|
365
365
|
mistralai/models/messageoutputentry.py,sha256=KyhPyXMm1pizXP9QQVFofOoUYOf5AvzXMb37wHVeebI,2942
|
|
366
366
|
mistralai/models/messageoutputevent.py,sha256=5iEtdssMYt27kgobk5SrfTaYE3BrmeDj8sCZtdhqEHg,2715
|
|
367
367
|
mistralai/models/metricout.py,sha256=dMSDFB4CnYIADYLDcKs3rUrDtOhyRVs8ClKr7uu5yrs,2040
|
|
368
|
+
mistralai/models/mistralerror.py,sha256=F2ghCuhQHNl09p4NwXd8XsX8uBhjTfWtavKkefqMEl4,714
|
|
368
369
|
mistralai/models/mistralpromptmode.py,sha256=v0UKuu6N0kcM_gjy3C7pVUWBs9tuMKtbHG6nLF9jtoI,253
|
|
369
370
|
mistralai/models/modelcapabilities.py,sha256=FpZZfrk7fg49y3SUinTT1kNOg9ikN6adHobzPiHmJeE,785
|
|
370
371
|
mistralai/models/modelconversation.py,sha256=6_QmpwiY5pfA8dtSF2ZenuAGEZTJSCRr07fe7y2JIYM,4443
|
|
371
372
|
mistralai/models/modellist.py,sha256=D4Y784kQkx0ARhofFrpEqGLfxa-jTY8ev0TQMrD_n8I,995
|
|
372
373
|
mistralai/models/moderationobject.py,sha256=mmzFEcccsT7G9PjmQrsYMijmICbfBtUpVN_ZisuhYbY,655
|
|
373
374
|
mistralai/models/moderationresponse.py,sha256=kxIRI3UJdddj2Hz-E9q21gKQAbacxZoG4hdoZjrae5M,508
|
|
375
|
+
mistralai/models/no_response_error.py,sha256=FQG44Lq6uF7uUlzbUYfM3dJon6sbqXzJ0Ri6YrDdsEs,380
|
|
374
376
|
mistralai/models/ocrimageobject.py,sha256=bIYt82TlTbDSavxM9UWuTmeqhha130v1CJyhUGlDHls,2808
|
|
375
377
|
mistralai/models/ocrpagedimensions.py,sha256=oP4v80I8d6ZELSZt6cRoECd6uIONgdyCeeFalm-4OvM,609
|
|
376
378
|
mistralai/models/ocrpageobject.py,sha256=eu24xe_wLyDlOg0cKIB6zUZTy_FkTTsc7QtxlJINaBI,2091
|
|
@@ -387,10 +389,11 @@ mistralai/models/responseerrorevent.py,sha256=JUlo0JopINhAjKeWDjTBR_ZyxE4IgvZ2uD
|
|
|
387
389
|
mistralai/models/responseformat.py,sha256=c3b40GwpVfZ4qUSyZ11-FuMpISR0WCQfuRMw-t6Rwuc,2231
|
|
388
390
|
mistralai/models/responseformats.py,sha256=O9lwS2M9m53DsRxTC4uRP12SvRhgaQoMjIYsDys5A7s,503
|
|
389
391
|
mistralai/models/responsestartedevent.py,sha256=1VJl_4F5yIpbrX8GwVq6vYxjDFeTf4OdYhqKpQy1r4M,686
|
|
392
|
+
mistralai/models/responsevalidationerror.py,sha256=OgoN-0zwRiM6bIoeiJkWaw7_KSXiSam0Y1uNLofIar0,690
|
|
390
393
|
mistralai/models/retrieve_model_v1_models_model_id_getop.py,sha256=N9_JFwiz9tz4zRXJ9c1V0c_anFEVxVzPDoFt2Wrer4M,1388
|
|
391
394
|
mistralai/models/retrievefileout.py,sha256=syXoAJmsXmqMsfkDTApAtAOM7vosHC5PDDwvw29gtKs,2874
|
|
392
395
|
mistralai/models/sampletype.py,sha256=zowUiTFxum8fltBs6j__BrFPio-dQdG0CIyLj-5icG8,316
|
|
393
|
-
mistralai/models/sdkerror.py,sha256=
|
|
396
|
+
mistralai/models/sdkerror.py,sha256=ZmVtaBozTibV_ZlXDv5152XRXeuYkZ_CMHjPpUthyt4,1223
|
|
394
397
|
mistralai/models/security.py,sha256=RQn-xHLq3q4OEzrx9BcJMuT49UaCvwABXrqBEcqyKmA,686
|
|
395
398
|
mistralai/models/shareenum.py,sha256=PM_tFgsuqLfKszNopSSAOtzUuMsmBhlJ8Py41UPXcYo,252
|
|
396
399
|
mistralai/models/sharingdelete.py,sha256=Wi9l3y-fWtT4y7vXPRIaJGI6yd583Qu8yPTHBLzHyMg,888
|
|
@@ -434,19 +437,19 @@ mistralai/models/wandbintegration.py,sha256=PbDvTC7hrS8u3mkYQlvzCFilDZdTtkCrKWlX
|
|
|
434
437
|
mistralai/models/wandbintegrationout.py,sha256=nDVAi7dismF5ktEBaEM8A8QsAtOVR0ReblTxF0_VWtg,2117
|
|
435
438
|
mistralai/models/websearchpremiumtool.py,sha256=wU3_oOKRWFLOXrZ-SrqAnGC7kb5uaSjLaTfUthuFoLY,502
|
|
436
439
|
mistralai/models/websearchtool.py,sha256=qpzzCo_nJunxRHlkwJE3vuEd-qPA_cW1X55qEXw3_KY,451
|
|
437
|
-
mistralai/models_.py,sha256=
|
|
438
|
-
mistralai/ocr.py,sha256=
|
|
440
|
+
mistralai/models_.py,sha256=942X1fagASW-5QHEQwWal4dN9af5DYSieNctAvISlw4,42510
|
|
441
|
+
mistralai/ocr.py,sha256=GKm8TqmwtdexRuctFy0EuhMwWXcOk1vA50UF9BbbyBk,11413
|
|
439
442
|
mistralai/py.typed,sha256=zrp19r0G21lr2yRiMC0f8MFkQFGj9wMpSbboePMg8KM,59
|
|
440
|
-
mistralai/sdk.py,sha256=
|
|
443
|
+
mistralai/sdk.py,sha256=1LlWK-8IIuN3-L103AC1OsNYRXG-sP1hRijxhuMf6q0,8324
|
|
441
444
|
mistralai/sdkconfiguration.py,sha256=8BDzcYQqDIM7pXsdsfmEZPUexeqdsL-8HMyhWiQeupE,1716
|
|
442
|
-
mistralai/transcriptions.py,sha256=
|
|
445
|
+
mistralai/transcriptions.py,sha256=GjyoxWd40S-sOu-suO0fPulGwfQQqTVuA-EHcWaHpFY,18478
|
|
443
446
|
mistralai/types/__init__.py,sha256=RArOwSgeeTIva6h-4ttjXwMUeCkz10nAFBL9D-QljI4,377
|
|
444
447
|
mistralai/types/basemodel.py,sha256=L79WXvTECbSqaJzs8D3ud_KdIWkU7Cx2wbohDAktE9E,1127
|
|
445
|
-
mistralai/utils/__init__.py,sha256=
|
|
448
|
+
mistralai/utils/__init__.py,sha256=CAG0O76aEToGKXpT6Ft87Vd-iiQTh4XdBrQ37BVbsiM,5861
|
|
446
449
|
mistralai/utils/annotations.py,sha256=aR7mZG34FzgRdew7WZPYEu9QGBerpuKxCF4sek5Z_5Y,1699
|
|
447
450
|
mistralai/utils/datetimes.py,sha256=oppAA5e3V35pQov1-FNLKxAaNF1_XWi-bQtyjjql3H8,855
|
|
448
451
|
mistralai/utils/enums.py,sha256=REU6ydF8gsVL3xaeGX4sMNyiL3q5P9h29-f6Sa6luAE,2633
|
|
449
|
-
mistralai/utils/eventstreaming.py,sha256=
|
|
452
|
+
mistralai/utils/eventstreaming.py,sha256=SgFqMcUOYKlrTQ4gAp_dNcKLvDXukeiEMNU3DP8mXk8,6692
|
|
450
453
|
mistralai/utils/forms.py,sha256=EJdnrfIkuwpDtekyHutla0HjI_FypTYcmYNyPKEu_W0,6874
|
|
451
454
|
mistralai/utils/headers.py,sha256=cPxWSmUILrefTGDzTH1Hdj7_Hlsj-EY6K5Tyc4iH4dk,3663
|
|
452
455
|
mistralai/utils/logger.py,sha256=TOF0Mqsua4GlsDhmrZz9hgMRvwd9zK7ytuqly3Vevxo,675
|
|
@@ -455,10 +458,11 @@ mistralai/utils/queryparams.py,sha256=MTK6inMS1_WwjmMJEJmAn67tSHHJyarpdGRlorRHEt
|
|
|
455
458
|
mistralai/utils/requestbodies.py,sha256=ySjEyjcLi731LNUahWvLOrES2HihuA8VrOJx4eQ7Qzg,2101
|
|
456
459
|
mistralai/utils/retries.py,sha256=6yhfZifqIat9i76xF0lTR2jLj1IN9BNGyqqxATlEFPU,6348
|
|
457
460
|
mistralai/utils/security.py,sha256=vWlpkikOnGN_HRRhJ7Pb8ywVAjiM3d3ey3oTWtM6jTU,6008
|
|
458
|
-
mistralai/utils/serializers.py,sha256=
|
|
461
|
+
mistralai/utils/serializers.py,sha256=Hndks5M_rJXVub_N5lu0gKZQUoEmWrn6PN7R-0HwvOE,5999
|
|
462
|
+
mistralai/utils/unmarshal_json_response.py,sha256=mCQ2G9mE9432ExbhO1PleywDN3UYOPW2exzcJX22gCM,585
|
|
459
463
|
mistralai/utils/url.py,sha256=BgGPgcTA6MRK4bF8fjP2dUopN3NzEzxWMXPBVg8NQUA,5254
|
|
460
464
|
mistralai/utils/values.py,sha256=CcaCXEa3xHhkUDROyXZocN8f0bdITftv9Y0P9lTf0YM,3517
|
|
461
|
-
mistralai-1.9.
|
|
462
|
-
mistralai-1.9.
|
|
463
|
-
mistralai-1.9.
|
|
464
|
-
mistralai-1.9.
|
|
465
|
+
mistralai-1.9.11.dist-info/METADATA,sha256=K3HcQ7s3RTwMTqLnCNoMcKJic1xnPxF7ddwYTOWtSOU,39370
|
|
466
|
+
mistralai-1.9.11.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
467
|
+
mistralai-1.9.11.dist-info/licenses/LICENSE,sha256=rUtQ_9GD0OyLPlb-2uWVdfE87hzudMRmsW-tS-0DK-0,11340
|
|
468
|
+
mistralai-1.9.11.dist-info/RECORD,,
|
|
File without changes
|