mistralai 1.10.0__py3-none-any.whl → 1.11.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. mistralai/_hooks/tracing.py +28 -3
  2. mistralai/_version.py +3 -3
  3. mistralai/accesses.py +22 -12
  4. mistralai/agents.py +88 -44
  5. mistralai/basesdk.py +6 -0
  6. mistralai/chat.py +96 -40
  7. mistralai/classifiers.py +48 -23
  8. mistralai/conversations.py +186 -64
  9. mistralai/documents.py +72 -26
  10. mistralai/embeddings.py +24 -9
  11. mistralai/extra/README.md +1 -1
  12. mistralai/extra/mcp/auth.py +10 -11
  13. mistralai/extra/mcp/base.py +17 -16
  14. mistralai/extra/mcp/sse.py +13 -15
  15. mistralai/extra/mcp/stdio.py +5 -6
  16. mistralai/extra/observability/otel.py +47 -68
  17. mistralai/extra/run/context.py +33 -43
  18. mistralai/extra/run/result.py +29 -30
  19. mistralai/extra/run/tools.py +8 -9
  20. mistralai/extra/struct_chat.py +15 -8
  21. mistralai/extra/utils/response_format.py +5 -3
  22. mistralai/files.py +58 -24
  23. mistralai/fim.py +20 -12
  24. mistralai/httpclient.py +0 -1
  25. mistralai/jobs.py +65 -26
  26. mistralai/libraries.py +20 -10
  27. mistralai/mistral_agents.py +438 -30
  28. mistralai/mistral_jobs.py +62 -17
  29. mistralai/models/__init__.py +46 -1
  30. mistralai/models/agent.py +1 -1
  31. mistralai/models/agentconversation.py +1 -1
  32. mistralai/models/agenthandoffdoneevent.py +1 -1
  33. mistralai/models/agenthandoffentry.py +3 -2
  34. mistralai/models/agenthandoffstartedevent.py +1 -1
  35. mistralai/models/agents_api_v1_agents_get_versionop.py +21 -0
  36. mistralai/models/agents_api_v1_agents_list_versionsop.py +33 -0
  37. mistralai/models/agents_api_v1_agents_listop.py +5 -1
  38. mistralai/models/agents_api_v1_conversations_listop.py +1 -1
  39. mistralai/models/agentscompletionrequest.py +2 -5
  40. mistralai/models/agentscompletionstreamrequest.py +2 -5
  41. mistralai/models/archiveftmodelout.py +1 -1
  42. mistralai/models/assistantmessage.py +1 -1
  43. mistralai/models/audiochunk.py +1 -1
  44. mistralai/models/audioencoding.py +18 -0
  45. mistralai/models/audioformat.py +17 -0
  46. mistralai/models/basemodelcard.py +1 -1
  47. mistralai/models/batchjobin.py +18 -9
  48. mistralai/models/batchjobout.py +6 -1
  49. mistralai/models/batchjobsout.py +1 -1
  50. mistralai/models/batchrequest.py +48 -0
  51. mistralai/models/chatcompletionchoice.py +10 -5
  52. mistralai/models/chatcompletionrequest.py +2 -5
  53. mistralai/models/chatcompletionstreamrequest.py +2 -5
  54. mistralai/models/classificationrequest.py +37 -3
  55. mistralai/models/classifierdetailedjobout.py +4 -2
  56. mistralai/models/classifierftmodelout.py +3 -2
  57. mistralai/models/classifierjobout.py +4 -2
  58. mistralai/models/codeinterpretertool.py +1 -1
  59. mistralai/models/completiondetailedjobout.py +5 -2
  60. mistralai/models/completionftmodelout.py +3 -2
  61. mistralai/models/completionjobout.py +5 -2
  62. mistralai/models/completionresponsestreamchoice.py +9 -8
  63. mistralai/models/conversationappendrequest.py +4 -1
  64. mistralai/models/conversationappendstreamrequest.py +4 -1
  65. mistralai/models/conversationhistory.py +2 -1
  66. mistralai/models/conversationmessages.py +1 -1
  67. mistralai/models/conversationrequest.py +5 -1
  68. mistralai/models/conversationresponse.py +2 -1
  69. mistralai/models/conversationrestartrequest.py +4 -1
  70. mistralai/models/conversationrestartstreamrequest.py +4 -1
  71. mistralai/models/conversationstreamrequest.py +5 -1
  72. mistralai/models/documentlibrarytool.py +1 -1
  73. mistralai/models/documenturlchunk.py +1 -1
  74. mistralai/models/embeddingdtype.py +7 -1
  75. mistralai/models/embeddingrequest.py +11 -3
  76. mistralai/models/encodingformat.py +4 -1
  77. mistralai/models/entitytype.py +8 -1
  78. mistralai/models/filepurpose.py +8 -1
  79. mistralai/models/files_api_routes_list_filesop.py +4 -11
  80. mistralai/models/files_api_routes_upload_fileop.py +2 -6
  81. mistralai/models/fileschema.py +3 -5
  82. mistralai/models/finetuneablemodeltype.py +4 -1
  83. mistralai/models/ftclassifierlossfunction.py +4 -1
  84. mistralai/models/ftmodelcard.py +1 -1
  85. mistralai/models/functioncallentry.py +3 -2
  86. mistralai/models/functioncallevent.py +1 -1
  87. mistralai/models/functionresultentry.py +3 -2
  88. mistralai/models/functiontool.py +1 -1
  89. mistralai/models/githubrepositoryin.py +1 -1
  90. mistralai/models/githubrepositoryout.py +1 -1
  91. mistralai/models/httpvalidationerror.py +4 -2
  92. mistralai/models/imagegenerationtool.py +1 -1
  93. mistralai/models/imageurlchunk.py +1 -1
  94. mistralai/models/jobs_api_routes_batch_get_batch_jobop.py +40 -3
  95. mistralai/models/jobsout.py +1 -1
  96. mistralai/models/legacyjobmetadataout.py +1 -1
  97. mistralai/models/messageinputentry.py +9 -3
  98. mistralai/models/messageoutputentry.py +6 -3
  99. mistralai/models/messageoutputevent.py +4 -2
  100. mistralai/models/mistralerror.py +11 -7
  101. mistralai/models/mistralpromptmode.py +1 -1
  102. mistralai/models/modelconversation.py +1 -1
  103. mistralai/models/no_response_error.py +5 -1
  104. mistralai/models/ocrrequest.py +11 -1
  105. mistralai/models/ocrtableobject.py +4 -1
  106. mistralai/models/referencechunk.py +1 -1
  107. mistralai/models/requestsource.py +5 -1
  108. mistralai/models/responsedoneevent.py +1 -1
  109. mistralai/models/responseerrorevent.py +1 -1
  110. mistralai/models/responseformats.py +5 -1
  111. mistralai/models/responsestartedevent.py +1 -1
  112. mistralai/models/responsevalidationerror.py +2 -0
  113. mistralai/models/retrievefileout.py +3 -5
  114. mistralai/models/sampletype.py +7 -1
  115. mistralai/models/sdkerror.py +2 -0
  116. mistralai/models/shareenum.py +7 -1
  117. mistralai/models/sharingdelete.py +2 -4
  118. mistralai/models/sharingin.py +3 -5
  119. mistralai/models/source.py +8 -1
  120. mistralai/models/systemmessage.py +1 -1
  121. mistralai/models/textchunk.py +1 -1
  122. mistralai/models/thinkchunk.py +1 -1
  123. mistralai/models/timestampgranularity.py +1 -1
  124. mistralai/models/tool.py +2 -6
  125. mistralai/models/toolcall.py +2 -6
  126. mistralai/models/toolchoice.py +2 -6
  127. mistralai/models/toolchoiceenum.py +6 -1
  128. mistralai/models/toolexecutiondeltaevent.py +2 -1
  129. mistralai/models/toolexecutiondoneevent.py +2 -1
  130. mistralai/models/toolexecutionentry.py +4 -2
  131. mistralai/models/toolexecutionstartedevent.py +2 -1
  132. mistralai/models/toolfilechunk.py +13 -5
  133. mistralai/models/toolmessage.py +1 -1
  134. mistralai/models/toolreferencechunk.py +15 -5
  135. mistralai/models/tooltypes.py +1 -1
  136. mistralai/models/transcriptionsegmentchunk.py +1 -1
  137. mistralai/models/transcriptionstreamdone.py +1 -1
  138. mistralai/models/transcriptionstreamlanguage.py +1 -1
  139. mistralai/models/transcriptionstreamsegmentdelta.py +1 -1
  140. mistralai/models/transcriptionstreamtextdelta.py +1 -1
  141. mistralai/models/unarchiveftmodelout.py +1 -1
  142. mistralai/models/uploadfileout.py +3 -5
  143. mistralai/models/usermessage.py +1 -1
  144. mistralai/models/wandbintegration.py +1 -1
  145. mistralai/models/wandbintegrationout.py +1 -1
  146. mistralai/models/websearchpremiumtool.py +1 -1
  147. mistralai/models/websearchtool.py +1 -1
  148. mistralai/models_.py +24 -12
  149. mistralai/ocr.py +38 -10
  150. mistralai/sdk.py +2 -2
  151. mistralai/transcriptions.py +28 -12
  152. mistralai/types/basemodel.py +41 -3
  153. mistralai/utils/__init__.py +0 -3
  154. mistralai/utils/annotations.py +32 -8
  155. mistralai/utils/enums.py +60 -0
  156. mistralai/utils/forms.py +21 -10
  157. mistralai/utils/queryparams.py +14 -2
  158. mistralai/utils/requestbodies.py +3 -3
  159. mistralai/utils/retries.py +69 -5
  160. mistralai/utils/serializers.py +0 -20
  161. mistralai/utils/unmarshal_json_response.py +15 -1
  162. {mistralai-1.10.0.dist-info → mistralai-1.11.1.dist-info}/METADATA +144 -159
  163. mistralai-1.11.1.dist-info/RECORD +495 -0
  164. {mistralai-1.10.0.dist-info → mistralai-1.11.1.dist-info}/WHEEL +1 -1
  165. mistralai_azure/_version.py +3 -3
  166. mistralai_azure/basesdk.py +21 -5
  167. mistralai_azure/chat.py +82 -109
  168. mistralai_azure/httpclient.py +0 -1
  169. mistralai_azure/models/__init__.py +66 -4
  170. mistralai_azure/models/assistantmessage.py +1 -1
  171. mistralai_azure/models/chatcompletionchoice.py +10 -7
  172. mistralai_azure/models/chatcompletionrequest.py +24 -10
  173. mistralai_azure/models/chatcompletionstreamrequest.py +24 -10
  174. mistralai_azure/models/completionresponsestreamchoice.py +11 -7
  175. mistralai_azure/models/documenturlchunk.py +1 -1
  176. mistralai_azure/models/httpvalidationerror.py +15 -8
  177. mistralai_azure/models/imageurlchunk.py +1 -1
  178. mistralai_azure/models/mistralazureerror.py +30 -0
  179. mistralai_azure/models/mistralpromptmode.py +1 -1
  180. mistralai_azure/models/no_response_error.py +17 -0
  181. mistralai_azure/models/ocrpageobject.py +32 -5
  182. mistralai_azure/models/ocrrequest.py +20 -1
  183. mistralai_azure/models/ocrtableobject.py +34 -0
  184. mistralai_azure/models/prediction.py +4 -0
  185. mistralai_azure/models/referencechunk.py +1 -1
  186. mistralai_azure/models/responseformat.py +4 -2
  187. mistralai_azure/models/responseformats.py +5 -2
  188. mistralai_azure/models/responsevalidationerror.py +27 -0
  189. mistralai_azure/models/sdkerror.py +32 -14
  190. mistralai_azure/models/systemmessage.py +8 -4
  191. mistralai_azure/models/systemmessagecontentchunks.py +21 -0
  192. mistralai_azure/models/textchunk.py +1 -1
  193. mistralai_azure/models/thinkchunk.py +35 -0
  194. mistralai_azure/models/tool.py +2 -6
  195. mistralai_azure/models/toolcall.py +2 -6
  196. mistralai_azure/models/toolchoice.py +2 -6
  197. mistralai_azure/models/toolchoiceenum.py +6 -1
  198. mistralai_azure/models/toolmessage.py +1 -1
  199. mistralai_azure/models/tooltypes.py +1 -1
  200. mistralai_azure/models/usermessage.py +1 -1
  201. mistralai_azure/ocr.py +39 -40
  202. mistralai_azure/types/basemodel.py +41 -3
  203. mistralai_azure/utils/__init__.py +18 -8
  204. mistralai_azure/utils/annotations.py +32 -8
  205. mistralai_azure/utils/enums.py +60 -0
  206. mistralai_azure/utils/eventstreaming.py +10 -0
  207. mistralai_azure/utils/forms.py +21 -10
  208. mistralai_azure/utils/queryparams.py +14 -2
  209. mistralai_azure/utils/requestbodies.py +3 -3
  210. mistralai_azure/utils/retries.py +69 -5
  211. mistralai_azure/utils/serializers.py +3 -22
  212. mistralai_azure/utils/unmarshal_json_response.py +38 -0
  213. mistralai_gcp/_hooks/types.py +7 -0
  214. mistralai_gcp/_version.py +4 -4
  215. mistralai_gcp/basesdk.py +33 -25
  216. mistralai_gcp/chat.py +98 -109
  217. mistralai_gcp/fim.py +62 -85
  218. mistralai_gcp/httpclient.py +6 -17
  219. mistralai_gcp/models/__init__.py +321 -116
  220. mistralai_gcp/models/assistantmessage.py +2 -2
  221. mistralai_gcp/models/chatcompletionchoice.py +10 -7
  222. mistralai_gcp/models/chatcompletionrequest.py +38 -7
  223. mistralai_gcp/models/chatcompletionresponse.py +6 -6
  224. mistralai_gcp/models/chatcompletionstreamrequest.py +38 -7
  225. mistralai_gcp/models/completionresponsestreamchoice.py +12 -8
  226. mistralai_gcp/models/deltamessage.py +1 -1
  227. mistralai_gcp/models/fimcompletionrequest.py +9 -10
  228. mistralai_gcp/models/fimcompletionresponse.py +6 -6
  229. mistralai_gcp/models/fimcompletionstreamrequest.py +9 -10
  230. mistralai_gcp/models/httpvalidationerror.py +15 -8
  231. mistralai_gcp/models/imageurl.py +1 -1
  232. mistralai_gcp/models/imageurlchunk.py +1 -1
  233. mistralai_gcp/models/jsonschema.py +1 -1
  234. mistralai_gcp/models/mistralgcperror.py +30 -0
  235. mistralai_gcp/models/mistralpromptmode.py +8 -0
  236. mistralai_gcp/models/no_response_error.py +17 -0
  237. mistralai_gcp/models/prediction.py +4 -0
  238. mistralai_gcp/models/referencechunk.py +1 -1
  239. mistralai_gcp/models/responseformat.py +5 -3
  240. mistralai_gcp/models/responseformats.py +5 -2
  241. mistralai_gcp/models/responsevalidationerror.py +27 -0
  242. mistralai_gcp/models/sdkerror.py +32 -14
  243. mistralai_gcp/models/systemmessage.py +8 -4
  244. mistralai_gcp/models/systemmessagecontentchunks.py +21 -0
  245. mistralai_gcp/models/textchunk.py +1 -1
  246. mistralai_gcp/models/thinkchunk.py +35 -0
  247. mistralai_gcp/models/tool.py +2 -6
  248. mistralai_gcp/models/toolcall.py +2 -6
  249. mistralai_gcp/models/toolchoice.py +2 -6
  250. mistralai_gcp/models/toolchoiceenum.py +6 -1
  251. mistralai_gcp/models/toolmessage.py +2 -2
  252. mistralai_gcp/models/tooltypes.py +1 -1
  253. mistralai_gcp/models/usageinfo.py +71 -8
  254. mistralai_gcp/models/usermessage.py +2 -2
  255. mistralai_gcp/sdk.py +12 -10
  256. mistralai_gcp/sdkconfiguration.py +0 -7
  257. mistralai_gcp/types/basemodel.py +41 -3
  258. mistralai_gcp/utils/__init__.py +141 -46
  259. mistralai_gcp/utils/annotations.py +32 -8
  260. mistralai_gcp/utils/datetimes.py +23 -0
  261. mistralai_gcp/utils/enums.py +125 -25
  262. mistralai_gcp/utils/eventstreaming.py +10 -0
  263. mistralai_gcp/utils/forms.py +62 -30
  264. mistralai_gcp/utils/queryparams.py +14 -2
  265. mistralai_gcp/utils/requestbodies.py +3 -3
  266. mistralai_gcp/utils/retries.py +69 -5
  267. mistralai_gcp/utils/serializers.py +33 -23
  268. mistralai_gcp/utils/unmarshal_json_response.py +38 -0
  269. mistralai-1.10.0.dist-info/RECORD +0 -475
  270. {mistralai-1.10.0.dist-info → mistralai-1.11.1.dist-info}/licenses/LICENSE +0 -0
mistralai/mistral_jobs.py CHANGED
@@ -4,10 +4,15 @@ from .basesdk import BaseSDK
4
4
  from datetime import datetime
5
5
  from mistralai import models, utils
6
6
  from mistralai._hooks import HookContext
7
+ from mistralai.models import (
8
+ apiendpoint as models_apiendpoint,
9
+ batchjobstatus as models_batchjobstatus,
10
+ batchrequest as models_batchrequest,
11
+ )
7
12
  from mistralai.types import OptionalNullable, UNSET
8
13
  from mistralai.utils import get_security_from_env
9
14
  from mistralai.utils.unmarshal_json_response import unmarshal_json_response
10
- from typing import Any, Dict, List, Mapping, Optional
15
+ from typing import Any, Dict, List, Mapping, Optional, Union
11
16
 
12
17
 
13
18
  class MistralJobs(BaseSDK):
@@ -21,7 +26,7 @@ class MistralJobs(BaseSDK):
21
26
  metadata: OptionalNullable[Dict[str, Any]] = UNSET,
22
27
  created_after: OptionalNullable[datetime] = UNSET,
23
28
  created_by_me: Optional[bool] = False,
24
- status: OptionalNullable[List[models.BatchJobStatus]] = UNSET,
29
+ status: OptionalNullable[List[models_batchjobstatus.BatchJobStatus]] = UNSET,
25
30
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
26
31
  server_url: Optional[str] = None,
27
32
  timeout_ms: Optional[int] = None,
@@ -78,6 +83,7 @@ class MistralJobs(BaseSDK):
78
83
  accept_header_value="application/json",
79
84
  http_headers=http_headers,
80
85
  security=self.sdk_configuration.security,
86
+ allow_empty_value=None,
81
87
  timeout_ms=timeout_ms,
82
88
  )
83
89
 
@@ -94,7 +100,7 @@ class MistralJobs(BaseSDK):
94
100
  config=self.sdk_configuration,
95
101
  base_url=base_url or "",
96
102
  operation_id="jobs_api_routes_batch_get_batch_jobs",
97
- oauth2_scopes=[],
103
+ oauth2_scopes=None,
98
104
  security_source=get_security_from_env(
99
105
  self.sdk_configuration.security, models.Security
100
106
  ),
@@ -125,7 +131,7 @@ class MistralJobs(BaseSDK):
125
131
  metadata: OptionalNullable[Dict[str, Any]] = UNSET,
126
132
  created_after: OptionalNullable[datetime] = UNSET,
127
133
  created_by_me: Optional[bool] = False,
128
- status: OptionalNullable[List[models.BatchJobStatus]] = UNSET,
134
+ status: OptionalNullable[List[models_batchjobstatus.BatchJobStatus]] = UNSET,
129
135
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
130
136
  server_url: Optional[str] = None,
131
137
  timeout_ms: Optional[int] = None,
@@ -182,6 +188,7 @@ class MistralJobs(BaseSDK):
182
188
  accept_header_value="application/json",
183
189
  http_headers=http_headers,
184
190
  security=self.sdk_configuration.security,
191
+ allow_empty_value=None,
185
192
  timeout_ms=timeout_ms,
186
193
  )
187
194
 
@@ -198,7 +205,7 @@ class MistralJobs(BaseSDK):
198
205
  config=self.sdk_configuration,
199
206
  base_url=base_url or "",
200
207
  operation_id="jobs_api_routes_batch_get_batch_jobs",
201
- oauth2_scopes=[],
208
+ oauth2_scopes=None,
202
209
  security_source=get_security_from_env(
203
210
  self.sdk_configuration.security, models.Security
204
211
  ),
@@ -222,8 +229,14 @@ class MistralJobs(BaseSDK):
222
229
  def create(
223
230
  self,
224
231
  *,
225
- input_files: List[str],
226
- endpoint: models.APIEndpoint,
232
+ endpoint: models_apiendpoint.APIEndpoint,
233
+ input_files: OptionalNullable[List[str]] = UNSET,
234
+ requests: OptionalNullable[
235
+ Union[
236
+ List[models_batchrequest.BatchRequest],
237
+ List[models_batchrequest.BatchRequestTypedDict],
238
+ ]
239
+ ] = UNSET,
227
240
  model: OptionalNullable[str] = UNSET,
228
241
  agent_id: OptionalNullable[str] = UNSET,
229
242
  metadata: OptionalNullable[Dict[str, str]] = UNSET,
@@ -237,8 +250,9 @@ class MistralJobs(BaseSDK):
237
250
 
238
251
  Create a new batch job, it will be queued for processing.
239
252
 
240
- :param input_files: The list of input files to be used for batch inference, these files should be `jsonl` files, containing the input data corresponding to the bory request for the batch inference in a \"body\" field. An example of such file is the following: ```json {\"custom_id\": \"0\", \"body\": {\"max_tokens\": 100, \"messages\": [{\"role\": \"user\", \"content\": \"What is the best French cheese?\"}]}} {\"custom_id\": \"1\", \"body\": {\"max_tokens\": 100, \"messages\": [{\"role\": \"user\", \"content\": \"What is the best French wine?\"}]}} ```
241
253
  :param endpoint:
254
+ :param input_files: The list of input files to be used for batch inference, these files should be `jsonl` files, containing the input data corresponding to the bory request for the batch inference in a \"body\" field. An example of such file is the following: ```json {\"custom_id\": \"0\", \"body\": {\"max_tokens\": 100, \"messages\": [{\"role\": \"user\", \"content\": \"What is the best French cheese?\"}]}} {\"custom_id\": \"1\", \"body\": {\"max_tokens\": 100, \"messages\": [{\"role\": \"user\", \"content\": \"What is the best French wine?\"}]}} ```
255
+ :param requests:
242
256
  :param model: The model to be used for batch inference.
243
257
  :param agent_id: In case you want to use a specific agent from the **deprecated** agents api for batch inference, you can specify the agent ID here.
244
258
  :param metadata: The metadata of your choice to be associated with the batch inference job.
@@ -260,6 +274,9 @@ class MistralJobs(BaseSDK):
260
274
 
261
275
  request = models.BatchJobIn(
262
276
  input_files=input_files,
277
+ requests=utils.get_pydantic_model(
278
+ requests, OptionalNullable[List[models.BatchRequest]]
279
+ ),
263
280
  endpoint=endpoint,
264
281
  model=model,
265
282
  agent_id=agent_id,
@@ -283,6 +300,7 @@ class MistralJobs(BaseSDK):
283
300
  get_serialized_body=lambda: utils.serialize_request_body(
284
301
  request, False, False, "json", models.BatchJobIn
285
302
  ),
303
+ allow_empty_value=None,
286
304
  timeout_ms=timeout_ms,
287
305
  )
288
306
 
@@ -299,7 +317,7 @@ class MistralJobs(BaseSDK):
299
317
  config=self.sdk_configuration,
300
318
  base_url=base_url or "",
301
319
  operation_id="jobs_api_routes_batch_create_batch_job",
302
- oauth2_scopes=[],
320
+ oauth2_scopes=None,
303
321
  security_source=get_security_from_env(
304
322
  self.sdk_configuration.security, models.Security
305
323
  ),
@@ -323,8 +341,14 @@ class MistralJobs(BaseSDK):
323
341
  async def create_async(
324
342
  self,
325
343
  *,
326
- input_files: List[str],
327
- endpoint: models.APIEndpoint,
344
+ endpoint: models_apiendpoint.APIEndpoint,
345
+ input_files: OptionalNullable[List[str]] = UNSET,
346
+ requests: OptionalNullable[
347
+ Union[
348
+ List[models_batchrequest.BatchRequest],
349
+ List[models_batchrequest.BatchRequestTypedDict],
350
+ ]
351
+ ] = UNSET,
328
352
  model: OptionalNullable[str] = UNSET,
329
353
  agent_id: OptionalNullable[str] = UNSET,
330
354
  metadata: OptionalNullable[Dict[str, str]] = UNSET,
@@ -338,8 +362,9 @@ class MistralJobs(BaseSDK):
338
362
 
339
363
  Create a new batch job, it will be queued for processing.
340
364
 
341
- :param input_files: The list of input files to be used for batch inference, these files should be `jsonl` files, containing the input data corresponding to the bory request for the batch inference in a \"body\" field. An example of such file is the following: ```json {\"custom_id\": \"0\", \"body\": {\"max_tokens\": 100, \"messages\": [{\"role\": \"user\", \"content\": \"What is the best French cheese?\"}]}} {\"custom_id\": \"1\", \"body\": {\"max_tokens\": 100, \"messages\": [{\"role\": \"user\", \"content\": \"What is the best French wine?\"}]}} ```
342
365
  :param endpoint:
366
+ :param input_files: The list of input files to be used for batch inference, these files should be `jsonl` files, containing the input data corresponding to the bory request for the batch inference in a \"body\" field. An example of such file is the following: ```json {\"custom_id\": \"0\", \"body\": {\"max_tokens\": 100, \"messages\": [{\"role\": \"user\", \"content\": \"What is the best French cheese?\"}]}} {\"custom_id\": \"1\", \"body\": {\"max_tokens\": 100, \"messages\": [{\"role\": \"user\", \"content\": \"What is the best French wine?\"}]}} ```
367
+ :param requests:
343
368
  :param model: The model to be used for batch inference.
344
369
  :param agent_id: In case you want to use a specific agent from the **deprecated** agents api for batch inference, you can specify the agent ID here.
345
370
  :param metadata: The metadata of your choice to be associated with the batch inference job.
@@ -361,6 +386,9 @@ class MistralJobs(BaseSDK):
361
386
 
362
387
  request = models.BatchJobIn(
363
388
  input_files=input_files,
389
+ requests=utils.get_pydantic_model(
390
+ requests, OptionalNullable[List[models.BatchRequest]]
391
+ ),
364
392
  endpoint=endpoint,
365
393
  model=model,
366
394
  agent_id=agent_id,
@@ -384,6 +412,7 @@ class MistralJobs(BaseSDK):
384
412
  get_serialized_body=lambda: utils.serialize_request_body(
385
413
  request, False, False, "json", models.BatchJobIn
386
414
  ),
415
+ allow_empty_value=None,
387
416
  timeout_ms=timeout_ms,
388
417
  )
389
418
 
@@ -400,7 +429,7 @@ class MistralJobs(BaseSDK):
400
429
  config=self.sdk_configuration,
401
430
  base_url=base_url or "",
402
431
  operation_id="jobs_api_routes_batch_create_batch_job",
403
- oauth2_scopes=[],
432
+ oauth2_scopes=None,
404
433
  security_source=get_security_from_env(
405
434
  self.sdk_configuration.security, models.Security
406
435
  ),
@@ -425,6 +454,7 @@ class MistralJobs(BaseSDK):
425
454
  self,
426
455
  *,
427
456
  job_id: str,
457
+ inline: OptionalNullable[bool] = UNSET,
428
458
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
429
459
  server_url: Optional[str] = None,
430
460
  timeout_ms: Optional[int] = None,
@@ -434,7 +464,11 @@ class MistralJobs(BaseSDK):
434
464
 
435
465
  Get a batch job details by its UUID.
436
466
 
467
+ Args:
468
+ inline: If True, return results inline in the response.
469
+
437
470
  :param job_id:
471
+ :param inline:
438
472
  :param retries: Override the default retry configuration for this method
439
473
  :param server_url: Override the default server URL for this method
440
474
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -452,6 +486,7 @@ class MistralJobs(BaseSDK):
452
486
 
453
487
  request = models.JobsAPIRoutesBatchGetBatchJobRequest(
454
488
  job_id=job_id,
489
+ inline=inline,
455
490
  )
456
491
 
457
492
  req = self._build_request(
@@ -467,6 +502,7 @@ class MistralJobs(BaseSDK):
467
502
  accept_header_value="application/json",
468
503
  http_headers=http_headers,
469
504
  security=self.sdk_configuration.security,
505
+ allow_empty_value=None,
470
506
  timeout_ms=timeout_ms,
471
507
  )
472
508
 
@@ -483,7 +519,7 @@ class MistralJobs(BaseSDK):
483
519
  config=self.sdk_configuration,
484
520
  base_url=base_url or "",
485
521
  operation_id="jobs_api_routes_batch_get_batch_job",
486
- oauth2_scopes=[],
522
+ oauth2_scopes=None,
487
523
  security_source=get_security_from_env(
488
524
  self.sdk_configuration.security, models.Security
489
525
  ),
@@ -508,6 +544,7 @@ class MistralJobs(BaseSDK):
508
544
  self,
509
545
  *,
510
546
  job_id: str,
547
+ inline: OptionalNullable[bool] = UNSET,
511
548
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
512
549
  server_url: Optional[str] = None,
513
550
  timeout_ms: Optional[int] = None,
@@ -517,7 +554,11 @@ class MistralJobs(BaseSDK):
517
554
 
518
555
  Get a batch job details by its UUID.
519
556
 
557
+ Args:
558
+ inline: If True, return results inline in the response.
559
+
520
560
  :param job_id:
561
+ :param inline:
521
562
  :param retries: Override the default retry configuration for this method
522
563
  :param server_url: Override the default server URL for this method
523
564
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -535,6 +576,7 @@ class MistralJobs(BaseSDK):
535
576
 
536
577
  request = models.JobsAPIRoutesBatchGetBatchJobRequest(
537
578
  job_id=job_id,
579
+ inline=inline,
538
580
  )
539
581
 
540
582
  req = self._build_request_async(
@@ -550,6 +592,7 @@ class MistralJobs(BaseSDK):
550
592
  accept_header_value="application/json",
551
593
  http_headers=http_headers,
552
594
  security=self.sdk_configuration.security,
595
+ allow_empty_value=None,
553
596
  timeout_ms=timeout_ms,
554
597
  )
555
598
 
@@ -566,7 +609,7 @@ class MistralJobs(BaseSDK):
566
609
  config=self.sdk_configuration,
567
610
  base_url=base_url or "",
568
611
  operation_id="jobs_api_routes_batch_get_batch_job",
569
- oauth2_scopes=[],
612
+ oauth2_scopes=None,
570
613
  security_source=get_security_from_env(
571
614
  self.sdk_configuration.security, models.Security
572
615
  ),
@@ -633,6 +676,7 @@ class MistralJobs(BaseSDK):
633
676
  accept_header_value="application/json",
634
677
  http_headers=http_headers,
635
678
  security=self.sdk_configuration.security,
679
+ allow_empty_value=None,
636
680
  timeout_ms=timeout_ms,
637
681
  )
638
682
 
@@ -649,7 +693,7 @@ class MistralJobs(BaseSDK):
649
693
  config=self.sdk_configuration,
650
694
  base_url=base_url or "",
651
695
  operation_id="jobs_api_routes_batch_cancel_batch_job",
652
- oauth2_scopes=[],
696
+ oauth2_scopes=None,
653
697
  security_source=get_security_from_env(
654
698
  self.sdk_configuration.security, models.Security
655
699
  ),
@@ -716,6 +760,7 @@ class MistralJobs(BaseSDK):
716
760
  accept_header_value="application/json",
717
761
  http_headers=http_headers,
718
762
  security=self.sdk_configuration.security,
763
+ allow_empty_value=None,
719
764
  timeout_ms=timeout_ms,
720
765
  )
721
766
 
@@ -732,7 +777,7 @@ class MistralJobs(BaseSDK):
732
777
  config=self.sdk_configuration,
733
778
  base_url=base_url or "",
734
779
  operation_id="jobs_api_routes_batch_cancel_batch_job",
735
- oauth2_scopes=[],
780
+ oauth2_scopes=None,
736
781
  security_source=get_security_from_env(
737
782
  self.sdk_configuration.security, models.Security
738
783
  ),
@@ -45,10 +45,18 @@ if TYPE_CHECKING:
45
45
  AgentsAPIV1AgentsDeleteRequest,
46
46
  AgentsAPIV1AgentsDeleteRequestTypedDict,
47
47
  )
48
+ from .agents_api_v1_agents_get_versionop import (
49
+ AgentsAPIV1AgentsGetVersionRequest,
50
+ AgentsAPIV1AgentsGetVersionRequestTypedDict,
51
+ )
48
52
  from .agents_api_v1_agents_getop import (
49
53
  AgentsAPIV1AgentsGetRequest,
50
54
  AgentsAPIV1AgentsGetRequestTypedDict,
51
55
  )
56
+ from .agents_api_v1_agents_list_versionsop import (
57
+ AgentsAPIV1AgentsListVersionsRequest,
58
+ AgentsAPIV1AgentsListVersionsRequestTypedDict,
59
+ )
52
60
  from .agents_api_v1_agents_listop import (
53
61
  AgentsAPIV1AgentsListRequest,
54
62
  AgentsAPIV1AgentsListRequestTypedDict,
@@ -141,6 +149,8 @@ if TYPE_CHECKING:
141
149
  AssistantMessageTypedDict,
142
150
  )
143
151
  from .audiochunk import AudioChunk, AudioChunkType, AudioChunkTypedDict
152
+ from .audioencoding import AudioEncoding
153
+ from .audioformat import AudioFormat, AudioFormatTypedDict
144
154
  from .audiotranscriptionrequest import (
145
155
  AudioTranscriptionRequest,
146
156
  AudioTranscriptionRequestTypedDict,
@@ -155,6 +165,7 @@ if TYPE_CHECKING:
155
165
  from .batchjobout import BatchJobOut, BatchJobOutObject, BatchJobOutTypedDict
156
166
  from .batchjobsout import BatchJobsOut, BatchJobsOutObject, BatchJobsOutTypedDict
157
167
  from .batchjobstatus import BatchJobStatus
168
+ from .batchrequest import BatchRequest, BatchRequestTypedDict
158
169
  from .builtinconnectors import BuiltInConnectors
159
170
  from .chatclassificationrequest import (
160
171
  ChatClassificationRequest,
@@ -840,7 +851,13 @@ if TYPE_CHECKING:
840
851
  ToolExecutionStartedEventType,
841
852
  ToolExecutionStartedEventTypedDict,
842
853
  )
843
- from .toolfilechunk import ToolFileChunk, ToolFileChunkType, ToolFileChunkTypedDict
854
+ from .toolfilechunk import (
855
+ ToolFileChunk,
856
+ ToolFileChunkTool,
857
+ ToolFileChunkToolTypedDict,
858
+ ToolFileChunkType,
859
+ ToolFileChunkTypedDict,
860
+ )
844
861
  from .toolmessage import (
845
862
  ToolMessage,
846
863
  ToolMessageContent,
@@ -850,6 +867,8 @@ if TYPE_CHECKING:
850
867
  )
851
868
  from .toolreferencechunk import (
852
869
  ToolReferenceChunk,
870
+ ToolReferenceChunkTool,
871
+ ToolReferenceChunkToolTypedDict,
853
872
  ToolReferenceChunkType,
854
873
  ToolReferenceChunkTypedDict,
855
874
  )
@@ -961,8 +980,12 @@ __all__ = [
961
980
  "AgentsAPIV1AgentsDeleteRequestTypedDict",
962
981
  "AgentsAPIV1AgentsGetRequest",
963
982
  "AgentsAPIV1AgentsGetRequestTypedDict",
983
+ "AgentsAPIV1AgentsGetVersionRequest",
984
+ "AgentsAPIV1AgentsGetVersionRequestTypedDict",
964
985
  "AgentsAPIV1AgentsListRequest",
965
986
  "AgentsAPIV1AgentsListRequestTypedDict",
987
+ "AgentsAPIV1AgentsListVersionsRequest",
988
+ "AgentsAPIV1AgentsListVersionsRequestTypedDict",
966
989
  "AgentsAPIV1AgentsUpdateRequest",
967
990
  "AgentsAPIV1AgentsUpdateRequestTypedDict",
968
991
  "AgentsAPIV1AgentsUpdateVersionRequest",
@@ -1018,6 +1041,9 @@ __all__ = [
1018
1041
  "AudioChunk",
1019
1042
  "AudioChunkType",
1020
1043
  "AudioChunkTypedDict",
1044
+ "AudioEncoding",
1045
+ "AudioFormat",
1046
+ "AudioFormatTypedDict",
1021
1047
  "AudioTranscriptionRequest",
1022
1048
  "AudioTranscriptionRequestStream",
1023
1049
  "AudioTranscriptionRequestStreamTypedDict",
@@ -1036,6 +1062,8 @@ __all__ = [
1036
1062
  "BatchJobsOut",
1037
1063
  "BatchJobsOutObject",
1038
1064
  "BatchJobsOutTypedDict",
1065
+ "BatchRequest",
1066
+ "BatchRequestTypedDict",
1039
1067
  "BuiltInConnectors",
1040
1068
  "ChatClassificationRequest",
1041
1069
  "ChatClassificationRequestTypedDict",
@@ -1567,6 +1595,8 @@ __all__ = [
1567
1595
  "ToolExecutionStartedEventType",
1568
1596
  "ToolExecutionStartedEventTypedDict",
1569
1597
  "ToolFileChunk",
1598
+ "ToolFileChunkTool",
1599
+ "ToolFileChunkToolTypedDict",
1570
1600
  "ToolFileChunkType",
1571
1601
  "ToolFileChunkTypedDict",
1572
1602
  "ToolMessage",
@@ -1575,6 +1605,8 @@ __all__ = [
1575
1605
  "ToolMessageRole",
1576
1606
  "ToolMessageTypedDict",
1577
1607
  "ToolReferenceChunk",
1608
+ "ToolReferenceChunkTool",
1609
+ "ToolReferenceChunkToolTypedDict",
1578
1610
  "ToolReferenceChunkType",
1579
1611
  "ToolReferenceChunkTypedDict",
1580
1612
  "ToolTypedDict",
@@ -1662,8 +1694,12 @@ _dynamic_imports: dict[str, str] = {
1662
1694
  "AgentHandoffStartedEventTypedDict": ".agenthandoffstartedevent",
1663
1695
  "AgentsAPIV1AgentsDeleteRequest": ".agents_api_v1_agents_deleteop",
1664
1696
  "AgentsAPIV1AgentsDeleteRequestTypedDict": ".agents_api_v1_agents_deleteop",
1697
+ "AgentsAPIV1AgentsGetVersionRequest": ".agents_api_v1_agents_get_versionop",
1698
+ "AgentsAPIV1AgentsGetVersionRequestTypedDict": ".agents_api_v1_agents_get_versionop",
1665
1699
  "AgentsAPIV1AgentsGetRequest": ".agents_api_v1_agents_getop",
1666
1700
  "AgentsAPIV1AgentsGetRequestTypedDict": ".agents_api_v1_agents_getop",
1701
+ "AgentsAPIV1AgentsListVersionsRequest": ".agents_api_v1_agents_list_versionsop",
1702
+ "AgentsAPIV1AgentsListVersionsRequestTypedDict": ".agents_api_v1_agents_list_versionsop",
1667
1703
  "AgentsAPIV1AgentsListRequest": ".agents_api_v1_agents_listop",
1668
1704
  "AgentsAPIV1AgentsListRequestTypedDict": ".agents_api_v1_agents_listop",
1669
1705
  "AgentsAPIV1AgentsUpdateVersionRequest": ".agents_api_v1_agents_update_versionop",
@@ -1724,6 +1760,9 @@ _dynamic_imports: dict[str, str] = {
1724
1760
  "AudioChunk": ".audiochunk",
1725
1761
  "AudioChunkType": ".audiochunk",
1726
1762
  "AudioChunkTypedDict": ".audiochunk",
1763
+ "AudioEncoding": ".audioencoding",
1764
+ "AudioFormat": ".audioformat",
1765
+ "AudioFormatTypedDict": ".audioformat",
1727
1766
  "AudioTranscriptionRequest": ".audiotranscriptionrequest",
1728
1767
  "AudioTranscriptionRequestTypedDict": ".audiotranscriptionrequest",
1729
1768
  "AudioTranscriptionRequestStream": ".audiotranscriptionrequeststream",
@@ -1742,6 +1781,8 @@ _dynamic_imports: dict[str, str] = {
1742
1781
  "BatchJobsOutObject": ".batchjobsout",
1743
1782
  "BatchJobsOutTypedDict": ".batchjobsout",
1744
1783
  "BatchJobStatus": ".batchjobstatus",
1784
+ "BatchRequest": ".batchrequest",
1785
+ "BatchRequestTypedDict": ".batchrequest",
1745
1786
  "BuiltInConnectors": ".builtinconnectors",
1746
1787
  "ChatClassificationRequest": ".chatclassificationrequest",
1747
1788
  "ChatClassificationRequestTypedDict": ".chatclassificationrequest",
@@ -2277,6 +2318,8 @@ _dynamic_imports: dict[str, str] = {
2277
2318
  "ToolExecutionStartedEventType": ".toolexecutionstartedevent",
2278
2319
  "ToolExecutionStartedEventTypedDict": ".toolexecutionstartedevent",
2279
2320
  "ToolFileChunk": ".toolfilechunk",
2321
+ "ToolFileChunkTool": ".toolfilechunk",
2322
+ "ToolFileChunkToolTypedDict": ".toolfilechunk",
2280
2323
  "ToolFileChunkType": ".toolfilechunk",
2281
2324
  "ToolFileChunkTypedDict": ".toolfilechunk",
2282
2325
  "ToolMessage": ".toolmessage",
@@ -2285,6 +2328,8 @@ _dynamic_imports: dict[str, str] = {
2285
2328
  "ToolMessageRole": ".toolmessage",
2286
2329
  "ToolMessageTypedDict": ".toolmessage",
2287
2330
  "ToolReferenceChunk": ".toolreferencechunk",
2331
+ "ToolReferenceChunkTool": ".toolreferencechunk",
2332
+ "ToolReferenceChunkToolTypedDict": ".toolreferencechunk",
2288
2333
  "ToolReferenceChunkType": ".toolreferencechunk",
2289
2334
  "ToolReferenceChunkTypedDict": ".toolreferencechunk",
2290
2335
  "ToolTypes": ".tooltypes",
mistralai/models/agent.py CHANGED
@@ -42,7 +42,7 @@ AgentTools = Annotated[
42
42
  ]
43
43
 
44
44
 
45
- AgentObject = Literal["agent"]
45
+ AgentObject = Literal["agent",]
46
46
 
47
47
 
48
48
  class AgentTypedDict(TypedDict):
@@ -8,7 +8,7 @@ from typing import Any, Dict, Literal, Optional
8
8
  from typing_extensions import NotRequired, TypedDict
9
9
 
10
10
 
11
- AgentConversationObject = Literal["conversation"]
11
+ AgentConversationObject = Literal["conversation",]
12
12
 
13
13
 
14
14
  class AgentConversationTypedDict(TypedDict):
@@ -7,7 +7,7 @@ from typing import Literal, Optional
7
7
  from typing_extensions import NotRequired, TypedDict
8
8
 
9
9
 
10
- AgentHandoffDoneEventType = Literal["agent.handoff.done"]
10
+ AgentHandoffDoneEventType = Literal["agent.handoff.done",]
11
11
 
12
12
 
13
13
  class AgentHandoffDoneEventTypedDict(TypedDict):
@@ -8,9 +8,10 @@ from typing import Literal, Optional
8
8
  from typing_extensions import NotRequired, TypedDict
9
9
 
10
10
 
11
- AgentHandoffEntryObject = Literal["entry"]
11
+ AgentHandoffEntryObject = Literal["entry",]
12
12
 
13
- AgentHandoffEntryType = Literal["agent.handoff"]
13
+
14
+ AgentHandoffEntryType = Literal["agent.handoff",]
14
15
 
15
16
 
16
17
  class AgentHandoffEntryTypedDict(TypedDict):
@@ -7,7 +7,7 @@ from typing import Literal, Optional
7
7
  from typing_extensions import NotRequired, TypedDict
8
8
 
9
9
 
10
- AgentHandoffStartedEventType = Literal["agent.handoff.started"]
10
+ AgentHandoffStartedEventType = Literal["agent.handoff.started",]
11
11
 
12
12
 
13
13
  class AgentHandoffStartedEventTypedDict(TypedDict):
@@ -0,0 +1,21 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from mistralai.types import BaseModel
5
+ from mistralai.utils import FieldMetadata, PathParamMetadata
6
+ from typing_extensions import Annotated, TypedDict
7
+
8
+
9
+ class AgentsAPIV1AgentsGetVersionRequestTypedDict(TypedDict):
10
+ agent_id: str
11
+ version: int
12
+
13
+
14
+ class AgentsAPIV1AgentsGetVersionRequest(BaseModel):
15
+ agent_id: Annotated[
16
+ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
17
+ ]
18
+
19
+ version: Annotated[
20
+ int, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
21
+ ]
@@ -0,0 +1,33 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from mistralai.types import BaseModel
5
+ from mistralai.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata
6
+ from typing import Optional
7
+ from typing_extensions import Annotated, NotRequired, TypedDict
8
+
9
+
10
+ class AgentsAPIV1AgentsListVersionsRequestTypedDict(TypedDict):
11
+ agent_id: str
12
+ page: NotRequired[int]
13
+ r"""Page number (0-indexed)"""
14
+ page_size: NotRequired[int]
15
+ r"""Number of versions per page"""
16
+
17
+
18
+ class AgentsAPIV1AgentsListVersionsRequest(BaseModel):
19
+ agent_id: Annotated[
20
+ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
21
+ ]
22
+
23
+ page: Annotated[
24
+ Optional[int],
25
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
26
+ ] = 0
27
+ r"""Page number (0-indexed)"""
28
+
29
+ page_size: Annotated[
30
+ Optional[int],
31
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
32
+ ] = 20
33
+ r"""Number of versions per page"""
@@ -11,7 +11,9 @@ from typing_extensions import Annotated, NotRequired, TypedDict
11
11
 
12
12
  class AgentsAPIV1AgentsListRequestTypedDict(TypedDict):
13
13
  page: NotRequired[int]
14
+ r"""Page number (0-indexed)"""
14
15
  page_size: NotRequired[int]
16
+ r"""Number of agents per page"""
15
17
  deployment_chat: NotRequired[Nullable[bool]]
16
18
  sources: NotRequired[Nullable[List[RequestSource]]]
17
19
  name: NotRequired[Nullable[str]]
@@ -24,11 +26,13 @@ class AgentsAPIV1AgentsListRequest(BaseModel):
24
26
  Optional[int],
25
27
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
26
28
  ] = 0
29
+ r"""Page number (0-indexed)"""
27
30
 
28
31
  page_size: Annotated[
29
32
  Optional[int],
30
33
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
31
34
  ] = 20
35
+ r"""Number of agents per page"""
32
36
 
33
37
  deployment_chat: Annotated[
34
38
  OptionalNullable[bool],
@@ -52,7 +56,7 @@ class AgentsAPIV1AgentsListRequest(BaseModel):
52
56
 
53
57
  metadata: Annotated[
54
58
  OptionalNullable[Dict[str, Any]],
55
- FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
59
+ FieldMetadata(query=QueryParamMetadata(serialization="json")),
56
60
  ] = UNSET
57
61
 
58
62
  @model_serializer(mode="wrap")
@@ -29,7 +29,7 @@ class AgentsAPIV1ConversationsListRequest(BaseModel):
29
29
 
30
30
  metadata: Annotated[
31
31
  OptionalNullable[Dict[str, Any]],
32
- FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
32
+ FieldMetadata(query=QueryParamMetadata(serialization="json")),
33
33
  ] = UNSET
34
34
 
35
35
  @model_serializer(mode="wrap")
@@ -12,9 +12,8 @@ from .toolchoiceenum import ToolChoiceEnum
12
12
  from .toolmessage import ToolMessage, ToolMessageTypedDict
13
13
  from .usermessage import UserMessage, UserMessageTypedDict
14
14
  from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
15
- from mistralai.utils import get_discriminator, validate_open_enum
15
+ from mistralai.utils import get_discriminator
16
16
  from pydantic import Discriminator, Tag, model_serializer
17
- from pydantic.functional_validators import PlainValidator
18
17
  from typing import Any, Dict, List, Optional, Union
19
18
  from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
20
19
 
@@ -137,9 +136,7 @@ class AgentsCompletionRequest(BaseModel):
137
136
 
138
137
  parallel_tool_calls: Optional[bool] = None
139
138
 
140
- prompt_mode: Annotated[
141
- OptionalNullable[MistralPromptMode], PlainValidator(validate_open_enum(False))
142
- ] = UNSET
139
+ prompt_mode: OptionalNullable[MistralPromptMode] = UNSET
143
140
  r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used."""
144
141
 
145
142
  @model_serializer(mode="wrap")
@@ -12,9 +12,8 @@ from .toolchoiceenum import ToolChoiceEnum
12
12
  from .toolmessage import ToolMessage, ToolMessageTypedDict
13
13
  from .usermessage import UserMessage, UserMessageTypedDict
14
14
  from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
15
- from mistralai.utils import get_discriminator, validate_open_enum
15
+ from mistralai.utils import get_discriminator
16
16
  from pydantic import Discriminator, Tag, model_serializer
17
- from pydantic.functional_validators import PlainValidator
18
17
  from typing import Any, Dict, List, Optional, Union
19
18
  from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
20
19
 
@@ -135,9 +134,7 @@ class AgentsCompletionStreamRequest(BaseModel):
135
134
 
136
135
  parallel_tool_calls: Optional[bool] = None
137
136
 
138
- prompt_mode: Annotated[
139
- OptionalNullable[MistralPromptMode], PlainValidator(validate_open_enum(False))
140
- ] = UNSET
137
+ prompt_mode: OptionalNullable[MistralPromptMode] = UNSET
141
138
  r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used."""
142
139
 
143
140
  @model_serializer(mode="wrap")
@@ -6,7 +6,7 @@ from typing import Literal, Optional
6
6
  from typing_extensions import NotRequired, TypedDict
7
7
 
8
8
 
9
- ArchiveFTModelOutObject = Literal["model"]
9
+ ArchiveFTModelOutObject = Literal["model",]
10
10
 
11
11
 
12
12
  class ArchiveFTModelOutTypedDict(TypedDict):
@@ -19,7 +19,7 @@ AssistantMessageContent = TypeAliasType(
19
19
  )
20
20
 
21
21
 
22
- AssistantMessageRole = Literal["assistant"]
22
+ AssistantMessageRole = Literal["assistant",]
23
23
 
24
24
 
25
25
  class AssistantMessageTypedDict(TypedDict):