Skip to content

Commit f027a7d

Browse files
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.477.0 (#206)
Co-authored-by: speakeasybot <[email protected]>
1 parent 0c0f209 commit f027a7d

18 files changed

+80
-61
lines changed

.speakeasy/gen.lock

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
lockVersion: 2.0.0
22
id: 2d045ec7-2ebb-4f4d-ad25-40953b132161
33
management:
4-
docChecksum: 81cc8be96362e2f1cb145b08a2e6c4fa
4+
docChecksum: 406e00c323dba0db26d6994620926af4
55
docVersion: 0.0.2
66
speakeasyVersion: 1.477.0
77
generationVersion: 2.497.0
8-
releaseVersion: 1.5.1
9-
configChecksum: ef3439d915c5d16e7cfb88fe2bf94907
8+
releaseVersion: 1.5.2
9+
configChecksum: 27786d5cae3bfccc8b434aba9bde02a3
1010
repoURL: https://github.com/mistralai/client-python.git
1111
installationURL: https://github.com/mistralai/client-python.git
1212
published: true
@@ -101,6 +101,7 @@ generatedFiles:
101101
- docs/models/detailedjoboutstatus.md
102102
- docs/models/document.md
103103
- docs/models/documenturlchunk.md
104+
- docs/models/documenturlchunktype.md
104105
- docs/models/embeddingrequest.md
105106
- docs/models/embeddingresponse.md
106107
- docs/models/embeddingresponsedata.md
@@ -650,7 +651,7 @@ examples:
650651
ocr_v1_ocr_post:
651652
speakeasy-default-ocr-v1-ocr-post:
652653
requestBody:
653-
application/json: {"model": "Focus", "document": {"document_url": "https://dutiful-horst.org"}}
654+
application/json: {"model": "Focus", "document": {"document_url": "https://dutiful-horst.org", "type": "document_url"}}
654655
responses:
655656
"200":
656657
application/json: {"pages": [], "model": "A4", "usage_info": {"pages_processed": 442675}}

.speakeasy/gen.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ generation:
1313
oAuth2ClientCredentialsEnabled: true
1414
oAuth2PasswordEnabled: false
1515
python:
16-
version: 1.5.1
16+
version: 1.5.2
1717
additionalDependencies:
1818
dev:
1919
pytest: ^8.2.2

.speakeasy/workflow.lock

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ sources:
1414
- latest
1515
mistral-openapi:
1616
sourceNamespace: mistral-openapi
17-
sourceRevisionDigest: sha256:bdfe3bd4e867529e1821e0f195c2d5832083f7699315f4a42d6b5551bd7847a3
18-
sourceBlobDigest: sha256:7e8a475b75404d724fc7936bd6f585b8e5226d3dca00ab4b69807b53fb63151b
17+
sourceRevisionDigest: sha256:8655bba5635f9f9bc3aa94690c26d6124c778e03478786074288cd63414a7a84
18+
sourceBlobDigest: sha256:cd9280b2b089ef5e0b06ba94ed2736b928f7e4e542d04f408df84e6912049ba6
1919
tags:
2020
- latest
21-
- speakeasy-sdk-regen-1741279153
21+
- speakeasy-sdk-regen-1742407785
2222
targets:
2323
mistralai-azure-sdk:
2424
source: mistral-azure-source
@@ -37,10 +37,10 @@ targets:
3737
mistralai-sdk:
3838
source: mistral-openapi
3939
sourceNamespace: mistral-openapi
40-
sourceRevisionDigest: sha256:bdfe3bd4e867529e1821e0f195c2d5832083f7699315f4a42d6b5551bd7847a3
41-
sourceBlobDigest: sha256:7e8a475b75404d724fc7936bd6f585b8e5226d3dca00ab4b69807b53fb63151b
40+
sourceRevisionDigest: sha256:8655bba5635f9f9bc3aa94690c26d6124c778e03478786074288cd63414a7a84
41+
sourceBlobDigest: sha256:cd9280b2b089ef5e0b06ba94ed2736b928f7e4e542d04f408df84e6912049ba6
4242
codeSamplesNamespace: mistral-openapi-code-samples
43-
codeSamplesRevisionDigest: sha256:ba10be893f3e6dae275eb8fb09a688f3652de81eebd314427f28c274800edc48
43+
codeSamplesRevisionDigest: sha256:d98cc101a0bdcb0666e965e71e7a472ea1e9ab6170aa7e2b4676987107704a58
4444
workflow:
4545
workflowVersion: 1.0.0
4646
speakeasyVersion: 1.477.0

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,10 @@ with Mistral(
242242
api_key=os.getenv("MISTRAL_API_KEY", ""),
243243
) as mistral:
244244

245-
res = mistral.embeddings.create(inputs=[
245+
res = mistral.embeddings.create(model="mistral-embed", inputs=[
246246
"Embed this sentence.",
247247
"As well as this one.",
248-
], model="mistral-embed")
248+
])
249249

250250
# Handle response
251251
print(res)
@@ -265,10 +265,10 @@ async def main():
265265
api_key=os.getenv("MISTRAL_API_KEY", ""),
266266
) as mistral:
267267

268-
res = await mistral.embeddings.create_async(inputs=[
268+
res = await mistral.embeddings.create_async(model="mistral-embed", inputs=[
269269
"Embed this sentence.",
270270
"As well as this one.",
271-
], model="mistral-embed")
271+
])
272272

273273
# Handle response
274274
print(res)

RELEASES.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -168,4 +168,14 @@ Based on:
168168
### Generated
169169
- [python v1.5.1] .
170170
### Releases
171-
- [PyPI v1.5.1] https://pypi.org/project/mistralai/1.5.1 - .
171+
- [PyPI v1.5.1] https://pypi.org/project/mistralai/1.5.1 - .
172+
173+
## 2025-03-19 18:09:29
174+
### Changes
175+
Based on:
176+
- OpenAPI Doc
177+
- Speakeasy CLI 1.477.0 (2.497.0) https://github.com/speakeasy-api/speakeasy
178+
### Generated
179+
- [python v1.5.2] .
180+
### Releases
181+
- [PyPI v1.5.2] https://pypi.org/project/mistralai/1.5.2 - .

USAGE.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@ with Mistral(
161161
api_key=os.getenv("MISTRAL_API_KEY", ""),
162162
) as mistral:
163163

164-
res = mistral.embeddings.create(inputs=[
164+
res = mistral.embeddings.create(model="mistral-embed", inputs=[
165165
"Embed this sentence.",
166166
"As well as this one.",
167-
], model="mistral-embed")
167+
])
168168

169169
# Handle response
170170
print(res)
@@ -184,10 +184,10 @@ async def main():
184184
api_key=os.getenv("MISTRAL_API_KEY", ""),
185185
) as mistral:
186186

187-
res = await mistral.embeddings.create_async(inputs=[
187+
res = await mistral.embeddings.create_async(model="mistral-embed", inputs=[
188188
"Embed this sentence.",
189189
"As well as this one.",
190-
], model="mistral-embed")
190+
])
191191

192192
# Handle response
193193
print(res)

docs/models/documenturlchunk.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
## Fields
55

6-
| Field | Type | Required | Description |
7-
| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
8-
| `document_url` | *str* | :heavy_check_mark: | N/A |
9-
| `type` | *Optional[Literal["document_url"]]* | :heavy_minus_sign: | N/A |
10-
| `document_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The filename of the document |
6+
| Field | Type | Required | Description |
7+
| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
8+
| `document_url` | *str* | :heavy_check_mark: | N/A |
9+
| `document_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The filename of the document |
10+
| `type` | [Optional[models.DocumentURLChunkType]](../models/documenturlchunktype.md) | :heavy_minus_sign: | N/A |

docs/models/documenturlchunktype.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# DocumentURLChunkType
2+
3+
4+
## Values
5+
6+
| Name | Value |
7+
| -------------- | -------------- |
8+
| `DOCUMENT_URL` | document_url |

docs/models/embeddingrequest.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55

66
| Field | Type | Required | Description | Example |
77
| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- |
8-
| `inputs` | [models.Inputs](../models/inputs.md) | :heavy_check_mark: | Text to embed. | [<br/>"Embed this sentence.",<br/>"As well as this one."<br/>] |
9-
| `model` | *Optional[str]* | :heavy_minus_sign: | ID of the model to use. | |
8+
| `model` | *str* | :heavy_check_mark: | ID of the model to use. | mistral-embed |
9+
| `inputs` | [models.Inputs](../models/inputs.md) | :heavy_check_mark: | Text to embed. | [<br/>"Embed this sentence.",<br/>"As well as this one."<br/>] |

docs/models/filepurpose.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
| Name | Value |
77
| ----------- | ----------- |
88
| `FINE_TUNE` | fine-tune |
9-
| `BATCH` | batch |
9+
| `BATCH` | batch |
10+
| `OCR` | ocr |

docs/sdks/embeddings/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ with Mistral(
2323
api_key=os.getenv("MISTRAL_API_KEY", ""),
2424
) as mistral:
2525

26-
res = mistral.embeddings.create(inputs=[
26+
res = mistral.embeddings.create(model="mistral-embed", inputs=[
2727
"Embed this sentence.",
2828
"As well as this one.",
29-
], model="mistral-embed")
29+
])
3030

3131
# Handle response
3232
print(res)
@@ -37,8 +37,8 @@ with Mistral(
3737

3838
| Parameter | Type | Required | Description | Example |
3939
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
40+
| `model` | *str* | :heavy_check_mark: | ID of the model to use. | mistral-embed |
4041
| `inputs` | [models.Inputs](../../models/inputs.md) | :heavy_check_mark: | Text to embed. | [<br/>"Embed this sentence.",<br/>"As well as this one."<br/>] |
41-
| `model` | *Optional[str]* | :heavy_minus_sign: | ID of the model to use. | |
4242
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
4343

4444
### Response

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "mistralai"
3-
version = "1.5.1"
3+
version = "1.5.2"
44
description = "Python Client SDK for the Mistral AI API."
55
authors = ["Mistral"]
66
readme = "README-PYPI.md"

src/mistralai/_version.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
import importlib.metadata
44

55
__title__: str = "mistralai"
6-
__version__: str = "1.5.1"
6+
__version__: str = "1.5.2"
77
__openapi_doc_version__: str = "0.0.2"
88
__gen_version__: str = "2.497.0"
9-
__user_agent__: str = "speakeasy-sdk/python 1.5.1 2.497.0 0.0.2 mistralai"
9+
__user_agent__: str = "speakeasy-sdk/python 1.5.2 2.497.0 0.0.2 mistralai"
1010

1111
try:
1212
if __package__ is not None:

src/mistralai/embeddings.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ class Embeddings(BaseSDK):
1414
def create(
1515
self,
1616
*,
17+
model: str,
1718
inputs: Union[models.Inputs, models.InputsTypedDict],
18-
model: Optional[str] = "mistral-embed",
1919
retries: OptionalNullable[utils.RetryConfig] = UNSET,
2020
server_url: Optional[str] = None,
2121
timeout_ms: Optional[int] = None,
@@ -25,8 +25,8 @@ def create(
2525
2626
Embeddings
2727
28-
:param inputs: Text to embed.
2928
:param model: ID of the model to use.
29+
:param inputs: Text to embed.
3030
:param retries: Override the default retry configuration for this method
3131
:param server_url: Override the default server URL for this method
3232
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -114,8 +114,8 @@ def create(
114114
async def create_async(
115115
self,
116116
*,
117+
model: str,
117118
inputs: Union[models.Inputs, models.InputsTypedDict],
118-
model: Optional[str] = "mistral-embed",
119119
retries: OptionalNullable[utils.RetryConfig] = UNSET,
120120
server_url: Optional[str] = None,
121121
timeout_ms: Optional[int] = None,
@@ -125,8 +125,8 @@ async def create_async(
125125
126126
Embeddings
127127
128-
:param inputs: Text to embed.
129128
:param model: ID of the model to use.
129+
:param inputs: Text to embed.
130130
:param retries: Override the default retry configuration for this method
131131
:param server_url: Override the default server URL for this method
132132
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds

src/mistralai/models/__init__.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@
115115
DetailedJobOutStatus,
116116
DetailedJobOutTypedDict,
117117
)
118-
from .documenturlchunk import DocumentURLChunk, DocumentURLChunkTypedDict
118+
from .documenturlchunk import (
119+
DocumentURLChunk,
120+
DocumentURLChunkType,
121+
DocumentURLChunkTypedDict,
122+
)
119123
from .embeddingrequest import (
120124
EmbeddingRequest,
121125
EmbeddingRequestTypedDict,
@@ -455,6 +459,7 @@
455459
"Document",
456460
"DocumentTypedDict",
457461
"DocumentURLChunk",
462+
"DocumentURLChunkType",
458463
"DocumentURLChunkTypedDict",
459464
"EmbeddingRequest",
460465
"EmbeddingRequestTypedDict",

src/mistralai/models/documenturlchunk.py

+8-14
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,32 @@
22

33
from __future__ import annotations
44
from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
5-
from mistralai.utils import validate_const
6-
import pydantic
75
from pydantic import model_serializer
8-
from pydantic.functional_validators import AfterValidator
96
from typing import Literal, Optional
10-
from typing_extensions import Annotated, NotRequired, TypedDict
7+
from typing_extensions import NotRequired, TypedDict
8+
9+
10+
DocumentURLChunkType = Literal["document_url"]
1111

1212

1313
class DocumentURLChunkTypedDict(TypedDict):
1414
document_url: str
15-
type: Literal["document_url"]
1615
document_name: NotRequired[Nullable[str]]
1716
r"""The filename of the document"""
17+
type: NotRequired[DocumentURLChunkType]
1818

1919

2020
class DocumentURLChunk(BaseModel):
2121
document_url: str
2222

23-
TYPE: Annotated[
24-
Annotated[
25-
Optional[Literal["document_url"]],
26-
AfterValidator(validate_const("document_url")),
27-
],
28-
pydantic.Field(alias="type"),
29-
] = "document_url"
30-
3123
document_name: OptionalNullable[str] = UNSET
3224
r"""The filename of the document"""
3325

26+
type: Optional[DocumentURLChunkType] = "document_url"
27+
3428
@model_serializer(mode="wrap")
3529
def serialize_model(self, handler):
36-
optional_fields = ["type", "document_name"]
30+
optional_fields = ["document_name", "type"]
3731
nullable_fields = ["document_name"]
3832
null_default_fields = []
3933

src/mistralai/models/embeddingrequest.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
from __future__ import annotations
44
from mistralai.types import BaseModel
55
import pydantic
6-
from typing import List, Optional, Union
7-
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
6+
from typing import List, Union
7+
from typing_extensions import Annotated, TypeAliasType, TypedDict
88

99

1010
InputsTypedDict = TypeAliasType("InputsTypedDict", Union[str, List[str]])
@@ -16,15 +16,15 @@
1616

1717

1818
class EmbeddingRequestTypedDict(TypedDict):
19+
model: str
20+
r"""ID of the model to use."""
1921
inputs: InputsTypedDict
2022
r"""Text to embed."""
21-
model: NotRequired[str]
22-
r"""ID of the model to use."""
2323

2424

2525
class EmbeddingRequest(BaseModel):
26+
model: str
27+
r"""ID of the model to use."""
28+
2629
inputs: Annotated[Inputs, pydantic.Field(alias="input")]
2730
r"""Text to embed."""
28-
29-
model: Optional[str] = "mistral-embed"
30-
r"""ID of the model to use."""

src/mistralai/models/filepurpose.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
from typing import Literal, Union
66

77

8-
FilePurpose = Union[Literal["fine-tune", "batch"], UnrecognizedStr]
8+
FilePurpose = Union[Literal["fine-tune", "batch", "ocr"], UnrecognizedStr]

0 commit comments

Comments
 (0)