diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 73686ad..952dea4 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: c33c788946fa446bfcf90b60f68abde9 + docChecksum: 52e6a68dbdc371fd28af0f2ae79505fa docVersion: 1.0.0 speakeasyVersion: 1.568.2 generationVersion: 2.634.2 - releaseVersion: 1.9.3 - configChecksum: 0f65a9bdd8df5ae03eaaaea3ab055bf1 + releaseVersion: 1.9.6 + configChecksum: 2b88c684b4750a8f781b81adb8480b58 repoURL: https://github.com/mistralai/client-python.git installationURL: https://github.com/mistralai/client-python.git published: true @@ -326,7 +326,6 @@ generatedFiles: - docs/models/messageoutputeventrole.md - docs/models/messageoutputeventtype.md - docs/models/messages.md - - docs/models/metadata.md - docs/models/metricout.md - docs/models/mistralpromptmode.md - docs/models/modelcapabilities.md diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index ffc6c82..140d66d 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -21,7 +21,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false python: - version: 1.9.3 + version: 1.9.6 additionalDependencies: dev: pytest: ^8.2.2 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 4514366..46da130 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -14,11 +14,11 @@ sources: - latest mistral-openapi: sourceNamespace: mistral-openapi - sourceRevisionDigest: sha256:22d8044215dc1331ba83f3d25598409bc82fdc04d68033fb05e0133a13cc4dad - sourceBlobDigest: sha256:f3322d8a44d0bf1515b5c1c078525dbf00ff90e6110644de4c03b0b0e9050350 + sourceRevisionDigest: sha256:55f3f81b4bc4061fe86e7c25987282480065414f142fdedfe5cb103de7161a2d + sourceBlobDigest: sha256:f14bdfab5afcc84705d574e6fc22806c4a518292b255fec0643f1e1aa18ae58f tags: - latest - - speakeasy-sdk-regen-1753290410 + - speakeasy-sdk-regen-1755069688 targets: mistralai-azure-sdk: source: mistral-azure-source @@ -37,10 +37,10 @@ targets: mistralai-sdk: source: mistral-openapi sourceNamespace: mistral-openapi - sourceRevisionDigest: sha256:22d8044215dc1331ba83f3d25598409bc82fdc04d68033fb05e0133a13cc4dad - sourceBlobDigest: sha256:f3322d8a44d0bf1515b5c1c078525dbf00ff90e6110644de4c03b0b0e9050350 + sourceRevisionDigest: sha256:55f3f81b4bc4061fe86e7c25987282480065414f142fdedfe5cb103de7161a2d + sourceBlobDigest: sha256:f14bdfab5afcc84705d574e6fc22806c4a518292b255fec0643f1e1aa18ae58f codeSamplesNamespace: mistral-openapi-code-samples - codeSamplesRevisionDigest: sha256:1fd9897fdd851557c592b8fd46232518359401d15a6574933c43be63ec2edb53 + codeSamplesRevisionDigest: sha256:42d98cf03323c832ebd0a3fe0d3927374d1c212998cc37a5d3372c1c6e8a31c8 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.568.2 diff --git a/RELEASES.md b/RELEASES.md index 2089bb0..430220f 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -268,4 +268,14 @@ Based on: ### Generated - [python v1.9.3] . ### Releases -- [PyPI v1.9.3] https://pypi.org/project/mistralai/1.9.3 - . \ No newline at end of file +- [PyPI v1.9.3] https://pypi.org/project/mistralai/1.9.3 - . + +## 2025-08-13 07:21:11 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.568.2 (2.634.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.9.6] . +### Releases +- [PyPI v1.9.6] https://pypi.org/project/mistralai/1.9.6 - . \ No newline at end of file diff --git a/docs/models/messageoutputcontentchunks.md b/docs/models/messageoutputcontentchunks.md index 5dc74a8..b2144e0 100644 --- a/docs/models/messageoutputcontentchunks.md +++ b/docs/models/messageoutputcontentchunks.md @@ -33,3 +33,9 @@ value: models.DocumentURLChunk = /* values here */ value: models.ToolReferenceChunk = /* values here */ ``` +### `models.ThinkChunk` + +```python +value: models.ThinkChunk = /* values here */ +``` + diff --git a/docs/models/metadata.md b/docs/models/metadata.md deleted file mode 100644 index e655f58..0000000 --- a/docs/models/metadata.md +++ /dev/null @@ -1,7 +0,0 @@ -# Metadata - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/outputcontentchunks.md b/docs/models/outputcontentchunks.md index 2da475f..b06d4a7 100644 --- a/docs/models/outputcontentchunks.md +++ b/docs/models/outputcontentchunks.md @@ -33,3 +33,9 @@ value: models.DocumentURLChunk = /* values here */ value: models.ToolReferenceChunk = /* values here */ ``` +### `models.ThinkChunk` + +```python +value: models.ThinkChunk = /* values here */ +``` + diff --git a/docs/models/toolcall.md b/docs/models/toolcall.md index 43e0905..3819236 100644 --- a/docs/models/toolcall.md +++ b/docs/models/toolcall.md @@ -3,10 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `type` | [Optional[models.ToolTypes]](../models/tooltypes.md) | :heavy_minus_sign: | N/A | -| `function` | [models.FunctionCall](../models/functioncall.md) | :heavy_check_mark: | N/A | -| `index` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `metadata` | [OptionalNullable[models.Metadata]](../models/metadata.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `type` | [Optional[models.ToolTypes]](../models/tooltypes.md) | :heavy_minus_sign: | N/A | +| `function` | [models.FunctionCall](../models/functioncall.md) | :heavy_check_mark: | N/A | +| `index` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdks/accesses/README.md b/docs/sdks/accesses/README.md index 2048412..c41b845 100644 --- a/docs/sdks/accesses/README.md +++ b/docs/sdks/accesses/README.md @@ -3,6 +3,8 @@ ## Overview +(beta) Libraries API - manage access to a library. + ### Available Operations * [list](#list) - List all of the access to this library. diff --git a/docs/sdks/documents/README.md b/docs/sdks/documents/README.md index 05ae6f7..0b49c05 100644 --- a/docs/sdks/documents/README.md +++ b/docs/sdks/documents/README.md @@ -3,6 +3,8 @@ ## Overview +(beta) Libraries API - manage documents in a library. + ### Available Operations * [list](#list) - List document in a given library. diff --git a/docs/sdks/libraries/README.md b/docs/sdks/libraries/README.md index 9c709d0..4b441c8 100644 --- a/docs/sdks/libraries/README.md +++ b/docs/sdks/libraries/README.md @@ -3,7 +3,7 @@ ## Overview -(beta) Libraries API for indexing documents to enhance agent capabilities. +(beta) Libraries API to create and manage libraries - index your documents to enhance agent capabilities. ### Available Operations diff --git a/pyproject.toml b/pyproject.toml index 80e65e4..42cf150 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "mistralai" -version = "1.9.3" +version = "1.9.6" 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 5937a74..e5fd40e 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.3" +__version__: str = "1.9.6" __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" +__user_agent__: str = "speakeasy-sdk/python 1.9.6 2.634.2 1.0.0 mistralai" try: if __package__ is not None: diff --git a/src/mistralai/accesses.py b/src/mistralai/accesses.py index 67061b7..f5f5b44 100644 --- a/src/mistralai/accesses.py +++ b/src/mistralai/accesses.py @@ -9,6 +9,8 @@ class Accesses(BaseSDK): + r"""(beta) Libraries API - manage access to a library.""" + def list( self, *, diff --git a/src/mistralai/beta.py b/src/mistralai/beta.py index 3408d94..5201022 100644 --- a/src/mistralai/beta.py +++ b/src/mistralai/beta.py @@ -13,7 +13,7 @@ class Beta(BaseSDK): agents: MistralAgents r"""(beta) Agents API""" libraries: Libraries - r"""(beta) Libraries API for indexing documents to enhance agent capabilities.""" + r"""(beta) Libraries API to create and manage libraries - index your documents to enhance agent capabilities.""" def __init__(self, sdk_config: SDKConfiguration) -> None: BaseSDK.__init__(self, sdk_config) diff --git a/src/mistralai/documents.py b/src/mistralai/documents.py index e43d3fa..c28758d 100644 --- a/src/mistralai/documents.py +++ b/src/mistralai/documents.py @@ -9,6 +9,8 @@ class Documents(BaseSDK): + r"""(beta) Libraries API - manage documents in a library.""" + def list( self, *, diff --git a/src/mistralai/libraries.py b/src/mistralai/libraries.py index 45bf039..852f699 100644 --- a/src/mistralai/libraries.py +++ b/src/mistralai/libraries.py @@ -12,10 +12,12 @@ class Libraries(BaseSDK): - r"""(beta) Libraries API for indexing documents to enhance agent capabilities.""" + r"""(beta) Libraries API to create and manage libraries - index your documents to enhance agent capabilities.""" documents: Documents + r"""(beta) Libraries API - manage documents in a library.""" accesses: Accesses + r"""(beta) Libraries API - manage access to a library.""" def __init__(self, sdk_config: SDKConfiguration) -> None: BaseSDK.__init__(self, sdk_config) diff --git a/src/mistralai/models/__init__.py b/src/mistralai/models/__init__.py index 2039c2b..d24492d 100644 --- a/src/mistralai/models/__init__.py +++ b/src/mistralai/models/__init__.py @@ -777,7 +777,7 @@ ) from .timestampgranularity import TimestampGranularity from .tool import Tool, ToolTypedDict - from .toolcall import Metadata, MetadataTypedDict, ToolCall, ToolCallTypedDict + from .toolcall import ToolCall, ToolCallTypedDict from .toolchoice import ToolChoice, ToolChoiceTypedDict from .toolchoiceenum import ToolChoiceEnum from .toolexecutiondeltaevent import ( @@ -1383,8 +1383,6 @@ "MessageOutputEventTypedDict", "Messages", "MessagesTypedDict", - "Metadata", - "MetadataTypedDict", "MetricOut", "MetricOutTypedDict", "MistralPromptMode", @@ -2172,8 +2170,6 @@ "TimestampGranularity": ".timestampgranularity", "Tool": ".tool", "ToolTypedDict": ".tool", - "Metadata": ".toolcall", - "MetadataTypedDict": ".toolcall", "ToolCall": ".toolcall", "ToolCallTypedDict": ".toolcall", "ToolChoice": ".toolchoice", diff --git a/src/mistralai/models/messageoutputcontentchunks.py b/src/mistralai/models/messageoutputcontentchunks.py index e83fb3a..136a760 100644 --- a/src/mistralai/models/messageoutputcontentchunks.py +++ b/src/mistralai/models/messageoutputcontentchunks.py @@ -4,6 +4,7 @@ from .documenturlchunk import DocumentURLChunk, DocumentURLChunkTypedDict from .imageurlchunk import ImageURLChunk, ImageURLChunkTypedDict from .textchunk import TextChunk, TextChunkTypedDict +from .thinkchunk import ThinkChunk, ThinkChunkTypedDict from .toolfilechunk import ToolFileChunk, ToolFileChunkTypedDict from .toolreferencechunk import ToolReferenceChunk, ToolReferenceChunkTypedDict from typing import Union @@ -16,6 +17,7 @@ TextChunkTypedDict, ImageURLChunkTypedDict, DocumentURLChunkTypedDict, + ThinkChunkTypedDict, ToolFileChunkTypedDict, ToolReferenceChunkTypedDict, ], @@ -25,6 +27,11 @@ MessageOutputContentChunks = TypeAliasType( "MessageOutputContentChunks", Union[ - TextChunk, ImageURLChunk, DocumentURLChunk, ToolFileChunk, ToolReferenceChunk + TextChunk, + ImageURLChunk, + DocumentURLChunk, + ThinkChunk, + ToolFileChunk, + ToolReferenceChunk, ], ) diff --git a/src/mistralai/models/outputcontentchunks.py b/src/mistralai/models/outputcontentchunks.py index 6b7e39e..ad0c087 100644 --- a/src/mistralai/models/outputcontentchunks.py +++ b/src/mistralai/models/outputcontentchunks.py @@ -4,6 +4,7 @@ from .documenturlchunk import DocumentURLChunk, DocumentURLChunkTypedDict from .imageurlchunk import ImageURLChunk, ImageURLChunkTypedDict from .textchunk import TextChunk, TextChunkTypedDict +from .thinkchunk import ThinkChunk, ThinkChunkTypedDict from .toolfilechunk import ToolFileChunk, ToolFileChunkTypedDict from .toolreferencechunk import ToolReferenceChunk, ToolReferenceChunkTypedDict from typing import Union @@ -16,6 +17,7 @@ TextChunkTypedDict, ImageURLChunkTypedDict, DocumentURLChunkTypedDict, + ThinkChunkTypedDict, ToolFileChunkTypedDict, ToolReferenceChunkTypedDict, ], @@ -25,6 +27,11 @@ OutputContentChunks = TypeAliasType( "OutputContentChunks", Union[ - TextChunk, ImageURLChunk, DocumentURLChunk, ToolFileChunk, ToolReferenceChunk + TextChunk, + ImageURLChunk, + DocumentURLChunk, + ThinkChunk, + ToolFileChunk, + ToolReferenceChunk, ], ) diff --git a/src/mistralai/models/toolcall.py b/src/mistralai/models/toolcall.py index 7d3a3c6..92dbb4a 100644 --- a/src/mistralai/models/toolcall.py +++ b/src/mistralai/models/toolcall.py @@ -3,28 +3,18 @@ from __future__ import annotations from .functioncall import FunctionCall, FunctionCallTypedDict from .tooltypes import ToolTypes -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from mistralai.types import BaseModel from mistralai.utils import validate_open_enum -from pydantic import model_serializer from pydantic.functional_validators import PlainValidator from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict -class MetadataTypedDict(TypedDict): - pass - - -class Metadata(BaseModel): - pass - - class ToolCallTypedDict(TypedDict): function: FunctionCallTypedDict id: NotRequired[str] type: NotRequired[ToolTypes] index: NotRequired[int] - metadata: NotRequired[Nullable[MetadataTypedDict]] class ToolCall(BaseModel): @@ -37,35 +27,3 @@ class ToolCall(BaseModel): ) index: Optional[int] = 0 - - metadata: OptionalNullable[Metadata] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["id", "type", "index", "metadata"] - nullable_fields = ["metadata"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m