diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 47f75811..7950eefa 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 2d045ec7-2ebb-4f4d-ad25-40953b132161 management: - docChecksum: a38b769b82bac0658cf02fed22bdbde0 + docChecksum: d88fc6da836fc7237380df90b01bc7a5 docVersion: 1.0.0 speakeasyVersion: 1.568.2 generationVersion: 2.634.2 - releaseVersion: 1.9.9 - configChecksum: b08e017cb434c255d6ef2c20584815e8 + releaseVersion: 1.9.10 + configChecksum: 438b1373b4090838b050a2779ab5383f repoURL: https://github.com/mistralai/client-python.git installationURL: https://github.com/mistralai/client-python.git published: true @@ -199,6 +199,7 @@ generatedFiles: - docs/models/embeddingrequestinputs.md - docs/models/embeddingresponse.md - docs/models/embeddingresponsedata.md + - docs/models/encodingformat.md - docs/models/entitytype.md - docs/models/entries.md - docs/models/eventout.md @@ -253,6 +254,7 @@ generatedFiles: - docs/models/imageurlchunktype.md - docs/models/inputentries.md - docs/models/inputs.md + - docs/models/inputs2.md - docs/models/instructrequest.md - docs/models/instructrequestinputs.md - docs/models/instructrequestinputsmessages.md @@ -579,6 +581,7 @@ generatedFiles: - src/mistralai/models/embeddingrequest.py - src/mistralai/models/embeddingresponse.py - src/mistralai/models/embeddingresponsedata.py + - src/mistralai/models/encodingformat.py - src/mistralai/models/entitytype.py - src/mistralai/models/eventout.py - src/mistralai/models/file.py diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 9d66f396..1fb8877e 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -21,7 +21,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false python: - version: 1.9.9 + version: 1.9.10 additionalDependencies: dev: pytest: ^8.2.2 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 8bb5e897..aebb7c18 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -14,11 +14,11 @@ sources: - latest mistral-openapi: sourceNamespace: mistral-openapi - sourceRevisionDigest: sha256:fcdf40207fa983a6ad7c0346f499d2b87ef2f1381a48e791a9a485bd40525ff8 - sourceBlobDigest: sha256:64fa97f0836a2441e32bc255ced698234c147c790775988102f17b493f0da87d + sourceRevisionDigest: sha256:d8843c0cd0ae7685ddd44539ee7b02054204bd4689c82ab3a90c6d45001a32e2 + sourceBlobDigest: sha256:4509a66d15223b5d1427305e517904c5726dced7bb027cf2d2d6c56e015c8d1d tags: - latest - - speakeasy-sdk-regen-1756229662 + - speakeasy-sdk-regen-1756727914 targets: mistralai-azure-sdk: source: mistral-azure-source @@ -37,10 +37,10 @@ targets: mistralai-sdk: source: mistral-openapi sourceNamespace: mistral-openapi - sourceRevisionDigest: sha256:fcdf40207fa983a6ad7c0346f499d2b87ef2f1381a48e791a9a485bd40525ff8 - sourceBlobDigest: sha256:64fa97f0836a2441e32bc255ced698234c147c790775988102f17b493f0da87d + sourceRevisionDigest: sha256:d8843c0cd0ae7685ddd44539ee7b02054204bd4689c82ab3a90c6d45001a32e2 + sourceBlobDigest: sha256:4509a66d15223b5d1427305e517904c5726dced7bb027cf2d2d6c56e015c8d1d codeSamplesNamespace: mistral-openapi-code-samples - codeSamplesRevisionDigest: sha256:39367b425e8a1e7376b8900711e0852f653aaab239f74cc658567fe05ad11784 + codeSamplesRevisionDigest: sha256:372d48b60fafc0c389b12af1dad61faa479598e8194dc3a2a1ed27c207ab9b18 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.568.2 diff --git a/RELEASES.md b/RELEASES.md index ecf8aff6..0038137c 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -308,4 +308,14 @@ Based on: ### Generated - [python v1.9.9] . ### Releases -- [PyPI v1.9.9] https://pypi.org/project/mistralai/1.9.9 - . \ No newline at end of file +- [PyPI v1.9.9] https://pypi.org/project/mistralai/1.9.9 - . + +## 2025-09-01 11:58:15 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.568.2 (2.634.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.9.10] . +### Releases +- [PyPI v1.9.10] https://pypi.org/project/mistralai/1.9.10 - . \ No newline at end of file diff --git a/docs/models/apiendpoint.md b/docs/models/apiendpoint.md index 700b932f..8d83a26f 100644 --- a/docs/models/apiendpoint.md +++ b/docs/models/apiendpoint.md @@ -3,10 +3,15 @@ ## Values -| Name | Value | -| -------------------------- | -------------------------- | -| `ROOT_V1_CHAT_COMPLETIONS` | /v1/chat/completions | -| `ROOT_V1_EMBEDDINGS` | /v1/embeddings | -| `ROOT_V1_FIM_COMPLETIONS` | /v1/fim/completions | -| `ROOT_V1_MODERATIONS` | /v1/moderations | -| `ROOT_V1_CHAT_MODERATIONS` | /v1/chat/moderations | \ No newline at end of file +| Name | Value | +| ------------------------------ | ------------------------------ | +| `ROOT_V1_CHAT_COMPLETIONS` | /v1/chat/completions | +| `ROOT_V1_EMBEDDINGS` | /v1/embeddings | +| `ROOT_V1_FIM_COMPLETIONS` | /v1/fim/completions | +| `ROOT_V1_MODERATIONS` | /v1/moderations | +| `ROOT_V1_CHAT_MODERATIONS` | /v1/chat/moderations | +| `ROOT_V1_OCR` | /v1/ocr | +| `ROOT_V1_CLASSIFICATIONS` | /v1/classifications | +| `ROOT_V1_CHAT_CLASSIFICATIONS` | /v1/chat/classifications | +| `ROOT_V1_CONVERSATIONS` | /v1/conversations | +| `ROOT_V1_AUDIO_TRANSCRIPTIONS` | /v1/audio/transcriptions | \ No newline at end of file diff --git a/docs/models/chatmoderationrequestinputs.md b/docs/models/chatmoderationrequestinputs.md index cf775d60..cc877c2d 100644 --- a/docs/models/chatmoderationrequestinputs.md +++ b/docs/models/chatmoderationrequestinputs.md @@ -11,9 +11,9 @@ Chat to classify value: List[models.One] = /* values here */ ``` -### `List[List[models.Two]]` +### `List[List[models.Inputs2]]` ```python -value: List[List[models.Two]] = /* values here */ +value: List[List[models.Inputs2]] = /* values here */ ``` diff --git a/docs/models/embeddingrequest.md b/docs/models/embeddingrequest.md index 3a778a6f..2f48099f 100644 --- a/docs/models/embeddingrequest.md +++ b/docs/models/embeddingrequest.md @@ -8,4 +8,5 @@ | `model` | *str* | :heavy_check_mark: | ID of the model to use. | mistral-embed | | `inputs` | [models.EmbeddingRequestInputs](../models/embeddingrequestinputs.md) | :heavy_check_mark: | Text to embed. | [
"Embed this sentence.",
"As well as this one."
] | | `output_dimension` | *OptionalNullable[int]* | :heavy_minus_sign: | The dimension of the output embeddings. | | -| `output_dtype` | [Optional[models.EmbeddingDtype]](../models/embeddingdtype.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `output_dtype` | [Optional[models.EmbeddingDtype]](../models/embeddingdtype.md) | :heavy_minus_sign: | N/A | | +| `encoding_format` | [Optional[models.EncodingFormat]](../models/encodingformat.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/encodingformat.md b/docs/models/encodingformat.md new file mode 100644 index 00000000..7d5941cf --- /dev/null +++ b/docs/models/encodingformat.md @@ -0,0 +1,9 @@ +# EncodingFormat + + +## Values + +| Name | Value | +| -------- | -------- | +| `FLOAT` | float | +| `BASE64` | base64 | \ No newline at end of file diff --git a/docs/models/inputs2.md b/docs/models/inputs2.md new file mode 100644 index 00000000..dc21af56 --- /dev/null +++ b/docs/models/inputs2.md @@ -0,0 +1,29 @@ +# Inputs2 + + +## Supported Types + +### `models.AssistantMessage` + +```python +value: models.AssistantMessage = /* values here */ +``` + +### `models.SystemMessage` + +```python +value: models.SystemMessage = /* values here */ +``` + +### `models.ToolMessage` + +```python +value: models.ToolMessage = /* values here */ +``` + +### `models.UserMessage` + +```python +value: models.UserMessage = /* values here */ +``` + diff --git a/docs/models/systemmessagecontent.md b/docs/models/systemmessagecontent.md index e0d27d9f..0930e6e0 100644 --- a/docs/models/systemmessagecontent.md +++ b/docs/models/systemmessagecontent.md @@ -9,9 +9,9 @@ value: str = /* values here */ ``` -### `List[models.TextChunk]` +### `List[models.Two]` ```python -value: List[models.TextChunk] = /* values here */ +value: List[models.Two] = /* values here */ ``` diff --git a/docs/models/two.md b/docs/models/two.md index 59dc2be2..13cae5de 100644 --- a/docs/models/two.md +++ b/docs/models/two.md @@ -3,27 +3,21 @@ ## Supported Types -### `models.AssistantMessage` +### `models.TextChunk` ```python -value: models.AssistantMessage = /* values here */ +value: models.TextChunk = /* values here */ ``` -### `models.SystemMessage` +### `models.ThinkChunk` ```python -value: models.SystemMessage = /* values here */ +value: models.ThinkChunk = /* values here */ ``` -### `models.ToolMessage` +### `models.ReferenceChunk` ```python -value: models.ToolMessage = /* values here */ -``` - -### `models.UserMessage` - -```python -value: models.UserMessage = /* values here */ +value: models.ReferenceChunk = /* values here */ ``` diff --git a/docs/sdks/embeddings/README.md b/docs/sdks/embeddings/README.md index 91e33138..a145855f 100644 --- a/docs/sdks/embeddings/README.md +++ b/docs/sdks/embeddings/README.md @@ -42,6 +42,7 @@ with Mistral( | `inputs` | [models.EmbeddingRequestInputs](../../models/embeddingrequestinputs.md) | :heavy_check_mark: | Text to embed. | [
"Embed this sentence.",
"As well as this one."
] | | `output_dimension` | *OptionalNullable[int]* | :heavy_minus_sign: | The dimension of the output embeddings. | | | `output_dtype` | [Optional[models.EmbeddingDtype]](../../models/embeddingdtype.md) | :heavy_minus_sign: | N/A | | +| `encoding_format` | [Optional[models.EncodingFormat]](../../models/encodingformat.md) | :heavy_minus_sign: | N/A | | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/pyproject.toml b/pyproject.toml index c1d167e3..47842d19 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "mistralai" -version = "1.9.9" +version = "1.9.10" description = "Python Client SDK for the Mistral AI API." authors = [{ name = "Mistral" },] readme = "README-PYPI.md" diff --git a/src/mistralai/_version.py b/src/mistralai/_version.py index 30310d6a..3fa6e7eb 100644 --- a/src/mistralai/_version.py +++ b/src/mistralai/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "mistralai" -__version__: str = "1.9.9" +__version__: str = "1.9.10" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.634.2" -__user_agent__: str = "speakeasy-sdk/python 1.9.9 2.634.2 1.0.0 mistralai" +__user_agent__: str = "speakeasy-sdk/python 1.9.10 2.634.2 1.0.0 mistralai" try: if __package__ is not None: diff --git a/src/mistralai/embeddings.py b/src/mistralai/embeddings.py index ef0699d1..79309eea 100644 --- a/src/mistralai/embeddings.py +++ b/src/mistralai/embeddings.py @@ -20,6 +20,7 @@ def create( ], output_dimension: OptionalNullable[int] = UNSET, output_dtype: Optional[models.EmbeddingDtype] = None, + encoding_format: Optional[models.EncodingFormat] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -33,6 +34,7 @@ def create( :param inputs: Text to embed. :param output_dimension: The dimension of the output embeddings. :param output_dtype: + :param encoding_format: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -53,6 +55,7 @@ def create( inputs=inputs, output_dimension=output_dimension, output_dtype=output_dtype, + encoding_format=encoding_format, ) req = self._build_request( @@ -134,6 +137,7 @@ async def create_async( ], output_dimension: OptionalNullable[int] = UNSET, output_dtype: Optional[models.EmbeddingDtype] = None, + encoding_format: Optional[models.EncodingFormat] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -147,6 +151,7 @@ async def create_async( :param inputs: Text to embed. :param output_dimension: The dimension of the output embeddings. :param output_dtype: + :param encoding_format: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -167,6 +172,7 @@ async def create_async( inputs=inputs, output_dimension=output_dimension, output_dtype=output_dtype, + encoding_format=encoding_format, ) req = self._build_request_async( diff --git a/src/mistralai/models/__init__.py b/src/mistralai/models/__init__.py index d24492d6..4415c73e 100644 --- a/src/mistralai/models/__init__.py +++ b/src/mistralai/models/__init__.py @@ -183,10 +183,10 @@ ChatModerationRequestInputs, ChatModerationRequestInputsTypedDict, ChatModerationRequestTypedDict, + Inputs2, + Inputs2TypedDict, One, OneTypedDict, - Two, - TwoTypedDict, ) from .checkpointout import CheckpointOut, CheckpointOutTypedDict from .classificationrequest import ( @@ -389,6 +389,7 @@ EmbeddingResponseData, EmbeddingResponseDataTypedDict, ) + from .encodingformat import EncodingFormat from .entitytype import EntityType from .eventout import EventOut, EventOutTypedDict from .file import File, FileTypedDict @@ -766,6 +767,8 @@ SystemMessageContent, SystemMessageContentTypedDict, SystemMessageTypedDict, + Two, + TwoTypedDict, ) from .textchunk import TextChunk, TextChunkType, TextChunkTypedDict from .thinkchunk import ( @@ -1156,6 +1159,7 @@ "EmbeddingResponseData", "EmbeddingResponseDataTypedDict", "EmbeddingResponseTypedDict", + "EncodingFormat", "EntityType", "Entries", "EntriesTypedDict", @@ -1246,6 +1250,8 @@ "InputEntries", "InputEntriesTypedDict", "Inputs", + "Inputs2", + "Inputs2TypedDict", "InputsTypedDict", "InstructRequest", "InstructRequestInputs", @@ -1702,10 +1708,10 @@ "ChatModerationRequestInputs": ".chatmoderationrequest", "ChatModerationRequestInputsTypedDict": ".chatmoderationrequest", "ChatModerationRequestTypedDict": ".chatmoderationrequest", + "Inputs2": ".chatmoderationrequest", + "Inputs2TypedDict": ".chatmoderationrequest", "One": ".chatmoderationrequest", "OneTypedDict": ".chatmoderationrequest", - "Two": ".chatmoderationrequest", - "TwoTypedDict": ".chatmoderationrequest", "CheckpointOut": ".checkpointout", "CheckpointOutTypedDict": ".checkpointout", "ClassificationRequest": ".classificationrequest", @@ -1858,6 +1864,7 @@ "EmbeddingResponseTypedDict": ".embeddingresponse", "EmbeddingResponseData": ".embeddingresponsedata", "EmbeddingResponseDataTypedDict": ".embeddingresponsedata", + "EncodingFormat": ".encodingformat", "EntityType": ".entitytype", "EventOut": ".eventout", "EventOutTypedDict": ".eventout", @@ -2159,6 +2166,8 @@ "SystemMessageContent": ".systemmessage", "SystemMessageContentTypedDict": ".systemmessage", "SystemMessageTypedDict": ".systemmessage", + "Two": ".systemmessage", + "TwoTypedDict": ".systemmessage", "TextChunk": ".textchunk", "TextChunkType": ".textchunk", "TextChunkTypedDict": ".textchunk", diff --git a/src/mistralai/models/apiendpoint.py b/src/mistralai/models/apiendpoint.py index a1b42e88..0ad9366f 100644 --- a/src/mistralai/models/apiendpoint.py +++ b/src/mistralai/models/apiendpoint.py @@ -12,6 +12,11 @@ "/v1/fim/completions", "/v1/moderations", "/v1/chat/moderations", + "/v1/ocr", + "/v1/classifications", + "/v1/chat/classifications", + "/v1/conversations", + "/v1/audio/transcriptions", ], UnrecognizedStr, ] diff --git a/src/mistralai/models/chatmoderationrequest.py b/src/mistralai/models/chatmoderationrequest.py index 2f58d52f..5b494ac0 100644 --- a/src/mistralai/models/chatmoderationrequest.py +++ b/src/mistralai/models/chatmoderationrequest.py @@ -13,8 +13,8 @@ from typing_extensions import Annotated, TypeAliasType, TypedDict -TwoTypedDict = TypeAliasType( - "TwoTypedDict", +Inputs2TypedDict = TypeAliasType( + "Inputs2TypedDict", Union[ SystemMessageTypedDict, UserMessageTypedDict, @@ -24,7 +24,7 @@ ) -Two = Annotated[ +Inputs2 = Annotated[ Union[ Annotated[AssistantMessage, Tag("assistant")], Annotated[SystemMessage, Tag("system")], @@ -59,13 +59,13 @@ ChatModerationRequestInputsTypedDict = TypeAliasType( "ChatModerationRequestInputsTypedDict", - Union[List[OneTypedDict], List[List[TwoTypedDict]]], + Union[List[OneTypedDict], List[List[Inputs2TypedDict]]], ) r"""Chat to classify""" ChatModerationRequestInputs = TypeAliasType( - "ChatModerationRequestInputs", Union[List[One], List[List[Two]]] + "ChatModerationRequestInputs", Union[List[One], List[List[Inputs2]]] ) r"""Chat to classify""" diff --git a/src/mistralai/models/embeddingrequest.py b/src/mistralai/models/embeddingrequest.py index 4b5db550..685f27fd 100644 --- a/src/mistralai/models/embeddingrequest.py +++ b/src/mistralai/models/embeddingrequest.py @@ -2,6 +2,7 @@ from __future__ import annotations from .embeddingdtype import EmbeddingDtype +from .encodingformat import EncodingFormat from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL import pydantic from pydantic import model_serializer @@ -27,6 +28,7 @@ class EmbeddingRequestTypedDict(TypedDict): output_dimension: NotRequired[Nullable[int]] r"""The dimension of the output embeddings.""" output_dtype: NotRequired[EmbeddingDtype] + encoding_format: NotRequired[EncodingFormat] class EmbeddingRequest(BaseModel): @@ -41,9 +43,11 @@ class EmbeddingRequest(BaseModel): output_dtype: Optional[EmbeddingDtype] = None + encoding_format: Optional[EncodingFormat] = None + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["output_dimension", "output_dtype"] + optional_fields = ["output_dimension", "output_dtype", "encoding_format"] nullable_fields = ["output_dimension"] null_default_fields = [] diff --git a/src/mistralai/models/encodingformat.py b/src/mistralai/models/encodingformat.py new file mode 100644 index 00000000..6c28a15a --- /dev/null +++ b/src/mistralai/models/encodingformat.py @@ -0,0 +1,7 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from typing import Literal + + +EncodingFormat = Literal["float", "base64"] diff --git a/src/mistralai/models/systemmessage.py b/src/mistralai/models/systemmessage.py index 7827ac4b..0a3fe01f 100644 --- a/src/mistralai/models/systemmessage.py +++ b/src/mistralai/models/systemmessage.py @@ -1,22 +1,31 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .referencechunk import ReferenceChunk, ReferenceChunkTypedDict from .textchunk import TextChunk, TextChunkTypedDict +from .thinkchunk import ThinkChunk, ThinkChunkTypedDict from mistralai.types import BaseModel from typing import List, Literal, Optional, Union from typing_extensions import NotRequired, TypeAliasType, TypedDict -SystemMessageContentTypedDict = TypeAliasType( - "SystemMessageContentTypedDict", Union[str, List[TextChunkTypedDict]] +TwoTypedDict = TypeAliasType( + "TwoTypedDict", + Union[TextChunkTypedDict, ReferenceChunkTypedDict, ThinkChunkTypedDict], ) -SystemMessageContent = TypeAliasType( - "SystemMessageContent", Union[str, List[TextChunk]] +Two = TypeAliasType("Two", Union[TextChunk, ReferenceChunk, ThinkChunk]) + + +SystemMessageContentTypedDict = TypeAliasType( + "SystemMessageContentTypedDict", Union[str, List[TwoTypedDict]] ) +SystemMessageContent = TypeAliasType("SystemMessageContent", Union[str, List[Two]]) + + Role = Literal["system"]