mistralai 1.1.0__py3-none-any.whl → 1.2.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 (187) hide show
  1. mistralai/__init__.py +4 -0
  2. mistralai/_version.py +12 -0
  3. mistralai/agents.py +56 -22
  4. mistralai/batch.py +17 -0
  5. mistralai/chat.py +64 -30
  6. mistralai/classifiers.py +396 -0
  7. mistralai/embeddings.py +10 -6
  8. mistralai/files.py +252 -19
  9. mistralai/fim.py +40 -30
  10. mistralai/jobs.py +40 -20
  11. mistralai/mistral_jobs.py +733 -0
  12. mistralai/models/__init__.py +108 -18
  13. mistralai/models/agentscompletionrequest.py +27 -10
  14. mistralai/models/agentscompletionstreamrequest.py +27 -10
  15. mistralai/models/apiendpoint.py +9 -0
  16. mistralai/models/archiveftmodelout.py +11 -5
  17. mistralai/models/assistantmessage.py +11 -6
  18. mistralai/models/basemodelcard.py +22 -6
  19. mistralai/models/batcherror.py +17 -0
  20. mistralai/models/batchjobin.py +58 -0
  21. mistralai/models/batchjobout.py +117 -0
  22. mistralai/models/batchjobsout.py +30 -0
  23. mistralai/models/batchjobstatus.py +15 -0
  24. mistralai/models/chatclassificationrequest.py +104 -0
  25. mistralai/models/chatcompletionchoice.py +9 -4
  26. mistralai/models/chatcompletionrequest.py +32 -13
  27. mistralai/models/chatcompletionresponse.py +2 -2
  28. mistralai/models/chatcompletionstreamrequest.py +32 -13
  29. mistralai/models/checkpointout.py +1 -1
  30. mistralai/models/classificationobject.py +21 -0
  31. mistralai/models/classificationrequest.py +59 -0
  32. mistralai/models/classificationresponse.py +21 -0
  33. mistralai/models/completionchunk.py +2 -2
  34. mistralai/models/completionevent.py +1 -1
  35. mistralai/models/completionresponsestreamchoice.py +11 -5
  36. mistralai/models/delete_model_v1_models_model_id_deleteop.py +1 -2
  37. mistralai/models/deletefileout.py +1 -1
  38. mistralai/models/deletemodelout.py +2 -2
  39. mistralai/models/deltamessage.py +14 -7
  40. mistralai/models/detailedjobout.py +11 -5
  41. mistralai/models/embeddingrequest.py +5 -5
  42. mistralai/models/embeddingresponse.py +2 -1
  43. mistralai/models/embeddingresponsedata.py +2 -2
  44. mistralai/models/eventout.py +2 -2
  45. mistralai/models/filepurpose.py +8 -0
  46. mistralai/models/files_api_routes_delete_fileop.py +1 -2
  47. mistralai/models/files_api_routes_download_fileop.py +16 -0
  48. mistralai/models/files_api_routes_list_filesop.py +96 -0
  49. mistralai/models/files_api_routes_retrieve_fileop.py +1 -2
  50. mistralai/models/files_api_routes_upload_fileop.py +9 -9
  51. mistralai/models/fileschema.py +7 -21
  52. mistralai/models/fimcompletionrequest.py +20 -13
  53. mistralai/models/fimcompletionresponse.py +2 -2
  54. mistralai/models/fimcompletionstreamrequest.py +20 -13
  55. mistralai/models/ftmodelcapabilitiesout.py +2 -2
  56. mistralai/models/ftmodelcard.py +24 -6
  57. mistralai/models/ftmodelout.py +9 -5
  58. mistralai/models/function.py +2 -2
  59. mistralai/models/functioncall.py +2 -1
  60. mistralai/models/functionname.py +1 -1
  61. mistralai/models/githubrepositoryin.py +11 -5
  62. mistralai/models/githubrepositoryout.py +11 -5
  63. mistralai/models/httpvalidationerror.py +0 -2
  64. mistralai/models/imageurl.py +1 -2
  65. mistralai/models/imageurlchunk.py +11 -5
  66. mistralai/models/jobin.py +2 -2
  67. mistralai/models/jobmetadataout.py +1 -2
  68. mistralai/models/jobout.py +10 -5
  69. mistralai/models/jobs_api_routes_batch_cancel_batch_jobop.py +16 -0
  70. mistralai/models/jobs_api_routes_batch_get_batch_jobop.py +16 -0
  71. mistralai/models/jobs_api_routes_batch_get_batch_jobsop.py +95 -0
  72. mistralai/models/jobs_api_routes_fine_tuning_archive_fine_tuned_modelop.py +1 -2
  73. mistralai/models/jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop.py +1 -2
  74. mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobop.py +1 -2
  75. mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobsop.py +2 -2
  76. mistralai/models/jobs_api_routes_fine_tuning_start_fine_tuning_jobop.py +1 -2
  77. mistralai/models/jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelop.py +1 -2
  78. mistralai/models/jobs_api_routes_fine_tuning_update_fine_tuned_modelop.py +1 -2
  79. mistralai/models/jobsout.py +9 -5
  80. mistralai/models/legacyjobmetadataout.py +12 -5
  81. mistralai/models/listfilesout.py +5 -1
  82. mistralai/models/metricout.py +1 -2
  83. mistralai/models/modelcapabilities.py +2 -2
  84. mistralai/models/modellist.py +2 -2
  85. mistralai/models/responseformat.py +2 -2
  86. mistralai/models/retrieve_model_v1_models_model_id_getop.py +2 -2
  87. mistralai/models/retrievefileout.py +10 -21
  88. mistralai/models/sampletype.py +6 -2
  89. mistralai/models/security.py +2 -2
  90. mistralai/models/source.py +3 -2
  91. mistralai/models/systemmessage.py +6 -6
  92. mistralai/models/textchunk.py +9 -5
  93. mistralai/models/tool.py +2 -2
  94. mistralai/models/toolcall.py +2 -2
  95. mistralai/models/toolchoice.py +2 -2
  96. mistralai/models/toolmessage.py +2 -2
  97. mistralai/models/trainingfile.py +2 -2
  98. mistralai/models/trainingparameters.py +7 -2
  99. mistralai/models/trainingparametersin.py +7 -2
  100. mistralai/models/unarchiveftmodelout.py +11 -5
  101. mistralai/models/updateftmodelin.py +1 -2
  102. mistralai/models/uploadfileout.py +7 -21
  103. mistralai/models/usageinfo.py +1 -1
  104. mistralai/models/usermessage.py +36 -5
  105. mistralai/models/validationerror.py +2 -1
  106. mistralai/models/wandbintegration.py +11 -5
  107. mistralai/models/wandbintegrationout.py +12 -6
  108. mistralai/models_.py +48 -24
  109. mistralai/sdk.py +7 -0
  110. mistralai/sdkconfiguration.py +7 -7
  111. mistralai/utils/__init__.py +8 -0
  112. mistralai/utils/annotations.py +13 -2
  113. mistralai/utils/serializers.py +25 -0
  114. {mistralai-1.1.0.dist-info → mistralai-1.2.1.dist-info}/METADATA +90 -14
  115. mistralai-1.2.1.dist-info/RECORD +276 -0
  116. {mistralai-1.1.0.dist-info → mistralai-1.2.1.dist-info}/WHEEL +1 -1
  117. mistralai_azure/__init__.py +4 -0
  118. mistralai_azure/_version.py +12 -0
  119. mistralai_azure/chat.py +64 -30
  120. mistralai_azure/models/__init__.py +9 -3
  121. mistralai_azure/models/assistantmessage.py +11 -6
  122. mistralai_azure/models/chatcompletionchoice.py +10 -5
  123. mistralai_azure/models/chatcompletionrequest.py +32 -13
  124. mistralai_azure/models/chatcompletionresponse.py +2 -2
  125. mistralai_azure/models/chatcompletionstreamrequest.py +32 -13
  126. mistralai_azure/models/completionchunk.py +2 -2
  127. mistralai_azure/models/completionevent.py +1 -1
  128. mistralai_azure/models/completionresponsestreamchoice.py +9 -4
  129. mistralai_azure/models/deltamessage.py +14 -7
  130. mistralai_azure/models/function.py +2 -2
  131. mistralai_azure/models/functioncall.py +2 -1
  132. mistralai_azure/models/functionname.py +1 -1
  133. mistralai_azure/models/httpvalidationerror.py +0 -2
  134. mistralai_azure/models/responseformat.py +2 -2
  135. mistralai_azure/models/security.py +1 -2
  136. mistralai_azure/models/systemmessage.py +6 -6
  137. mistralai_azure/models/textchunk.py +9 -5
  138. mistralai_azure/models/tool.py +2 -2
  139. mistralai_azure/models/toolcall.py +2 -2
  140. mistralai_azure/models/toolchoice.py +2 -2
  141. mistralai_azure/models/toolmessage.py +2 -2
  142. mistralai_azure/models/usageinfo.py +1 -1
  143. mistralai_azure/models/usermessage.py +36 -5
  144. mistralai_azure/models/validationerror.py +2 -1
  145. mistralai_azure/sdkconfiguration.py +7 -7
  146. mistralai_azure/utils/__init__.py +8 -0
  147. mistralai_azure/utils/annotations.py +13 -2
  148. mistralai_azure/utils/serializers.py +25 -0
  149. mistralai_gcp/__init__.py +4 -0
  150. mistralai_gcp/_version.py +12 -0
  151. mistralai_gcp/chat.py +64 -30
  152. mistralai_gcp/fim.py +40 -30
  153. mistralai_gcp/models/__init__.py +9 -3
  154. mistralai_gcp/models/assistantmessage.py +11 -6
  155. mistralai_gcp/models/chatcompletionchoice.py +10 -5
  156. mistralai_gcp/models/chatcompletionrequest.py +32 -13
  157. mistralai_gcp/models/chatcompletionresponse.py +2 -2
  158. mistralai_gcp/models/chatcompletionstreamrequest.py +32 -13
  159. mistralai_gcp/models/completionchunk.py +2 -2
  160. mistralai_gcp/models/completionevent.py +1 -1
  161. mistralai_gcp/models/completionresponsestreamchoice.py +9 -4
  162. mistralai_gcp/models/deltamessage.py +14 -7
  163. mistralai_gcp/models/fimcompletionrequest.py +20 -13
  164. mistralai_gcp/models/fimcompletionresponse.py +2 -2
  165. mistralai_gcp/models/fimcompletionstreamrequest.py +20 -13
  166. mistralai_gcp/models/function.py +2 -2
  167. mistralai_gcp/models/functioncall.py +2 -1
  168. mistralai_gcp/models/functionname.py +1 -1
  169. mistralai_gcp/models/httpvalidationerror.py +0 -2
  170. mistralai_gcp/models/responseformat.py +2 -2
  171. mistralai_gcp/models/security.py +1 -2
  172. mistralai_gcp/models/systemmessage.py +6 -6
  173. mistralai_gcp/models/textchunk.py +9 -5
  174. mistralai_gcp/models/tool.py +2 -2
  175. mistralai_gcp/models/toolcall.py +2 -2
  176. mistralai_gcp/models/toolchoice.py +2 -2
  177. mistralai_gcp/models/toolmessage.py +2 -2
  178. mistralai_gcp/models/usageinfo.py +1 -1
  179. mistralai_gcp/models/usermessage.py +36 -5
  180. mistralai_gcp/models/validationerror.py +2 -1
  181. mistralai_gcp/sdk.py +20 -11
  182. mistralai_gcp/sdkconfiguration.py +7 -7
  183. mistralai_gcp/utils/__init__.py +8 -0
  184. mistralai_gcp/utils/annotations.py +13 -2
  185. mistralai_gcp/utils/serializers.py +25 -0
  186. mistralai-1.1.0.dist-info/RECORD +0 -254
  187. {mistralai-1.1.0.dist-info → mistralai-1.2.1.dist-info}/LICENSE +0 -0
@@ -20,6 +20,7 @@ from .agentscompletionstreamrequest import (
20
20
  AgentsCompletionStreamRequestToolChoiceTypedDict,
21
21
  AgentsCompletionStreamRequestTypedDict,
22
22
  )
23
+ from .apiendpoint import APIEndpoint
23
24
  from .archiveftmodelout import (
24
25
  ArchiveFTModelOut,
25
26
  ArchiveFTModelOutObject,
@@ -27,10 +28,27 @@ from .archiveftmodelout import (
27
28
  )
28
29
  from .assistantmessage import (
29
30
  AssistantMessage,
31
+ AssistantMessageContent,
32
+ AssistantMessageContentTypedDict,
30
33
  AssistantMessageRole,
31
34
  AssistantMessageTypedDict,
32
35
  )
33
- from .basemodelcard import BaseModelCard, BaseModelCardTypedDict
36
+ from .basemodelcard import BaseModelCard, BaseModelCardTypedDict, Type
37
+ from .batcherror import BatchError, BatchErrorTypedDict
38
+ from .batchjobin import BatchJobIn, BatchJobInTypedDict
39
+ from .batchjobout import BatchJobOut, BatchJobOutObject, BatchJobOutTypedDict
40
+ from .batchjobsout import BatchJobsOut, BatchJobsOutObject, BatchJobsOutTypedDict
41
+ from .batchjobstatus import BatchJobStatus
42
+ from .chatclassificationrequest import (
43
+ ChatClassificationRequest,
44
+ ChatClassificationRequestInputs,
45
+ ChatClassificationRequestInputsTypedDict,
46
+ ChatClassificationRequestTypedDict,
47
+ One,
48
+ OneTypedDict,
49
+ Two,
50
+ TwoTypedDict,
51
+ )
34
52
  from .chatcompletionchoice import (
35
53
  ChatCompletionChoice,
36
54
  ChatCompletionChoiceTypedDict,
@@ -61,6 +79,17 @@ from .chatcompletionstreamrequest import (
61
79
  ChatCompletionStreamRequestTypedDict,
62
80
  )
63
81
  from .checkpointout import CheckpointOut, CheckpointOutTypedDict
82
+ from .classificationobject import ClassificationObject, ClassificationObjectTypedDict
83
+ from .classificationrequest import (
84
+ ClassificationRequest,
85
+ ClassificationRequestInputs,
86
+ ClassificationRequestInputsTypedDict,
87
+ ClassificationRequestTypedDict,
88
+ )
89
+ from .classificationresponse import (
90
+ ClassificationResponse,
91
+ ClassificationResponseTypedDict,
92
+ )
64
93
  from .completionchunk import CompletionChunk, CompletionChunkTypedDict
65
94
  from .completionevent import CompletionEvent, CompletionEventTypedDict
66
95
  from .completionresponsestreamchoice import (
@@ -75,7 +104,7 @@ from .delete_model_v1_models_model_id_deleteop import (
75
104
  )
76
105
  from .deletefileout import DeleteFileOut, DeleteFileOutTypedDict
77
106
  from .deletemodelout import DeleteModelOut, DeleteModelOutTypedDict
78
- from .deltamessage import DeltaMessage, DeltaMessageTypedDict
107
+ from .deltamessage import Content, ContentTypedDict, DeltaMessage, DeltaMessageTypedDict
79
108
  from .detailedjobout import (
80
109
  DetailedJobOut,
81
110
  DetailedJobOutIntegrations,
@@ -95,10 +124,19 @@ from .embeddingrequest import (
95
124
  from .embeddingresponse import EmbeddingResponse, EmbeddingResponseTypedDict
96
125
  from .embeddingresponsedata import EmbeddingResponseData, EmbeddingResponseDataTypedDict
97
126
  from .eventout import EventOut, EventOutTypedDict
127
+ from .filepurpose import FilePurpose
98
128
  from .files_api_routes_delete_fileop import (
99
129
  FilesAPIRoutesDeleteFileRequest,
100
130
  FilesAPIRoutesDeleteFileRequestTypedDict,
101
131
  )
132
+ from .files_api_routes_download_fileop import (
133
+ FilesAPIRoutesDownloadFileRequest,
134
+ FilesAPIRoutesDownloadFileRequestTypedDict,
135
+ )
136
+ from .files_api_routes_list_filesop import (
137
+ FilesAPIRoutesListFilesRequest,
138
+ FilesAPIRoutesListFilesRequestTypedDict,
139
+ )
102
140
  from .files_api_routes_retrieve_fileop import (
103
141
  FilesAPIRoutesRetrieveFileRequest,
104
142
  FilesAPIRoutesRetrieveFileRequestTypedDict,
@@ -108,9 +146,8 @@ from .files_api_routes_upload_fileop import (
108
146
  FileTypedDict,
109
147
  FilesAPIRoutesUploadFileMultiPartBodyParams,
110
148
  FilesAPIRoutesUploadFileMultiPartBodyParamsTypedDict,
111
- FilesAPIRoutesUploadFilePurpose,
112
149
  )
113
- from .fileschema import FileSchema, FileSchemaPurpose, FileSchemaTypedDict
150
+ from .fileschema import FileSchema, FileSchemaTypedDict
114
151
  from .fimcompletionrequest import (
115
152
  FIMCompletionRequest,
116
153
  FIMCompletionRequestStop,
@@ -129,7 +166,7 @@ from .ftmodelcapabilitiesout import (
129
166
  FTModelCapabilitiesOut,
130
167
  FTModelCapabilitiesOutTypedDict,
131
168
  )
132
- from .ftmodelcard import FTModelCard, FTModelCardTypedDict
169
+ from .ftmodelcard import FTModelCard, FTModelCardType, FTModelCardTypedDict
133
170
  from .ftmodelout import FTModelOut, FTModelOutObject, FTModelOutTypedDict
134
171
  from .function import Function, FunctionTypedDict
135
172
  from .functioncall import (
@@ -177,6 +214,18 @@ from .jobout import (
177
214
  RepositoriesTypedDict,
178
215
  Status,
179
216
  )
217
+ from .jobs_api_routes_batch_cancel_batch_jobop import (
218
+ JobsAPIRoutesBatchCancelBatchJobRequest,
219
+ JobsAPIRoutesBatchCancelBatchJobRequestTypedDict,
220
+ )
221
+ from .jobs_api_routes_batch_get_batch_jobop import (
222
+ JobsAPIRoutesBatchGetBatchJobRequest,
223
+ JobsAPIRoutesBatchGetBatchJobRequestTypedDict,
224
+ )
225
+ from .jobs_api_routes_batch_get_batch_jobsop import (
226
+ JobsAPIRoutesBatchGetBatchJobsRequest,
227
+ JobsAPIRoutesBatchGetBatchJobsRequestTypedDict,
228
+ )
180
229
  from .jobs_api_routes_fine_tuning_archive_fine_tuned_modelop import (
181
230
  JobsAPIRoutesFineTuningArchiveFineTunedModelRequest,
182
231
  JobsAPIRoutesFineTuningArchiveFineTunedModelRequestTypedDict,
@@ -228,20 +277,16 @@ from .retrieve_model_v1_models_model_id_getop import (
228
277
  RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGet,
229
278
  RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGetTypedDict,
230
279
  )
231
- from .retrievefileout import (
232
- RetrieveFileOut,
233
- RetrieveFileOutPurpose,
234
- RetrieveFileOutTypedDict,
235
- )
280
+ from .retrievefileout import RetrieveFileOut, RetrieveFileOutTypedDict
236
281
  from .sampletype import SampleType
237
282
  from .sdkerror import SDKError
238
283
  from .security import Security, SecurityTypedDict
239
284
  from .source import Source
240
285
  from .systemmessage import (
241
- Content,
242
- ContentTypedDict,
243
286
  Role,
244
287
  SystemMessage,
288
+ SystemMessageContent,
289
+ SystemMessageContentTypedDict,
245
290
  SystemMessageTypedDict,
246
291
  )
247
292
  from .textchunk import TextChunk, TextChunkType, TextChunkTypedDict
@@ -260,7 +305,7 @@ from .unarchiveftmodelout import (
260
305
  UnarchiveFTModelOutTypedDict,
261
306
  )
262
307
  from .updateftmodelin import UpdateFTModelIn, UpdateFTModelInTypedDict
263
- from .uploadfileout import Purpose, UploadFileOut, UploadFileOutTypedDict
308
+ from .uploadfileout import UploadFileOut, UploadFileOutTypedDict
264
309
  from .usageinfo import UsageInfo, UsageInfoTypedDict
265
310
  from .usermessage import (
266
311
  UserMessage,
@@ -280,9 +325,14 @@ from .wandbintegration import (
280
325
  WandbIntegrationType,
281
326
  WandbIntegrationTypedDict,
282
327
  )
283
- from .wandbintegrationout import Type, WandbIntegrationOut, WandbIntegrationOutTypedDict
328
+ from .wandbintegrationout import (
329
+ WandbIntegrationOut,
330
+ WandbIntegrationOutType,
331
+ WandbIntegrationOutTypedDict,
332
+ )
284
333
 
285
334
  __all__ = [
335
+ "APIEndpoint",
286
336
  "AgentsCompletionRequest",
287
337
  "AgentsCompletionRequestMessages",
288
338
  "AgentsCompletionRequestMessagesTypedDict",
@@ -305,10 +355,27 @@ __all__ = [
305
355
  "Arguments",
306
356
  "ArgumentsTypedDict",
307
357
  "AssistantMessage",
358
+ "AssistantMessageContent",
359
+ "AssistantMessageContentTypedDict",
308
360
  "AssistantMessageRole",
309
361
  "AssistantMessageTypedDict",
310
362
  "BaseModelCard",
311
363
  "BaseModelCardTypedDict",
364
+ "BatchError",
365
+ "BatchErrorTypedDict",
366
+ "BatchJobIn",
367
+ "BatchJobInTypedDict",
368
+ "BatchJobOut",
369
+ "BatchJobOutObject",
370
+ "BatchJobOutTypedDict",
371
+ "BatchJobStatus",
372
+ "BatchJobsOut",
373
+ "BatchJobsOutObject",
374
+ "BatchJobsOutTypedDict",
375
+ "ChatClassificationRequest",
376
+ "ChatClassificationRequestInputs",
377
+ "ChatClassificationRequestInputsTypedDict",
378
+ "ChatClassificationRequestTypedDict",
312
379
  "ChatCompletionChoice",
313
380
  "ChatCompletionChoiceTypedDict",
314
381
  "ChatCompletionRequest",
@@ -327,6 +394,14 @@ __all__ = [
327
394
  "ChatCompletionStreamRequestTypedDict",
328
395
  "CheckpointOut",
329
396
  "CheckpointOutTypedDict",
397
+ "ClassificationObject",
398
+ "ClassificationObjectTypedDict",
399
+ "ClassificationRequest",
400
+ "ClassificationRequestInputs",
401
+ "ClassificationRequestInputsTypedDict",
402
+ "ClassificationRequestTypedDict",
403
+ "ClassificationResponse",
404
+ "ClassificationResponseTypedDict",
330
405
  "CompletionChunk",
331
406
  "CompletionChunkTypedDict",
332
407
  "CompletionEvent",
@@ -377,22 +452,26 @@ __all__ = [
377
452
  "FTModelCapabilitiesOut",
378
453
  "FTModelCapabilitiesOutTypedDict",
379
454
  "FTModelCard",
455
+ "FTModelCardType",
380
456
  "FTModelCardTypedDict",
381
457
  "FTModelOut",
382
458
  "FTModelOutObject",
383
459
  "FTModelOutTypedDict",
384
460
  "File",
461
+ "FilePurpose",
385
462
  "FileSchema",
386
- "FileSchemaPurpose",
387
463
  "FileSchemaTypedDict",
388
464
  "FileTypedDict",
389
465
  "FilesAPIRoutesDeleteFileRequest",
390
466
  "FilesAPIRoutesDeleteFileRequestTypedDict",
467
+ "FilesAPIRoutesDownloadFileRequest",
468
+ "FilesAPIRoutesDownloadFileRequestTypedDict",
469
+ "FilesAPIRoutesListFilesRequest",
470
+ "FilesAPIRoutesListFilesRequestTypedDict",
391
471
  "FilesAPIRoutesRetrieveFileRequest",
392
472
  "FilesAPIRoutesRetrieveFileRequestTypedDict",
393
473
  "FilesAPIRoutesUploadFileMultiPartBodyParams",
394
474
  "FilesAPIRoutesUploadFileMultiPartBodyParamsTypedDict",
395
- "FilesAPIRoutesUploadFilePurpose",
396
475
  "FineTuneableModel",
397
476
  "FinishReason",
398
477
  "Function",
@@ -430,6 +509,12 @@ __all__ = [
430
509
  "JobMetadataOutTypedDict",
431
510
  "JobOut",
432
511
  "JobOutTypedDict",
512
+ "JobsAPIRoutesBatchCancelBatchJobRequest",
513
+ "JobsAPIRoutesBatchCancelBatchJobRequestTypedDict",
514
+ "JobsAPIRoutesBatchGetBatchJobRequest",
515
+ "JobsAPIRoutesBatchGetBatchJobRequestTypedDict",
516
+ "JobsAPIRoutesBatchGetBatchJobsRequest",
517
+ "JobsAPIRoutesBatchGetBatchJobsRequestTypedDict",
433
518
  "JobsAPIRoutesFineTuningArchiveFineTunedModelRequest",
434
519
  "JobsAPIRoutesFineTuningArchiveFineTunedModelRequestTypedDict",
435
520
  "JobsAPIRoutesFineTuningCancelFineTuningJobRequest",
@@ -465,7 +550,8 @@ __all__ = [
465
550
  "ModelList",
466
551
  "ModelListTypedDict",
467
552
  "Object",
468
- "Purpose",
553
+ "One",
554
+ "OneTypedDict",
469
555
  "QueryParamStatus",
470
556
  "Repositories",
471
557
  "RepositoriesTypedDict",
@@ -473,7 +559,6 @@ __all__ = [
473
559
  "ResponseFormatTypedDict",
474
560
  "ResponseFormats",
475
561
  "RetrieveFileOut",
476
- "RetrieveFileOutPurpose",
477
562
  "RetrieveFileOutTypedDict",
478
563
  "RetrieveModelV1ModelsModelIDGetRequest",
479
564
  "RetrieveModelV1ModelsModelIDGetRequestTypedDict",
@@ -489,6 +574,8 @@ __all__ = [
489
574
  "Stop",
490
575
  "StopTypedDict",
491
576
  "SystemMessage",
577
+ "SystemMessageContent",
578
+ "SystemMessageContentTypedDict",
492
579
  "SystemMessageTypedDict",
493
580
  "TextChunk",
494
581
  "TextChunkType",
@@ -510,6 +597,8 @@ __all__ = [
510
597
  "TrainingParametersIn",
511
598
  "TrainingParametersInTypedDict",
512
599
  "TrainingParametersTypedDict",
600
+ "Two",
601
+ "TwoTypedDict",
513
602
  "Type",
514
603
  "UnarchiveFTModelOut",
515
604
  "UnarchiveFTModelOutObject",
@@ -529,6 +618,7 @@ __all__ = [
529
618
  "ValidationErrorTypedDict",
530
619
  "WandbIntegration",
531
620
  "WandbIntegrationOut",
621
+ "WandbIntegrationOutType",
532
622
  "WandbIntegrationOutTypedDict",
533
623
  "WandbIntegrationType",
534
624
  "WandbIntegrationTypedDict",
@@ -3,6 +3,7 @@
3
3
  from __future__ import annotations
4
4
  from .assistantmessage import AssistantMessage, AssistantMessageTypedDict
5
5
  from .responseformat import ResponseFormat, ResponseFormatTypedDict
6
+ from .systemmessage import SystemMessage, SystemMessageTypedDict
6
7
  from .tool import Tool, ToolTypedDict
7
8
  from .toolchoice import ToolChoice, ToolChoiceTypedDict
8
9
  from .toolchoiceenum import ToolChoiceEnum
@@ -11,8 +12,8 @@ from .usermessage import UserMessage, UserMessageTypedDict
11
12
  from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
12
13
  from mistralai.utils import get_discriminator
13
14
  from pydantic import Discriminator, Tag, model_serializer
14
- from typing import List, Optional, TypedDict, Union
15
- from typing_extensions import Annotated, NotRequired
15
+ from typing import List, Optional, Union
16
+ from typing_extensions import Annotated, NotRequired, TypedDict
16
17
 
17
18
 
18
19
  AgentsCompletionRequestStopTypedDict = Union[str, List[str]]
@@ -24,13 +25,17 @@ r"""Stop generation if this token is detected. Or if one of these tokens is dete
24
25
 
25
26
 
26
27
  AgentsCompletionRequestMessagesTypedDict = Union[
27
- UserMessageTypedDict, AssistantMessageTypedDict, ToolMessageTypedDict
28
+ SystemMessageTypedDict,
29
+ UserMessageTypedDict,
30
+ AssistantMessageTypedDict,
31
+ ToolMessageTypedDict,
28
32
  ]
29
33
 
30
34
 
31
35
  AgentsCompletionRequestMessages = Annotated[
32
36
  Union[
33
37
  Annotated[AssistantMessage, Tag("assistant")],
38
+ Annotated[SystemMessage, Tag("system")],
34
39
  Annotated[ToolMessage, Tag("tool")],
35
40
  Annotated[UserMessage, Tag("user")],
36
41
  ],
@@ -51,8 +56,6 @@ class AgentsCompletionRequestTypedDict(TypedDict):
51
56
  r"""The ID of the agent to use for this completion."""
52
57
  max_tokens: NotRequired[Nullable[int]]
53
58
  r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length."""
54
- min_tokens: NotRequired[Nullable[int]]
55
- r"""The minimum number of tokens to generate in the completion."""
56
59
  stream: NotRequired[bool]
57
60
  r"""Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON."""
58
61
  stop: NotRequired[AgentsCompletionRequestStopTypedDict]
@@ -62,6 +65,12 @@ class AgentsCompletionRequestTypedDict(TypedDict):
62
65
  response_format: NotRequired[ResponseFormatTypedDict]
63
66
  tools: NotRequired[Nullable[List[ToolTypedDict]]]
64
67
  tool_choice: NotRequired[AgentsCompletionRequestToolChoiceTypedDict]
68
+ presence_penalty: NotRequired[float]
69
+ r"""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."""
70
+ frequency_penalty: NotRequired[float]
71
+ r"""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."""
72
+ n: NotRequired[Nullable[int]]
73
+ r"""Number of completions to return for each request, input tokens are only billed once."""
65
74
 
66
75
 
67
76
  class AgentsCompletionRequest(BaseModel):
@@ -74,9 +83,6 @@ class AgentsCompletionRequest(BaseModel):
74
83
  max_tokens: OptionalNullable[int] = UNSET
75
84
  r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length."""
76
85
 
77
- min_tokens: OptionalNullable[int] = UNSET
78
- r"""The minimum number of tokens to generate in the completion."""
79
-
80
86
  stream: Optional[bool] = False
81
87
  r"""Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON."""
82
88
 
@@ -92,19 +98,30 @@ class AgentsCompletionRequest(BaseModel):
92
98
 
93
99
  tool_choice: Optional[AgentsCompletionRequestToolChoice] = None
94
100
 
101
+ presence_penalty: Optional[float] = 0
102
+ r"""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."""
103
+
104
+ frequency_penalty: Optional[float] = 0
105
+ r"""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."""
106
+
107
+ n: OptionalNullable[int] = UNSET
108
+ r"""Number of completions to return for each request, input tokens are only billed once."""
109
+
95
110
  @model_serializer(mode="wrap")
96
111
  def serialize_model(self, handler):
97
112
  optional_fields = [
98
113
  "max_tokens",
99
- "min_tokens",
100
114
  "stream",
101
115
  "stop",
102
116
  "random_seed",
103
117
  "response_format",
104
118
  "tools",
105
119
  "tool_choice",
120
+ "presence_penalty",
121
+ "frequency_penalty",
122
+ "n",
106
123
  ]
107
- nullable_fields = ["max_tokens", "min_tokens", "random_seed", "tools"]
124
+ nullable_fields = ["max_tokens", "random_seed", "tools", "n"]
108
125
  null_default_fields = []
109
126
 
110
127
  serialized = handler(self)
@@ -3,6 +3,7 @@
3
3
  from __future__ import annotations
4
4
  from .assistantmessage import AssistantMessage, AssistantMessageTypedDict
5
5
  from .responseformat import ResponseFormat, ResponseFormatTypedDict
6
+ from .systemmessage import SystemMessage, SystemMessageTypedDict
6
7
  from .tool import Tool, ToolTypedDict
7
8
  from .toolchoice import ToolChoice, ToolChoiceTypedDict
8
9
  from .toolchoiceenum import ToolChoiceEnum
@@ -11,8 +12,8 @@ from .usermessage import UserMessage, UserMessageTypedDict
11
12
  from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
12
13
  from mistralai.utils import get_discriminator
13
14
  from pydantic import Discriminator, Tag, model_serializer
14
- from typing import List, Optional, TypedDict, Union
15
- from typing_extensions import Annotated, NotRequired
15
+ from typing import List, Optional, Union
16
+ from typing_extensions import Annotated, NotRequired, TypedDict
16
17
 
17
18
 
18
19
  AgentsCompletionStreamRequestStopTypedDict = Union[str, List[str]]
@@ -24,13 +25,17 @@ r"""Stop generation if this token is detected. Or if one of these tokens is dete
24
25
 
25
26
 
26
27
  AgentsCompletionStreamRequestMessagesTypedDict = Union[
27
- UserMessageTypedDict, AssistantMessageTypedDict, ToolMessageTypedDict
28
+ SystemMessageTypedDict,
29
+ UserMessageTypedDict,
30
+ AssistantMessageTypedDict,
31
+ ToolMessageTypedDict,
28
32
  ]
29
33
 
30
34
 
31
35
  AgentsCompletionStreamRequestMessages = Annotated[
32
36
  Union[
33
37
  Annotated[AssistantMessage, Tag("assistant")],
38
+ Annotated[SystemMessage, Tag("system")],
34
39
  Annotated[ToolMessage, Tag("tool")],
35
40
  Annotated[UserMessage, Tag("user")],
36
41
  ],
@@ -53,8 +58,6 @@ class AgentsCompletionStreamRequestTypedDict(TypedDict):
53
58
  r"""The ID of the agent to use for this completion."""
54
59
  max_tokens: NotRequired[Nullable[int]]
55
60
  r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length."""
56
- min_tokens: NotRequired[Nullable[int]]
57
- r"""The minimum number of tokens to generate in the completion."""
58
61
  stream: NotRequired[bool]
59
62
  stop: NotRequired[AgentsCompletionStreamRequestStopTypedDict]
60
63
  r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array"""
@@ -63,6 +66,12 @@ class AgentsCompletionStreamRequestTypedDict(TypedDict):
63
66
  response_format: NotRequired[ResponseFormatTypedDict]
64
67
  tools: NotRequired[Nullable[List[ToolTypedDict]]]
65
68
  tool_choice: NotRequired[AgentsCompletionStreamRequestToolChoiceTypedDict]
69
+ presence_penalty: NotRequired[float]
70
+ r"""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."""
71
+ frequency_penalty: NotRequired[float]
72
+ r"""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."""
73
+ n: NotRequired[Nullable[int]]
74
+ r"""Number of completions to return for each request, input tokens are only billed once."""
66
75
 
67
76
 
68
77
  class AgentsCompletionStreamRequest(BaseModel):
@@ -75,9 +84,6 @@ class AgentsCompletionStreamRequest(BaseModel):
75
84
  max_tokens: OptionalNullable[int] = UNSET
76
85
  r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length."""
77
86
 
78
- min_tokens: OptionalNullable[int] = UNSET
79
- r"""The minimum number of tokens to generate in the completion."""
80
-
81
87
  stream: Optional[bool] = True
82
88
 
83
89
  stop: Optional[AgentsCompletionStreamRequestStop] = None
@@ -92,19 +98,30 @@ class AgentsCompletionStreamRequest(BaseModel):
92
98
 
93
99
  tool_choice: Optional[AgentsCompletionStreamRequestToolChoice] = None
94
100
 
101
+ presence_penalty: Optional[float] = 0
102
+ r"""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."""
103
+
104
+ frequency_penalty: Optional[float] = 0
105
+ r"""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."""
106
+
107
+ n: OptionalNullable[int] = UNSET
108
+ r"""Number of completions to return for each request, input tokens are only billed once."""
109
+
95
110
  @model_serializer(mode="wrap")
96
111
  def serialize_model(self, handler):
97
112
  optional_fields = [
98
113
  "max_tokens",
99
- "min_tokens",
100
114
  "stream",
101
115
  "stop",
102
116
  "random_seed",
103
117
  "response_format",
104
118
  "tools",
105
119
  "tool_choice",
120
+ "presence_penalty",
121
+ "frequency_penalty",
122
+ "n",
106
123
  ]
107
- nullable_fields = ["max_tokens", "min_tokens", "random_seed", "tools"]
124
+ nullable_fields = ["max_tokens", "random_seed", "tools", "n"]
108
125
  null_default_fields = []
109
126
 
110
127
  serialized = handler(self)
@@ -0,0 +1,9 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from typing import Literal
5
+
6
+
7
+ APIEndpoint = Literal[
8
+ "/v1/chat/completions", "/v1/embeddings", "/v1/fim/completions", "/v1/moderations"
9
+ ]
@@ -2,9 +2,11 @@
2
2
 
3
3
  from __future__ import annotations
4
4
  from mistralai.types import BaseModel
5
+ from mistralai.utils import validate_const
5
6
  import pydantic
6
- from typing import Final, Literal, Optional, TypedDict
7
- from typing_extensions import Annotated, NotRequired
7
+ from pydantic.functional_validators import AfterValidator
8
+ from typing import Literal, Optional
9
+ from typing_extensions import Annotated, NotRequired, TypedDict
8
10
 
9
11
 
10
12
  ArchiveFTModelOutObject = Literal["model"]
@@ -12,14 +14,18 @@ ArchiveFTModelOutObject = Literal["model"]
12
14
 
13
15
  class ArchiveFTModelOutTypedDict(TypedDict):
14
16
  id: str
17
+ object: ArchiveFTModelOutObject
15
18
  archived: NotRequired[bool]
16
19
 
17
20
 
18
21
  class ArchiveFTModelOut(BaseModel):
19
22
  id: str
20
23
 
21
- # fmt: off
22
- OBJECT: Annotated[Final[Optional[ArchiveFTModelOutObject]], pydantic.Field(alias="object")] = "model" # type: ignore
23
- # fmt: on
24
+ OBJECT: Annotated[
25
+ Annotated[
26
+ Optional[ArchiveFTModelOutObject], AfterValidator(validate_const("model"))
27
+ ],
28
+ pydantic.Field(alias="object"),
29
+ ] = "model"
24
30
 
25
31
  archived: Optional[bool] = True
@@ -1,31 +1,36 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
+ from .contentchunk import ContentChunk, ContentChunkTypedDict
4
5
  from .toolcall import ToolCall, ToolCallTypedDict
5
6
  from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
6
7
  from pydantic import model_serializer
7
- from typing import List, Literal, Optional, TypedDict
8
- from typing_extensions import NotRequired
8
+ from typing import List, Literal, Optional, Union
9
+ from typing_extensions import NotRequired, TypedDict
10
+
11
+
12
+ AssistantMessageContentTypedDict = Union[str, List[ContentChunkTypedDict]]
13
+
14
+
15
+ AssistantMessageContent = Union[str, List[ContentChunk]]
9
16
 
10
17
 
11
18
  AssistantMessageRole = Literal["assistant"]
12
19
 
13
20
 
14
21
  class AssistantMessageTypedDict(TypedDict):
15
- content: NotRequired[Nullable[str]]
22
+ content: NotRequired[Nullable[AssistantMessageContentTypedDict]]
16
23
  tool_calls: NotRequired[Nullable[List[ToolCallTypedDict]]]
17
24
  prefix: NotRequired[bool]
18
- r"""Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message."""
19
25
  role: NotRequired[AssistantMessageRole]
20
26
 
21
27
 
22
28
  class AssistantMessage(BaseModel):
23
- content: OptionalNullable[str] = UNSET
29
+ content: OptionalNullable[AssistantMessageContent] = UNSET
24
30
 
25
31
  tool_calls: OptionalNullable[List[ToolCall]] = UNSET
26
32
 
27
33
  prefix: Optional[bool] = False
28
- r"""Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message."""
29
34
 
30
35
  role: Optional[AssistantMessageRole] = "assistant"
31
36
 
@@ -4,10 +4,15 @@ from __future__ import annotations
4
4
  from .modelcapabilities import ModelCapabilities, ModelCapabilitiesTypedDict
5
5
  from datetime import datetime
6
6
  from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
7
+ from mistralai.utils import validate_const
7
8
  import pydantic
8
9
  from pydantic import model_serializer
9
- from typing import Final, List, Optional, TypedDict
10
- from typing_extensions import Annotated, NotRequired
10
+ from pydantic.functional_validators import AfterValidator
11
+ from typing import List, Literal, Optional
12
+ from typing_extensions import Annotated, NotRequired, TypedDict
13
+
14
+
15
+ Type = Literal["base"]
11
16
 
12
17
 
13
18
  class BaseModelCardTypedDict(TypedDict):
@@ -21,6 +26,8 @@ class BaseModelCardTypedDict(TypedDict):
21
26
  max_context_length: NotRequired[int]
22
27
  aliases: NotRequired[List[str]]
23
28
  deprecation: NotRequired[Nullable[datetime]]
29
+ default_model_temperature: NotRequired[Nullable[float]]
30
+ type: Type
24
31
 
25
32
 
26
33
  class BaseModelCard(BaseModel):
@@ -44,9 +51,12 @@ class BaseModelCard(BaseModel):
44
51
 
45
52
  deprecation: OptionalNullable[datetime] = UNSET
46
53
 
47
- # fmt: off
48
- TYPE: Annotated[Final[Optional[str]], pydantic.Field(alias="type")] = "base" # type: ignore
49
- # fmt: on
54
+ default_model_temperature: OptionalNullable[float] = UNSET
55
+
56
+ TYPE: Annotated[
57
+ Annotated[Optional[Type], AfterValidator(validate_const("base"))],
58
+ pydantic.Field(alias="type"),
59
+ ] = "base"
50
60
 
51
61
  @model_serializer(mode="wrap")
52
62
  def serialize_model(self, handler):
@@ -59,9 +69,15 @@ class BaseModelCard(BaseModel):
59
69
  "max_context_length",
60
70
  "aliases",
61
71
  "deprecation",
72
+ "default_model_temperature",
62
73
  "type",
63
74
  ]
64
- nullable_fields = ["name", "description", "deprecation"]
75
+ nullable_fields = [
76
+ "name",
77
+ "description",
78
+ "deprecation",
79
+ "default_model_temperature",
80
+ ]
65
81
  null_default_fields = []
66
82
 
67
83
  serialized = handler(self)
@@ -0,0 +1,17 @@
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 typing import Optional
6
+ from typing_extensions import NotRequired, TypedDict
7
+
8
+
9
+ class BatchErrorTypedDict(TypedDict):
10
+ message: str
11
+ count: NotRequired[int]
12
+
13
+
14
+ class BatchError(BaseModel):
15
+ message: str
16
+
17
+ count: Optional[int] = 1