Skip to content

Commit e2ad430

Browse files
authored
Fix streaming response with empty content (#135)
* fix streaming response with empty content * fix example
1 parent f769a07 commit e2ad430

File tree

20 files changed

+50
-52
lines changed

20 files changed

+50
-52
lines changed

.speakeasy/gen.lock

Lines changed: 4 additions & 4 deletions
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: c19f5a86b8045af32a46604ee5478061
4+
docChecksum: 87135817a5a746d7466c41070e5f581e
55
docVersion: 0.0.2
6-
speakeasyVersion: 1.372.0
6+
speakeasyVersion: 1.373.1
77
generationVersion: 2.399.0
8-
releaseVersion: 1.1.3
9-
configChecksum: b9757e45cfabeceebf51f9a514724903
8+
releaseVersion: 1.0.1
9+
configChecksum: 374a669373f10730cda1eb9a91d59b8b
1010
repoURL: https://github.com/mistralai/client-python.git
1111
installationURL: https://github.com/mistralai/client-python.git
1212
published: true

.speakeasy/gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ generation:
1212
auth:
1313
oAuth2ClientCredentialsEnabled: true
1414
python:
15-
version: 1.1.3
15+
version: 1.0.1
1616
additionalDependencies:
1717
dev:
1818
pytest: ^8.2.2

.speakeasy/workflow.lock

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
speakeasyVersion: 1.372.0
1+
speakeasyVersion: 1.373.1
22
sources:
33
mistral-azure-source:
44
sourceNamespace: mistral-openapi-azure
5-
sourceRevisionDigest: sha256:bc53dba5935490a409045de3c39ccf9e90243a289656dd538a542990aa376cca
6-
sourceBlobDigest: sha256:4173c3be19775dd2bdd4ce28bb9ae6655650df75f2b689a44c3362d418d69d49
5+
sourceRevisionDigest: sha256:becb324b11dfc5155aa0cc420ca312d0af5aecfcbad22fe90066a09561ae4e6a
6+
sourceBlobDigest: sha256:84928a6297c3a838dce719ffa3da1e221cba968ce4a6c74d5c3bb41bf86a7e5d
77
tags:
88
- latest
99
mistral-google-cloud-source:
1010
sourceNamespace: mistral-openapi-google-cloud
11-
sourceRevisionDigest: sha256:ab52d75474e071db240ed9a5367dc6374867b5c9306d478dcfdf8f7b7d08607f
12-
sourceBlobDigest: sha256:d5f9c665861d7fedd5093567d13e1f7f6a12b82137fbbecda4708007b15030ba
11+
sourceRevisionDigest: sha256:7fee22ae1a434b8919112c7feae87af7f1378952fcc6bde081deb55f65e5bfc2
12+
sourceBlobDigest: sha256:a4c011f461c73809a7d6cf1c9823d3c51d5050895aad246287ff14ac971efb8c
1313
tags:
1414
- latest
1515
mistral-openapi:
1616
sourceNamespace: mistral-openapi
17-
sourceRevisionDigest: sha256:e4d5f5fe40e7f1141006ba40c1d85b743ce5dc2407635ca2e776ba0dfb00a398
18-
sourceBlobDigest: sha256:56f1bbe3a050c9505e003bb9790e443084922bff74b072805757076cdb8a136e
17+
sourceRevisionDigest: sha256:088d899162941380ec90445852dc7e8c65a8e2eab6b32f552fd7f4fc6f152e76
18+
sourceBlobDigest: sha256:feb2a952c0f5757a656e8fed5614e28bc4da195cbeb548b5aaf4fc09aee4ddac
1919
tags:
2020
- latest
2121
targets:
2222
mistralai-azure-sdk:
2323
source: mistral-azure-source
2424
sourceNamespace: mistral-openapi-azure
25-
sourceRevisionDigest: sha256:bc53dba5935490a409045de3c39ccf9e90243a289656dd538a542990aa376cca
26-
sourceBlobDigest: sha256:4173c3be19775dd2bdd4ce28bb9ae6655650df75f2b689a44c3362d418d69d49
25+
sourceRevisionDigest: sha256:becb324b11dfc5155aa0cc420ca312d0af5aecfcbad22fe90066a09561ae4e6a
26+
sourceBlobDigest: sha256:84928a6297c3a838dce719ffa3da1e221cba968ce4a6c74d5c3bb41bf86a7e5d
2727
outLocation: ./packages/mistralai_azure
2828
mistralai-gcp-sdk:
2929
source: mistral-google-cloud-source
3030
sourceNamespace: mistral-openapi-google-cloud
31-
sourceRevisionDigest: sha256:ab52d75474e071db240ed9a5367dc6374867b5c9306d478dcfdf8f7b7d08607f
32-
sourceBlobDigest: sha256:d5f9c665861d7fedd5093567d13e1f7f6a12b82137fbbecda4708007b15030ba
31+
sourceRevisionDigest: sha256:7fee22ae1a434b8919112c7feae87af7f1378952fcc6bde081deb55f65e5bfc2
32+
sourceBlobDigest: sha256:a4c011f461c73809a7d6cf1c9823d3c51d5050895aad246287ff14ac971efb8c
3333
outLocation: ./packages/mistralai_gcp
3434
mistralai-sdk:
3535
source: mistral-openapi
3636
sourceNamespace: mistral-openapi
37-
sourceRevisionDigest: sha256:e4d5f5fe40e7f1141006ba40c1d85b743ce5dc2407635ca2e776ba0dfb00a398
38-
sourceBlobDigest: sha256:56f1bbe3a050c9505e003bb9790e443084922bff74b072805757076cdb8a136e
37+
sourceRevisionDigest: sha256:088d899162941380ec90445852dc7e8c65a8e2eab6b32f552fd7f4fc6f152e76
38+
sourceBlobDigest: sha256:feb2a952c0f5757a656e8fed5614e28bc4da195cbeb548b5aaf4fc09aee4ddac
3939
outLocation: /Users/gaspard/public-mistral/client-python
4040
workflow:
4141
workflowVersion: 1.0.0

docs/models/deltamessage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
| Field | Type | Required | Description |
77
| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- |
88
| `role` | *Optional[str]* | :heavy_minus_sign: | N/A |
9-
| `content` | *Optional[str]* | :heavy_minus_sign: | N/A |
9+
| `content` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
1010
| `tool_calls` | List[[models.ToolCall](../models/toolcall.md)] | :heavy_minus_sign: | N/A |

examples/async_jobs.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
async def main():
1111
api_key = os.environ["MISTRAL_API_KEY"]
1212

13-
client = Mistral(
14-
api_key="gpN4hC0YOSdZoBbzRcWNyALyMnNOT9jj", server_url="http://0.0.0.0:8882/"
15-
)
13+
client = Mistral(api_key=api_key)
1614

1715
# Create new files
1816
with open("examples/file.jsonl", "rb") as f:

packages/mistralai_azure/.speakeasy/gen.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
lockVersion: 2.0.0
22
id: dc40fa48-2c4d-46ad-ac8b-270749770f34
33
management:
4-
docChecksum: 0f6edfd8ad8df6c49b3d429d1af7b9e2
4+
docChecksum: 9128fabc3ae45ecc9ed7fae8991b3d3e
55
docVersion: 0.0.2
6-
speakeasyVersion: 1.372.0
6+
speakeasyVersion: 1.373.1
77
generationVersion: 2.399.0
8-
releaseVersion: 1.0.0-rc.7
9-
configChecksum: d14083a6bfd01e2d81264338ac4ed619
8+
releaseVersion: 1.0.1
9+
configChecksum: dc28e30e8f503aee23a53bb77a46c902
1010
published: true
1111
features:
1212
python:

packages/mistralai_azure/.speakeasy/gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ generation:
1212
auth:
1313
oAuth2ClientCredentialsEnabled: true
1414
python:
15-
version: 1.0.0-rc.7
15+
version: 1.0.1
1616
additionalDependencies:
1717
dev:
1818
pytest: ^8.2.2

packages/mistralai_azure/docs/models/deltamessage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
| Field | Type | Required | Description |
77
| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- |
88
| `role` | *Optional[str]* | :heavy_minus_sign: | N/A |
9-
| `content` | *Optional[str]* | :heavy_minus_sign: | N/A |
9+
| `content` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
1010
| `tool_calls` | List[[models.ToolCall](../models/toolcall.md)] | :heavy_minus_sign: | N/A |

packages/mistralai_azure/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "mistralai_azure"
3-
version = "1.0.0-rc.7"
3+
version = "1.0.1"
44
description = "Python Client SDK for the Mistral AI API in Azure."
55
authors = ["Mistral",]
66
readme = "README-PYPI.md"

packages/mistralai_azure/src/mistralai_azure/models/deltamessage.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@
1010

1111
class DeltaMessageTypedDict(TypedDict):
1212
role: NotRequired[str]
13-
content: NotRequired[str]
13+
content: NotRequired[Nullable[str]]
1414
tool_calls: NotRequired[Nullable[List[ToolCallTypedDict]]]
1515

1616

1717
class DeltaMessage(BaseModel):
1818
role: Optional[str] = None
19-
content: Optional[str] = None
19+
content: OptionalNullable[str] = UNSET
2020
tool_calls: OptionalNullable[List[ToolCall]] = UNSET
2121

2222
@model_serializer(mode="wrap")
2323
def serialize_model(self, handler):
2424
optional_fields = ["role", "content", "tool_calls"]
25-
nullable_fields = ["tool_calls"]
25+
nullable_fields = ["content", "tool_calls"]
2626
null_default_fields = []
2727

2828
serialized = handler(self)

0 commit comments

Comments
 (0)