Skip to content

Update Speakeasy SDKs to version 1.580.2 #262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ id: 2d045ec7-2ebb-4f4d-ad25-40953b132161
management:
docChecksum: c33c788946fa446bfcf90b60f68abde9
docVersion: 1.0.0
speakeasyVersion: 1.568.2
generationVersion: 2.634.2
speakeasyVersion: 1.580.2
generationVersion: 2.656.5
releaseVersion: 1.9.3
configChecksum: 0f65a9bdd8df5ae03eaaaea3ab055bf1
repoURL: https://github.com/mistralai/client-python.git
Expand All @@ -15,13 +15,13 @@ features:
additionalDependencies: 1.0.0
additionalProperties: 1.0.1
constsAndDefaults: 1.0.5
core: 5.19.3
core: 5.19.4
customCodeRegions: 0.1.1
defaultEnabledRetries: 0.2.0
downloadStreams: 1.0.1
enumUnions: 0.1.0
envVarSecurityUsage: 0.3.2
examples: 3.0.1
examples: 3.0.2
flatRequests: 1.0.1
flattening: 3.1.1
globalSecurity: 3.0.3
Expand All @@ -43,7 +43,6 @@ features:
uploadStreams: 1.0.0
generatedFiles:
- .gitattributes
- .python-version
- .vscode/settings.json
- USAGE.md
- docs/models/agent.md
Expand Down Expand Up @@ -663,12 +662,14 @@ generatedFiles:
- src/mistralai/models/messageoutputentry.py
- src/mistralai/models/messageoutputevent.py
- src/mistralai/models/metricout.py
- src/mistralai/models/mistralerror.py
- src/mistralai/models/mistralpromptmode.py
- src/mistralai/models/modelcapabilities.py
- src/mistralai/models/modelconversation.py
- src/mistralai/models/modellist.py
- src/mistralai/models/moderationobject.py
- src/mistralai/models/moderationresponse.py
- src/mistralai/models/no_response_error.py
- src/mistralai/models/ocrimageobject.py
- src/mistralai/models/ocrpagedimensions.py
- src/mistralai/models/ocrpageobject.py
Expand All @@ -685,6 +686,7 @@ generatedFiles:
- src/mistralai/models/responseformat.py
- src/mistralai/models/responseformats.py
- src/mistralai/models/responsestartedevent.py
- src/mistralai/models/responsevalidationerror.py
- src/mistralai/models/retrieve_model_v1_models_model_id_getop.py
- src/mistralai/models/retrievefileout.py
- src/mistralai/models/sampletype.py
Expand Down Expand Up @@ -753,6 +755,7 @@ generatedFiles:
- src/mistralai/utils/retries.py
- src/mistralai/utils/security.py
- src/mistralai/utils/serializers.py
- src/mistralai/utils/unmarshal_json_response.py
- src/mistralai/utils/url.py
- src/mistralai/utils/values.py
examples:
Expand Down
14 changes: 7 additions & 7 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
speakeasyVersion: 1.568.2
speakeasyVersion: 1.580.2
sources:
mistral-azure-source:
sourceNamespace: mistral-openapi-azure
Expand All @@ -18,7 +18,7 @@ sources:
sourceBlobDigest: sha256:f3322d8a44d0bf1515b5c1c078525dbf00ff90e6110644de4c03b0b0e9050350
tags:
- latest
- speakeasy-sdk-regen-1753290410
- main
targets:
mistralai-azure-sdk:
source: mistral-azure-source
Expand All @@ -40,20 +40,20 @@ targets:
sourceRevisionDigest: sha256:22d8044215dc1331ba83f3d25598409bc82fdc04d68033fb05e0133a13cc4dad
sourceBlobDigest: sha256:f3322d8a44d0bf1515b5c1c078525dbf00ff90e6110644de4c03b0b0e9050350
codeSamplesNamespace: mistral-openapi-code-samples
codeSamplesRevisionDigest: sha256:1fd9897fdd851557c592b8fd46232518359401d15a6574933c43be63ec2edb53
codeSamplesRevisionDigest: sha256:c9a428984222df28202f67c104d8d2f1a52e5a2f33f07d9a09a4dafdb740d28a
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.568.2
speakeasyVersion: 1.580.2
sources:
mistral-azure-source:
inputs:
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:main
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:sha256:c5931a7e0cc2db844149d71db57dfc2178665f0400bc26c90ee113795ea2872f
mistral-google-cloud-source:
inputs:
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:main
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:sha256:4a5343e63c6a78152e472b00ccc46d7bcb15594496bc94c8040039d3a9d4c5f8
mistral-openapi:
inputs:
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:main
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:sha256:22d8044215dc1331ba83f3d25598409bc82fdc04d68033fb05e0133a13cc4dad
targets:
mistralai-azure-sdk:
target: python
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
workflowVersion: 1.0.0
speakeasyVersion: 1.568.2
speakeasyVersion: 1.580.2
sources:
mistral-azure-source:
inputs:
Expand Down
67 changes: 44 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -680,27 +680,20 @@ with Mistral(
<!-- Start Error Handling [errors] -->
## Error Handling

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

By default, an API error will raise a models.SDKError exception, which has the following properties:

| Property | Type | Description |
|-----------------|------------------|-----------------------|
| `.status_code` | *int* | The HTTP status code |
| `.message` | *str* | The error message |
| `.raw_response` | *httpx.Response* | The raw HTTP response |
| `.body` | *str* | The response content |

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:

| Error Type | Status Code | Content Type |
| -------------------------- | ----------- | ---------------- |
| models.HTTPValidationError | 422 | application/json |
| models.SDKError | 4XX, 5XX | \*/\* |
| Property | Type | Description |
| ------------------ | ---------------- | --------------------------------------------------------------------------------------- |
| `err.message` | `str` | Error message |
| `err.status_code` | `int` | HTTP response status code eg `404` |
| `err.headers` | `httpx.Headers` | HTTP response headers |
| `err.body` | `str` | HTTP body. Can be empty string if no body is returned. |
| `err.raw_response` | `httpx.Response` | Raw HTTP response |
| `err.data` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |

### Example

```python
import mistralai
from mistralai import Mistral, models
import os

Expand All @@ -716,13 +709,41 @@ with Mistral(
# Handle response
print(res)

except models.HTTPValidationError as e:
# handle e.data: models.HTTPValidationErrorData
raise(e)
except models.SDKError as e:
# handle exception
raise(e)

except models.MistralError as e:
# The base class for HTTP error responses
print(e.message)
print(e.status_code)
print(e.body)
print(e.headers)
print(e.raw_response)

# Depending on the method different errors may be thrown
if isinstance(e, models.HTTPValidationError):
print(e.data.detail) # Optional[List[mistralai.ValidationError]]
```

### Error Classes
**Primary error:**
* [`MistralError`](./src/mistralai/models/mistralerror.py): The base class for HTTP error responses.

<details><summary>Less common errors (6)</summary>

<br />

**Network errors:**
* [`httpx.RequestError`](https://www.python-httpx.org/exceptions/#httpx.RequestError): Base class for request errors.
* [`httpx.ConnectError`](https://www.python-httpx.org/exceptions/#httpx.ConnectError): HTTP client was unable to make a request to a server.
* [`httpx.TimeoutException`](https://www.python-httpx.org/exceptions/#httpx.TimeoutException): HTTP request timed out.


**Inherit from [`MistralError`](./src/mistralai/models/mistralerror.py)**:
* [`HTTPValidationError`](./src/mistralai/models/httpvalidationerror.py): Validation Error. Status code `422`. Applicable to 47 of 68 methods.*
* [`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.

</details>

\* Check [the method documentation](#available-resources-and-operations) to see if the error is applicable.
<!-- End Error Handling [errors] -->

<!-- Start Server Selection [server] -->
Expand Down
4 changes: 2 additions & 2 deletions src/mistralai/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
__title__: str = "mistralai"
__version__: str = "1.9.3"
__openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.634.2"
__user_agent__: str = "speakeasy-sdk/python 1.9.3 2.634.2 1.0.0 mistralai"
__gen_version__: str = "2.656.5"
__user_agent__: str = "speakeasy-sdk/python 1.9.3 2.656.5 1.0.0 mistralai"

try:
if __package__ is not None:
Expand Down
Loading
Loading