Skip to content

Commit 824187d

Browse files
Update Speakeasy SDKs to version 1.606.10 (#275)
Co-authored-by: GitHub Action <[email protected]>
1 parent 2bdff9f commit 824187d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1265
-2417
lines changed

.speakeasy/gen.lock

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ id: 2d045ec7-2ebb-4f4d-ad25-40953b132161
33
management:
44
docChecksum: c3693e4872a0785b2ed46c59a8464804
55
docVersion: 1.0.0
6-
speakeasyVersion: 1.568.2
7-
generationVersion: 2.634.2
6+
speakeasyVersion: 1.606.10
7+
generationVersion: 2.687.13
88
releaseVersion: 1.9.10
9-
configChecksum: 438b1373b4090838b050a2779ab5383f
9+
configChecksum: 928d8206dce080425b60348d566b2c4e
1010
repoURL: https://github.com/mistralai/client-python.git
1111
installationURL: https://github.com/mistralai/client-python.git
1212
published: true
@@ -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.20.1
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
@@ -36,14 +36,13 @@ features:
3636
responseFormat: 1.0.1
3737
retries: 3.0.2
3838
sdkHooks: 1.1.0
39-
serverEvents: 1.0.7
39+
serverEvents: 1.0.8
4040
serverEventsSentinels: 0.1.0
4141
serverIDs: 3.0.0
4242
unions: 3.0.4
4343
uploadStreams: 1.0.0
4444
generatedFiles:
4545
- .gitattributes
46-
- .python-version
4746
- .vscode/settings.json
4847
- USAGE.md
4948
- docs/models/agent.md
@@ -665,12 +664,14 @@ generatedFiles:
665664
- src/mistralai/models/messageoutputentry.py
666665
- src/mistralai/models/messageoutputevent.py
667666
- src/mistralai/models/metricout.py
667+
- src/mistralai/models/mistralerror.py
668668
- src/mistralai/models/mistralpromptmode.py
669669
- src/mistralai/models/modelcapabilities.py
670670
- src/mistralai/models/modelconversation.py
671671
- src/mistralai/models/modellist.py
672672
- src/mistralai/models/moderationobject.py
673673
- src/mistralai/models/moderationresponse.py
674+
- src/mistralai/models/no_response_error.py
674675
- src/mistralai/models/ocrimageobject.py
675676
- src/mistralai/models/ocrpagedimensions.py
676677
- src/mistralai/models/ocrpageobject.py
@@ -687,6 +688,7 @@ generatedFiles:
687688
- src/mistralai/models/responseformat.py
688689
- src/mistralai/models/responseformats.py
689690
- src/mistralai/models/responsestartedevent.py
691+
- src/mistralai/models/responsevalidationerror.py
690692
- src/mistralai/models/retrieve_model_v1_models_model_id_getop.py
691693
- src/mistralai/models/retrievefileout.py
692694
- src/mistralai/models/sampletype.py
@@ -756,6 +758,7 @@ generatedFiles:
756758
- src/mistralai/utils/retries.py
757759
- src/mistralai/utils/security.py
758760
- src/mistralai/utils/serializers.py
761+
- src/mistralai/utils/unmarshal_json_response.py
759762
- src/mistralai/utils/url.py
760763
- src/mistralai/utils/values.py
761764
examples:

.speakeasy/gen.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ python:
2626
dev:
2727
pytest: ^8.2.2
2828
pytest-asyncio: ^0.23.7
29+
allowedRedefinedBuiltins:
30+
- id
31+
- object
2932
authors:
3033
- Mistral
3134
baseErrorName: MistralError
@@ -53,6 +56,7 @@ python:
5356
methodArguments: infer-optional-args
5457
moduleName: ""
5558
outputModelSuffix: output
59+
packageManager: poetry
5660
packageName: mistralai
5761
pytestFilterWarnings: []
5862
pytestTimeout: 0

.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.606.10
22
sources:
33
mistral-azure-source:
44
sourceNamespace: mistral-openapi-azure
@@ -18,7 +18,7 @@ sources:
1818
sourceBlobDigest: sha256:97767522559603de92a9738938e522cea4d558b2a854500acf6fe8d81f8ccfb8
1919
tags:
2020
- latest
21-
- speakeasy-sdk-regen-1756796562
21+
- main
2222
targets:
2323
mistralai-azure-sdk:
2424
source: mistral-azure-source
@@ -40,20 +40,20 @@ targets:
4040
sourceRevisionDigest: sha256:eefc1f0b6a5e9ec673d317d61cad766290710b5fc369412491b75f732cccfedd
4141
sourceBlobDigest: sha256:97767522559603de92a9738938e522cea4d558b2a854500acf6fe8d81f8ccfb8
4242
codeSamplesNamespace: mistral-openapi-code-samples
43-
codeSamplesRevisionDigest: sha256:372d48b60fafc0c389b12af1dad61faa479598e8194dc3a2a1ed27c207ab9b18
43+
codeSamplesRevisionDigest: sha256:31dee4783f73e1efa932b16da7238ddfe29b94f4b1c66223d6e0f2393cdc6f72
4444
workflow:
4545
workflowVersion: 1.0.0
46-
speakeasyVersion: 1.568.2
46+
speakeasyVersion: 1.606.10
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:670c460702ec74f7077491464a6dc5ee9d873969c80e812c48dbf4deb160e470
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:eefc1f0b6a5e9ec673d317d61cad766290710b5fc369412491b75f732cccfedd
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.606.10
33
sources:
44
mistral-azure-source:
55
inputs:

README.md

Lines changed: 57 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,15 @@ Mistral AI API: Our Chat Completion and Embeddings APIs specification. Create yo
5858
>
5959
> 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.
6060
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+
```
6270

6371
### PIP
6472

@@ -150,7 +158,7 @@ with Mistral(
150158

151159
</br>
152160

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.
154162
```python
155163
# Asynchronous Example
156164
import asyncio
@@ -201,7 +209,7 @@ with Mistral(
201209

202210
</br>
203211

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.
205213
```python
206214
# Asynchronous Example
207215
import asyncio
@@ -252,7 +260,7 @@ with Mistral(
252260

253261
</br>
254262

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.
256264
```python
257265
# Asynchronous Example
258266
import asyncio
@@ -303,7 +311,7 @@ with Mistral(
303311

304312
</br>
305313

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.
307315
```python
308316
# Asynchronous Example
309317
import asyncio
@@ -680,27 +688,20 @@ with Mistral(
680688
<!-- Start Error Handling [errors] -->
681689
## Error Handling
682690

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:
684692

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 | \*/\* |
693+
| Property | Type | Description |
694+
| ------------------ | ---------------- | --------------------------------------------------------------------------------------- |
695+
| `err.message` | `str` | Error message |
696+
| `err.status_code` | `int` | HTTP response status code eg `404` |
697+
| `err.headers` | `httpx.Headers` | HTTP response headers |
698+
| `err.body` | `str` | HTTP body. Can be empty string if no body is returned. |
699+
| `err.raw_response` | `httpx.Response` | Raw HTTP response |
700+
| `err.data` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |
700701

701702
### Example
702-
703703
```python
704+
import mistralai
704705
from mistralai import Mistral, models
705706
import os
706707

@@ -716,13 +717,41 @@ with Mistral(
716717
# Handle response
717718
print(res)
718719

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)
720+
721+
except models.MistralError as e:
722+
# The base class for HTTP error responses
723+
print(e.message)
724+
print(e.status_code)
725+
print(e.body)
726+
print(e.headers)
727+
print(e.raw_response)
728+
729+
# Depending on the method different errors may be thrown
730+
if isinstance(e, models.HTTPValidationError):
731+
print(e.data.detail) # Optional[List[mistralai.ValidationError]]
725732
```
733+
734+
### Error Classes
735+
**Primary error:**
736+
* [`MistralError`](./src/mistralai/models/mistralerror.py): The base class for HTTP error responses.
737+
738+
<details><summary>Less common errors (6)</summary>
739+
740+
<br />
741+
742+
**Network errors:**
743+
* [`httpx.RequestError`](https://www.python-httpx.org/exceptions/#httpx.RequestError): Base class for request errors.
744+
* [`httpx.ConnectError`](https://www.python-httpx.org/exceptions/#httpx.ConnectError): HTTP client was unable to make a request to a server.
745+
* [`httpx.TimeoutException`](https://www.python-httpx.org/exceptions/#httpx.TimeoutException): HTTP request timed out.
746+
747+
748+
**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.
726755
<!-- End Error Handling [errors] -->
727756

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

USAGE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ with Mistral(
2626

2727
</br>
2828

29-
The same SDK client can also be used to make asychronous requests by importing asyncio.
29+
The same SDK client can also be used to make asynchronous requests by importing asyncio.
3030
```python
3131
# Asynchronous Example
3232
import asyncio
@@ -77,7 +77,7 @@ with Mistral(
7777

7878
</br>
7979

80-
The same SDK client can also be used to make asychronous requests by importing asyncio.
80+
The same SDK client can also be used to make asynchronous requests by importing asyncio.
8181
```python
8282
# Asynchronous Example
8383
import asyncio
@@ -128,7 +128,7 @@ with Mistral(
128128

129129
</br>
130130

131-
The same SDK client can also be used to make asychronous requests by importing asyncio.
131+
The same SDK client can also be used to make asynchronous requests by importing asyncio.
132132
```python
133133
# Asynchronous Example
134134
import asyncio
@@ -179,7 +179,7 @@ with Mistral(
179179

180180
</br>
181181

182-
The same SDK client can also be used to make asychronous requests by importing asyncio.
182+
The same SDK client can also be used to make asynchronous requests by importing asyncio.
183183
```python
184184
# Asynchronous Example
185185
import asyncio

docs/sdks/accesses/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Given a library, list all of the Entity that have access and to what level.
1717

1818
### Example Usage
1919

20+
<!-- UsageSnippet language="python" operationID="libraries_share_list_v1" method="get" path="/v1/libraries/{library_id}/share" -->
2021
```python
2122
from mistralai import Mistral
2223
import os
@@ -57,6 +58,7 @@ Given a library id, you can create or update the access level of an entity. You
5758

5859
### Example Usage
5960

61+
<!-- UsageSnippet language="python" operationID="libraries_share_create_v1" method="put" path="/v1/libraries/{library_id}/share" -->
6062
```python
6163
from mistralai import Mistral
6264
import os
@@ -101,6 +103,7 @@ Given a library id, you can delete the access level of an entity. An owner canno
101103

102104
### Example Usage
103105

106+
<!-- UsageSnippet language="python" operationID="libraries_share_delete_v1" method="delete" path="/v1/libraries/{library_id}/share" -->
104107
```python
105108
from mistralai import Mistral
106109
import os

docs/sdks/agents/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Agents Completion
1616

1717
### Example Usage
1818

19+
<!-- UsageSnippet language="python" operationID="agents_completion_v1_agents_completions_post" method="post" path="/v1/agents/completions" -->
1920
```python
2021
from mistralai import Mistral
2122
import os
@@ -75,6 +76,7 @@ Mistral AI provides the ability to stream responses back to a client in order to
7576

7677
### Example Usage
7778

79+
<!-- UsageSnippet language="python" operationID="stream_agents" method="post" path="/v1/agents/completions#stream" -->
7880
```python
7981
from mistralai import Mistral
8082
import os

docs/sdks/chat/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Chat Completion
1616

1717
### Example Usage
1818

19+
<!-- UsageSnippet language="python" operationID="chat_completion_v1_chat_completions_post" method="post" path="/v1/chat/completions" -->
1920
```python
2021
from mistralai import Mistral
2122
import os
@@ -78,6 +79,7 @@ Mistral AI provides the ability to stream responses back to a client in order to
7879

7980
### Example Usage
8081

82+
<!-- UsageSnippet language="python" operationID="stream_chat" method="post" path="/v1/chat/completions#stream" -->
8183
```python
8284
from mistralai import Mistral
8385
import os

0 commit comments

Comments
 (0)