Skip to content

Commit fc41a07

Browse files
chore: switch to v2 specs for shorter SDK class names (#352)
* chore: add Makefile for SDK generation commands - test-generate: Test SDK generation locally - update-speakeasy-version: Update Speakeasy CLI version Production generation is done via GitHub Actions. * chore: switch SDK generation to v2 specs for shorter class names Update Speakeasy workflow to pull from :v2 registry tags instead of :main. This enables shorter SDK class names via x-mistral-sdk-operation-id. * chore: regenerate SDK with v2 specs (shorter class names) Auto-generated by Speakeasy using v2 spec with short operation IDs. Class names now use concise names like ArchiveModelRequest instead of JobsAPIRoutesFineTuningArchiveFineTunedModelRequest. * chore: bump version to 2.0.0a3 * chore: regenerate SDK for v2.0.0a3 * docs: add shorter class names section to migration guide * fix(examples): use mistral-small-latest for fine-tuning examples * ci: skip fine-tuning job examples (CI API key lacks access) * refactor(examples): rename job examples to clarify fine-tuning vs batch
1 parent 346dc75 commit fc41a07

File tree

437 files changed

+3809
-3413
lines changed

Some content is hidden

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

437 files changed

+3809
-3413
lines changed

.speakeasy/gen.lock

Lines changed: 1785 additions & 1107 deletions
Large diffs are not rendered by default.

.speakeasy/gen.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ generation:
2222
schemas:
2323
allOfMergeStrategy: shallowMerge
2424
requestBodyFieldName: ""
25-
persistentEdits: {}
25+
persistentEdits:
26+
enabled: "true"
2627
tests:
2728
generateTests: true
2829
generateNewTests: false
2930
skipResponseBodyAssertions: false
3031
python:
31-
version: 2.0.0a2
32+
version: 2.0.0a3
3233
additionalDependencies:
3334
dev:
3435
pytest: ^8.2.2

.speakeasy/generated-files-2d045ec7-2ebb-4f4d-ad25-40953b132161.lock

Lines changed: 0 additions & 799 deletions
This file was deleted.

.speakeasy/workflow.lock

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,57 +2,57 @@ speakeasyVersion: 1.685.0
22
sources:
33
mistral-azure-source:
44
sourceNamespace: mistral-openapi-azure
5-
sourceRevisionDigest: sha256:544a7fd4d099e72a9a12681b326d44201f1b163e4df2f5fd643d831167255d84
6-
sourceBlobDigest: sha256:41c72401329a30983907c32a60063da8ccd82137cf79d7f452089b5b83bb9d92
5+
sourceRevisionDigest: sha256:d303e640ad565cc8a9801519b20dc7eab226efdfdab951c11256962d9e479f74
6+
sourceBlobDigest: sha256:6e4c789de61b2c9c604bf581e0abbadae90e360491d95ec4247678f4f70cee87
77
tags:
88
- latest
99
mistral-google-cloud-source:
1010
sourceNamespace: mistral-openapi-google-cloud
11-
sourceRevisionDigest: sha256:e3dd3079347edf744151936aaee4ec0ce3eeeb8f46b5c7f31f8e224221e879d4
12-
sourceBlobDigest: sha256:7a525230930debff23fec4e92e3ad2a57889ea46de86cc96d519615709ae8a16
11+
sourceRevisionDigest: sha256:351c4d392b8b2220c337a207e98ed5665ed27fd85de854871a70c4bc2b9c0784
12+
sourceBlobDigest: sha256:d79b21f70efb93b0cd261d2044939a288beaf8707a7caae86aca5c4d5de3821b
1313
tags:
1414
- latest
1515
mistral-openapi:
1616
sourceNamespace: mistral-openapi
17-
sourceRevisionDigest: sha256:4e49849eba5334a3fe4a3d081baa9afdecd8f41dfc4c2a5115bc19ead4d92d13
18-
sourceBlobDigest: sha256:3ab3c61ac6a4e9fab37d924d516838ca27dd7e57a1b5e9059d4db2ef29efec56
17+
sourceRevisionDigest: sha256:74d0de7750f6a1878b68c9da683eba7a447d7c367131d0cb8f5c3b1e05829624
18+
sourceBlobDigest: sha256:41e8354c48993fc29be68959d835ea4f8e0cc1d4b4fbd527afcd970bc02c62a2
1919
tags:
2020
- latest
2121
targets:
2222
mistralai-azure-sdk:
2323
source: mistral-azure-source
2424
sourceNamespace: mistral-openapi-azure
25-
sourceRevisionDigest: sha256:544a7fd4d099e72a9a12681b326d44201f1b163e4df2f5fd643d831167255d84
26-
sourceBlobDigest: sha256:41c72401329a30983907c32a60063da8ccd82137cf79d7f452089b5b83bb9d92
25+
sourceRevisionDigest: sha256:d303e640ad565cc8a9801519b20dc7eab226efdfdab951c11256962d9e479f74
26+
sourceBlobDigest: sha256:6e4c789de61b2c9c604bf581e0abbadae90e360491d95ec4247678f4f70cee87
2727
codeSamplesNamespace: mistral-openapi-azure-code-samples
28-
codeSamplesRevisionDigest: sha256:57821a9bf6cfe7001dfcbcaa2f17b233b98c2f79e2d7588540c41750f10b9c05
28+
codeSamplesRevisionDigest: sha256:0109302b87fa17b0103ef1e372fae76356811b3c552103e659bd5373d537d759
2929
mistralai-gcp-sdk:
3030
source: mistral-google-cloud-source
3131
sourceNamespace: mistral-openapi-google-cloud
32-
sourceRevisionDigest: sha256:e3dd3079347edf744151936aaee4ec0ce3eeeb8f46b5c7f31f8e224221e879d4
33-
sourceBlobDigest: sha256:7a525230930debff23fec4e92e3ad2a57889ea46de86cc96d519615709ae8a16
32+
sourceRevisionDigest: sha256:351c4d392b8b2220c337a207e98ed5665ed27fd85de854871a70c4bc2b9c0784
33+
sourceBlobDigest: sha256:d79b21f70efb93b0cd261d2044939a288beaf8707a7caae86aca5c4d5de3821b
3434
codeSamplesNamespace: mistral-openapi-google-cloud-code-samples
35-
codeSamplesRevisionDigest: sha256:404d5964361b3ced085b11e4b8408c36a4a92efe12a97f7497919efdf7594f6f
35+
codeSamplesRevisionDigest: sha256:09bb7cbf291076170d228116db05d1c9606af541b301b6564609c4d76633258a
3636
mistralai-sdk:
3737
source: mistral-openapi
3838
sourceNamespace: mistral-openapi
39-
sourceRevisionDigest: sha256:4e49849eba5334a3fe4a3d081baa9afdecd8f41dfc4c2a5115bc19ead4d92d13
40-
sourceBlobDigest: sha256:3ab3c61ac6a4e9fab37d924d516838ca27dd7e57a1b5e9059d4db2ef29efec56
39+
sourceRevisionDigest: sha256:74d0de7750f6a1878b68c9da683eba7a447d7c367131d0cb8f5c3b1e05829624
40+
sourceBlobDigest: sha256:41e8354c48993fc29be68959d835ea4f8e0cc1d4b4fbd527afcd970bc02c62a2
4141
codeSamplesNamespace: mistral-openapi-code-samples
42-
codeSamplesRevisionDigest: sha256:debd698577e8da014e900a57194128d867ad76fd0d2e2b361e9d0c298700fc67
42+
codeSamplesRevisionDigest: sha256:f37fb6188ad25957bef4cadaa03f454a4f9ab0c045db633a46d9cc89af145ba2
4343
workflow:
4444
workflowVersion: 1.0.0
4545
speakeasyVersion: 1.685.0
4646
sources:
4747
mistral-azure-source:
4848
inputs:
49-
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:main
49+
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:v2
5050
mistral-google-cloud-source:
5151
inputs:
52-
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:main
52+
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:v2
5353
mistral-openapi:
5454
inputs:
55-
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:main
55+
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:v2
5656
targets:
5757
mistralai-azure-sdk:
5858
target: python

.speakeasy/workflow.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ speakeasyVersion: 1.685.0
33
sources:
44
mistral-azure-source:
55
inputs:
6-
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:main
6+
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:v2
77
mistral-google-cloud-source:
88
inputs:
9-
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:main
9+
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:v2
1010
mistral-openapi:
1111
inputs:
12-
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:main
12+
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:v2
1313
targets:
1414
mistralai-azure-sdk:
1515
target: python

MIGRATION.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,19 @@ Some type names have been updated for clarity and consistency:
4949
| `HandoffExecution` | `ConversationRequestHandoffExecution` |
5050
| `AgentVersion` | `ConversationRequestAgentVersion` |
5151

52+
### Shorter Request/Response Class Names
53+
54+
Internal request and response wrapper classes now use concise names:
55+
56+
| Old Name | New Name |
57+
|---|---|
58+
| `JobsAPIRoutesFineTuningArchiveFineTunedModelRequest` | `ArchiveModelRequest` |
59+
| `JobsAPIRoutesFineTuningCreateFineTuningJobResponse` | `CreateFineTuningJobResponse` |
60+
| `FilesAPIRoutesUploadFileRequest` | `UploadFileRequest` |
61+
| `AgentsAPIV1ConversationsAppendRequest` | `AppendConversationRequest` |
62+
63+
This affects all operation-specific request/response types. Core models like `UserMessage`, `ChatCompletionRequest`, etc. are unchanged.
64+
5265
Enums now accept unknown values for forward compatibility with API changes.
5366

5467
---

Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.PHONY: help test-generate update-speakeasy-version
2+
3+
help:
4+
@echo "Available targets:"
5+
@echo " make test-generate Test SDK generation locally"
6+
@echo " make update-speakeasy-version VERSION=x.y.z Update Speakeasy CLI version"
7+
@echo ""
8+
@echo "Note: Production SDK generation is done via GitHub Actions:"
9+
@echo " .github/workflows/sdk_generation_mistralai_sdk.yaml"
10+
11+
# Test SDK generation locally.
12+
# For production, use GitHub Actions: .github/workflows/sdk_generation_mistralai_sdk.yaml
13+
# This uses the Speakeasy CLI version defined in .speakeasy/workflow.yaml
14+
test-generate:
15+
speakeasy run --skip-versioning
16+
17+
# Update the Speakeasy CLI version (the code generator tool).
18+
# This modifies speakeasyVersion in .speakeasy/workflow.yaml and regenerates the SDK.
19+
# Usage: make update-speakeasy-version VERSION=1.685.0
20+
update-speakeasy-version:
21+
ifndef VERSION
22+
$(error VERSION is required. This is the Speakeasy CLI version (e.g., 1.685.0))
23+
endif
24+
uv run inv update-speakeasy --version "$(VERSION)" --targets "all"

README.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ $ source ~/.zshenv
2222
<!-- Start Summary [summary] -->
2323
## Summary
2424

25-
Mistral AI API: Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it.
25+
Mistral AI API: Dora OpenAPI schema
26+
27+
Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it.
2628
<!-- End Summary [summary] -->
2729

2830
<!-- Start Table of Contents [toc] -->
@@ -485,6 +487,7 @@ The documentation for the GCP SDK is available [here](packages/mistralai_gcp/REA
485487
* [get_version](docs/sdks/betaagents/README.md#get_version) - Retrieve a specific version of an agent.
486488
* [create_version_alias](docs/sdks/betaagents/README.md#create_version_alias) - Create or update an agent version alias.
487489
* [list_version_aliases](docs/sdks/betaagents/README.md#list_version_aliases) - List all aliases for an agent.
490+
* [delete_version_alias](docs/sdks/betaagents/README.md#delete_version_alias) - Delete an agent version alias.
488491

489492
### [Beta.Conversations](docs/sdks/conversations/README.md)
490493

@@ -602,14 +605,7 @@ with Mistral(
602605
api_key=os.getenv("MISTRAL_API_KEY", ""),
603606
) as mistral:
604607

605-
res = mistral.beta.conversations.start_stream(inputs=[
606-
{
607-
"object": "entry",
608-
"type": "function.result",
609-
"tool_call_id": "<id>",
610-
"result": "<value>",
611-
},
612-
], stream=True, completion_args={
608+
res = mistral.beta.conversations.start_stream(inputs="<value>", stream=True, completion_args={
613609
"response_format": {
614610
"type": "text",
615611
},
@@ -646,7 +642,7 @@ with Mistral(
646642
api_key=os.getenv("MISTRAL_API_KEY", ""),
647643
) as mistral:
648644

649-
res = mistral.beta.libraries.documents.upload(library_id="a02150d9-5ee0-4877-b62c-28b1fcdf3b76", file={
645+
res = mistral.beta.libraries.documents.upload(library_id="f973c54e-979a-4464-9d36-8cc31beb21fe", file={
650646
"file_name": "example.file",
651647
"content": open("example.file", "rb"),
652648
})
@@ -762,7 +758,7 @@ with Mistral(
762758

763759

764760
**Inherit from [`MistralError`](./src/mistralai/client/models/mistralerror.py)**:
765-
* [`HTTPValidationError`](./src/mistralai/client/models/httpvalidationerror.py): Validation Error. Status code `422`. Applicable to 52 of 74 methods.*
761+
* [`HTTPValidationError`](./src/mistralai/client/models/httpvalidationerror.py): Validation Error. Status code `422`. Applicable to 53 of 75 methods.*
766762
* [`ResponseValidationError`](./src/mistralai/client/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.
767763

768764
</details>

docs/models/agent.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@
2020
| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A |
2121
| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A |
2222
| `deployment_chat` | *bool* | :heavy_check_mark: | N/A |
23-
| `source` | *str* | :heavy_check_mark: | N/A |
23+
| `source` | *str* | :heavy_check_mark: | N/A |
24+
| `version_message` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |

docs/models/agentcreationrequest.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212
| `name` | *str* | :heavy_check_mark: | N/A |
1313
| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
1414
| `handoffs` | List[*str*] | :heavy_minus_sign: | N/A |
15-
| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A |
15+
| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A |
16+
| `version_message` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |

0 commit comments

Comments
 (0)