diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index d44c268b..b4168566 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: 2d045ec7-2ebb-4f4d-ad25-40953b132161 management: - docChecksum: 68426731e22b47ac547feb3144b7defb + docChecksum: 97b4909a97eae2c0d6eaef46534c47fe docVersion: 1.0.0 speakeasyVersion: 1.754.0 generationVersion: 2.862.0 - releaseVersion: 2.1.1 - configChecksum: 1dfcdfd9a3f484dd098a0bffb4d13d4d + releaseVersion: 2.1.2 + configChecksum: eae98dd1cf81d8778436fcccb0cf416a repoURL: https://github.com/mistralai/client-python.git installationURL: https://github.com/mistralai/client-python.git published: true persistentEdits: - generation_id: 3bd5e5b5-16bb-4a97-9eeb-dfa952779f1a - pristine_commit_hash: 7166e430b976c667a0ec83f5c5791809dd2fc3a4 - pristine_tree_hash: 770f1e01cc9f7d6efbd9fe9350f0d688d21d2b4b + generation_id: 987926a2-b35b-41a4-9457-7d23e8864309 + pristine_commit_hash: ae957d3fa2a92c2d13b3bbeadfa245d6c98c7d3d + pristine_tree_hash: 11d13bcf1460e6925ea9207ffd93aa9b220a0210 features: python: acceptHeaders: 3.0.0 @@ -363,26 +363,14 @@ trackedFiles: id: 57b86771c870 last_write_checksum: sha1:bfd2fb8e2c83578ca0cea5209ea3f18c3bcd2ae5 pristine_git_object: ba9c95eab2c1e4f080e39e8804a5de222e052ee6 - docs/models/chatcompletionchoice1.md: - id: 00f3eec89329 - last_write_checksum: sha1:60653ac0761272bbae3a7732d7c7c36a107a67b0 - pristine_git_object: 269023f7a39ecd90dce9b5cb9c625bed679d4c88 - docs/models/chatcompletionchoice2.md: - id: e8badb5ca1ac - last_write_checksum: sha1:3e6b5c62c82b937bc0baad25fc21f6a1dcc55e54 - pristine_git_object: 274565e8b877d39ee383c1c971928f45c734b5f0 - docs/models/chatcompletionchoicefinishreason1.md: - id: a2cbd7d56a20 - last_write_checksum: sha1:99fee4a97c754027da16d9a780f9cc6512a25974 - pristine_git_object: f340dc9d81a16536d0ad09bf6578ae7e303d2d2e - docs/models/chatcompletionchoicefinishreason2.md: - id: 7f55ad364454 - last_write_checksum: sha1:615d829e68a6557d1e739060cb4ddd64d5b41335 - pristine_git_object: 51abd6c1c2e55222a8112109e4d798010c3294fd - docs/models/chatcompletionchoiceunion.md: - id: 0f8f08d07fbf - last_write_checksum: sha1:320f4323f22e7d1ad0eb5ae3ed9e312409c69f8c - pristine_git_object: c577759974759149a2a007793ec22bd7907ecfe4 + docs/models/chatcompletionchoice.md: + id: 0d15c59ab501 + last_write_checksum: sha1:a6274a39a4239e054816d08517bf8507cb5c4564 + pristine_git_object: deaa0ea073e1b6c21bd466c10db31db2464066f1 + docs/models/chatcompletionchoicefinishreason.md: + id: 225764da91d3 + last_write_checksum: sha1:160ff1297bfbaa9158e575b8bd7ab573533c8f9f + pristine_git_object: c289272622b137541843bb4ba9654d0e1405ffec docs/models/chatcompletionevent.md: id: fc1097c5bfe2 last_write_checksum: sha1:ef1f417581e943503acb38b503aedde3e157d934 @@ -425,8 +413,8 @@ trackedFiles: pristine_git_object: 48d8596d7caaf09e4773b80f451fb2bc16eab1d7 docs/models/chatcompletionresponse.md: id: 7c53b24681b9 - last_write_checksum: sha1:0d7d8c74d7fe3919f9e41e5c7b37d23d74e73744 - pristine_git_object: 2cde9a3f657ab6f458f9fcddbd26b792a1b0871c + last_write_checksum: sha1:a56581c0846638cfe6df26d3045fb4f874ccd931 + pristine_git_object: a0465ffbfc5558628953e03fbc53b80bbdc8649b docs/models/chatcompletionstreamrequest.md: id: cf8f29558a68 last_write_checksum: sha1:eae5eb85146e95ce4d3f76a362abfe29e4b40c5b @@ -1097,8 +1085,8 @@ trackedFiles: pristine_git_object: a0dbb00a82a03acc8b62b81d7597722a6ca46118 docs/models/fimcompletionresponse.md: id: 050d62ba2fac - last_write_checksum: sha1:7cadd128b7684c078a0337b42f599dca2c585225 - pristine_git_object: 0d92cc8520882c56c587d1c851206a3172373fef + last_write_checksum: sha1:a6101a69e83b7a5bcf96ec77ba1cab8748f734f4 + pristine_git_object: cd62d0349503fd8b13582d0ba47ab9cff40f6b28 docs/models/fimcompletionstreamrequest.md: id: c881d7e27637 last_write_checksum: sha1:f8755bc554dd44568c42eb5b6dde04db464647ab @@ -2481,8 +2469,8 @@ trackedFiles: pristine_git_object: 036d44b8cfc51599873bd5c401a6aed30450536c src/mistralai/client/_version.py: id: cc807b30de19 - last_write_checksum: sha1:a814bf6ebf521181526a7a5a669ed2b5c87ed818 - pristine_git_object: 2ce42718554bf69f5c5780428ff8bf74e926063b + last_write_checksum: sha1:d7a3abfbd260f39e87a405377e56d9dd8a48439f + pristine_git_object: a5ba9a2a6bcff1a4b62db94c38d18b40c88813cc src/mistralai/client/accesses.py: id: 76fc53bfcf59 last_write_checksum: sha1:4b1cf5d760f690d35582f9037df44c97c11e7e14 @@ -2613,8 +2601,8 @@ trackedFiles: pristine_git_object: b8728362b87349118ac6f163f50613dd18c43340 src/mistralai/client/models/__init__.py: id: e0e8dad92725 - last_write_checksum: sha1:890d241c6f6b09a31715fd87696b183f1c2fc45f - pristine_git_object: 8363bb841d291bea962e9f75924de88b2e1def7e + last_write_checksum: sha1:fba31c478e24e28b21f8d42eb4071685b1937892 + pristine_git_object: 905fae94be27b73eb6af7bbdade00680ec970d22 src/mistralai/client/models/agent.py: id: 1336849c84fb last_write_checksum: sha1:2574866d9855cb0b6314ac94ca288d59f3196c73 @@ -2819,10 +2807,10 @@ trackedFiles: id: afd9cdc71834 last_write_checksum: sha1:a29088359142ebd6409f45569168b2096014119e pristine_git_object: cf2aa78af3ffc747d557422b83551075b83e601d - src/mistralai/client/models/chatcompletionchoice_union.py: - id: 970941f980d1 - last_write_checksum: sha1:2d4851170d49a274d0ddee61cdbb10dc36bc5d2a - pristine_git_object: 0bd55d47d4b11728cd85228b401c3063875ee459 + src/mistralai/client/models/chatcompletionchoice.py: + id: 7e6a512f6a04 + last_write_checksum: sha1:de0281a258140f081012b303e3c14e0b42acdf63 + pristine_git_object: 2c515f6e9a290ebab43bae41e07493e4b99afe8f src/mistralai/client/models/chatcompletionevent.py: id: d85484d0205e last_write_checksum: sha1:b709e6f710b62fee646eb7d12b24d69125522088 @@ -2837,8 +2825,8 @@ trackedFiles: pristine_git_object: 558efb7618b259dae8262cb671c7dc39cbd4729e src/mistralai/client/models/chatcompletionresponse.py: id: 669d996b8e82 - last_write_checksum: sha1:6adb894d14b6932f79d47b40d4801403f5aaedf6 - pristine_git_object: cdb7c37f2675eb70de7a3f3b9b5e3fc4b05abc94 + last_write_checksum: sha1:97f164fea881127ac82303e637b6a270e200ac5b + pristine_git_object: 7092bbc18425091d111ec998b33edc009ff0931b src/mistralai/client/models/chatcompletionstreamrequest.py: id: 18cb2b2415d4 last_write_checksum: sha1:be41df80620c88cd1f3f93b9e9aa31d1aa238075 @@ -3305,8 +3293,8 @@ trackedFiles: pristine_git_object: 2ca34598854f3777430de33d2acf2fc45f27fbcc src/mistralai/client/models/fimcompletionresponse.py: id: b860d2ba771e - last_write_checksum: sha1:4fe39c00b10e4d83f6b987393763b27d4610d799 - pristine_git_object: 441a913001ecec779c4c1ea569d7586450698e58 + last_write_checksum: sha1:dffd5a7005999340f57eaa94e17b2c82ddc7fd90 + pristine_git_object: 1345a116b7855ab4b824cf0369c0a5281e44ea97 src/mistralai/client/models/fimcompletionstreamrequest.py: id: 1d1ee09f1913 last_write_checksum: sha1:338c8d224fa5739296fe0e1ea1c00e65fba30b99 diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 2547237b..2d939a25 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -31,7 +31,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false python: - version: 2.1.1 + version: 2.1.2 additionalDependencies: dev: pytest: ^8.2.2 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 454dde75..c21d6bba 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -16,8 +16,8 @@ sources: - speakeasy-sdk-regen-1773084660 mistral-openapi: sourceNamespace: mistral-openapi - sourceRevisionDigest: sha256:07001643ff9c8cc14ad90b1339637698af0fcf923c6336398016ff927f825f2b - sourceBlobDigest: sha256:6566cab4050d1f6841c4717a5d0c91819dea84840d7c04b1194ca939aee3d8e7 + sourceRevisionDigest: sha256:4dfede971964b6bed279893ea59d78fb670e78c0f2492354ea25ffcdc4e56768 + sourceBlobDigest: sha256:54e2c0536c78ca593dc5f194cdd4994bf6a1d4f9e4b08e2f3c54c799b94ae414 tags: - latest targets: @@ -38,10 +38,10 @@ targets: mistralai-sdk: source: mistral-openapi sourceNamespace: mistral-openapi - sourceRevisionDigest: sha256:07001643ff9c8cc14ad90b1339637698af0fcf923c6336398016ff927f825f2b - sourceBlobDigest: sha256:6566cab4050d1f6841c4717a5d0c91819dea84840d7c04b1194ca939aee3d8e7 + sourceRevisionDigest: sha256:4dfede971964b6bed279893ea59d78fb670e78c0f2492354ea25ffcdc4e56768 + sourceBlobDigest: sha256:54e2c0536c78ca593dc5f194cdd4994bf6a1d4f9e4b08e2f3c54c799b94ae414 codeSamplesNamespace: mistral-openapi-code-samples - codeSamplesRevisionDigest: sha256:972495e91c76c3f044f7d71d8ccb55294421ddb6247c3e0b3dbd3c27490a7184 + codeSamplesRevisionDigest: sha256:73ee5f1c98a01d8413b3cfcd8aed9e41a2b23042ec6bd663d8d992437d4ab617 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.754.0 diff --git a/RELEASES.md b/RELEASES.md index cea03081..50c388e6 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -468,4 +468,14 @@ Based on: ### Generated - [python v2.1.1] . ### Releases -- [PyPI v2.1.1] https://pypi.org/project/mistralai/2.1.1 - . \ No newline at end of file +- [PyPI v2.1.1] https://pypi.org/project/mistralai/2.1.1 - . + +## 2026-03-20 13:48:41 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.754.0 (2.862.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.1.2] . +### Releases +- [PyPI v2.1.2] https://pypi.org/project/mistralai/2.1.2 - . \ No newline at end of file diff --git a/docs/models/chatcompletionchoice.md b/docs/models/chatcompletionchoice.md new file mode 100644 index 00000000..deaa0ea0 --- /dev/null +++ b/docs/models/chatcompletionchoice.md @@ -0,0 +1,10 @@ +# ChatCompletionChoice + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `index` | *int* | :heavy_check_mark: | N/A | 0 | +| `message` | [models.AssistantMessage](../models/assistantmessage.md) | :heavy_check_mark: | N/A | | +| `finish_reason` | [models.ChatCompletionChoiceFinishReason](../models/chatcompletionchoicefinishreason.md) | :heavy_check_mark: | N/A | stop | \ No newline at end of file diff --git a/docs/models/chatcompletionchoice1.md b/docs/models/chatcompletionchoice1.md deleted file mode 100644 index 269023f7..00000000 --- a/docs/models/chatcompletionchoice1.md +++ /dev/null @@ -1,11 +0,0 @@ -# ChatCompletionChoice1 - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `index` | *int* | :heavy_check_mark: | N/A | 0 | -| `message` | [models.AssistantMessage](../models/assistantmessage.md) | :heavy_check_mark: | N/A | | -| `finish_reason` | [models.ChatCompletionChoiceFinishReason1](../models/chatcompletionchoicefinishreason1.md) | :heavy_check_mark: | N/A | stop | -| `messages` | List[[models.AssistantMessage](../models/assistantmessage.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/chatcompletionchoice2.md b/docs/models/chatcompletionchoice2.md deleted file mode 100644 index 274565e8..00000000 --- a/docs/models/chatcompletionchoice2.md +++ /dev/null @@ -1,11 +0,0 @@ -# ChatCompletionChoice2 - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `index` | *int* | :heavy_check_mark: | N/A | 0 | -| `message` | [Optional[models.AssistantMessage]](../models/assistantmessage.md) | :heavy_minus_sign: | N/A | | -| `finish_reason` | [models.ChatCompletionChoiceFinishReason2](../models/chatcompletionchoicefinishreason2.md) | :heavy_check_mark: | N/A | stop | -| `messages` | List[[models.AssistantMessage](../models/assistantmessage.md)] | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/chatcompletionchoicefinishreason1.md b/docs/models/chatcompletionchoicefinishreason.md similarity index 77% rename from docs/models/chatcompletionchoicefinishreason1.md rename to docs/models/chatcompletionchoicefinishreason.md index f340dc9d..c2892726 100644 --- a/docs/models/chatcompletionchoicefinishreason1.md +++ b/docs/models/chatcompletionchoicefinishreason.md @@ -1,12 +1,12 @@ -# ChatCompletionChoiceFinishReason1 +# ChatCompletionChoiceFinishReason ## Example Usage ```python -from mistralai.client.models import ChatCompletionChoiceFinishReason1 +from mistralai.client.models import ChatCompletionChoiceFinishReason # Open enum: unrecognized values are captured as UnrecognizedStr -value: ChatCompletionChoiceFinishReason1 = "stop" +value: ChatCompletionChoiceFinishReason = "stop" ``` diff --git a/docs/models/chatcompletionchoicefinishreason2.md b/docs/models/chatcompletionchoicefinishreason2.md deleted file mode 100644 index 51abd6c1..00000000 --- a/docs/models/chatcompletionchoicefinishreason2.md +++ /dev/null @@ -1,21 +0,0 @@ -# ChatCompletionChoiceFinishReason2 - -## Example Usage - -```python -from mistralai.client.models import ChatCompletionChoiceFinishReason2 - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: ChatCompletionChoiceFinishReason2 = "stop" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"stop"` -- `"length"` -- `"model_length"` -- `"error"` -- `"tool_calls"` diff --git a/docs/models/chatcompletionchoiceunion.md b/docs/models/chatcompletionchoiceunion.md deleted file mode 100644 index c5777599..00000000 --- a/docs/models/chatcompletionchoiceunion.md +++ /dev/null @@ -1,17 +0,0 @@ -# ChatCompletionChoiceUnion - - -## Supported Types - -### `models.ChatCompletionChoice1` - -```python -value: models.ChatCompletionChoice1 = /* values here */ -``` - -### `models.ChatCompletionChoice2` - -```python -value: models.ChatCompletionChoice2 = /* values here */ -``` - diff --git a/docs/models/chatcompletionresponse.md b/docs/models/chatcompletionresponse.md index 2cde9a3f..a0465ffb 100644 --- a/docs/models/chatcompletionresponse.md +++ b/docs/models/chatcompletionresponse.md @@ -3,11 +3,11 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | N/A | cmpl-e5cc70bb28c444948073e77776eb30ef | -| `object` | *str* | :heavy_check_mark: | N/A | chat.completion | -| `model` | *str* | :heavy_check_mark: | N/A | mistral-small-latest | -| `usage` | [models.UsageInfo](../models/usageinfo.md) | :heavy_check_mark: | N/A | | -| `created` | *int* | :heavy_check_mark: | N/A | 1702256327 | -| `choices` | List[[models.ChatCompletionChoiceUnion](../models/chatcompletionchoiceunion.md)] | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | cmpl-e5cc70bb28c444948073e77776eb30ef | +| `object` | *str* | :heavy_check_mark: | N/A | chat.completion | +| `model` | *str* | :heavy_check_mark: | N/A | mistral-small-latest | +| `usage` | [models.UsageInfo](../models/usageinfo.md) | :heavy_check_mark: | N/A | | +| `created` | *int* | :heavy_check_mark: | N/A | 1702256327 | +| `choices` | List[[models.ChatCompletionChoice](../models/chatcompletionchoice.md)] | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/fimcompletionresponse.md b/docs/models/fimcompletionresponse.md index 0d92cc85..cd62d034 100644 --- a/docs/models/fimcompletionresponse.md +++ b/docs/models/fimcompletionresponse.md @@ -3,11 +3,11 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | N/A | cmpl-e5cc70bb28c444948073e77776eb30ef | -| `object` | *str* | :heavy_check_mark: | N/A | chat.completion | -| `model` | *str* | :heavy_check_mark: | N/A | codestral-latest | -| `usage` | [models.UsageInfo](../models/usageinfo.md) | :heavy_check_mark: | N/A | | -| `created` | *int* | :heavy_check_mark: | N/A | 1702256327 | -| `choices` | List[[models.ChatCompletionChoiceUnion](../models/chatcompletionchoiceunion.md)] | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | cmpl-e5cc70bb28c444948073e77776eb30ef | +| `object` | *str* | :heavy_check_mark: | N/A | chat.completion | +| `model` | *str* | :heavy_check_mark: | N/A | codestral-latest | +| `usage` | [models.UsageInfo](../models/usageinfo.md) | :heavy_check_mark: | N/A | | +| `created` | *int* | :heavy_check_mark: | N/A | 1702256327 | +| `choices` | List[[models.ChatCompletionChoice](../models/chatcompletionchoice.md)] | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 462d7b04..c1ea7450 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "mistralai" -version = "2.1.1" +version = "2.1.2" description = "Python Client SDK for the Mistral AI API." authors = [{ name = "Mistral" }] requires-python = ">=3.10" diff --git a/src/mistralai/client/_version.py b/src/mistralai/client/_version.py index 2ce42718..a5ba9a2a 100644 --- a/src/mistralai/client/_version.py +++ b/src/mistralai/client/_version.py @@ -4,10 +4,10 @@ import importlib.metadata __title__: str = "mistralai" -__version__: str = "2.1.1" +__version__: str = "2.1.2" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.862.0" -__user_agent__: str = "speakeasy-sdk/python 2.1.1 2.862.0 1.0.0 mistralai" +__user_agent__: str = "speakeasy-sdk/python 2.1.2 2.862.0 1.0.0 mistralai" try: if __package__ is not None: diff --git a/src/mistralai/client/models/__init__.py b/src/mistralai/client/models/__init__.py index 8363bb84..905fae94 100644 --- a/src/mistralai/client/models/__init__.py +++ b/src/mistralai/client/models/__init__.py @@ -196,15 +196,10 @@ ChatClassificationRequest, ChatClassificationRequestTypedDict, ) - from .chatcompletionchoice_union import ( - ChatCompletionChoice1, - ChatCompletionChoice1TypedDict, - ChatCompletionChoice2, - ChatCompletionChoice2TypedDict, - ChatCompletionChoiceFinishReason1, - ChatCompletionChoiceFinishReason2, - ChatCompletionChoiceUnion, - ChatCompletionChoiceUnionTypedDict, + from .chatcompletionchoice import ( + ChatCompletionChoice, + ChatCompletionChoiceFinishReason, + ChatCompletionChoiceTypedDict, ) from .chatcompletionevent import ( ChatCompletionEvent, @@ -1686,14 +1681,9 @@ "CampaignTypedDict", "ChatClassificationRequest", "ChatClassificationRequestTypedDict", - "ChatCompletionChoice1", - "ChatCompletionChoice1TypedDict", - "ChatCompletionChoice2", - "ChatCompletionChoice2TypedDict", - "ChatCompletionChoiceFinishReason1", - "ChatCompletionChoiceFinishReason2", - "ChatCompletionChoiceUnion", - "ChatCompletionChoiceUnionTypedDict", + "ChatCompletionChoice", + "ChatCompletionChoiceFinishReason", + "ChatCompletionChoiceTypedDict", "ChatCompletionEvent", "ChatCompletionEventExtraFields", "ChatCompletionEventExtraFieldsTypedDict", @@ -2779,14 +2769,9 @@ "CampaignTypedDict": ".campaign", "ChatClassificationRequest": ".chatclassificationrequest", "ChatClassificationRequestTypedDict": ".chatclassificationrequest", - "ChatCompletionChoice1": ".chatcompletionchoice_union", - "ChatCompletionChoice1TypedDict": ".chatcompletionchoice_union", - "ChatCompletionChoice2": ".chatcompletionchoice_union", - "ChatCompletionChoice2TypedDict": ".chatcompletionchoice_union", - "ChatCompletionChoiceFinishReason1": ".chatcompletionchoice_union", - "ChatCompletionChoiceFinishReason2": ".chatcompletionchoice_union", - "ChatCompletionChoiceUnion": ".chatcompletionchoice_union", - "ChatCompletionChoiceUnionTypedDict": ".chatcompletionchoice_union", + "ChatCompletionChoice": ".chatcompletionchoice", + "ChatCompletionChoiceFinishReason": ".chatcompletionchoice", + "ChatCompletionChoiceTypedDict": ".chatcompletionchoice", "ChatCompletionEvent": ".chatcompletionevent", "ChatCompletionEventExtraFields": ".chatcompletionevent", "ChatCompletionEventExtraFieldsTypedDict": ".chatcompletionevent", diff --git a/src/mistralai/client/models/chatcompletionchoice.py b/src/mistralai/client/models/chatcompletionchoice.py new file mode 100644 index 00000000..2c515f6e --- /dev/null +++ b/src/mistralai/client/models/chatcompletionchoice.py @@ -0,0 +1,34 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 7e6a512f6a04 + +from __future__ import annotations +from .assistantmessage import AssistantMessage, AssistantMessageTypedDict +from mistralai.client.types import BaseModel, UnrecognizedStr +from typing import Literal, Union +from typing_extensions import TypedDict + + +ChatCompletionChoiceFinishReason = Union[ + Literal[ + "stop", + "length", + "model_length", + "error", + "tool_calls", + ], + UnrecognizedStr, +] + + +class ChatCompletionChoiceTypedDict(TypedDict): + index: int + message: AssistantMessageTypedDict + finish_reason: ChatCompletionChoiceFinishReason + + +class ChatCompletionChoice(BaseModel): + index: int + + message: AssistantMessage + + finish_reason: ChatCompletionChoiceFinishReason diff --git a/src/mistralai/client/models/chatcompletionchoice_union.py b/src/mistralai/client/models/chatcompletionchoice_union.py deleted file mode 100644 index 0bd55d47..00000000 --- a/src/mistralai/client/models/chatcompletionchoice_union.py +++ /dev/null @@ -1,110 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -# @generated-id: 970941f980d1 - -from __future__ import annotations -from .assistantmessage import AssistantMessage, AssistantMessageTypedDict -from mistralai.client.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr -from pydantic import model_serializer -from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -ChatCompletionChoiceFinishReason2 = Union[ - Literal[ - "stop", - "length", - "model_length", - "error", - "tool_calls", - ], - UnrecognizedStr, -] - - -class ChatCompletionChoice2TypedDict(TypedDict): - index: int - finish_reason: ChatCompletionChoiceFinishReason2 - messages: List[AssistantMessageTypedDict] - message: NotRequired[AssistantMessageTypedDict] - - -class ChatCompletionChoice2(BaseModel): - index: int - - finish_reason: ChatCompletionChoiceFinishReason2 - - messages: List[AssistantMessage] - - message: Optional[AssistantMessage] = None - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["message"]) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -ChatCompletionChoiceFinishReason1 = Union[ - Literal[ - "stop", - "length", - "model_length", - "error", - "tool_calls", - ], - UnrecognizedStr, -] - - -class ChatCompletionChoice1TypedDict(TypedDict): - index: int - message: AssistantMessageTypedDict - finish_reason: ChatCompletionChoiceFinishReason1 - messages: NotRequired[List[AssistantMessageTypedDict]] - - -class ChatCompletionChoice1(BaseModel): - index: int - - message: AssistantMessage - - finish_reason: ChatCompletionChoiceFinishReason1 - - messages: Optional[List[AssistantMessage]] = None - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["messages"]) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -ChatCompletionChoiceUnionTypedDict = TypeAliasType( - "ChatCompletionChoiceUnionTypedDict", - Union[ChatCompletionChoice1TypedDict, ChatCompletionChoice2TypedDict], -) - - -ChatCompletionChoiceUnion = TypeAliasType( - "ChatCompletionChoiceUnion", Union[ChatCompletionChoice1, ChatCompletionChoice2] -) diff --git a/src/mistralai/client/models/chatcompletionresponse.py b/src/mistralai/client/models/chatcompletionresponse.py index cdb7c37f..7092bbc1 100644 --- a/src/mistralai/client/models/chatcompletionresponse.py +++ b/src/mistralai/client/models/chatcompletionresponse.py @@ -2,10 +2,7 @@ # @generated-id: 669d996b8e82 from __future__ import annotations -from .chatcompletionchoice_union import ( - ChatCompletionChoiceUnion, - ChatCompletionChoiceUnionTypedDict, -) +from .chatcompletionchoice import ChatCompletionChoice, ChatCompletionChoiceTypedDict from .usageinfo import UsageInfo, UsageInfoTypedDict from mistralai.client.types import BaseModel from typing import List @@ -18,7 +15,7 @@ class ChatCompletionResponseTypedDict(TypedDict): model: str usage: UsageInfoTypedDict created: int - choices: List[ChatCompletionChoiceUnionTypedDict] + choices: List[ChatCompletionChoiceTypedDict] class ChatCompletionResponse(BaseModel): @@ -32,4 +29,4 @@ class ChatCompletionResponse(BaseModel): created: int - choices: List[ChatCompletionChoiceUnion] + choices: List[ChatCompletionChoice] diff --git a/src/mistralai/client/models/fimcompletionresponse.py b/src/mistralai/client/models/fimcompletionresponse.py index 441a9130..1345a116 100644 --- a/src/mistralai/client/models/fimcompletionresponse.py +++ b/src/mistralai/client/models/fimcompletionresponse.py @@ -2,10 +2,7 @@ # @generated-id: b860d2ba771e from __future__ import annotations -from .chatcompletionchoice_union import ( - ChatCompletionChoiceUnion, - ChatCompletionChoiceUnionTypedDict, -) +from .chatcompletionchoice import ChatCompletionChoice, ChatCompletionChoiceTypedDict from .usageinfo import UsageInfo, UsageInfoTypedDict from mistralai.client.types import BaseModel from typing import List @@ -18,7 +15,7 @@ class FIMCompletionResponseTypedDict(TypedDict): model: str usage: UsageInfoTypedDict created: int - choices: List[ChatCompletionChoiceUnionTypedDict] + choices: List[ChatCompletionChoiceTypedDict] class FIMCompletionResponse(BaseModel): @@ -32,4 +29,4 @@ class FIMCompletionResponse(BaseModel): created: int - choices: List[ChatCompletionChoiceUnion] + choices: List[ChatCompletionChoice] diff --git a/uv.lock b/uv.lock index 576da6b0..e3e432a4 100644 --- a/uv.lock +++ b/uv.lock @@ -551,7 +551,7 @@ wheels = [ [[package]] name = "mistralai" -version = "2.1.1" +version = "2.1.2" source = { editable = "." } dependencies = [ { name = "eval-type-backport" },