You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+57-28Lines changed: 57 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,15 @@ Mistral AI API: Our Chat Completion and Embeddings APIs specification. Create yo
58
58
>
59
59
> 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.
60
60
61
-
The SDK can be installed with either *pip* or *poetry* package managers.
61
+
The SDK can be installed with *uv*, *pip*, or *poetry* package managers.
62
+
63
+
### uv
64
+
65
+
*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.
66
+
67
+
```bash
68
+
uv add mistralai
69
+
```
62
70
63
71
### PIP
64
72
@@ -150,7 +158,7 @@ with Mistral(
150
158
151
159
</br>
152
160
153
-
The same SDK client can also be used to make asychronous requests by importing asyncio.
161
+
The same SDK client can also be used to make asynchronous requests by importing asyncio.
154
162
```python
155
163
# Asynchronous Example
156
164
import asyncio
@@ -201,7 +209,7 @@ with Mistral(
201
209
202
210
</br>
203
211
204
-
The same SDK client can also be used to make asychronous requests by importing asyncio.
212
+
The same SDK client can also be used to make asynchronous requests by importing asyncio.
205
213
```python
206
214
# Asynchronous Example
207
215
import asyncio
@@ -252,7 +260,7 @@ with Mistral(
252
260
253
261
</br>
254
262
255
-
The same SDK client can also be used to make asychronous requests by importing asyncio.
263
+
The same SDK client can also be used to make asynchronous requests by importing asyncio.
256
264
```python
257
265
# Asynchronous Example
258
266
import asyncio
@@ -303,7 +311,7 @@ with Mistral(
303
311
304
312
</br>
305
313
306
-
The same SDK client can also be used to make asychronous requests by importing asyncio.
314
+
The same SDK client can also be used to make asynchronous requests by importing asyncio.
307
315
```python
308
316
# Asynchronous Example
309
317
import asyncio
@@ -680,27 +688,20 @@ with Mistral(
680
688
<!-- Start Error Handling [errors] -->
681
689
## Error Handling
682
690
683
-
Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception.
691
+
[`MistralError`](./src/mistralai/models/mistralerror.py) is the base class for all HTTP error responses. It has the following properties:
684
692
685
-
By default, an API error will raise a models.SDKError exception, which has the following properties:
|`.raw_response`|*httpx.Response*| The raw HTTP response |
692
-
|`.body`|*str*| The response content |
693
-
694
-
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:
**Inherit from [`MistralError`](./src/mistralai/models/mistralerror.py)**:
749
+
*[`HTTPValidationError`](./src/mistralai/models/httpvalidationerror.py): Validation Error. Status code `422`. Applicable to 47 of 68 methods.*
750
+
*[`ResponseValidationError`](./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.
751
+
752
+
</details>
753
+
754
+
\* Check [the method documentation](#available-resources-and-operations) to see if the error is applicable.
0 commit comments