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
Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type.
546
+
Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception.
547
+
548
+
By default, an API error will raise a models.SDKError exception, which has the following properties:
|`.raw_response`|*httpx.Response*| The raw HTTP response |
555
+
|`.body`|*str*| The response content |
556
+
557
+
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:
You can override the default server globally by passing a server name to the `server: str` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers:
522
597
523
-
| Name | Server| Variables |
524
-
| ------|------------------------ | --------- |
525
-
|`prod`|`https://api.mistral.ai`| None|
598
+
| Name | Server | Variables |
599
+
| ----- | ------ | --------- |
600
+
|`eu`|`https://api.mistral.ai`| None |
526
601
527
602
#### Example
528
603
@@ -531,7 +606,7 @@ from mistralai import Mistral
531
606
import os
532
607
533
608
s = Mistral(
534
-
server="prod",
609
+
server="eu",
535
610
api_key=os.getenv("MISTRAL_API_KEY", ""),
536
611
)
537
612
@@ -653,9 +728,9 @@ s = Mistral(async_client=CustomClient(httpx.AsyncClient()))
653
728
654
729
This SDK supports the following security scheme globally:
0 commit comments