From 8465245ddab25a804825a3b9245b8cb8840d542c Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 20 Mar 2026 14:43:17 +0000 Subject: [PATCH 1/5] =?UTF-8?q?##=20Python=20SDK=20Changes:=20*=20`mistral?= =?UTF-8?q?.beta.conversations.start()`:=20=20=20*=20=20`request.tools[]`?= =?UTF-8?q?=20**Changed**=20(Breaking=20=E2=9A=A0=EF=B8=8F)=20*=20`mistral?= =?UTF-8?q?.beta.conversations.list()`:=20=20`response.[].union(ModelConve?= =?UTF-8?q?rsation).tools[]`=20**Changed**=20(Breaking=20=E2=9A=A0?= =?UTF-8?q?=EF=B8=8F)=20*=20`mistral.beta.conversations.get()`:=20=20`resp?= =?UTF-8?q?onse.union(ModelConversation).tools[]`=20**Changed**=20(Breakin?= =?UTF-8?q?g=20=E2=9A=A0=EF=B8=8F)=20*=20`mistral.beta.conversations.start?= =?UTF-8?q?=5Fstream()`:=20=20=20*=20=20`request.tools[]`=20**Changed**=20?= =?UTF-8?q?(Breaking=20=E2=9A=A0=EF=B8=8F)=20*=20`mistral.beta.agents.crea?= =?UTF-8?q?te()`:=20=20=20*=20=20`request.tools[]`=20**Changed**=20(Breaki?= =?UTF-8?q?ng=20=E2=9A=A0=EF=B8=8F)=20=20=20*=20=20`response.tools[]`=20**?= =?UTF-8?q?Changed**=20(Breaking=20=E2=9A=A0=EF=B8=8F)=20*=20`mistral.beta?= =?UTF-8?q?.agents.list()`:=20=20`response.[].tools[]`=20**Changed**=20(Br?= =?UTF-8?q?eaking=20=E2=9A=A0=EF=B8=8F)=20*=20`mistral.beta.agents.get()`:?= =?UTF-8?q?=20=20`response.tools[]`=20**Changed**=20(Breaking=20=E2=9A=A0?= =?UTF-8?q?=EF=B8=8F)=20*=20`mistral.beta.agents.update()`:=20=20=20*=20?= =?UTF-8?q?=20`request.tools[]`=20**Changed**=20(Breaking=20=E2=9A=A0?= =?UTF-8?q?=EF=B8=8F)=20=20=20*=20=20`response.tools[]`=20**Changed**=20(B?= =?UTF-8?q?reaking=20=E2=9A=A0=EF=B8=8F)=20*=20`mistral.beta.agents.update?= =?UTF-8?q?=5Fversion()`:=20=20`response.tools[]`=20**Changed**=20(Breakin?= =?UTF-8?q?g=20=E2=9A=A0=EF=B8=8F)=20*=20`mistral.beta.agents.list=5Fversi?= =?UTF-8?q?ons()`:=20=20`response.[].tools[]`=20**Changed**=20(Breaking=20?= =?UTF-8?q?=E2=9A=A0=EF=B8=8F)=20*=20`mistral.beta.agents.get=5Fversion()`?= =?UTF-8?q?:=20=20`response.tools[]`=20**Changed**=20(Breaking=20=E2=9A=A0?= =?UTF-8?q?=EF=B8=8F)=20*=20`mistral.chat.complete()`:=20=20=20*=20=20`req?= =?UTF-8?q?uest`=20**Changed**=20(Breaking=20=E2=9A=A0=EF=B8=8F)=20=20=20*?= =?UTF-8?q?=20=20`response.choices[]`=20**Changed**=20(Breaking=20?= =?UTF-8?q?=E2=9A=A0=EF=B8=8F)=20*=20`mistral.chat.stream()`:=20=20`reques?= =?UTF-8?q?t`=20**Changed**=20(Breaking=20=E2=9A=A0=EF=B8=8F)=20*=20`mistr?= =?UTF-8?q?al.fim.complete()`:=20=20`response.choices[]`=20**Changed**=20(?= =?UTF-8?q?Breaking=20=E2=9A=A0=EF=B8=8F)=20*=20`mistral.agents.complete()?= =?UTF-8?q?`:=20=20=20*=20=20`request`=20**Changed**=20(Breaking=20?= =?UTF-8?q?=E2=9A=A0=EF=B8=8F)=20=20=20*=20=20`response.choices[]`=20**Cha?= =?UTF-8?q?nged**=20(Breaking=20=E2=9A=A0=EF=B8=8F)=20*=20`mistral.agents.?= =?UTF-8?q?stream()`:=20=20`request`=20**Changed**=20(Breaking=20=E2=9A=A0?= =?UTF-8?q?=EF=B8=8F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .speakeasy/gen.lock | 266 +++++++----------- .speakeasy/gen.yaml | 2 +- .speakeasy/workflow.lock | 10 +- README-PYPI.md | 8 - README.md | 8 - RELEASES.md | 12 +- USAGE.md | 8 - docs/models/agentscompletionrequest.md | 5 +- docs/models/agentscompletionrequesttools1.md | 47 ---- docs/models/agentscompletionrequesttools2.md | 17 -- docs/models/agentscompletionstreamrequest.md | 5 +- .../agentscompletionstreamrequesttools1.md | 47 ---- .../agentscompletionstreamrequesttools2.md | 17 -- docs/models/basefielddefinition.md | 14 +- docs/models/chatcompletionchoice.md | 10 + docs/models/chatcompletionchoice1.md | 11 - docs/models/chatcompletionchoice2.md | 11 - ...md => chatcompletionchoicefinishreason.md} | 6 +- .../chatcompletionchoicefinishreason2.md | 21 -- docs/models/chatcompletionchoiceunion.md | 17 -- docs/models/chatcompletionrequest.md | 5 +- docs/models/chatcompletionrequesttools1.md | 47 ---- docs/models/chatcompletionrequesttools2.md | 19 -- docs/models/chatcompletionresponse.md | 16 +- docs/models/chatcompletionstreamrequest.md | 5 +- .../chatcompletionstreamrequesttools1.md | 47 ---- .../chatcompletionstreamrequesttools2.md | 19 -- docs/models/codeinterpretertool.md | 8 +- docs/models/codeinterpretertooltype.md | 13 - docs/models/customconnector.md | 2 +- docs/models/customconnectortype.md | 13 - docs/models/documentlibrarytool.md | 10 +- docs/models/documentlibrarytooltype.md | 13 - docs/models/fimcompletionresponse.md | 16 +- docs/models/imagegenerationtool.md | 8 +- docs/models/imagegenerationtooltype.md | 13 - ...basefielddefinitiontype.md => typeenum.md} | 6 +- docs/models/websearchpremiumtool.md | 8 +- docs/models/websearchpremiumtooltype.md | 13 - docs/models/websearchtool.md | 2 +- docs/models/websearchtooltype.md | 13 - docs/sdks/agents/README.md | 10 +- docs/sdks/chat/README.md | 10 +- src/mistralai/client/_version.py | 4 +- src/mistralai/client/agents.py | 48 +--- src/mistralai/client/chat.py | 48 +--- src/mistralai/client/models/__init__.py | 122 ++------ .../client/models/agentscompletionrequest.py | 69 +---- .../models/agentscompletionstreamrequest.py | 69 +---- .../client/models/basefielddefinition.py | 6 +- .../client/models/chatcompletionchoice.py | 34 +++ .../models/chatcompletionchoice_union.py | 110 -------- .../client/models/chatcompletionrequest.py | 70 +---- .../client/models/chatcompletionresponse.py | 9 +- .../models/chatcompletionstreamrequest.py | 71 +---- .../client/models/codeinterpretertool.py | 28 +- .../client/models/conversationrequest.py | 20 +- .../models/conversationstreamrequest.py | 20 +- .../client/models/createagentrequest.py | 19 +- .../client/models/customconnector.py | 24 +- .../client/models/documentlibrarytool.py | 28 +- .../client/models/fimcompletionresponse.py | 9 +- .../client/models/imagegenerationtool.py | 28 +- .../client/models/updateagentrequest.py | 19 +- .../client/models/websearchpremiumtool.py | 28 +- src/mistralai/client/models/websearchtool.py | 25 +- 66 files changed, 424 insertions(+), 1342 deletions(-) delete mode 100644 docs/models/agentscompletionrequesttools1.md delete mode 100644 docs/models/agentscompletionrequesttools2.md delete mode 100644 docs/models/agentscompletionstreamrequesttools1.md delete mode 100644 docs/models/agentscompletionstreamrequesttools2.md create mode 100644 docs/models/chatcompletionchoice.md delete mode 100644 docs/models/chatcompletionchoice1.md delete mode 100644 docs/models/chatcompletionchoice2.md rename docs/models/{chatcompletionchoicefinishreason1.md => chatcompletionchoicefinishreason.md} (77%) delete mode 100644 docs/models/chatcompletionchoicefinishreason2.md delete mode 100644 docs/models/chatcompletionchoiceunion.md delete mode 100644 docs/models/chatcompletionrequesttools1.md delete mode 100644 docs/models/chatcompletionrequesttools2.md delete mode 100644 docs/models/chatcompletionstreamrequesttools1.md delete mode 100644 docs/models/chatcompletionstreamrequesttools2.md delete mode 100644 docs/models/codeinterpretertooltype.md delete mode 100644 docs/models/customconnectortype.md delete mode 100644 docs/models/documentlibrarytooltype.md delete mode 100644 docs/models/imagegenerationtooltype.md rename docs/models/{basefielddefinitiontype.md => typeenum.md} (67%) delete mode 100644 docs/models/websearchpremiumtooltype.md delete mode 100644 docs/models/websearchtooltype.md create mode 100644 src/mistralai/client/models/chatcompletionchoice.py delete mode 100644 src/mistralai/client/models/chatcompletionchoice_union.py diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index d44c268b..943cbc20 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: b5e9004e334f10e92bcdd2dda5add214 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: 5d5e9fc0-fa6b-4de0-a07a-341d5253e0bf + pristine_commit_hash: 71e334fc50f03122723915e87292d042754cf256 + pristine_tree_hash: 707ae8319edbeab9bafba92a056d810909f31a61 features: python: acceptHeaders: 3.0.0 @@ -61,8 +61,8 @@ trackedFiles: deleted: true USAGE.md: id: 3aed33ce6e6f - last_write_checksum: sha1:f2758c4f177674158f30097fae8d916be6bfb5c5 - pristine_git_object: fc624708474f8088a1f0855a668940f0a0a0c82a + last_write_checksum: sha1:d172deb3ee1630f16b279de22aec1f8f68d7565f + pristine_git_object: 9d32240a60c8885479c95388bb81c8024b5604ff docs/errors/httpvalidationerror.md: id: 7fe2e5327e07 last_write_checksum: sha1:277a46811144643262651853dc6176d21b33573e @@ -185,8 +185,8 @@ trackedFiles: pristine_git_object: 7548286af5d1db51fbfd29c893eb8afdc3c97c4d docs/models/agentscompletionrequest.md: id: 906b82c214dc - last_write_checksum: sha1:9a3b0e6dfc62cda48bb2b2772217d7748aa814c3 - pristine_git_object: 119c4bc807ffe4a09227afa3a8e3f67ee096d7b2 + last_write_checksum: sha1:7932ecb14b0e32f46e5a4b97c83581ecdca53ddf + pristine_git_object: 99f47f5cedb79f44393f0cdb3c9a26660500cdee docs/models/agentscompletionrequestmessage.md: id: 5337f0644b40 last_write_checksum: sha1:ecf7b7cdf0d24a5e97b520366cf816b8731734bb @@ -199,18 +199,10 @@ trackedFiles: id: bd8a6f9fbb47 last_write_checksum: sha1:f3d9ec3c82b6bbd2c3cbc320a71b927edcc292b1 pristine_git_object: 63b9dca9fbb8d829f93d8327a77fbc385a846c76 - docs/models/agentscompletionrequesttools1.md: - id: 85a79f0c6360 - last_write_checksum: sha1:0054d7ad7f3ce10edacad90fec077fe23317b4db - pristine_git_object: 61eb3257a7dc73e56d715706e12a4537bbf49a71 - docs/models/agentscompletionrequesttools2.md: - id: 7362c1585f5a - last_write_checksum: sha1:ba51c8d83f2ccf84e04d8c37820072466411cb2c - pristine_git_object: 5c1a4bc4623a792049766c8a3ab5613b23018b93 docs/models/agentscompletionstreamrequest.md: id: 21d09756447b - last_write_checksum: sha1:ac5e5e5e54035c79f0b3397f6b4b81080437c112 - pristine_git_object: ee24b68b31370c0ca7af388066056002f5f075cb + last_write_checksum: sha1:021b53d01c8f46c2a074defbb08736752e99ad9c + pristine_git_object: d5455230b1b5d640c19e1ee0f1c29361674077a7 docs/models/agentscompletionstreamrequestmessage.md: id: b309ade92081 last_write_checksum: sha1:98744c9646969250242cbbfbdf428dbd7030e4bb @@ -223,14 +215,6 @@ trackedFiles: id: b1f76f7a4e1c last_write_checksum: sha1:843c4946d5cab61df2cba458af40835c4e8bcafe pristine_git_object: 4354523a7d0d21721a96e91938b89236169ccced - docs/models/agentscompletionstreamrequesttools1.md: - id: 040d16e34648 - last_write_checksum: sha1:7c1cafca6e8b68175130ab8a8faba5bfdbf5a588 - pristine_git_object: fef7e190cc23e9ac6951e12f0de321ddb0a4bfeb - docs/models/agentscompletionstreamrequesttools2.md: - id: d996c51a1957 - last_write_checksum: sha1:323be3ad4250f3144a1a39c202be981c0e95a551 - pristine_git_object: d90093593cae6edb5bc4d706b165f9efdd54b0b9 docs/models/agenttool.md: id: 513b8b7bc0b7 last_write_checksum: sha1:8dedf7bcaa05492689ce0828e5644380258d5a7e @@ -317,12 +301,8 @@ trackedFiles: pristine_git_object: f8401a8e26c3d54aa47a1a6cc265050f0a4afc80 docs/models/basefielddefinition.md: id: f9e0bbae859b - last_write_checksum: sha1:fea96b146e5696ff3b93e6b6529fe4ace90616aa - pristine_git_object: 3d721d91572e4cdb8d5de5a2cdd294693f552d73 - docs/models/basefielddefinitiontype.md: - id: e0678603f859 - last_write_checksum: sha1:4c79afbbc22081d7ac18c3de963b92dd2dca0069 - pristine_git_object: efdff2a4bf26336c8f1880683fb2d798ee2d630d + last_write_checksum: sha1:28a4d2774231873af97debedcf2fba4f49e83bf2 + pristine_git_object: 3f7abea981c142e1fb1ba993a10dbd0e347b2df2 docs/models/basemodelcard.md: id: 2f62bfbd650e last_write_checksum: sha1:d42dfe36b103ee95f55e91ac306e3179060dfb3f @@ -363,26 +343,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 @@ -401,8 +369,8 @@ trackedFiles: pristine_git_object: dd2138278eb73abffc15fdc2583fe61c6c1f17d1 docs/models/chatcompletionrequest.md: id: adffe90369d0 - last_write_checksum: sha1:8bc525398b3e06d486d3e759c3221c59d41c00c5 - pristine_git_object: 14e860db0f75b41d9f9316a2d65434215c8831b6 + last_write_checksum: sha1:9979175951fd1540db1660f0c3494217b80cde61 + pristine_git_object: d335f908276165dfc7d1b92f55ff246fcf6d2e8a docs/models/chatcompletionrequestmessage.md: id: 3f5e170d418c last_write_checksum: sha1:7921c5a508a9f88adc01caab34e26182b8035607 @@ -415,22 +383,14 @@ trackedFiles: id: b97041b2f15b last_write_checksum: sha1:7ad7eb133f70e07d0d6a9def36aadd08b35cf861 pristine_git_object: dc82a8ef91e7bfd44f1d2d9d9a4ef61b6e76cc34 - docs/models/chatcompletionrequesttools1.md: - id: e811358cf0a2 - last_write_checksum: sha1:492a8d95f6882b77e928e7cd1478c5501ff47dfd - pristine_git_object: 9926c6d56335a618b2dd52e0de80a6e572cfdab5 - docs/models/chatcompletionrequesttools2.md: - id: e11c129a790e - last_write_checksum: sha1:d6a8fb76c8c6f8ebe88b6bebc688c93b87f99faf - 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 - pristine_git_object: b5f35a5ab4cdfeccbb2bc3219168c59103c6b8b7 + last_write_checksum: sha1:213564d7a2848ad3d390419c7e12a6b11c79982a + pristine_git_object: 9d50902fe8205ab7fc646074509a1ebf5e480eab docs/models/chatcompletionstreamrequestmessage.md: id: 053a98476cd2 last_write_checksum: sha1:8270692463fab1243d9de4bbef7162daa64e52c5 @@ -443,14 +403,6 @@ trackedFiles: id: 210d5e5b1413 last_write_checksum: sha1:0543164caf3f4fb2bef3061dbd1a5e6b34b17ae9 pristine_git_object: 43f3ca3809bf1a2a040e2ad7c19a2b22db0b73f8 - docs/models/chatcompletionstreamrequesttools1.md: - id: 97ecbd5846d6 - last_write_checksum: sha1:d10c00e0bf94342d2e0c54f5a61452f934e8da3d - pristine_git_object: fb7a968bffd4a4542338fcfcfa3747ff6e1d32aa - docs/models/chatcompletionstreamrequesttools2.md: - id: a5c63583cb81 - last_write_checksum: sha1:5009ab4f4518fde936e13c549d994263ce2fc571 - pristine_git_object: 273651d8326bc5ec3f4ff80592867ecd5a2b038d docs/models/chatmoderationrequest.md: id: 22862d4d20ec last_write_checksum: sha1:9bbe510ee67515092bd953ad7f84ae118398af54 @@ -533,12 +485,8 @@ trackedFiles: pristine_git_object: 3b6f3be6942bbcf56261f773864a518d16923880 docs/models/codeinterpretertool.md: id: f009740c6e54 - last_write_checksum: sha1:8f6a07297073cd031b5b2cde48f8f5dc33eca3b9 - pristine_git_object: 9fd6a90785e11593a5ab18d873c2e8974f687615 - docs/models/codeinterpretertooltype.md: - id: d6d0f83de515 - last_write_checksum: sha1:55c1ace70ca09529d03e6fcb4e37aabbf3f2f45e - pristine_git_object: 7f95f5da826c18822176e477d26f8a5a3e05a05b + last_write_checksum: sha1:a2114d61a98a48b4365a77c0c75c06ca834367ad + pristine_git_object: 6302fc627d7c49442b6c9aec19c70fdceaf7c519 docs/models/completionargs.md: id: 3b54534f9830 last_write_checksum: sha1:3629a70a095750b82bc60a80c0a2b3e3496bafba @@ -853,12 +801,8 @@ trackedFiles: pristine_git_object: 71562806dbec6444dcdd0a19852a31ca00b6229a docs/models/customconnector.md: id: 7bcc77607afa - last_write_checksum: sha1:542fe858ababf1d56024d1766e68f6d388d6e874 - pristine_git_object: d238eb5f86a00cf51b3146dc482cb378c9711bc4 - docs/models/customconnectortype.md: - id: 8918c5e0ca8d - last_write_checksum: sha1:82bad5f8c0b4e4c2a11da24dd8cc51f59aa1e29e - pristine_git_object: e2c8e0e03434843dc7ecd2413e7d4c5d647364af + last_write_checksum: sha1:ce9e8ffac3f83e08269fbed5d2dffbfeb9f8649a + pristine_git_object: 0a0b69217abb0fbcbe30fad32c239aea070d3740 docs/models/dataset.md: id: 31af4d237e19 last_write_checksum: sha1:073fa9a0b7891ccd9b6ae64ba960d74eeb5c9007 @@ -925,12 +869,8 @@ trackedFiles: pristine_git_object: 42c639a6a9b235ab4c754286486fa7e8872a0e7e docs/models/documentlibrarytool.md: id: 68083b0ef8f3 - last_write_checksum: sha1:00eac0753cc8f509d9f3b560cdd302537fc492df - pristine_git_object: d22ff33a9697700fb605ed661d2c70179c3b75a5 - docs/models/documentlibrarytooltype.md: - id: 23c5ba5c4b3f - last_write_checksum: sha1:c8a4364d8a80b94d81c70a8202bde70763bd6acf - pristine_git_object: 945452e3807b1aceae15ee0015f53c347b3636b7 + last_write_checksum: sha1:76b9f47c399915a338abe929cb10c1b37282eadf + pristine_git_object: 95c3fa52ee3ff29e72bc0240a98c0afaa0cd5f62 docs/models/documenttextcontent.md: id: 29587399f346 last_write_checksum: sha1:93382da0228027a02501abbcf681f247814d3d68 @@ -1097,8 +1037,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 @@ -1273,12 +1213,8 @@ trackedFiles: pristine_git_object: bd7ea1fe08f2fcc737d6951a44584e22578ed9ba docs/models/imagegenerationtool.md: id: d5deb6b06d28 - last_write_checksum: sha1:782948e17f9e3119910eef09ddecf74b13b2735a - pristine_git_object: 93edbbf8a8139d2029b46e2379ae88bb85a9972d - docs/models/imagegenerationtooltype.md: - id: fc670aabaff7 - last_write_checksum: sha1:fdb97734f6943a163affd2eb69e861d574d1afbf - pristine_git_object: 7763ca21563d123dae99f6dc8899163a035e2db0 + last_write_checksum: sha1:a1813ef99e4a0990fd073bb2311c475e88072029 + pristine_git_object: b476b6f2733a49767d7f7a4ad091fc321ab514f4 docs/models/imageurl.md: id: e75dd23cec1d last_write_checksum: sha1:a5cf621ce58a9cc7c96afa7de53367eac7b4cb0b @@ -2223,6 +2159,10 @@ trackedFiles: id: 69a13554b554 last_write_checksum: sha1:d969f462034ed356f2c8713b601ee7d873d4ce07 pristine_git_object: 77bd0ddcf8a1d95707fa9e041de3a47bb9e7f56d + docs/models/typeenum.md: + id: d306d1d601a4 + last_write_checksum: sha1:f0f0bfac75bf5e5fcd972d0cb196961d512d40ad + pristine_git_object: ec47cf9668f839469c9ab71c010f3e1975be929c docs/models/unarchivemodelresponse.md: id: a690f43df567 last_write_checksum: sha1:5c9d4b78c92d30bb4835cb724d1ea22a19bf5327 @@ -2341,28 +2281,20 @@ trackedFiles: pristine_git_object: d12bc31191ba534a9744d78f657c19e7f93f777a docs/models/websearchpremiumtool.md: id: 267988aa8c3f - last_write_checksum: sha1:2b9723ebee6793f1fef80a17b7f08695af1555f7 - pristine_git_object: 27951776158b6dc07c1a1e175aad6874bca3ea1d - docs/models/websearchpremiumtooltype.md: - id: c70fa6b0ee9f - last_write_checksum: sha1:4892fd886ef09e8ace205a636292aea727720628 - pristine_git_object: e4f3d7bf27593f99fb344a27d6149ff280dd9001 + last_write_checksum: sha1:38f80a43f73a13ddedc7730f853c092a48b665f9 + pristine_git_object: 78b736cd314617caa0d77f3c42015212e37ab539 docs/models/websearchtool.md: id: fc4df52fb9b5 - last_write_checksum: sha1:c84ff90f03fe964d4e3b77958dccaadeac89c127 - pristine_git_object: 5dfd8c22c4434003e77a772df2642032891da0e6 - docs/models/websearchtooltype.md: - id: 6591e569c4f3 - last_write_checksum: sha1:961d8f5e9aaaaa88150f4164a871cf06dfdcbb84 - pristine_git_object: 89af0c4da9b28107e6e938b2289b25388285e2a2 + last_write_checksum: sha1:72636dc7ae74264bb5158d284ef6f83da5290b27 + pristine_git_object: 4ca7333c412ad819e3e02c61debe402e3f9b0af9 docs/sdks/accesses/README.md: id: 2ea167c2eff2 last_write_checksum: sha1:663516c8c94ca324b938a5d5bd1196663cb1de88 pristine_git_object: 51051e2f8def9bfd6032617530ba9bead989404f docs/sdks/agents/README.md: id: 5965d8232fd8 - last_write_checksum: sha1:8af2c47744428babaed655bbfb984964c64d6b4e - pristine_git_object: 76d6a57c19f09d951bd328bbcd0338e0d41cf625 + last_write_checksum: sha1:95844e1e50f850f71580e08ed9cd1ffdefa899bc + pristine_git_object: 46fb60ef4f92d61b2959f1b67e5f07e5bae55ba7 docs/sdks/batchjobs/README.md: id: a3b8043c6336 last_write_checksum: sha1:b4b3123ff210545048e2b0c729f2b7e5f7460f4e @@ -2377,8 +2309,8 @@ trackedFiles: pristine_git_object: d5d7e4d4681811419874f58c294cb59688e595aa docs/sdks/chat/README.md: id: 393193527c2c - last_write_checksum: sha1:c6cf1a026f4717962ef50c3deb014bd39d37e2f4 - pristine_git_object: 6d7d00075f8a1419f5e46f83dee5994f3a9ef08a + last_write_checksum: sha1:8527d41d1095e052f0b71a9e5f7075f0a722447f + pristine_git_object: 61c8813f3f168bf958edadd985875498e5205497 docs/sdks/chatcompletionevents/README.md: id: 6965539e0525 last_write_checksum: sha1:ae7c0a0e7576a1114a85b9e607cb91c2ac1181a2 @@ -2481,16 +2413,16 @@ 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 pristine_git_object: 2cfdc7da91be41177f62b8ac7b2fe48aba42e496 src/mistralai/client/agents.py: id: e946546e3eaa - last_write_checksum: sha1:bb272f94ff3e2bd86ef4aa5ec036c499951bc4a0 - pristine_git_object: 8ac699623e8bb88b545eb34e715bc2d50e40e069 + last_write_checksum: sha1:bd526b7613c13f07adee931996ec7fed54e72f26 + pristine_git_object: 2e91dd04aa66e340db8fe61ee8f04abf67798eaf src/mistralai/client/audio.py: id: 7a8ed2e90d61 last_write_checksum: sha1:b9dc19b4b6070baf7d8937907b8665e9f0e36afd @@ -2521,8 +2453,8 @@ trackedFiles: pristine_git_object: a1ffcebc7c98a3c889ccace55c9a6c9cf3ff28df src/mistralai/client/chat.py: id: 7eba0f088d47 - last_write_checksum: sha1:5dde26716e632c3c84faf33cc4b6eb187dff2928 - pristine_git_object: 8c73bdc9a0e2f6bf41bc3abf0576e215467fa4dd + last_write_checksum: sha1:dced89ea82a30a61e0c62db2f2a0c3be8a7ba099 + pristine_git_object: c11a53d1237c284ff74b5aba791bd405bac2d0ff src/mistralai/client/chat_completion_events.py: id: 1813f339625b last_write_checksum: sha1:cde21c8338e4fd60143fdc6ca361c0c42ec54775 @@ -2613,8 +2545,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:a1e0aa6e1959ee7380d30eea984d79bcd84a6203 + pristine_git_object: 05756e5b68c67b3697636bc49939edc6e5b701e8 src/mistralai/client/models/agent.py: id: 1336849c84fb last_write_checksum: sha1:2574866d9855cb0b6314ac94ca288d59f3196c73 @@ -2717,12 +2649,12 @@ trackedFiles: pristine_git_object: 3186d5df9000d4a62c0fbc64a601e6b709803deb src/mistralai/client/models/agentscompletionrequest.py: id: 3960bc4c545f - last_write_checksum: sha1:150523bb6aca6d81e3e6d4c78a6a93a536f7b4ac - pristine_git_object: 527d6230d4e42da8de2b3b3d114b7eb62e679049 + last_write_checksum: sha1:87237462a5289c5aac2d1ce59b8b766342dd5ccd + pristine_git_object: f4ce34cb614a992f5276a1664d05426b2b16766a src/mistralai/client/models/agentscompletionstreamrequest.py: id: 1b73f90befc2 - last_write_checksum: sha1:b0f62e7e88f6c73c4be95dbefe3af158f5c8b074 - pristine_git_object: 483ec99c0df4db5a0f154da14cdc0b9070d0fd7a + last_write_checksum: sha1:a449cb9287617ba7337a73777b7ab50479e7cd87 + pristine_git_object: 0feb38038f5aec52bb393c633a0913b99b1579a7 src/mistralai/client/models/annotations.py: id: 3ae9e07de11d last_write_checksum: sha1:c015e86fa53f60f6fccce2be63b2faf8a6d81f38 @@ -2777,8 +2709,8 @@ trackedFiles: pristine_git_object: 1f5a6639b3fae3a5c96cf35bc4417d5d5151a37f src/mistralai/client/models/basefielddefinition.py: id: ffa42818fea3 - last_write_checksum: sha1:a323bc4117cecf4ffcb228cf896e7ceae02f9b6d - pristine_git_object: acf9cf8d6fc3220f736b7c6cfe32d42425febd2a + last_write_checksum: sha1:7d7b08ba19500836193c593bacc1dd6982c9ef71 + pristine_git_object: b57ff2cab05c7a2a7f10292ff1c017eb58a10f84 src/mistralai/client/models/basemodelcard.py: id: 556ebdc33276 last_write_checksum: sha1:1a1d261bad5394f01bbad562e8eee941014b7d9e @@ -2819,10 +2751,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 @@ -2833,16 +2765,16 @@ trackedFiles: pristine_git_object: e7fef9d08ca3d8ea1fa1f63c5847a5f8a6d74201 src/mistralai/client/models/chatcompletionrequest.py: id: 9979805d8c38 - last_write_checksum: sha1:fc65418994a7f4fba8ca2bf0f240a9dc604cb4d1 - pristine_git_object: 558efb7618b259dae8262cb671c7dc39cbd4729e + last_write_checksum: sha1:bcc680ee202ce920823502f59f8549453cf4a999 + pristine_git_object: f1b0b2d61beae2827b9f66331d74850e7c56be91 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 - pristine_git_object: 4d92d524b8d1159cbb87c0cb22d80c17fd888a05 + last_write_checksum: sha1:dd9dc2cd5d154e7a8e6cff928fe47582e0d4bd81 + pristine_git_object: d9f413c673b030a4ebd1cd363b0376a009b45540 src/mistralai/client/models/chatmoderationrequest.py: id: 057aecb07275 last_write_checksum: sha1:7677494c0e36ccbc201384cb587abeb852a1a924 @@ -2893,8 +2825,8 @@ trackedFiles: pristine_git_object: 3a9576c830163d351b5d8f6b66bb612fca12b844 src/mistralai/client/models/codeinterpretertool.py: id: 950cd8f4ad49 - last_write_checksum: sha1:ad38c653d3355ffd9d000bde82d83481939e3495 - pristine_git_object: 3c6a384fbbf18feea672f309c892c2e78acfe737 + last_write_checksum: sha1:248d6e6c1906303f03eb4f29429227a7d39679a2 + pristine_git_object: 4cf9d055c3aaee426d99071180ae6de21eb648cf src/mistralai/client/models/completionargs.py: id: 3db008bcddca last_write_checksum: sha1:1c9918b8b9631471dcee25f6608c026770810a2f @@ -3021,8 +2953,8 @@ trackedFiles: pristine_git_object: 6bfc5894b329531c7845d0457209a0d5c35c0145 src/mistralai/client/models/conversationrequest.py: id: 58e3ae67f149 - last_write_checksum: sha1:0c4616fe65bac48a5b5ff9b583da748fd76bcc5d - pristine_git_object: 5b6951bf0f04cd19db3ad8790f3f52f796cc41e7 + last_write_checksum: sha1:66c8ac371f79d0ec93cae4ee2afe8cfe37edae4a + pristine_git_object: f7ed89b51f3a747f5058666a36700ced23e14c7d src/mistralai/client/models/conversationresponse.py: id: ad7a8472c7bf last_write_checksum: sha1:cd45eec534ccd27052d9809f8aafedeee243d9f9 @@ -3041,8 +2973,8 @@ trackedFiles: pristine_git_object: a3b93b61b842002fc9fbb05815b800fb1294cb52 src/mistralai/client/models/conversationstreamrequest.py: id: 58d633507527 - last_write_checksum: sha1:4ca22e6062a10c03b2050165b98c0ea7345c23d8 - pristine_git_object: 9a323e2af341593c6a1e95c99efe4bf4141d7a8f + last_write_checksum: sha1:b5260447a552fd71a3c45aa0c2105b7db94026f7 + pristine_git_object: 4ec455b21b61d6f45bbf2a17fa5edc2edbc5fab9 src/mistralai/client/models/conversationusageinfo.py: id: 6685e3b50b50 last_write_checksum: sha1:ee993afc39cece27caf99ee60258f45980d86cbc @@ -3053,8 +2985,8 @@ trackedFiles: pristine_git_object: 03156fa31f51655dfd9bda21082710b1d1f42907 src/mistralai/client/models/createagentrequest.py: id: 442629bd914b - last_write_checksum: sha1:fe48fea4272f841faaa8a8770bcdf4d38031c383 - pristine_git_object: 78a9cd24972b7245e4ee6e4e489d4bae6cd05f6b + last_write_checksum: sha1:ebc559195377b1526a1aa5ad7344d934daf96b2f + pristine_git_object: b31fbc9178ad57fc290114061fd500f67657e89e src/mistralai/client/models/createbatchjobrequest.py: id: 56e24cd24e98 last_write_checksum: sha1:9061e5f387d98c2c2f624efafd6ef178dfad6b43 @@ -3097,8 +3029,8 @@ trackedFiles: pristine_git_object: 28dda0cb8c5ba2462ed0f68f19747447c6ae401b src/mistralai/client/models/customconnector.py: id: 14f3643f7703 - last_write_checksum: sha1:5001ec4c8d744a66a66a14ae5085064c5f119049 - pristine_git_object: 9235dfd95e752f7a20598401c129ffcfec74b4bf + last_write_checksum: sha1:2162c7e4b3a9c747c5da88e72315d138f28dea5d + pristine_git_object: f3a1e2ffb1a29e8798a2ac8c9c636ac3bada7413 src/mistralai/client/models/dataset.py: id: cbf14670ee00 last_write_checksum: sha1:012f85ebfbdb286436621efc3b5b1adb150871f3 @@ -3161,8 +3093,8 @@ trackedFiles: pristine_git_object: 8d1aea883e579ff1677949573f43dddc362bd35d src/mistralai/client/models/documentlibrarytool.py: id: 3eb3c218f457 - last_write_checksum: sha1:a677b07da68e42bd67078e040519d6b166124ac8 - pristine_git_object: aa3093f4ef6b373c078af9734b00eae5ef713a25 + last_write_checksum: sha1:a84295aba7b9e7f70b68f279934d1a5ca0817f77 + pristine_git_object: 29f8d64a695342489d81bfe20ec2f8de60546ddd src/mistralai/client/models/documenttextcontent.py: id: e730005e44cb last_write_checksum: sha1:c86f4b15e8fda1cd5c173da01462342cd22b7286 @@ -3305,8 +3237,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 @@ -3461,8 +3393,8 @@ trackedFiles: pristine_git_object: 1982d357277a92fc7ebea3b99146116596d99c78 src/mistralai/client/models/imagegenerationtool.py: id: e1532275faa0 - last_write_checksum: sha1:0e31f3c2d0b36a676ed136e3551435b5b4861566 - pristine_git_object: 5012a5657b18950bb402133a8a65821c23b3a423 + last_write_checksum: sha1:0fcb9fdeffe252c88497f02164f7e753bea40ff1 + pristine_git_object: 0dd4a4d2a4671bb310410eb17bb85032638d817c src/mistralai/client/models/imageurl.py: id: e4bbf5881fbf last_write_checksum: sha1:a3e5c91291a5fcc24bda8fc1c96a2608965edae5 @@ -4257,8 +4189,8 @@ trackedFiles: pristine_git_object: a11b626a9b4ec3b1761bb383dda2cead843ee634 src/mistralai/client/models/updateagentrequest.py: id: 914b4b2be67a - last_write_checksum: sha1:9b2e91f96cc1153d15c2f48d347174732df38acc - pristine_git_object: 8fec91498119cc7e9ee64f3300600cd04a98cfb4 + last_write_checksum: sha1:0917571c77c739ae6c158b2adcd5df7ebc332f4f + pristine_git_object: df4664fa294ab8e900d0a0f060f35e6c82a0825d src/mistralai/client/models/updateconnectorrequest.py: id: a761cd154109 last_write_checksum: sha1:cdf3aa496722d84b0a76d52ce76133cfaafb0073 @@ -4333,12 +4265,12 @@ trackedFiles: pristine_git_object: e64bb27c9142d3fe312e8d7476893382dab20722 src/mistralai/client/models/websearchpremiumtool.py: id: bfe88af887e3 - last_write_checksum: sha1:6c6344f5b429cd1f37b58daaf08ed281fe124fbd - pristine_git_object: 249e18402ec4842ed78816a6ca93bec50c2dd8a5 + last_write_checksum: sha1:bdb724b386fe512c2b6db6bd2931ea71c796dbc9 + pristine_git_object: 5c929e94c20159cf394a9f95ef990a926643f0ea src/mistralai/client/models/websearchtool.py: id: 26b0903423e5 - last_write_checksum: sha1:ac79e5882823ebcea821ee8a497703b188e02632 - pristine_git_object: 9f372ec00aa765cbfe748624eefa3bf696f5beaa + last_write_checksum: sha1:e486f50095cc7540ce828fff7571c6aa6748bf2f + pristine_git_object: f82b6ec1c89cae83ea21d9bae12a1984679262ae src/mistralai/client/models_.py: id: 1d277958a843 last_write_checksum: sha1:f68fc105aca375b135a00026dbbec818cd55cd73 @@ -6467,11 +6399,7 @@ examples: application/json: {} examplesVersion: 1.0.2 generatedTests: {} -releaseNotes: | - ## Python SDK Changes: - * `mistral.chat.complete()`: `response.choices[]` **Changed** (Breaking ⚠️) - * `mistral.fim.complete()`: `response.choices[]` **Changed** (Breaking ⚠️) - * `mistral.agents.complete()`: `response.choices[]` **Changed** (Breaking ⚠️) +releaseNotes: "## Python SDK Changes:\n* `mistral.beta.conversations.start()`: \n * `request.tools[]` **Changed** (Breaking ⚠️)\n* `mistral.beta.conversations.list()`: `response.[].union(ModelConversation).tools[]` **Changed** (Breaking ⚠️)\n* `mistral.beta.conversations.get()`: `response.union(ModelConversation).tools[]` **Changed** (Breaking ⚠️)\n* `mistral.beta.conversations.start_stream()`: \n * `request.tools[]` **Changed** (Breaking ⚠️)\n* `mistral.beta.agents.create()`: \n * `request.tools[]` **Changed** (Breaking ⚠️)\n * `response.tools[]` **Changed** (Breaking ⚠️)\n* `mistral.beta.agents.list()`: `response.[].tools[]` **Changed** (Breaking ⚠️)\n* `mistral.beta.agents.get()`: `response.tools[]` **Changed** (Breaking ⚠️)\n* `mistral.beta.agents.update()`: \n * `request.tools[]` **Changed** (Breaking ⚠️)\n * `response.tools[]` **Changed** (Breaking ⚠️)\n* `mistral.beta.agents.update_version()`: `response.tools[]` **Changed** (Breaking ⚠️)\n* `mistral.beta.agents.list_versions()`: `response.[].tools[]` **Changed** (Breaking ⚠️)\n* `mistral.beta.agents.get_version()`: `response.tools[]` **Changed** (Breaking ⚠️)\n* `mistral.chat.complete()`: \n * `request` **Changed** (Breaking ⚠️)\n * `response.choices[]` **Changed** (Breaking ⚠️)\n* `mistral.chat.stream()`: `request` **Changed** (Breaking ⚠️)\n* `mistral.fim.complete()`: `response.choices[]` **Changed** (Breaking ⚠️)\n* `mistral.agents.complete()`: \n * `request` **Changed** (Breaking ⚠️)\n * `response.choices[]` **Changed** (Breaking ⚠️)\n* `mistral.agents.stream()`: `request` **Changed** (Breaking ⚠️)\n" generatedFiles: - .gitattributes - .vscode/settings.json 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..69bef81b 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:2796a05e4b9f32ebc2ffa6b195b959507d7d2683f6b06593781cc8ebdcd7cb6f + sourceBlobDigest: sha256:9e5029c7cf5ae151e2b0a123e70013dc6d9a58b8127884cf33e85fa3be32abee tags: - latest targets: @@ -38,10 +38,10 @@ targets: mistralai-sdk: source: mistral-openapi sourceNamespace: mistral-openapi - sourceRevisionDigest: sha256:07001643ff9c8cc14ad90b1339637698af0fcf923c6336398016ff927f825f2b - sourceBlobDigest: sha256:6566cab4050d1f6841c4717a5d0c91819dea84840d7c04b1194ca939aee3d8e7 + sourceRevisionDigest: sha256:2796a05e4b9f32ebc2ffa6b195b959507d7d2683f6b06593781cc8ebdcd7cb6f + sourceBlobDigest: sha256:9e5029c7cf5ae151e2b0a123e70013dc6d9a58b8127884cf33e85fa3be32abee codeSamplesNamespace: mistral-openapi-code-samples - codeSamplesRevisionDigest: sha256:972495e91c76c3f044f7d71d8ccb55294421ddb6247c3e0b3dbd3c27490a7184 + codeSamplesRevisionDigest: sha256:5aa694bacc4be160d5afb6c05c08407744acbc82e951d650b2a2faaeb13e4271 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.754.0 diff --git a/README-PYPI.md b/README-PYPI.md index 7b238181..625c6558 100644 --- a/README-PYPI.md +++ b/README-PYPI.md @@ -159,8 +159,6 @@ with Mistral( }, ], stream=False, response_format={ "type": "text", - }, additional_properties={ - }) # Handle response @@ -190,8 +188,6 @@ async def main(): }, ], stream=False, response_format={ "type": "text", - }, additional_properties={ - }) # Handle response @@ -271,8 +267,6 @@ with Mistral( }, ], agent_id="", stream=False, response_format={ "type": "text", - }, additional_properties={ - }) # Handle response @@ -302,8 +296,6 @@ async def main(): }, ], agent_id="", stream=False, response_format={ "type": "text", - }, additional_properties={ - }) # Handle response diff --git a/README.md b/README.md index 0ca3d949..54374697 100644 --- a/README.md +++ b/README.md @@ -159,8 +159,6 @@ with Mistral( }, ], stream=False, response_format={ "type": "text", - }, additional_properties={ - }) # Handle response @@ -190,8 +188,6 @@ async def main(): }, ], stream=False, response_format={ "type": "text", - }, additional_properties={ - }) # Handle response @@ -271,8 +267,6 @@ with Mistral( }, ], agent_id="", stream=False, response_format={ "type": "text", - }, additional_properties={ - }) # Handle response @@ -302,8 +296,6 @@ async def main(): }, ], agent_id="", stream=False, response_format={ "type": "text", - }, additional_properties={ - }) # Handle response diff --git a/RELEASES.md b/RELEASES.md index cea03081..c557596d 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 14:40:56 +### 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/USAGE.md b/USAGE.md index cce299c7..bb01b160 100644 --- a/USAGE.md +++ b/USAGE.md @@ -20,8 +20,6 @@ with Mistral( }, ], stream=False, response_format={ "type": "text", - }, additional_properties={ - }) # Handle response @@ -51,8 +49,6 @@ async def main(): }, ], stream=False, response_format={ "type": "text", - }, additional_properties={ - }) # Handle response @@ -132,8 +128,6 @@ with Mistral( }, ], agent_id="", stream=False, response_format={ "type": "text", - }, additional_properties={ - }) # Handle response @@ -163,8 +157,6 @@ async def main(): }, ], agent_id="", stream=False, response_format={ "type": "text", - }, additional_properties={ - }) # Handle response diff --git a/docs/models/agentscompletionrequest.md b/docs/models/agentscompletionrequest.md index 119c4bc8..99f47f5c 100644 --- a/docs/models/agentscompletionrequest.md +++ b/docs/models/agentscompletionrequest.md @@ -12,7 +12,7 @@ | `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | | `messages` | List[[models.AgentsCompletionRequestMessage](../models/agentscompletionrequestmessage.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | | `response_format` | [Optional[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | -| `tools` | [OptionalNullable[models.AgentsCompletionRequestTools2]](../models/agentscompletionrequesttools2.md) | :heavy_minus_sign: | N/A | | +| `tools` | List[[models.Tool](../models/tool.md)] | :heavy_minus_sign: | N/A | | | `tool_choice` | [Optional[models.AgentsCompletionRequestToolChoice]](../models/agentscompletionrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | | `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | | `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | @@ -22,5 +22,4 @@ | `reasoning_effort` | [OptionalNullable[models.ReasoningEffort]](../models/reasoningeffort.md) | :heavy_minus_sign: | N/A | | | `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | | `guardrails` | List[[models.GuardrailConfig](../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | | -| `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to use for this completion. | | -| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to use for this completion. | | \ No newline at end of file diff --git a/docs/models/agentscompletionrequesttools1.md b/docs/models/agentscompletionrequesttools1.md deleted file mode 100644 index 61eb3257..00000000 --- a/docs/models/agentscompletionrequesttools1.md +++ /dev/null @@ -1,47 +0,0 @@ -# AgentsCompletionRequestTools1 - - -## Supported Types - -### `models.WebSearchTool` - -```python -value: models.WebSearchTool = /* values here */ -``` - -### `models.WebSearchPremiumTool` - -```python -value: models.WebSearchPremiumTool = /* values here */ -``` - -### `models.CodeInterpreterTool` - -```python -value: models.CodeInterpreterTool = /* values here */ -``` - -### `models.ImageGenerationTool` - -```python -value: models.ImageGenerationTool = /* values here */ -``` - -### `models.DocumentLibraryTool` - -```python -value: models.DocumentLibraryTool = /* values here */ -``` - -### `models.CustomConnector` - -```python -value: models.CustomConnector = /* values here */ -``` - -### `models.Tool` - -```python -value: models.Tool = /* values here */ -``` - diff --git a/docs/models/agentscompletionrequesttools2.md b/docs/models/agentscompletionrequesttools2.md deleted file mode 100644 index 5c1a4bc4..00000000 --- a/docs/models/agentscompletionrequesttools2.md +++ /dev/null @@ -1,17 +0,0 @@ -# AgentsCompletionRequestTools2 - - -## Supported Types - -### `List[models.AgentsCompletionRequestTools1]` - -```python -value: List[models.AgentsCompletionRequestTools1] = /* values here */ -``` - -### `List[str]` - -```python -value: List[str] = /* values here */ -``` - diff --git a/docs/models/agentscompletionstreamrequest.md b/docs/models/agentscompletionstreamrequest.md index ee24b68b..d5455230 100644 --- a/docs/models/agentscompletionstreamrequest.md +++ b/docs/models/agentscompletionstreamrequest.md @@ -12,7 +12,7 @@ | `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | | `messages` | List[[models.AgentsCompletionStreamRequestMessage](../models/agentscompletionstreamrequestmessage.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | | `response_format` | [Optional[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | -| `tools` | [OptionalNullable[models.AgentsCompletionStreamRequestTools2]](../models/agentscompletionstreamrequesttools2.md) | :heavy_minus_sign: | N/A | | +| `tools` | List[[models.Tool](../models/tool.md)] | :heavy_minus_sign: | N/A | | | `tool_choice` | [Optional[models.AgentsCompletionStreamRequestToolChoice]](../models/agentscompletionstreamrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | | `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | | `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | @@ -22,5 +22,4 @@ | `reasoning_effort` | [OptionalNullable[models.ReasoningEffort]](../models/reasoningeffort.md) | :heavy_minus_sign: | N/A | | | `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | | `guardrails` | List[[models.GuardrailConfig](../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | | -| `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to use for this completion. | | -| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to use for this completion. | | \ No newline at end of file diff --git a/docs/models/agentscompletionstreamrequesttools1.md b/docs/models/agentscompletionstreamrequesttools1.md deleted file mode 100644 index fef7e190..00000000 --- a/docs/models/agentscompletionstreamrequesttools1.md +++ /dev/null @@ -1,47 +0,0 @@ -# AgentsCompletionStreamRequestTools1 - - -## Supported Types - -### `models.WebSearchTool` - -```python -value: models.WebSearchTool = /* values here */ -``` - -### `models.WebSearchPremiumTool` - -```python -value: models.WebSearchPremiumTool = /* values here */ -``` - -### `models.CodeInterpreterTool` - -```python -value: models.CodeInterpreterTool = /* values here */ -``` - -### `models.ImageGenerationTool` - -```python -value: models.ImageGenerationTool = /* values here */ -``` - -### `models.DocumentLibraryTool` - -```python -value: models.DocumentLibraryTool = /* values here */ -``` - -### `models.CustomConnector` - -```python -value: models.CustomConnector = /* values here */ -``` - -### `models.Tool` - -```python -value: models.Tool = /* values here */ -``` - diff --git a/docs/models/agentscompletionstreamrequesttools2.md b/docs/models/agentscompletionstreamrequesttools2.md deleted file mode 100644 index d9009359..00000000 --- a/docs/models/agentscompletionstreamrequesttools2.md +++ /dev/null @@ -1,17 +0,0 @@ -# AgentsCompletionStreamRequestTools2 - - -## Supported Types - -### `List[models.AgentsCompletionStreamRequestTools1]` - -```python -value: List[models.AgentsCompletionStreamRequestTools1] = /* values here */ -``` - -### `List[str]` - -```python -value: List[str] = /* values here */ -``` - diff --git a/docs/models/basefielddefinition.md b/docs/models/basefielddefinition.md index 3d721d91..3f7abea9 100644 --- a/docs/models/basefielddefinition.md +++ b/docs/models/basefielddefinition.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `name` | *str* | :heavy_check_mark: | N/A | -| `label` | *str* | :heavy_check_mark: | N/A | -| `type` | [models.BaseFieldDefinitionType](../models/basefielddefinitiontype.md) | :heavy_check_mark: | N/A | -| `group` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `supported_operators` | List[[models.SupportedOperator](../models/supportedoperator.md)] | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | N/A | +| `label` | *str* | :heavy_check_mark: | N/A | +| `type` | [models.TypeEnum](../models/typeenum.md) | :heavy_check_mark: | N/A | +| `group` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `supported_operators` | List[[models.SupportedOperator](../models/supportedoperator.md)] | :heavy_check_mark: | N/A | \ 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/chatcompletionrequest.md b/docs/models/chatcompletionrequest.md index c19738a7..4e29ad05 100644 --- a/docs/models/chatcompletionrequest.md +++ b/docs/models/chatcompletionrequest.md @@ -15,7 +15,7 @@ | `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | | `messages` | List[[models.ChatCompletionRequestMessage](../models/chatcompletionrequestmessage.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | | `response_format` | [Optional[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | -| `tools` | [OptionalNullable[models.ChatCompletionRequestTools2]](../models/chatcompletionrequesttools2.md) | :heavy_minus_sign: | A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. | | +| `tools` | List[[models.Tool](../models/tool.md)] | :heavy_minus_sign: | A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. | | | `tool_choice` | [Optional[models.ChatCompletionRequestToolChoice]](../models/chatcompletionrequesttoolchoice.md) | :heavy_minus_sign: | Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. | | | `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | | `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | @@ -25,5 +25,4 @@ | `reasoning_effort` | [OptionalNullable[models.ReasoningEffort]](../models/reasoningeffort.md) | :heavy_minus_sign: | N/A | | | `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | | `guardrails` | List[[models.GuardrailConfig](../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | | -| `safe_prompt` | *Optional[bool]* | :heavy_minus_sign: | Whether to inject a safety prompt before all conversations. | | -| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `safe_prompt` | *Optional[bool]* | :heavy_minus_sign: | Whether to inject a safety prompt before all conversations. | | \ No newline at end of file diff --git a/docs/models/chatcompletionrequesttools1.md b/docs/models/chatcompletionrequesttools1.md deleted file mode 100644 index 9926c6d5..00000000 --- a/docs/models/chatcompletionrequesttools1.md +++ /dev/null @@ -1,47 +0,0 @@ -# ChatCompletionRequestTools1 - - -## Supported Types - -### `models.WebSearchTool` - -```python -value: models.WebSearchTool = /* values here */ -``` - -### `models.WebSearchPremiumTool` - -```python -value: models.WebSearchPremiumTool = /* values here */ -``` - -### `models.CodeInterpreterTool` - -```python -value: models.CodeInterpreterTool = /* values here */ -``` - -### `models.ImageGenerationTool` - -```python -value: models.ImageGenerationTool = /* values here */ -``` - -### `models.DocumentLibraryTool` - -```python -value: models.DocumentLibraryTool = /* values here */ -``` - -### `models.CustomConnector` - -```python -value: models.CustomConnector = /* values here */ -``` - -### `models.Tool` - -```python -value: models.Tool = /* values here */ -``` - diff --git a/docs/models/chatcompletionrequesttools2.md b/docs/models/chatcompletionrequesttools2.md deleted file mode 100644 index 48d8596d..00000000 --- a/docs/models/chatcompletionrequesttools2.md +++ /dev/null @@ -1,19 +0,0 @@ -# ChatCompletionRequestTools2 - -A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. - - -## Supported Types - -### `List[models.ChatCompletionRequestTools1]` - -```python -value: List[models.ChatCompletionRequestTools1] = /* values here */ -``` - -### `List[str]` - -```python -value: List[str] = /* 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/chatcompletionstreamrequest.md b/docs/models/chatcompletionstreamrequest.md index 0bffc0fc..7ece3742 100644 --- a/docs/models/chatcompletionstreamrequest.md +++ b/docs/models/chatcompletionstreamrequest.md @@ -15,7 +15,7 @@ | `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | | `messages` | List[[models.ChatCompletionStreamRequestMessage](../models/chatcompletionstreamrequestmessage.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | | `response_format` | [Optional[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | -| `tools` | [OptionalNullable[models.ChatCompletionStreamRequestTools2]](../models/chatcompletionstreamrequesttools2.md) | :heavy_minus_sign: | A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. | | +| `tools` | List[[models.Tool](../models/tool.md)] | :heavy_minus_sign: | A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. | | | `tool_choice` | [Optional[models.ChatCompletionStreamRequestToolChoice]](../models/chatcompletionstreamrequesttoolchoice.md) | :heavy_minus_sign: | Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. | | | `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | | `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | @@ -25,5 +25,4 @@ | `reasoning_effort` | [OptionalNullable[models.ReasoningEffort]](../models/reasoningeffort.md) | :heavy_minus_sign: | N/A | | | `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | | `guardrails` | List[[models.GuardrailConfig](../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | | -| `safe_prompt` | *Optional[bool]* | :heavy_minus_sign: | Whether to inject a safety prompt before all conversations. | | -| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `safe_prompt` | *Optional[bool]* | :heavy_minus_sign: | Whether to inject a safety prompt before all conversations. | | \ No newline at end of file diff --git a/docs/models/chatcompletionstreamrequesttools1.md b/docs/models/chatcompletionstreamrequesttools1.md deleted file mode 100644 index fb7a968b..00000000 --- a/docs/models/chatcompletionstreamrequesttools1.md +++ /dev/null @@ -1,47 +0,0 @@ -# ChatCompletionStreamRequestTools1 - - -## Supported Types - -### `models.WebSearchTool` - -```python -value: models.WebSearchTool = /* values here */ -``` - -### `models.WebSearchPremiumTool` - -```python -value: models.WebSearchPremiumTool = /* values here */ -``` - -### `models.CodeInterpreterTool` - -```python -value: models.CodeInterpreterTool = /* values here */ -``` - -### `models.ImageGenerationTool` - -```python -value: models.ImageGenerationTool = /* values here */ -``` - -### `models.DocumentLibraryTool` - -```python -value: models.DocumentLibraryTool = /* values here */ -``` - -### `models.CustomConnector` - -```python -value: models.CustomConnector = /* values here */ -``` - -### `models.Tool` - -```python -value: models.Tool = /* values here */ -``` - diff --git a/docs/models/chatcompletionstreamrequesttools2.md b/docs/models/chatcompletionstreamrequesttools2.md deleted file mode 100644 index 273651d8..00000000 --- a/docs/models/chatcompletionstreamrequesttools2.md +++ /dev/null @@ -1,19 +0,0 @@ -# ChatCompletionStreamRequestTools2 - -A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. - - -## Supported Types - -### `List[models.ChatCompletionStreamRequestTools1]` - -```python -value: List[models.ChatCompletionStreamRequestTools1] = /* values here */ -``` - -### `List[str]` - -```python -value: List[str] = /* values here */ -``` - diff --git a/docs/models/codeinterpretertool.md b/docs/models/codeinterpretertool.md index 9fd6a907..6302fc62 100644 --- a/docs/models/codeinterpretertool.md +++ b/docs/models/codeinterpretertool.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `tool_configuration` | [OptionalNullable[models.ToolConfiguration]](../models/toolconfiguration.md) | :heavy_minus_sign: | N/A | -| `type` | [Optional[models.CodeInterpreterToolType]](../models/codeinterpretertooltype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `tool_configuration` | [OptionalNullable[models.ToolConfiguration]](../models/toolconfiguration.md) | :heavy_minus_sign: | N/A | +| `type` | *Literal["code_interpreter"]* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/codeinterpretertooltype.md b/docs/models/codeinterpretertooltype.md deleted file mode 100644 index 7f95f5da..00000000 --- a/docs/models/codeinterpretertooltype.md +++ /dev/null @@ -1,13 +0,0 @@ -# CodeInterpreterToolType - -## Example Usage - -```python -from mistralai.client.models import CodeInterpreterToolType -value: CodeInterpreterToolType = "code_interpreter" -``` - - -## Values - -- `"code_interpreter"` diff --git a/docs/models/customconnector.md b/docs/models/customconnector.md index d238eb5f..0a0b6921 100644 --- a/docs/models/customconnector.md +++ b/docs/models/customconnector.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `type` | [Optional[models.CustomConnectorType]](../models/customconnectortype.md) | :heavy_minus_sign: | N/A | +| `type` | *Literal["connector"]* | :heavy_check_mark: | N/A | | `connector_id` | *str* | :heavy_check_mark: | N/A | | `authorization` | [OptionalNullable[models.Authorization]](../models/authorization.md) | :heavy_minus_sign: | N/A | | `tool_configuration` | [OptionalNullable[models.ToolConfiguration]](../models/toolconfiguration.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/customconnectortype.md b/docs/models/customconnectortype.md deleted file mode 100644 index e2c8e0e0..00000000 --- a/docs/models/customconnectortype.md +++ /dev/null @@ -1,13 +0,0 @@ -# CustomConnectorType - -## Example Usage - -```python -from mistralai.client.models import CustomConnectorType -value: CustomConnectorType = "connector" -``` - - -## Values - -- `"connector"` diff --git a/docs/models/documentlibrarytool.md b/docs/models/documentlibrarytool.md index d22ff33a..95c3fa52 100644 --- a/docs/models/documentlibrarytool.md +++ b/docs/models/documentlibrarytool.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `tool_configuration` | [OptionalNullable[models.ToolConfiguration]](../models/toolconfiguration.md) | :heavy_minus_sign: | N/A | -| `type` | [Optional[models.DocumentLibraryToolType]](../models/documentlibrarytooltype.md) | :heavy_minus_sign: | N/A | -| `library_ids` | List[*str*] | :heavy_check_mark: | Ids of the library in which to search. | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `tool_configuration` | [OptionalNullable[models.ToolConfiguration]](../models/toolconfiguration.md) | :heavy_minus_sign: | N/A | +| `type` | *Literal["document_library"]* | :heavy_check_mark: | N/A | +| `library_ids` | List[*str*] | :heavy_check_mark: | Ids of the library in which to search. | \ No newline at end of file diff --git a/docs/models/documentlibrarytooltype.md b/docs/models/documentlibrarytooltype.md deleted file mode 100644 index 945452e3..00000000 --- a/docs/models/documentlibrarytooltype.md +++ /dev/null @@ -1,13 +0,0 @@ -# DocumentLibraryToolType - -## Example Usage - -```python -from mistralai.client.models import DocumentLibraryToolType -value: DocumentLibraryToolType = "document_library" -``` - - -## Values - -- `"document_library"` 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/docs/models/imagegenerationtool.md b/docs/models/imagegenerationtool.md index 93edbbf8..b476b6f2 100644 --- a/docs/models/imagegenerationtool.md +++ b/docs/models/imagegenerationtool.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `tool_configuration` | [OptionalNullable[models.ToolConfiguration]](../models/toolconfiguration.md) | :heavy_minus_sign: | N/A | -| `type` | [Optional[models.ImageGenerationToolType]](../models/imagegenerationtooltype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `tool_configuration` | [OptionalNullable[models.ToolConfiguration]](../models/toolconfiguration.md) | :heavy_minus_sign: | N/A | +| `type` | *Literal["image_generation"]* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/imagegenerationtooltype.md b/docs/models/imagegenerationtooltype.md deleted file mode 100644 index 7763ca21..00000000 --- a/docs/models/imagegenerationtooltype.md +++ /dev/null @@ -1,13 +0,0 @@ -# ImageGenerationToolType - -## Example Usage - -```python -from mistralai.client.models import ImageGenerationToolType -value: ImageGenerationToolType = "image_generation" -``` - - -## Values - -- `"image_generation"` diff --git a/docs/models/basefielddefinitiontype.md b/docs/models/typeenum.md similarity index 67% rename from docs/models/basefielddefinitiontype.md rename to docs/models/typeenum.md index efdff2a4..ec47cf96 100644 --- a/docs/models/basefielddefinitiontype.md +++ b/docs/models/typeenum.md @@ -1,12 +1,12 @@ -# BaseFieldDefinitionType +# TypeEnum ## Example Usage ```python -from mistralai.client.models import BaseFieldDefinitionType +from mistralai.client.models import TypeEnum # Open enum: unrecognized values are captured as UnrecognizedStr -value: BaseFieldDefinitionType = "ENUM" +value: TypeEnum = "ENUM" ``` diff --git a/docs/models/websearchpremiumtool.md b/docs/models/websearchpremiumtool.md index 27951776..78b736cd 100644 --- a/docs/models/websearchpremiumtool.md +++ b/docs/models/websearchpremiumtool.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `tool_configuration` | [OptionalNullable[models.ToolConfiguration]](../models/toolconfiguration.md) | :heavy_minus_sign: | N/A | -| `type` | [Optional[models.WebSearchPremiumToolType]](../models/websearchpremiumtooltype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `tool_configuration` | [OptionalNullable[models.ToolConfiguration]](../models/toolconfiguration.md) | :heavy_minus_sign: | N/A | +| `type` | *Literal["web_search_premium"]* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/websearchpremiumtooltype.md b/docs/models/websearchpremiumtooltype.md deleted file mode 100644 index e4f3d7bf..00000000 --- a/docs/models/websearchpremiumtooltype.md +++ /dev/null @@ -1,13 +0,0 @@ -# WebSearchPremiumToolType - -## Example Usage - -```python -from mistralai.client.models import WebSearchPremiumToolType -value: WebSearchPremiumToolType = "web_search_premium" -``` - - -## Values - -- `"web_search_premium"` diff --git a/docs/models/websearchtool.md b/docs/models/websearchtool.md index 5dfd8c22..4ca7333c 100644 --- a/docs/models/websearchtool.md +++ b/docs/models/websearchtool.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | | `tool_configuration` | [OptionalNullable[models.ToolConfiguration]](../models/toolconfiguration.md) | :heavy_minus_sign: | N/A | -| `type` | [Optional[models.WebSearchToolType]](../models/websearchtooltype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `type` | *Literal["web_search"]* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/websearchtooltype.md b/docs/models/websearchtooltype.md deleted file mode 100644 index 89af0c4d..00000000 --- a/docs/models/websearchtooltype.md +++ /dev/null @@ -1,13 +0,0 @@ -# WebSearchToolType - -## Example Usage - -```python -from mistralai.client.models import WebSearchToolType -value: WebSearchToolType = "web_search" -``` - - -## Values - -- `"web_search"` diff --git a/docs/sdks/agents/README.md b/docs/sdks/agents/README.md index b8c7db45..b1b80bdf 100644 --- a/docs/sdks/agents/README.md +++ b/docs/sdks/agents/README.md @@ -32,8 +32,6 @@ with Mistral( }, ], agent_id="", stream=False, response_format={ "type": "text", - }, additional_properties={ - }) # Handle response @@ -53,7 +51,7 @@ with Mistral( | `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | | `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | | `response_format` | [Optional[models.ResponseFormat]](../../models/responseformat.md) | :heavy_minus_sign: | Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | -| `tools` | [OptionalNullable[models.AgentsCompletionRequestTools2]](../../models/agentscompletionrequesttools2.md) | :heavy_minus_sign: | N/A | | +| `tools` | List[[models.Tool](../../models/tool.md)] | :heavy_minus_sign: | N/A | | | `tool_choice` | [Optional[models.AgentsCompletionRequestToolChoice]](../../models/agentscompletionrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | | `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | | `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | @@ -63,7 +61,6 @@ with Mistral( | `reasoning_effort` | [OptionalNullable[models.ReasoningEffort]](../../models/reasoningeffort.md) | :heavy_minus_sign: | N/A | | | `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | | `guardrails` | List[[models.GuardrailConfig](../../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | | -| `additional_properties` | Dict[str, *Any*] | :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 @@ -100,8 +97,6 @@ with Mistral( }, ], agent_id="", stream=True, response_format={ "type": "text", - }, additional_properties={ - }) with res as event_stream: @@ -123,7 +118,7 @@ with Mistral( | `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | | `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | | `response_format` | [Optional[models.ResponseFormat]](../../models/responseformat.md) | :heavy_minus_sign: | Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | -| `tools` | [OptionalNullable[models.AgentsCompletionStreamRequestTools2]](../../models/agentscompletionstreamrequesttools2.md) | :heavy_minus_sign: | N/A | | +| `tools` | List[[models.Tool](../../models/tool.md)] | :heavy_minus_sign: | N/A | | | `tool_choice` | [Optional[models.AgentsCompletionStreamRequestToolChoice]](../../models/agentscompletionstreamrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | | `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | | `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | @@ -133,7 +128,6 @@ with Mistral( | `reasoning_effort` | [OptionalNullable[models.ReasoningEffort]](../../models/reasoningeffort.md) | :heavy_minus_sign: | N/A | | | `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | | `guardrails` | List[[models.GuardrailConfig](../../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | | -| `additional_properties` | Dict[str, *Any*] | :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/docs/sdks/chat/README.md b/docs/sdks/chat/README.md index e449bb62..afbbeae4 100644 --- a/docs/sdks/chat/README.md +++ b/docs/sdks/chat/README.md @@ -32,8 +32,6 @@ with Mistral( }, ], stream=False, response_format={ "type": "text", - }, additional_properties={ - }) # Handle response @@ -55,7 +53,7 @@ with Mistral( | `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | | `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | | `response_format` | [Optional[models.ResponseFormat]](../../models/responseformat.md) | :heavy_minus_sign: | Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | -| `tools` | [OptionalNullable[models.ChatCompletionRequestTools2]](../../models/chatcompletionrequesttools2.md) | :heavy_minus_sign: | A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. | | +| `tools` | List[[models.Tool](../../models/tool.md)] | :heavy_minus_sign: | A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. | | | `tool_choice` | [Optional[models.ChatCompletionRequestToolChoice]](../../models/chatcompletionrequesttoolchoice.md) | :heavy_minus_sign: | Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. | | | `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | | `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | @@ -66,7 +64,6 @@ with Mistral( | `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | | `guardrails` | List[[models.GuardrailConfig](../../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | | | `safe_prompt` | *Optional[bool]* | :heavy_minus_sign: | Whether to inject a safety prompt before all conversations. | | -| `additional_properties` | Dict[str, *Any*] | :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 @@ -103,8 +100,6 @@ with Mistral( }, ], stream=True, response_format={ "type": "text", - }, additional_properties={ - }) with res as event_stream: @@ -128,7 +123,7 @@ with Mistral( | `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | | `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | | `response_format` | [Optional[models.ResponseFormat]](../../models/responseformat.md) | :heavy_minus_sign: | Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | -| `tools` | [OptionalNullable[models.ChatCompletionStreamRequestTools2]](../../models/chatcompletionstreamrequesttools2.md) | :heavy_minus_sign: | A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. | | +| `tools` | List[[models.Tool](../../models/tool.md)] | :heavy_minus_sign: | A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. | | | `tool_choice` | [Optional[models.ChatCompletionStreamRequestToolChoice]](../../models/chatcompletionstreamrequesttoolchoice.md) | :heavy_minus_sign: | Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. | | | `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | | `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | @@ -139,7 +134,6 @@ with Mistral( | `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | | `guardrails` | List[[models.GuardrailConfig](../../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | | | `safe_prompt` | *Optional[bool]* | :heavy_minus_sign: | Whether to inject a safety prompt before all conversations. | | -| `additional_properties` | Dict[str, *Any*] | :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/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/agents.py b/src/mistralai/client/agents.py index 8ac69962..2e91dd04 100644 --- a/src/mistralai/client/agents.py +++ b/src/mistralai/client/agents.py @@ -35,10 +35,7 @@ def complete( Union[models.ResponseFormat, models.ResponseFormatTypedDict] ] = None, tools: OptionalNullable[ - Union[ - models.AgentsCompletionRequestTools2, - models.AgentsCompletionRequestTools2TypedDict, - ] + Union[List[models.Tool], List[models.ToolTypedDict]] ] = UNSET, tool_choice: Optional[ Union[ @@ -58,7 +55,6 @@ def complete( guardrails: OptionalNullable[ Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] ] = UNSET, - additional_properties: Optional[Dict[str, Any]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -84,7 +80,6 @@ def complete( :param reasoning_effort: :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. :param guardrails: - :param additional_properties: :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 @@ -112,9 +107,7 @@ def complete( response_format=utils.get_pydantic_model( response_format, Optional[models.ResponseFormat] ), - tools=utils.get_pydantic_model( - tools, OptionalNullable[models.AgentsCompletionRequestTools2] - ), + tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), tool_choice=utils.get_pydantic_model( tool_choice, Optional[models.AgentsCompletionRequestToolChoice] ), @@ -131,7 +124,6 @@ def complete( guardrails, OptionalNullable[List[models.GuardrailConfig]] ), agent_id=agent_id, - **(additional_properties or {}), ) req = self._build_request( @@ -216,10 +208,7 @@ async def complete_async( Union[models.ResponseFormat, models.ResponseFormatTypedDict] ] = None, tools: OptionalNullable[ - Union[ - models.AgentsCompletionRequestTools2, - models.AgentsCompletionRequestTools2TypedDict, - ] + Union[List[models.Tool], List[models.ToolTypedDict]] ] = UNSET, tool_choice: Optional[ Union[ @@ -239,7 +228,6 @@ async def complete_async( guardrails: OptionalNullable[ Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] ] = UNSET, - additional_properties: Optional[Dict[str, Any]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -265,7 +253,6 @@ async def complete_async( :param reasoning_effort: :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. :param guardrails: - :param additional_properties: :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 @@ -293,9 +280,7 @@ async def complete_async( response_format=utils.get_pydantic_model( response_format, Optional[models.ResponseFormat] ), - tools=utils.get_pydantic_model( - tools, OptionalNullable[models.AgentsCompletionRequestTools2] - ), + tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), tool_choice=utils.get_pydantic_model( tool_choice, Optional[models.AgentsCompletionRequestToolChoice] ), @@ -312,7 +297,6 @@ async def complete_async( guardrails, OptionalNullable[List[models.GuardrailConfig]] ), agent_id=agent_id, - **(additional_properties or {}), ) req = self._build_request_async( @@ -397,10 +381,7 @@ def stream( Union[models.ResponseFormat, models.ResponseFormatTypedDict] ] = None, tools: OptionalNullable[ - Union[ - models.AgentsCompletionStreamRequestTools2, - models.AgentsCompletionStreamRequestTools2TypedDict, - ] + Union[List[models.Tool], List[models.ToolTypedDict]] ] = UNSET, tool_choice: Optional[ Union[ @@ -420,7 +401,6 @@ def stream( guardrails: OptionalNullable[ Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] ] = UNSET, - additional_properties: Optional[Dict[str, Any]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -448,7 +428,6 @@ def stream( :param reasoning_effort: :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. :param guardrails: - :param additional_properties: :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 @@ -476,9 +455,7 @@ def stream( response_format=utils.get_pydantic_model( response_format, Optional[models.ResponseFormat] ), - tools=utils.get_pydantic_model( - tools, OptionalNullable[models.AgentsCompletionStreamRequestTools2] - ), + tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), tool_choice=utils.get_pydantic_model( tool_choice, Optional[models.AgentsCompletionStreamRequestToolChoice] ), @@ -495,7 +472,6 @@ def stream( guardrails, OptionalNullable[List[models.GuardrailConfig]] ), agent_id=agent_id, - **(additional_properties or {}), ) req = self._build_request( @@ -588,10 +564,7 @@ async def stream_async( Union[models.ResponseFormat, models.ResponseFormatTypedDict] ] = None, tools: OptionalNullable[ - Union[ - models.AgentsCompletionStreamRequestTools2, - models.AgentsCompletionStreamRequestTools2TypedDict, - ] + Union[List[models.Tool], List[models.ToolTypedDict]] ] = UNSET, tool_choice: Optional[ Union[ @@ -611,7 +584,6 @@ async def stream_async( guardrails: OptionalNullable[ Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] ] = UNSET, - additional_properties: Optional[Dict[str, Any]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -639,7 +611,6 @@ async def stream_async( :param reasoning_effort: :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. :param guardrails: - :param additional_properties: :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 @@ -667,9 +638,7 @@ async def stream_async( response_format=utils.get_pydantic_model( response_format, Optional[models.ResponseFormat] ), - tools=utils.get_pydantic_model( - tools, OptionalNullable[models.AgentsCompletionStreamRequestTools2] - ), + tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), tool_choice=utils.get_pydantic_model( tool_choice, Optional[models.AgentsCompletionStreamRequestToolChoice] ), @@ -686,7 +655,6 @@ async def stream_async( guardrails, OptionalNullable[List[models.GuardrailConfig]] ), agent_id=agent_id, - **(additional_properties or {}), ) req = self._build_request_async( diff --git a/src/mistralai/client/chat.py b/src/mistralai/client/chat.py index 8c73bdc9..c11a53d1 100644 --- a/src/mistralai/client/chat.py +++ b/src/mistralai/client/chat.py @@ -122,10 +122,7 @@ def complete( Union[models.ResponseFormat, models.ResponseFormatTypedDict] ] = None, tools: OptionalNullable[ - Union[ - models.ChatCompletionRequestTools2, - models.ChatCompletionRequestTools2TypedDict, - ] + Union[List[models.Tool], List[models.ToolTypedDict]] ] = UNSET, tool_choice: Optional[ Union[ @@ -146,7 +143,6 @@ def complete( Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] ] = UNSET, safe_prompt: Optional[bool] = None, - additional_properties: Optional[Dict[str, Any]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -175,7 +171,6 @@ def complete( :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. :param guardrails: :param safe_prompt: Whether to inject a safety prompt before all conversations. - :param additional_properties: :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 @@ -206,9 +201,7 @@ def complete( response_format=utils.get_pydantic_model( response_format, Optional[models.ResponseFormat] ), - tools=utils.get_pydantic_model( - tools, OptionalNullable[models.ChatCompletionRequestTools2] - ), + tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), tool_choice=utils.get_pydantic_model( tool_choice, Optional[models.ChatCompletionRequestToolChoice] ), @@ -225,7 +218,6 @@ def complete( guardrails, OptionalNullable[List[models.GuardrailConfig]] ), safe_prompt=safe_prompt, - **(additional_properties or {}), ) req = self._build_request( @@ -312,10 +304,7 @@ async def complete_async( Union[models.ResponseFormat, models.ResponseFormatTypedDict] ] = None, tools: OptionalNullable[ - Union[ - models.ChatCompletionRequestTools2, - models.ChatCompletionRequestTools2TypedDict, - ] + Union[List[models.Tool], List[models.ToolTypedDict]] ] = UNSET, tool_choice: Optional[ Union[ @@ -336,7 +325,6 @@ async def complete_async( Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] ] = UNSET, safe_prompt: Optional[bool] = None, - additional_properties: Optional[Dict[str, Any]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -365,7 +353,6 @@ async def complete_async( :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. :param guardrails: :param safe_prompt: Whether to inject a safety prompt before all conversations. - :param additional_properties: :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 @@ -396,9 +383,7 @@ async def complete_async( response_format=utils.get_pydantic_model( response_format, Optional[models.ResponseFormat] ), - tools=utils.get_pydantic_model( - tools, OptionalNullable[models.ChatCompletionRequestTools2] - ), + tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), tool_choice=utils.get_pydantic_model( tool_choice, Optional[models.ChatCompletionRequestToolChoice] ), @@ -415,7 +400,6 @@ async def complete_async( guardrails, OptionalNullable[List[models.GuardrailConfig]] ), safe_prompt=safe_prompt, - **(additional_properties or {}), ) req = self._build_request_async( @@ -502,10 +486,7 @@ def stream( Union[models.ResponseFormat, models.ResponseFormatTypedDict] ] = None, tools: OptionalNullable[ - Union[ - models.ChatCompletionStreamRequestTools2, - models.ChatCompletionStreamRequestTools2TypedDict, - ] + Union[List[models.Tool], List[models.ToolTypedDict]] ] = UNSET, tool_choice: Optional[ Union[ @@ -526,7 +507,6 @@ def stream( Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] ] = UNSET, safe_prompt: Optional[bool] = None, - additional_properties: Optional[Dict[str, Any]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -557,7 +537,6 @@ def stream( :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. :param guardrails: :param safe_prompt: Whether to inject a safety prompt before all conversations. - :param additional_properties: :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 @@ -588,9 +567,7 @@ def stream( response_format=utils.get_pydantic_model( response_format, Optional[models.ResponseFormat] ), - tools=utils.get_pydantic_model( - tools, OptionalNullable[models.ChatCompletionStreamRequestTools2] - ), + tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), tool_choice=utils.get_pydantic_model( tool_choice, Optional[models.ChatCompletionStreamRequestToolChoice] ), @@ -607,7 +584,6 @@ def stream( guardrails, OptionalNullable[List[models.GuardrailConfig]] ), safe_prompt=safe_prompt, - **(additional_properties or {}), ) req = self._build_request( @@ -702,10 +678,7 @@ async def stream_async( Union[models.ResponseFormat, models.ResponseFormatTypedDict] ] = None, tools: OptionalNullable[ - Union[ - models.ChatCompletionStreamRequestTools2, - models.ChatCompletionStreamRequestTools2TypedDict, - ] + Union[List[models.Tool], List[models.ToolTypedDict]] ] = UNSET, tool_choice: Optional[ Union[ @@ -726,7 +699,6 @@ async def stream_async( Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] ] = UNSET, safe_prompt: Optional[bool] = None, - additional_properties: Optional[Dict[str, Any]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -757,7 +729,6 @@ async def stream_async( :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. :param guardrails: :param safe_prompt: Whether to inject a safety prompt before all conversations. - :param additional_properties: :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 @@ -788,9 +759,7 @@ async def stream_async( response_format=utils.get_pydantic_model( response_format, Optional[models.ResponseFormat] ), - tools=utils.get_pydantic_model( - tools, OptionalNullable[models.ChatCompletionStreamRequestTools2] - ), + tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), tool_choice=utils.get_pydantic_model( tool_choice, Optional[models.ChatCompletionStreamRequestToolChoice] ), @@ -807,7 +776,6 @@ async def stream_async( guardrails, OptionalNullable[List[models.GuardrailConfig]] ), safe_prompt=safe_prompt, - **(additional_properties or {}), ) req = self._build_request_async( diff --git a/src/mistralai/client/models/__init__.py b/src/mistralai/client/models/__init__.py index 8363bb84..05756e5b 100644 --- a/src/mistralai/client/models/__init__.py +++ b/src/mistralai/client/models/__init__.py @@ -127,10 +127,6 @@ AgentsCompletionRequestStopTypedDict, AgentsCompletionRequestToolChoice, AgentsCompletionRequestToolChoiceTypedDict, - AgentsCompletionRequestTools1, - AgentsCompletionRequestTools1TypedDict, - AgentsCompletionRequestTools2, - AgentsCompletionRequestTools2TypedDict, AgentsCompletionRequestTypedDict, ) from .agentscompletionstreamrequest import ( @@ -141,10 +137,6 @@ AgentsCompletionStreamRequestStopTypedDict, AgentsCompletionStreamRequestToolChoice, AgentsCompletionStreamRequestToolChoiceTypedDict, - AgentsCompletionStreamRequestTools1, - AgentsCompletionStreamRequestTools1TypedDict, - AgentsCompletionStreamRequestTools2, - AgentsCompletionStreamRequestTools2TypedDict, AgentsCompletionStreamRequestTypedDict, ) from .annotations import Annotations, AnnotationsTypedDict, Audience @@ -176,9 +168,9 @@ from .authurlresponse import AuthURLResponse, AuthURLResponseTypedDict from .basefielddefinition import ( BaseFieldDefinition, - BaseFieldDefinitionType, BaseFieldDefinitionTypedDict, SupportedOperator, + TypeEnum, ) from .basemodelcard import BaseModelCard, BaseModelCardTypedDict from .basetaskstatus import BaseTaskStatus @@ -196,15 +188,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, @@ -226,10 +213,6 @@ ChatCompletionRequestStopTypedDict, ChatCompletionRequestToolChoice, ChatCompletionRequestToolChoiceTypedDict, - ChatCompletionRequestTools1, - ChatCompletionRequestTools1TypedDict, - ChatCompletionRequestTools2, - ChatCompletionRequestTools2TypedDict, ChatCompletionRequestTypedDict, ) from .chatcompletionresponse import ( @@ -244,10 +227,6 @@ ChatCompletionStreamRequestStopTypedDict, ChatCompletionStreamRequestToolChoice, ChatCompletionStreamRequestToolChoiceTypedDict, - ChatCompletionStreamRequestTools1, - ChatCompletionStreamRequestTools1TypedDict, - ChatCompletionStreamRequestTools2, - ChatCompletionStreamRequestTools2TypedDict, ChatCompletionStreamRequestTypedDict, ) from .chatmoderationrequest import ( @@ -308,11 +287,7 @@ ClassifierTrainingParameters, ClassifierTrainingParametersTypedDict, ) - from .codeinterpretertool import ( - CodeInterpreterTool, - CodeInterpreterToolType, - CodeInterpreterToolTypedDict, - ) + from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict from .completionargs import CompletionArgs, CompletionArgsTypedDict from .completionargsstop import CompletionArgsStop, CompletionArgsStopTypedDict from .completionchunk import CompletionChunk, CompletionChunkTypedDict @@ -534,7 +509,6 @@ Authorization, AuthorizationTypedDict, CustomConnector, - CustomConnectorType, CustomConnectorTypedDict, UnknownAuthorization, ) @@ -579,11 +553,7 @@ DeltaMessageTypedDict, ) from .document import Document, DocumentTypedDict - from .documentlibrarytool import ( - DocumentLibraryTool, - DocumentLibraryToolType, - DocumentLibraryToolTypedDict, - ) + from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict from .documenttextcontent import DocumentTextContent, DocumentTextContentTypedDict from .documenturlchunk import DocumentURLChunk, DocumentURLChunkTypedDict from .embeddedresource import ( @@ -813,11 +783,7 @@ from .guardrailconfig import GuardrailConfig, GuardrailConfigTypedDict from .imagecontent import ImageContent, ImageContentTypedDict from .imagedetail import ImageDetail - from .imagegenerationtool import ( - ImageGenerationTool, - ImageGenerationToolType, - ImageGenerationToolTypedDict, - ) + from .imagegenerationtool import ImageGenerationTool, ImageGenerationToolTypedDict from .imageurl import ImageURL, ImageURLTypedDict from .imageurlchunk import ( ImageURLChunk, @@ -1535,12 +1501,10 @@ ) from .websearchpremiumtool import ( WebSearchPremiumTool, - WebSearchPremiumToolType, WebSearchPremiumToolTypedDict, ) from .websearchtool import ( WebSearchTool, - WebSearchToolType, WebSearchToolTypedDict, ) # Pydantic models with forward references FilterGroup.model_rebuild() @@ -1615,10 +1579,6 @@ "AgentsCompletionRequestStopTypedDict", "AgentsCompletionRequestToolChoice", "AgentsCompletionRequestToolChoiceTypedDict", - "AgentsCompletionRequestTools1", - "AgentsCompletionRequestTools1TypedDict", - "AgentsCompletionRequestTools2", - "AgentsCompletionRequestTools2TypedDict", "AgentsCompletionRequestTypedDict", "AgentsCompletionStreamRequest", "AgentsCompletionStreamRequestMessage", @@ -1627,10 +1587,6 @@ "AgentsCompletionStreamRequestStopTypedDict", "AgentsCompletionStreamRequestToolChoice", "AgentsCompletionStreamRequestToolChoiceTypedDict", - "AgentsCompletionStreamRequestTools1", - "AgentsCompletionStreamRequestTools1TypedDict", - "AgentsCompletionStreamRequestTools2", - "AgentsCompletionStreamRequestTools2TypedDict", "AgentsCompletionStreamRequestTypedDict", "And", "AndTypedDict", @@ -1667,7 +1623,6 @@ "Authorization", "AuthorizationTypedDict", "BaseFieldDefinition", - "BaseFieldDefinitionType", "BaseFieldDefinitionTypedDict", "BaseModelCard", "BaseModelCardTypedDict", @@ -1686,14 +1641,9 @@ "CampaignTypedDict", "ChatClassificationRequest", "ChatClassificationRequestTypedDict", - "ChatCompletionChoice1", - "ChatCompletionChoice1TypedDict", - "ChatCompletionChoice2", - "ChatCompletionChoice2TypedDict", - "ChatCompletionChoiceFinishReason1", - "ChatCompletionChoiceFinishReason2", - "ChatCompletionChoiceUnion", - "ChatCompletionChoiceUnionTypedDict", + "ChatCompletionChoice", + "ChatCompletionChoiceFinishReason", + "ChatCompletionChoiceTypedDict", "ChatCompletionEvent", "ChatCompletionEventExtraFields", "ChatCompletionEventExtraFieldsTypedDict", @@ -1709,10 +1659,6 @@ "ChatCompletionRequestStopTypedDict", "ChatCompletionRequestToolChoice", "ChatCompletionRequestToolChoiceTypedDict", - "ChatCompletionRequestTools1", - "ChatCompletionRequestTools1TypedDict", - "ChatCompletionRequestTools2", - "ChatCompletionRequestTools2TypedDict", "ChatCompletionRequestTypedDict", "ChatCompletionResponse", "ChatCompletionResponseTypedDict", @@ -1723,10 +1669,6 @@ "ChatCompletionStreamRequestStopTypedDict", "ChatCompletionStreamRequestToolChoice", "ChatCompletionStreamRequestToolChoiceTypedDict", - "ChatCompletionStreamRequestTools1", - "ChatCompletionStreamRequestTools1TypedDict", - "ChatCompletionStreamRequestTools2", - "ChatCompletionStreamRequestTools2TypedDict", "ChatCompletionStreamRequestTypedDict", "ChatModerationRequest", "ChatModerationRequestInputs1", @@ -1767,7 +1709,6 @@ "ClassifierTrainingParameters", "ClassifierTrainingParametersTypedDict", "CodeInterpreterTool", - "CodeInterpreterToolType", "CodeInterpreterToolTypedDict", "CompletionArgs", "CompletionArgsStop", @@ -1915,7 +1856,6 @@ "CreateLibraryRequest", "CreateLibraryRequestTypedDict", "CustomConnector", - "CustomConnectorType", "CustomConnectorTypedDict", "Dataset", "DatasetImportTask", @@ -1949,7 +1889,6 @@ "DeltaMessageTypedDict", "Document", "DocumentLibraryTool", - "DocumentLibraryToolType", "DocumentLibraryToolTypedDict", "DocumentTextContent", "DocumentTextContentTypedDict", @@ -2111,7 +2050,6 @@ "ImageContentTypedDict", "ImageDetail", "ImageGenerationTool", - "ImageGenerationToolType", "ImageGenerationToolTypedDict", "ImageURL", "ImageURLChunk", @@ -2558,6 +2496,7 @@ "TranscriptionStreamSegmentDeltaTypedDict", "TranscriptionStreamTextDelta", "TranscriptionStreamTextDeltaTypedDict", + "TypeEnum", "UnarchiveModelResponse", "UnarchiveModelResponseTypedDict", "UnknownAgentTool", @@ -2638,10 +2577,8 @@ "WandbIntegrationResultTypedDict", "WandbIntegrationTypedDict", "WebSearchPremiumTool", - "WebSearchPremiumToolType", "WebSearchPremiumToolTypedDict", "WebSearchTool", - "WebSearchToolType", "WebSearchToolTypedDict", ] @@ -2714,10 +2651,6 @@ "AgentsCompletionRequestStopTypedDict": ".agentscompletionrequest", "AgentsCompletionRequestToolChoice": ".agentscompletionrequest", "AgentsCompletionRequestToolChoiceTypedDict": ".agentscompletionrequest", - "AgentsCompletionRequestTools1": ".agentscompletionrequest", - "AgentsCompletionRequestTools1TypedDict": ".agentscompletionrequest", - "AgentsCompletionRequestTools2": ".agentscompletionrequest", - "AgentsCompletionRequestTools2TypedDict": ".agentscompletionrequest", "AgentsCompletionRequestTypedDict": ".agentscompletionrequest", "AgentsCompletionStreamRequest": ".agentscompletionstreamrequest", "AgentsCompletionStreamRequestMessage": ".agentscompletionstreamrequest", @@ -2726,10 +2659,6 @@ "AgentsCompletionStreamRequestStopTypedDict": ".agentscompletionstreamrequest", "AgentsCompletionStreamRequestToolChoice": ".agentscompletionstreamrequest", "AgentsCompletionStreamRequestToolChoiceTypedDict": ".agentscompletionstreamrequest", - "AgentsCompletionStreamRequestTools1": ".agentscompletionstreamrequest", - "AgentsCompletionStreamRequestTools1TypedDict": ".agentscompletionstreamrequest", - "AgentsCompletionStreamRequestTools2": ".agentscompletionstreamrequest", - "AgentsCompletionStreamRequestTools2TypedDict": ".agentscompletionstreamrequest", "AgentsCompletionStreamRequestTypedDict": ".agentscompletionstreamrequest", "Annotations": ".annotations", "AnnotationsTypedDict": ".annotations", @@ -2759,9 +2688,9 @@ "AuthURLResponse": ".authurlresponse", "AuthURLResponseTypedDict": ".authurlresponse", "BaseFieldDefinition": ".basefielddefinition", - "BaseFieldDefinitionType": ".basefielddefinition", "BaseFieldDefinitionTypedDict": ".basefielddefinition", "SupportedOperator": ".basefielddefinition", + "TypeEnum": ".basefielddefinition", "BaseModelCard": ".basemodelcard", "BaseModelCardTypedDict": ".basemodelcard", "BaseTaskStatus": ".basetaskstatus", @@ -2779,14 +2708,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", @@ -2802,10 +2726,6 @@ "ChatCompletionRequestStopTypedDict": ".chatcompletionrequest", "ChatCompletionRequestToolChoice": ".chatcompletionrequest", "ChatCompletionRequestToolChoiceTypedDict": ".chatcompletionrequest", - "ChatCompletionRequestTools1": ".chatcompletionrequest", - "ChatCompletionRequestTools1TypedDict": ".chatcompletionrequest", - "ChatCompletionRequestTools2": ".chatcompletionrequest", - "ChatCompletionRequestTools2TypedDict": ".chatcompletionrequest", "ChatCompletionRequestTypedDict": ".chatcompletionrequest", "ChatCompletionResponse": ".chatcompletionresponse", "ChatCompletionResponseTypedDict": ".chatcompletionresponse", @@ -2816,10 +2736,6 @@ "ChatCompletionStreamRequestStopTypedDict": ".chatcompletionstreamrequest", "ChatCompletionStreamRequestToolChoice": ".chatcompletionstreamrequest", "ChatCompletionStreamRequestToolChoiceTypedDict": ".chatcompletionstreamrequest", - "ChatCompletionStreamRequestTools1": ".chatcompletionstreamrequest", - "ChatCompletionStreamRequestTools1TypedDict": ".chatcompletionstreamrequest", - "ChatCompletionStreamRequestTools2": ".chatcompletionstreamrequest", - "ChatCompletionStreamRequestTools2TypedDict": ".chatcompletionstreamrequest", "ChatCompletionStreamRequestTypedDict": ".chatcompletionstreamrequest", "ChatModerationRequest": ".chatmoderationrequest", "ChatModerationRequestInputs1": ".chatmoderationrequest", @@ -2862,7 +2778,6 @@ "ClassifierTrainingParameters": ".classifiertrainingparameters", "ClassifierTrainingParametersTypedDict": ".classifiertrainingparameters", "CodeInterpreterTool": ".codeinterpretertool", - "CodeInterpreterToolType": ".codeinterpretertool", "CodeInterpreterToolTypedDict": ".codeinterpretertool", "CompletionArgs": ".completionargs", "CompletionArgsTypedDict": ".completionargs", @@ -3020,7 +2935,6 @@ "Authorization": ".customconnector", "AuthorizationTypedDict": ".customconnector", "CustomConnector": ".customconnector", - "CustomConnectorType": ".customconnector", "CustomConnectorTypedDict": ".customconnector", "UnknownAuthorization": ".customconnector", "Dataset": ".dataset", @@ -3056,7 +2970,6 @@ "Document": ".document", "DocumentTypedDict": ".document", "DocumentLibraryTool": ".documentlibrarytool", - "DocumentLibraryToolType": ".documentlibrarytool", "DocumentLibraryToolTypedDict": ".documentlibrarytool", "DocumentTextContent": ".documenttextcontent", "DocumentTextContentTypedDict": ".documenttextcontent", @@ -3216,7 +3129,6 @@ "ImageContentTypedDict": ".imagecontent", "ImageDetail": ".imagedetail", "ImageGenerationTool": ".imagegenerationtool", - "ImageGenerationToolType": ".imagegenerationtool", "ImageGenerationToolTypedDict": ".imagegenerationtool", "ImageURL": ".imageurl", "ImageURLTypedDict": ".imageurl", @@ -3731,10 +3643,8 @@ "WandbIntegrationResult": ".wandbintegrationresult", "WandbIntegrationResultTypedDict": ".wandbintegrationresult", "WebSearchPremiumTool": ".websearchpremiumtool", - "WebSearchPremiumToolType": ".websearchpremiumtool", "WebSearchPremiumToolTypedDict": ".websearchpremiumtool", "WebSearchTool": ".websearchtool", - "WebSearchToolType": ".websearchtool", "WebSearchToolTypedDict": ".websearchtool", } diff --git a/src/mistralai/client/models/agentscompletionrequest.py b/src/mistralai/client/models/agentscompletionrequest.py index 527d6230..f4ce34cb 100644 --- a/src/mistralai/client/models/agentscompletionrequest.py +++ b/src/mistralai/client/models/agentscompletionrequest.py @@ -3,11 +3,7 @@ from __future__ import annotations from .assistantmessage import AssistantMessage, AssistantMessageTypedDict -from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict -from .customconnector import CustomConnector, CustomConnectorTypedDict -from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict from .guardrailconfig import GuardrailConfig, GuardrailConfigTypedDict -from .imagegenerationtool import ImageGenerationTool, ImageGenerationToolTypedDict from .mistralpromptmode import MistralPromptMode from .prediction import Prediction, PredictionTypedDict from .reasoningeffort import ReasoningEffort @@ -18,8 +14,6 @@ from .toolchoiceenum import ToolChoiceEnum from .toolmessage import ToolMessage, ToolMessageTypedDict from .usermessage import UserMessage, UserMessageTypedDict -from .websearchpremiumtool import WebSearchPremiumTool, WebSearchPremiumToolTypedDict -from .websearchtool import WebSearchTool, WebSearchToolTypedDict from mistralai.client.types import ( BaseModel, Nullable, @@ -28,8 +22,7 @@ UNSET_SENTINEL, ) from mistralai.client.utils import get_discriminator -import pydantic -from pydantic import ConfigDict, Discriminator, Tag, model_serializer +from pydantic import Discriminator, Tag, model_serializer from typing import Any, Dict, List, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -68,46 +61,6 @@ ] -AgentsCompletionRequestTools1TypedDict = TypeAliasType( - "AgentsCompletionRequestTools1TypedDict", - Union[ - WebSearchToolTypedDict, - WebSearchPremiumToolTypedDict, - CodeInterpreterToolTypedDict, - ImageGenerationToolTypedDict, - ToolTypedDict, - DocumentLibraryToolTypedDict, - CustomConnectorTypedDict, - ], -) - - -AgentsCompletionRequestTools1 = TypeAliasType( - "AgentsCompletionRequestTools1", - Union[ - WebSearchTool, - WebSearchPremiumTool, - CodeInterpreterTool, - ImageGenerationTool, - Tool, - DocumentLibraryTool, - CustomConnector, - ], -) - - -AgentsCompletionRequestTools2TypedDict = TypeAliasType( - "AgentsCompletionRequestTools2TypedDict", - Union[List[AgentsCompletionRequestTools1TypedDict], List[str]], -) - - -AgentsCompletionRequestTools2 = TypeAliasType( - "AgentsCompletionRequestTools2", - Union[List[AgentsCompletionRequestTools1], List[str]], -) - - AgentsCompletionRequestToolChoiceTypedDict = TypeAliasType( "AgentsCompletionRequestToolChoiceTypedDict", Union[ToolChoiceTypedDict, ToolChoiceEnum], @@ -135,7 +88,7 @@ class AgentsCompletionRequestTypedDict(TypedDict): metadata: NotRequired[Nullable[Dict[str, Any]]] response_format: NotRequired[ResponseFormatTypedDict] r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" - tools: NotRequired[Nullable[AgentsCompletionRequestTools2TypedDict]] + tools: NotRequired[Nullable[List[ToolTypedDict]]] tool_choice: NotRequired[AgentsCompletionRequestToolChoiceTypedDict] presence_penalty: NotRequired[float] r"""The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" @@ -153,11 +106,6 @@ class AgentsCompletionRequestTypedDict(TypedDict): class AgentsCompletionRequest(BaseModel): - model_config = ConfigDict( - populate_by_name=True, arbitrary_types_allowed=True, extra="allow" - ) - __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) - messages: List[AgentsCompletionRequestMessage] r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" @@ -181,7 +129,7 @@ class AgentsCompletionRequest(BaseModel): response_format: Optional[ResponseFormat] = None r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" - tools: OptionalNullable[AgentsCompletionRequestTools2] = UNSET + tools: OptionalNullable[List[Tool]] = UNSET tool_choice: Optional[AgentsCompletionRequestToolChoice] = None @@ -206,14 +154,6 @@ class AgentsCompletionRequest(BaseModel): guardrails: OptionalNullable[List[GuardrailConfig]] = UNSET - @property - def additional_properties(self): - return self.__pydantic_extra__ - - @additional_properties.setter - def additional_properties(self, value): - self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] - @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -254,7 +194,6 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k, serialized.get(n)) - serialized.pop(k, serialized.pop(n, None)) is_nullable_and_explicitly_set = ( k in nullable_fields and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member @@ -267,7 +206,5 @@ def serialize_model(self, handler): or is_nullable_and_explicitly_set ): m[k] = val - for k, v in serialized.items(): - m[k] = v return m diff --git a/src/mistralai/client/models/agentscompletionstreamrequest.py b/src/mistralai/client/models/agentscompletionstreamrequest.py index 483ec99c..0feb3803 100644 --- a/src/mistralai/client/models/agentscompletionstreamrequest.py +++ b/src/mistralai/client/models/agentscompletionstreamrequest.py @@ -3,11 +3,7 @@ from __future__ import annotations from .assistantmessage import AssistantMessage, AssistantMessageTypedDict -from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict -from .customconnector import CustomConnector, CustomConnectorTypedDict -from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict from .guardrailconfig import GuardrailConfig, GuardrailConfigTypedDict -from .imagegenerationtool import ImageGenerationTool, ImageGenerationToolTypedDict from .mistralpromptmode import MistralPromptMode from .prediction import Prediction, PredictionTypedDict from .reasoningeffort import ReasoningEffort @@ -18,8 +14,6 @@ from .toolchoiceenum import ToolChoiceEnum from .toolmessage import ToolMessage, ToolMessageTypedDict from .usermessage import UserMessage, UserMessageTypedDict -from .websearchpremiumtool import WebSearchPremiumTool, WebSearchPremiumToolTypedDict -from .websearchtool import WebSearchTool, WebSearchToolTypedDict from mistralai.client.types import ( BaseModel, Nullable, @@ -28,8 +22,7 @@ UNSET_SENTINEL, ) from mistralai.client.utils import get_discriminator -import pydantic -from pydantic import ConfigDict, Discriminator, Tag, model_serializer +from pydantic import Discriminator, Tag, model_serializer from typing import Any, Dict, List, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -68,46 +61,6 @@ ] -AgentsCompletionStreamRequestTools1TypedDict = TypeAliasType( - "AgentsCompletionStreamRequestTools1TypedDict", - Union[ - WebSearchToolTypedDict, - WebSearchPremiumToolTypedDict, - CodeInterpreterToolTypedDict, - ImageGenerationToolTypedDict, - ToolTypedDict, - DocumentLibraryToolTypedDict, - CustomConnectorTypedDict, - ], -) - - -AgentsCompletionStreamRequestTools1 = TypeAliasType( - "AgentsCompletionStreamRequestTools1", - Union[ - WebSearchTool, - WebSearchPremiumTool, - CodeInterpreterTool, - ImageGenerationTool, - Tool, - DocumentLibraryTool, - CustomConnector, - ], -) - - -AgentsCompletionStreamRequestTools2TypedDict = TypeAliasType( - "AgentsCompletionStreamRequestTools2TypedDict", - Union[List[AgentsCompletionStreamRequestTools1TypedDict], List[str]], -) - - -AgentsCompletionStreamRequestTools2 = TypeAliasType( - "AgentsCompletionStreamRequestTools2", - Union[List[AgentsCompletionStreamRequestTools1], List[str]], -) - - AgentsCompletionStreamRequestToolChoiceTypedDict = TypeAliasType( "AgentsCompletionStreamRequestToolChoiceTypedDict", Union[ToolChoiceTypedDict, ToolChoiceEnum], @@ -134,7 +87,7 @@ class AgentsCompletionStreamRequestTypedDict(TypedDict): metadata: NotRequired[Nullable[Dict[str, Any]]] response_format: NotRequired[ResponseFormatTypedDict] r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" - tools: NotRequired[Nullable[AgentsCompletionStreamRequestTools2TypedDict]] + tools: NotRequired[Nullable[List[ToolTypedDict]]] tool_choice: NotRequired[AgentsCompletionStreamRequestToolChoiceTypedDict] presence_penalty: NotRequired[float] r"""The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" @@ -152,11 +105,6 @@ class AgentsCompletionStreamRequestTypedDict(TypedDict): class AgentsCompletionStreamRequest(BaseModel): - model_config = ConfigDict( - populate_by_name=True, arbitrary_types_allowed=True, extra="allow" - ) - __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) - messages: List[AgentsCompletionStreamRequestMessage] r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" @@ -179,7 +127,7 @@ class AgentsCompletionStreamRequest(BaseModel): response_format: Optional[ResponseFormat] = None r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" - tools: OptionalNullable[AgentsCompletionStreamRequestTools2] = UNSET + tools: OptionalNullable[List[Tool]] = UNSET tool_choice: Optional[AgentsCompletionStreamRequestToolChoice] = None @@ -204,14 +152,6 @@ class AgentsCompletionStreamRequest(BaseModel): guardrails: OptionalNullable[List[GuardrailConfig]] = UNSET - @property - def additional_properties(self): - return self.__pydantic_extra__ - - @additional_properties.setter - def additional_properties(self, value): - self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] - @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -252,7 +192,6 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k, serialized.get(n)) - serialized.pop(k, serialized.pop(n, None)) is_nullable_and_explicitly_set = ( k in nullable_fields and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member @@ -265,7 +204,5 @@ def serialize_model(self, handler): or is_nullable_and_explicitly_set ): m[k] = val - for k, v in serialized.items(): - m[k] = v return m diff --git a/src/mistralai/client/models/basefielddefinition.py b/src/mistralai/client/models/basefielddefinition.py index acf9cf8d..b57ff2ca 100644 --- a/src/mistralai/client/models/basefielddefinition.py +++ b/src/mistralai/client/models/basefielddefinition.py @@ -15,7 +15,7 @@ from typing_extensions import NotRequired, TypedDict -BaseFieldDefinitionType = Union[ +TypeEnum = Union[ Literal[ "ENUM", "TEXT", @@ -58,7 +58,7 @@ class BaseFieldDefinitionTypedDict(TypedDict): name: str label: str - type: BaseFieldDefinitionType + type: TypeEnum supported_operators: List[SupportedOperator] group: NotRequired[Nullable[str]] @@ -68,7 +68,7 @@ class BaseFieldDefinition(BaseModel): label: str - type: BaseFieldDefinitionType + type: TypeEnum supported_operators: List[SupportedOperator] 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/chatcompletionrequest.py b/src/mistralai/client/models/chatcompletionrequest.py index 558efb76..f1b0b2d6 100644 --- a/src/mistralai/client/models/chatcompletionrequest.py +++ b/src/mistralai/client/models/chatcompletionrequest.py @@ -3,11 +3,7 @@ from __future__ import annotations from .assistantmessage import AssistantMessage, AssistantMessageTypedDict -from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict -from .customconnector import CustomConnector, CustomConnectorTypedDict -from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict from .guardrailconfig import GuardrailConfig, GuardrailConfigTypedDict -from .imagegenerationtool import ImageGenerationTool, ImageGenerationToolTypedDict from .mistralpromptmode import MistralPromptMode from .prediction import Prediction, PredictionTypedDict from .reasoningeffort import ReasoningEffort @@ -18,8 +14,6 @@ from .toolchoiceenum import ToolChoiceEnum from .toolmessage import ToolMessage, ToolMessageTypedDict from .usermessage import UserMessage, UserMessageTypedDict -from .websearchpremiumtool import WebSearchPremiumTool, WebSearchPremiumToolTypedDict -from .websearchtool import WebSearchTool, WebSearchToolTypedDict from mistralai.client.types import ( BaseModel, Nullable, @@ -28,8 +22,7 @@ UNSET_SENTINEL, ) from mistralai.client.utils import get_discriminator -import pydantic -from pydantic import ConfigDict, Discriminator, Tag, model_serializer +from pydantic import Discriminator, Tag, model_serializer from typing import Any, Dict, List, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -68,47 +61,6 @@ ] -ChatCompletionRequestTools1TypedDict = TypeAliasType( - "ChatCompletionRequestTools1TypedDict", - Union[ - WebSearchToolTypedDict, - WebSearchPremiumToolTypedDict, - CodeInterpreterToolTypedDict, - ImageGenerationToolTypedDict, - ToolTypedDict, - DocumentLibraryToolTypedDict, - CustomConnectorTypedDict, - ], -) - - -ChatCompletionRequestTools1 = TypeAliasType( - "ChatCompletionRequestTools1", - Union[ - WebSearchTool, - WebSearchPremiumTool, - CodeInterpreterTool, - ImageGenerationTool, - Tool, - DocumentLibraryTool, - CustomConnector, - ], -) - - -ChatCompletionRequestTools2TypedDict = TypeAliasType( - "ChatCompletionRequestTools2TypedDict", - Union[List[ChatCompletionRequestTools1TypedDict], List[str]], -) -r"""A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.""" - - -ChatCompletionRequestTools2 = TypeAliasType( - "ChatCompletionRequestTools2", Union[List[ChatCompletionRequestTools1], List[str]] -) -r"""A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.""" - - ChatCompletionRequestToolChoiceTypedDict = TypeAliasType( "ChatCompletionRequestToolChoiceTypedDict", Union[ToolChoiceTypedDict, ToolChoiceEnum], @@ -142,7 +94,7 @@ class ChatCompletionRequestTypedDict(TypedDict): metadata: NotRequired[Nullable[Dict[str, Any]]] response_format: NotRequired[ResponseFormatTypedDict] r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" - tools: NotRequired[Nullable[ChatCompletionRequestTools2TypedDict]] + tools: NotRequired[Nullable[List[ToolTypedDict]]] r"""A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.""" tool_choice: NotRequired[ChatCompletionRequestToolChoiceTypedDict] r"""Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.""" @@ -165,11 +117,6 @@ class ChatCompletionRequestTypedDict(TypedDict): class ChatCompletionRequest(BaseModel): - model_config = ConfigDict( - populate_by_name=True, arbitrary_types_allowed=True, extra="allow" - ) - __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) - model: str r"""ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions.""" @@ -199,7 +146,7 @@ class ChatCompletionRequest(BaseModel): response_format: Optional[ResponseFormat] = None r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" - tools: OptionalNullable[ChatCompletionRequestTools2] = UNSET + tools: OptionalNullable[List[Tool]] = UNSET r"""A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.""" tool_choice: Optional[ChatCompletionRequestToolChoice] = None @@ -230,14 +177,6 @@ class ChatCompletionRequest(BaseModel): safe_prompt: Optional[bool] = None r"""Whether to inject a safety prompt before all conversations.""" - @property - def additional_properties(self): - return self.__pydantic_extra__ - - @additional_properties.setter - def additional_properties(self, value): - self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] - @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -282,7 +221,6 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k, serialized.get(n)) - serialized.pop(k, serialized.pop(n, None)) is_nullable_and_explicitly_set = ( k in nullable_fields and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member @@ -295,7 +233,5 @@ def serialize_model(self, handler): or is_nullable_and_explicitly_set ): m[k] = val - for k, v in serialized.items(): - m[k] = v return m 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/chatcompletionstreamrequest.py b/src/mistralai/client/models/chatcompletionstreamrequest.py index 4d92d524..d9f413c6 100644 --- a/src/mistralai/client/models/chatcompletionstreamrequest.py +++ b/src/mistralai/client/models/chatcompletionstreamrequest.py @@ -3,11 +3,7 @@ from __future__ import annotations from .assistantmessage import AssistantMessage, AssistantMessageTypedDict -from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict -from .customconnector import CustomConnector, CustomConnectorTypedDict -from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict from .guardrailconfig import GuardrailConfig, GuardrailConfigTypedDict -from .imagegenerationtool import ImageGenerationTool, ImageGenerationToolTypedDict from .mistralpromptmode import MistralPromptMode from .prediction import Prediction, PredictionTypedDict from .reasoningeffort import ReasoningEffort @@ -18,8 +14,6 @@ from .toolchoiceenum import ToolChoiceEnum from .toolmessage import ToolMessage, ToolMessageTypedDict from .usermessage import UserMessage, UserMessageTypedDict -from .websearchpremiumtool import WebSearchPremiumTool, WebSearchPremiumToolTypedDict -from .websearchtool import WebSearchTool, WebSearchToolTypedDict from mistralai.client.types import ( BaseModel, Nullable, @@ -28,8 +22,7 @@ UNSET_SENTINEL, ) from mistralai.client.utils import get_discriminator -import pydantic -from pydantic import ConfigDict, Discriminator, Tag, model_serializer +from pydantic import Discriminator, Tag, model_serializer from typing import Any, Dict, List, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -68,48 +61,6 @@ ] -ChatCompletionStreamRequestTools1TypedDict = TypeAliasType( - "ChatCompletionStreamRequestTools1TypedDict", - Union[ - WebSearchToolTypedDict, - WebSearchPremiumToolTypedDict, - CodeInterpreterToolTypedDict, - ImageGenerationToolTypedDict, - ToolTypedDict, - DocumentLibraryToolTypedDict, - CustomConnectorTypedDict, - ], -) - - -ChatCompletionStreamRequestTools1 = TypeAliasType( - "ChatCompletionStreamRequestTools1", - Union[ - WebSearchTool, - WebSearchPremiumTool, - CodeInterpreterTool, - ImageGenerationTool, - Tool, - DocumentLibraryTool, - CustomConnector, - ], -) - - -ChatCompletionStreamRequestTools2TypedDict = TypeAliasType( - "ChatCompletionStreamRequestTools2TypedDict", - Union[List[ChatCompletionStreamRequestTools1TypedDict], List[str]], -) -r"""A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.""" - - -ChatCompletionStreamRequestTools2 = TypeAliasType( - "ChatCompletionStreamRequestTools2", - Union[List[ChatCompletionStreamRequestTools1], List[str]], -) -r"""A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.""" - - ChatCompletionStreamRequestToolChoiceTypedDict = TypeAliasType( "ChatCompletionStreamRequestToolChoiceTypedDict", Union[ToolChoiceTypedDict, ToolChoiceEnum], @@ -142,7 +93,7 @@ class ChatCompletionStreamRequestTypedDict(TypedDict): metadata: NotRequired[Nullable[Dict[str, Any]]] response_format: NotRequired[ResponseFormatTypedDict] r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" - tools: NotRequired[Nullable[ChatCompletionStreamRequestTools2TypedDict]] + tools: NotRequired[Nullable[List[ToolTypedDict]]] r"""A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.""" tool_choice: NotRequired[ChatCompletionStreamRequestToolChoiceTypedDict] r"""Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.""" @@ -165,11 +116,6 @@ class ChatCompletionStreamRequestTypedDict(TypedDict): class ChatCompletionStreamRequest(BaseModel): - model_config = ConfigDict( - populate_by_name=True, arbitrary_types_allowed=True, extra="allow" - ) - __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) - model: str r"""ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions.""" @@ -198,7 +144,7 @@ class ChatCompletionStreamRequest(BaseModel): response_format: Optional[ResponseFormat] = None r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" - tools: OptionalNullable[ChatCompletionStreamRequestTools2] = UNSET + tools: OptionalNullable[List[Tool]] = UNSET r"""A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.""" tool_choice: Optional[ChatCompletionStreamRequestToolChoice] = None @@ -229,14 +175,6 @@ class ChatCompletionStreamRequest(BaseModel): safe_prompt: Optional[bool] = None r"""Whether to inject a safety prompt before all conversations.""" - @property - def additional_properties(self): - return self.__pydantic_extra__ - - @additional_properties.setter - def additional_properties(self, value): - self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] - @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -281,7 +219,6 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k, serialized.get(n)) - serialized.pop(k, serialized.pop(n, None)) is_nullable_and_explicitly_set = ( k in nullable_fields and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member @@ -294,7 +231,5 @@ def serialize_model(self, handler): or is_nullable_and_explicitly_set ): m[k] = val - for k, v in serialized.items(): - m[k] = v return m diff --git a/src/mistralai/client/models/codeinterpretertool.py b/src/mistralai/client/models/codeinterpretertool.py index 3c6a384f..4cf9d055 100644 --- a/src/mistralai/client/models/codeinterpretertool.py +++ b/src/mistralai/client/models/codeinterpretertool.py @@ -10,27 +10,33 @@ UNSET, UNSET_SENTINEL, ) +from mistralai.client.utils import validate_const +import pydantic from pydantic import model_serializer -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -CodeInterpreterToolType = Literal["code_interpreter",] +from pydantic.functional_validators import AfterValidator +from typing import Literal +from typing_extensions import Annotated, NotRequired, TypedDict class CodeInterpreterToolTypedDict(TypedDict): tool_configuration: NotRequired[Nullable[ToolConfigurationTypedDict]] - type: NotRequired[CodeInterpreterToolType] + type: Literal["code_interpreter"] class CodeInterpreterTool(BaseModel): tool_configuration: OptionalNullable[ToolConfiguration] = UNSET - type: Optional[CodeInterpreterToolType] = "code_interpreter" + type: Annotated[ + Annotated[ + Literal["code_interpreter"], + AfterValidator(validate_const("code_interpreter")), + ], + pydantic.Field(alias="type"), + ] = "code_interpreter" @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["tool_configuration", "type"]) + optional_fields = set(["tool_configuration"]) nullable_fields = set(["tool_configuration"]) serialized = handler(self) m = {} @@ -52,3 +58,9 @@ def serialize_model(self, handler): m[k] = val return m + + +try: + CodeInterpreterTool.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/conversationrequest.py b/src/mistralai/client/models/conversationrequest.py index 5b6951bf..f7ed89b5 100644 --- a/src/mistralai/client/models/conversationrequest.py +++ b/src/mistralai/client/models/conversationrequest.py @@ -20,9 +20,9 @@ UNSET, UNSET_SENTINEL, ) -from mistralai.client.utils import get_discriminator, validate_const +from mistralai.client.utils import validate_const import pydantic -from pydantic import Discriminator, Tag, model_serializer +from pydantic import Field, model_serializer from pydantic.functional_validators import AfterValidator from typing import List, Literal, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -50,15 +50,15 @@ ConversationRequestTool = Annotated[ Union[ - Annotated[CodeInterpreterTool, Tag("code_interpreter")], - Annotated[CustomConnector, Tag("connector")], - Annotated[DocumentLibraryTool, Tag("document_library")], - Annotated[FunctionTool, Tag("function")], - Annotated[ImageGenerationTool, Tag("image_generation")], - Annotated[WebSearchTool, Tag("web_search")], - Annotated[WebSearchPremiumTool, Tag("web_search_premium")], + CodeInterpreterTool, + CustomConnector, + DocumentLibraryTool, + FunctionTool, + ImageGenerationTool, + WebSearchTool, + WebSearchPremiumTool, ], - Discriminator(lambda m: get_discriminator(m, "type", "type")), + Field(discriminator="type"), ] diff --git a/src/mistralai/client/models/conversationstreamrequest.py b/src/mistralai/client/models/conversationstreamrequest.py index 9a323e2a..4ec455b2 100644 --- a/src/mistralai/client/models/conversationstreamrequest.py +++ b/src/mistralai/client/models/conversationstreamrequest.py @@ -20,9 +20,9 @@ UNSET, UNSET_SENTINEL, ) -from mistralai.client.utils import get_discriminator, validate_const +from mistralai.client.utils import validate_const import pydantic -from pydantic import Discriminator, Tag, model_serializer +from pydantic import Field, model_serializer from pydantic.functional_validators import AfterValidator from typing import List, Literal, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -50,15 +50,15 @@ ConversationStreamRequestTool = Annotated[ Union[ - Annotated[CodeInterpreterTool, Tag("code_interpreter")], - Annotated[CustomConnector, Tag("connector")], - Annotated[DocumentLibraryTool, Tag("document_library")], - Annotated[FunctionTool, Tag("function")], - Annotated[ImageGenerationTool, Tag("image_generation")], - Annotated[WebSearchTool, Tag("web_search")], - Annotated[WebSearchPremiumTool, Tag("web_search_premium")], + CodeInterpreterTool, + CustomConnector, + DocumentLibraryTool, + FunctionTool, + ImageGenerationTool, + WebSearchTool, + WebSearchPremiumTool, ], - Discriminator(lambda m: get_discriminator(m, "type", "type")), + Field(discriminator="type"), ] diff --git a/src/mistralai/client/models/createagentrequest.py b/src/mistralai/client/models/createagentrequest.py index 78a9cd24..b31fbc91 100644 --- a/src/mistralai/client/models/createagentrequest.py +++ b/src/mistralai/client/models/createagentrequest.py @@ -19,8 +19,7 @@ UNSET, UNSET_SENTINEL, ) -from mistralai.client.utils import get_discriminator -from pydantic import Discriminator, Tag, model_serializer +from pydantic import Field, model_serializer from typing import List, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -41,15 +40,15 @@ CreateAgentRequestTool = Annotated[ Union[ - Annotated[CodeInterpreterTool, Tag("code_interpreter")], - Annotated[CustomConnector, Tag("connector")], - Annotated[DocumentLibraryTool, Tag("document_library")], - Annotated[FunctionTool, Tag("function")], - Annotated[ImageGenerationTool, Tag("image_generation")], - Annotated[WebSearchTool, Tag("web_search")], - Annotated[WebSearchPremiumTool, Tag("web_search_premium")], + CodeInterpreterTool, + CustomConnector, + DocumentLibraryTool, + FunctionTool, + ImageGenerationTool, + WebSearchTool, + WebSearchPremiumTool, ], - Discriminator(lambda m: get_discriminator(m, "type", "type")), + Field(discriminator="type"), ] diff --git a/src/mistralai/client/models/customconnector.py b/src/mistralai/client/models/customconnector.py index 9235dfd9..f3a1e2ff 100644 --- a/src/mistralai/client/models/customconnector.py +++ b/src/mistralai/client/models/customconnector.py @@ -13,16 +13,15 @@ UNSET, UNSET_SENTINEL, ) +from mistralai.client.utils import validate_const from mistralai.client.utils.unions import parse_open_union +import pydantic from pydantic import ConfigDict, model_serializer -from pydantic.functional_validators import BeforeValidator -from typing import Any, Literal, Optional, Union +from pydantic.functional_validators import AfterValidator, BeforeValidator +from typing import Any, Literal, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict -CustomConnectorType = Literal["connector",] - - AuthorizationTypedDict = TypeAliasType( "AuthorizationTypedDict", Union[OAuth2TokenAuthTypedDict, APIKeyAuthTypedDict] ) @@ -60,7 +59,7 @@ class UnknownAuthorization(BaseModel): class CustomConnectorTypedDict(TypedDict): connector_id: str - type: NotRequired[CustomConnectorType] + type: Literal["connector"] authorization: NotRequired[Nullable[AuthorizationTypedDict]] tool_configuration: NotRequired[Nullable[ToolConfigurationTypedDict]] @@ -68,7 +67,10 @@ class CustomConnectorTypedDict(TypedDict): class CustomConnector(BaseModel): connector_id: str - type: Optional[CustomConnectorType] = "connector" + type: Annotated[ + Annotated[Literal["connector"], AfterValidator(validate_const("connector"))], + pydantic.Field(alias="type"), + ] = "connector" authorization: OptionalNullable[Authorization] = UNSET @@ -76,7 +78,7 @@ class CustomConnector(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["type", "authorization", "tool_configuration"]) + optional_fields = set(["authorization", "tool_configuration"]) nullable_fields = set(["authorization", "tool_configuration"]) serialized = handler(self) m = {} @@ -98,3 +100,9 @@ def serialize_model(self, handler): m[k] = val return m + + +try: + CustomConnector.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/documentlibrarytool.py b/src/mistralai/client/models/documentlibrarytool.py index aa3093f4..29f8d64a 100644 --- a/src/mistralai/client/models/documentlibrarytool.py +++ b/src/mistralai/client/models/documentlibrarytool.py @@ -10,19 +10,19 @@ UNSET, UNSET_SENTINEL, ) +from mistralai.client.utils import validate_const +import pydantic from pydantic import model_serializer -from typing import List, Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -DocumentLibraryToolType = Literal["document_library",] +from pydantic.functional_validators import AfterValidator +from typing import List, Literal +from typing_extensions import Annotated, NotRequired, TypedDict class DocumentLibraryToolTypedDict(TypedDict): library_ids: List[str] r"""Ids of the library in which to search.""" tool_configuration: NotRequired[Nullable[ToolConfigurationTypedDict]] - type: NotRequired[DocumentLibraryToolType] + type: Literal["document_library"] class DocumentLibraryTool(BaseModel): @@ -31,11 +31,17 @@ class DocumentLibraryTool(BaseModel): tool_configuration: OptionalNullable[ToolConfiguration] = UNSET - type: Optional[DocumentLibraryToolType] = "document_library" + type: Annotated[ + Annotated[ + Literal["document_library"], + AfterValidator(validate_const("document_library")), + ], + pydantic.Field(alias="type"), + ] = "document_library" @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["tool_configuration", "type"]) + optional_fields = set(["tool_configuration"]) nullable_fields = set(["tool_configuration"]) serialized = handler(self) m = {} @@ -57,3 +63,9 @@ def serialize_model(self, handler): m[k] = val return m + + +try: + DocumentLibraryTool.model_rebuild() +except NameError: + pass 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/src/mistralai/client/models/imagegenerationtool.py b/src/mistralai/client/models/imagegenerationtool.py index 5012a565..0dd4a4d2 100644 --- a/src/mistralai/client/models/imagegenerationtool.py +++ b/src/mistralai/client/models/imagegenerationtool.py @@ -10,27 +10,33 @@ UNSET, UNSET_SENTINEL, ) +from mistralai.client.utils import validate_const +import pydantic from pydantic import model_serializer -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -ImageGenerationToolType = Literal["image_generation",] +from pydantic.functional_validators import AfterValidator +from typing import Literal +from typing_extensions import Annotated, NotRequired, TypedDict class ImageGenerationToolTypedDict(TypedDict): tool_configuration: NotRequired[Nullable[ToolConfigurationTypedDict]] - type: NotRequired[ImageGenerationToolType] + type: Literal["image_generation"] class ImageGenerationTool(BaseModel): tool_configuration: OptionalNullable[ToolConfiguration] = UNSET - type: Optional[ImageGenerationToolType] = "image_generation" + type: Annotated[ + Annotated[ + Literal["image_generation"], + AfterValidator(validate_const("image_generation")), + ], + pydantic.Field(alias="type"), + ] = "image_generation" @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["tool_configuration", "type"]) + optional_fields = set(["tool_configuration"]) nullable_fields = set(["tool_configuration"]) serialized = handler(self) m = {} @@ -52,3 +58,9 @@ def serialize_model(self, handler): m[k] = val return m + + +try: + ImageGenerationTool.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/updateagentrequest.py b/src/mistralai/client/models/updateagentrequest.py index 8fec9149..df4664fa 100644 --- a/src/mistralai/client/models/updateagentrequest.py +++ b/src/mistralai/client/models/updateagentrequest.py @@ -19,8 +19,7 @@ UNSET, UNSET_SENTINEL, ) -from mistralai.client.utils import get_discriminator -from pydantic import Discriminator, Tag, model_serializer +from pydantic import Field, model_serializer from typing import List, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -41,15 +40,15 @@ UpdateAgentRequestTool = Annotated[ Union[ - Annotated[CodeInterpreterTool, Tag("code_interpreter")], - Annotated[CustomConnector, Tag("connector")], - Annotated[DocumentLibraryTool, Tag("document_library")], - Annotated[FunctionTool, Tag("function")], - Annotated[ImageGenerationTool, Tag("image_generation")], - Annotated[WebSearchTool, Tag("web_search")], - Annotated[WebSearchPremiumTool, Tag("web_search_premium")], + CodeInterpreterTool, + CustomConnector, + DocumentLibraryTool, + FunctionTool, + ImageGenerationTool, + WebSearchTool, + WebSearchPremiumTool, ], - Discriminator(lambda m: get_discriminator(m, "type", "type")), + Field(discriminator="type"), ] diff --git a/src/mistralai/client/models/websearchpremiumtool.py b/src/mistralai/client/models/websearchpremiumtool.py index 249e1840..5c929e94 100644 --- a/src/mistralai/client/models/websearchpremiumtool.py +++ b/src/mistralai/client/models/websearchpremiumtool.py @@ -10,27 +10,33 @@ UNSET, UNSET_SENTINEL, ) +from mistralai.client.utils import validate_const +import pydantic from pydantic import model_serializer -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -WebSearchPremiumToolType = Literal["web_search_premium",] +from pydantic.functional_validators import AfterValidator +from typing import Literal +from typing_extensions import Annotated, NotRequired, TypedDict class WebSearchPremiumToolTypedDict(TypedDict): tool_configuration: NotRequired[Nullable[ToolConfigurationTypedDict]] - type: NotRequired[WebSearchPremiumToolType] + type: Literal["web_search_premium"] class WebSearchPremiumTool(BaseModel): tool_configuration: OptionalNullable[ToolConfiguration] = UNSET - type: Optional[WebSearchPremiumToolType] = "web_search_premium" + type: Annotated[ + Annotated[ + Literal["web_search_premium"], + AfterValidator(validate_const("web_search_premium")), + ], + pydantic.Field(alias="type"), + ] = "web_search_premium" @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["tool_configuration", "type"]) + optional_fields = set(["tool_configuration"]) nullable_fields = set(["tool_configuration"]) serialized = handler(self) m = {} @@ -52,3 +58,9 @@ def serialize_model(self, handler): m[k] = val return m + + +try: + WebSearchPremiumTool.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/websearchtool.py b/src/mistralai/client/models/websearchtool.py index 9f372ec0..f82b6ec1 100644 --- a/src/mistralai/client/models/websearchtool.py +++ b/src/mistralai/client/models/websearchtool.py @@ -10,27 +10,30 @@ UNSET, UNSET_SENTINEL, ) +from mistralai.client.utils import validate_const +import pydantic from pydantic import model_serializer -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -WebSearchToolType = Literal["web_search",] +from pydantic.functional_validators import AfterValidator +from typing import Literal +from typing_extensions import Annotated, NotRequired, TypedDict class WebSearchToolTypedDict(TypedDict): tool_configuration: NotRequired[Nullable[ToolConfigurationTypedDict]] - type: NotRequired[WebSearchToolType] + type: Literal["web_search"] class WebSearchTool(BaseModel): tool_configuration: OptionalNullable[ToolConfiguration] = UNSET - type: Optional[WebSearchToolType] = "web_search" + type: Annotated[ + Annotated[Literal["web_search"], AfterValidator(validate_const("web_search"))], + pydantic.Field(alias="type"), + ] = "web_search" @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["tool_configuration", "type"]) + optional_fields = set(["tool_configuration"]) nullable_fields = set(["tool_configuration"]) serialized = handler(self) m = {} @@ -52,3 +55,9 @@ def serialize_model(self, handler): m[k] = val return m + + +try: + WebSearchTool.model_rebuild() +except NameError: + pass From 8043b383d92218a0920efbc551b90ad9b3902feb Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 20 Mar 2026 14:43:48 +0000 Subject: [PATCH 2/5] chore: align pyproject.toml and uv.lock to version 2.1.2 --- pyproject.toml | 2 +- uv.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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/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" }, From c9a327b431c69384ec96931b96191e536868db16 Mon Sep 17 00:00:00 2001 From: Louis Sanna Date: Fri, 20 Mar 2026 15:47:55 +0100 Subject: [PATCH 3/5] chore: trigger CI From 9d05ea5dfa435c7cd62901a519e086f3a12d0f9e Mon Sep 17 00:00:00 2001 From: Louis Sanna Date: Fri, 20 Mar 2026 15:53:49 +0100 Subject: [PATCH 4/5] fix(examples): revert to list[Tool] now that ChatCompletionRequestTools1 is removed --- examples/mistral/chat/function_calling.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/mistral/chat/function_calling.py b/examples/mistral/chat/function_calling.py index 9299a822..68e9d91c 100644 --- a/examples/mistral/chat/function_calling.py +++ b/examples/mistral/chat/function_calling.py @@ -7,7 +7,6 @@ from mistralai.client.models import ( AssistantMessage, ChatCompletionRequestMessage, - ChatCompletionRequestTools1, Function, Tool, ToolMessage, @@ -49,7 +48,7 @@ def retrieve_payment_date(data: dict[str, list[Any]], transaction_id: str) -> st "retrieve_payment_date": functools.partial(retrieve_payment_date, data=data), } -tools: list[ChatCompletionRequestTools1] = [ +tools: list[Tool] = [ Tool( function=Function( name="retrieve_payment_status", From 46e7abfa60bb9f495a3e816ffd29795a36e81710 Mon Sep 17 00:00:00 2001 From: Louis Sanna Date: Fri, 20 Mar 2026 16:06:22 +0100 Subject: [PATCH 5/5] chore: retrigger CI