Skip to content

Commit 681e057

Browse files
committed
Update Speakeasy SDKs to version 1.580.2
Targets updated: mistralai-sdk This PR was automatically generated by the Update Speakeasy workflow.
1 parent 0ed803d commit 681e057

30 files changed

+1051
-2376
lines changed

.speakeasy/gen.lock

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ id: 2d045ec7-2ebb-4f4d-ad25-40953b132161
33
management:
44
docChecksum: c33c788946fa446bfcf90b60f68abde9
55
docVersion: 1.0.0
6-
speakeasyVersion: 1.568.2
7-
generationVersion: 2.634.2
6+
speakeasyVersion: 1.580.2
7+
generationVersion: 2.656.5
88
releaseVersion: 1.9.3
99
configChecksum: 0f65a9bdd8df5ae03eaaaea3ab055bf1
1010
repoURL: https://github.com/mistralai/client-python.git
@@ -15,13 +15,13 @@ features:
1515
additionalDependencies: 1.0.0
1616
additionalProperties: 1.0.1
1717
constsAndDefaults: 1.0.5
18-
core: 5.19.3
18+
core: 5.19.4
1919
customCodeRegions: 0.1.1
2020
defaultEnabledRetries: 0.2.0
2121
downloadStreams: 1.0.1
2222
enumUnions: 0.1.0
2323
envVarSecurityUsage: 0.3.2
24-
examples: 3.0.1
24+
examples: 3.0.2
2525
flatRequests: 1.0.1
2626
flattening: 3.1.1
2727
globalSecurity: 3.0.3
@@ -43,7 +43,6 @@ features:
4343
uploadStreams: 1.0.0
4444
generatedFiles:
4545
- .gitattributes
46-
- .python-version
4746
- .vscode/settings.json
4847
- USAGE.md
4948
- docs/models/agent.md
@@ -663,12 +662,14 @@ generatedFiles:
663662
- src/mistralai/models/messageoutputentry.py
664663
- src/mistralai/models/messageoutputevent.py
665664
- src/mistralai/models/metricout.py
665+
- src/mistralai/models/mistralerror.py
666666
- src/mistralai/models/mistralpromptmode.py
667667
- src/mistralai/models/modelcapabilities.py
668668
- src/mistralai/models/modelconversation.py
669669
- src/mistralai/models/modellist.py
670670
- src/mistralai/models/moderationobject.py
671671
- src/mistralai/models/moderationresponse.py
672+
- src/mistralai/models/no_response_error.py
672673
- src/mistralai/models/ocrimageobject.py
673674
- src/mistralai/models/ocrpagedimensions.py
674675
- src/mistralai/models/ocrpageobject.py
@@ -685,6 +686,7 @@ generatedFiles:
685686
- src/mistralai/models/responseformat.py
686687
- src/mistralai/models/responseformats.py
687688
- src/mistralai/models/responsestartedevent.py
689+
- src/mistralai/models/responsevalidationerror.py
688690
- src/mistralai/models/retrieve_model_v1_models_model_id_getop.py
689691
- src/mistralai/models/retrievefileout.py
690692
- src/mistralai/models/sampletype.py
@@ -753,6 +755,7 @@ generatedFiles:
753755
- src/mistralai/utils/retries.py
754756
- src/mistralai/utils/security.py
755757
- src/mistralai/utils/serializers.py
758+
- src/mistralai/utils/unmarshal_json_response.py
756759
- src/mistralai/utils/url.py
757760
- src/mistralai/utils/values.py
758761
examples:

.speakeasy/workflow.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
speakeasyVersion: 1.568.2
1+
speakeasyVersion: 1.580.2
22
sources:
33
mistral-azure-source:
44
sourceNamespace: mistral-openapi-azure
@@ -18,7 +18,7 @@ sources:
1818
sourceBlobDigest: sha256:f3322d8a44d0bf1515b5c1c078525dbf00ff90e6110644de4c03b0b0e9050350
1919
tags:
2020
- latest
21-
- speakeasy-sdk-regen-1753290410
21+
- amenasria-speakeasy-update-workflow-fix
2222
targets:
2323
mistralai-azure-sdk:
2424
source: mistral-azure-source
@@ -40,20 +40,20 @@ targets:
4040
sourceRevisionDigest: sha256:22d8044215dc1331ba83f3d25598409bc82fdc04d68033fb05e0133a13cc4dad
4141
sourceBlobDigest: sha256:f3322d8a44d0bf1515b5c1c078525dbf00ff90e6110644de4c03b0b0e9050350
4242
codeSamplesNamespace: mistral-openapi-code-samples
43-
codeSamplesRevisionDigest: sha256:1fd9897fdd851557c592b8fd46232518359401d15a6574933c43be63ec2edb53
43+
codeSamplesRevisionDigest: sha256:ba0a715b345192c3916d059210df9c83205018f4c1f6919e7d75f3f7172c8fa4
4444
workflow:
4545
workflowVersion: 1.0.0
46-
speakeasyVersion: 1.568.2
46+
speakeasyVersion: 1.580.2
4747
sources:
4848
mistral-azure-source:
4949
inputs:
50-
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:main
50+
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:sha256:c5931a7e0cc2db844149d71db57dfc2178665f0400bc26c90ee113795ea2872f
5151
mistral-google-cloud-source:
5252
inputs:
53-
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:main
53+
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:sha256:4a5343e63c6a78152e472b00ccc46d7bcb15594496bc94c8040039d3a9d4c5f8
5454
mistral-openapi:
5555
inputs:
56-
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:main
56+
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:sha256:22d8044215dc1331ba83f3d25598409bc82fdc04d68033fb05e0133a13cc4dad
5757
targets:
5858
mistralai-azure-sdk:
5959
target: python

.speakeasy/workflow.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
workflowVersion: 1.0.0
2-
speakeasyVersion: 1.568.2
2+
speakeasyVersion: 1.580.2
33
sources:
44
mistral-azure-source:
55
inputs:

README.md

Lines changed: 44 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -680,27 +680,20 @@ with Mistral(
680680
<!-- Start Error Handling [errors] -->
681681
## Error Handling
682682

683-
Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception.
683+
[`MistralError`](./src/mistralai/models/mistralerror.py) is the base class for all HTTP error responses. It has the following properties:
684684

685-
By default, an API error will raise a models.SDKError exception, which has the following properties:
686-
687-
| Property | Type | Description |
688-
|-----------------|------------------|-----------------------|
689-
| `.status_code` | *int* | The HTTP status code |
690-
| `.message` | *str* | The error message |
691-
| `.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:
695-
696-
| Error Type | Status Code | Content Type |
697-
| -------------------------- | ----------- | ---------------- |
698-
| models.HTTPValidationError | 422 | application/json |
699-
| models.SDKError | 4XX, 5XX | \*/\* |
685+
| Property | Type | Description |
686+
| ------------------ | ---------------- | --------------------------------------------------------------------------------------- |
687+
| `err.message` | `str` | Error message |
688+
| `err.status_code` | `int` | HTTP response status code eg `404` |
689+
| `err.headers` | `httpx.Headers` | HTTP response headers |
690+
| `err.body` | `str` | HTTP body. Can be empty string if no body is returned. |
691+
| `err.raw_response` | `httpx.Response` | Raw HTTP response |
692+
| `err.data` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |
700693

701694
### Example
702-
703695
```python
696+
import mistralai
704697
from mistralai import Mistral, models
705698
import os
706699

@@ -716,13 +709,41 @@ with Mistral(
716709
# Handle response
717710
print(res)
718711

719-
except models.HTTPValidationError as e:
720-
# handle e.data: models.HTTPValidationErrorData
721-
raise(e)
722-
except models.SDKError as e:
723-
# handle exception
724-
raise(e)
712+
713+
except models.MistralError as e:
714+
# The base class for HTTP error responses
715+
print(e.message)
716+
print(e.status_code)
717+
print(e.body)
718+
print(e.headers)
719+
print(e.raw_response)
720+
721+
# Depending on the method different errors may be thrown
722+
if isinstance(e, models.HTTPValidationError):
723+
print(e.data.detail) # Optional[List[mistralai.ValidationError]]
725724
```
725+
726+
### Error Classes
727+
**Primary error:**
728+
* [`MistralError`](./src/mistralai/models/mistralerror.py): The base class for HTTP error responses.
729+
730+
<details><summary>Less common errors (6)</summary>
731+
732+
<br />
733+
734+
**Network errors:**
735+
* [`httpx.RequestError`](https://www.python-httpx.org/exceptions/#httpx.RequestError): Base class for request errors.
736+
* [`httpx.ConnectError`](https://www.python-httpx.org/exceptions/#httpx.ConnectError): HTTP client was unable to make a request to a server.
737+
* [`httpx.TimeoutException`](https://www.python-httpx.org/exceptions/#httpx.TimeoutException): HTTP request timed out.
738+
739+
740+
**Inherit from [`MistralError`](./src/mistralai/models/mistralerror.py)**:
741+
* [`HTTPValidationError`](./src/mistralai/models/httpvalidationerror.py): Validation Error. Status code `422`. Applicable to 47 of 68 methods.*
742+
* [`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.
743+
744+
</details>
745+
746+
\* Check [the method documentation](#available-resources-and-operations) to see if the error is applicable.
726747
<!-- End Error Handling [errors] -->
727748

728749
<!-- Start Server Selection [server] -->

src/mistralai/_version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
__title__: str = "mistralai"
66
__version__: str = "1.9.3"
77
__openapi_doc_version__: str = "1.0.0"
8-
__gen_version__: str = "2.634.2"
9-
__user_agent__: str = "speakeasy-sdk/python 1.9.3 2.634.2 1.0.0 mistralai"
8+
__gen_version__: str = "2.656.5"
9+
__user_agent__: str = "speakeasy-sdk/python 1.9.3 2.656.5 1.0.0 mistralai"
1010

1111
try:
1212
if __package__ is not None:

0 commit comments

Comments
 (0)