Skip to content

chore: 🐝 Update SDK - Generate MISTRALAI MISTRALAI-SDK 1.9.6 #261

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

Merged
merged 1 commit into from
Aug 17, 2025
Merged
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
7 changes: 3 additions & 4 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -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
Comment on lines -8 to +9
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we're bumping the version too much?

repoURL: https://github.com/mistralai/client-python.git
installationURL: https://github.com/mistralai/client-python.git
published: true
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ generation:
generateNewTests: false
skipResponseBodyAssertions: false
python:
version: 1.9.3
version: 1.9.6
additionalDependencies:
dev:
pytest: ^8.2.2
Expand Down
12 changes: 6 additions & 6 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,4 +268,14 @@ Based on:
### Generated
- [python v1.9.3] .
### Releases
- [PyPI v1.9.3] https://pypi.org/project/mistralai/1.9.3 - .
- [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 - .
6 changes: 6 additions & 0 deletions docs/models/messageoutputcontentchunks.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@ value: models.DocumentURLChunk = /* values here */
value: models.ToolReferenceChunk = /* values here */
```

### `models.ThinkChunk`

```python
value: models.ThinkChunk = /* values here */
```

7 changes: 0 additions & 7 deletions docs/models/metadata.md

This file was deleted.

6 changes: 6 additions & 0 deletions docs/models/outputcontentchunks.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@ value: models.DocumentURLChunk = /* values here */
value: models.ToolReferenceChunk = /* values here */
```

### `models.ThinkChunk`

```python
value: models.ThinkChunk = /* values here */
```

13 changes: 6 additions & 7 deletions docs/models/toolcall.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
| 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 |
2 changes: 2 additions & 0 deletions docs/sdks/accesses/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions docs/sdks/documents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

## Overview

(beta) Libraries API - manage documents in a library.

### Available Operations

* [list](#list) - List document in a given library.
Expand Down
2 changes: 1 addition & 1 deletion docs/sdks/libraries/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 2 additions & 2 deletions src/mistralai/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions src/mistralai/accesses.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@


class Accesses(BaseSDK):
r"""(beta) Libraries API - manage access to a library."""

def list(
self,
*,
Expand Down
2 changes: 1 addition & 1 deletion src/mistralai/beta.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions src/mistralai/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@


class Documents(BaseSDK):
r"""(beta) Libraries API - manage documents in a library."""

def list(
self,
*,
Expand Down
4 changes: 3 additions & 1 deletion src/mistralai/libraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 1 addition & 5 deletions src/mistralai/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -1383,8 +1383,6 @@
"MessageOutputEventTypedDict",
"Messages",
"MessagesTypedDict",
"Metadata",
"MetadataTypedDict",
"MetricOut",
"MetricOutTypedDict",
"MistralPromptMode",
Expand Down Expand Up @@ -2172,8 +2170,6 @@
"TimestampGranularity": ".timestampgranularity",
"Tool": ".tool",
"ToolTypedDict": ".tool",
"Metadata": ".toolcall",
"MetadataTypedDict": ".toolcall",
"ToolCall": ".toolcall",
"ToolCallTypedDict": ".toolcall",
"ToolChoice": ".toolchoice",
Expand Down
9 changes: 8 additions & 1 deletion src/mistralai/models/messageoutputcontentchunks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -16,6 +17,7 @@
TextChunkTypedDict,
ImageURLChunkTypedDict,
DocumentURLChunkTypedDict,
ThinkChunkTypedDict,
ToolFileChunkTypedDict,
ToolReferenceChunkTypedDict,
],
Expand All @@ -25,6 +27,11 @@
MessageOutputContentChunks = TypeAliasType(
"MessageOutputContentChunks",
Union[
TextChunk, ImageURLChunk, DocumentURLChunk, ToolFileChunk, ToolReferenceChunk
TextChunk,
ImageURLChunk,
DocumentURLChunk,
ThinkChunk,
ToolFileChunk,
ToolReferenceChunk,
],
)
9 changes: 8 additions & 1 deletion src/mistralai/models/outputcontentchunks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -16,6 +17,7 @@
TextChunkTypedDict,
ImageURLChunkTypedDict,
DocumentURLChunkTypedDict,
ThinkChunkTypedDict,
ToolFileChunkTypedDict,
ToolReferenceChunkTypedDict,
],
Expand All @@ -25,6 +27,11 @@
OutputContentChunks = TypeAliasType(
"OutputContentChunks",
Union[
TextChunk, ImageURLChunk, DocumentURLChunk, ToolFileChunk, ToolReferenceChunk
TextChunk,
ImageURLChunk,
DocumentURLChunk,
ThinkChunk,
ToolFileChunk,
ToolReferenceChunk,
],
)
44 changes: 1 addition & 43 deletions src/mistralai/models/toolcall.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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
Loading