mistralai 1.9.11__py3-none-any.whl → 1.10.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 (151) hide show
  1. mistralai/_hooks/registration.py +5 -0
  2. mistralai/_hooks/tracing.py +75 -0
  3. mistralai/_version.py +2 -2
  4. mistralai/accesses.py +8 -8
  5. mistralai/agents.py +29 -17
  6. mistralai/chat.py +41 -29
  7. mistralai/classifiers.py +13 -1
  8. mistralai/conversations.py +294 -62
  9. mistralai/documents.py +19 -3
  10. mistralai/embeddings.py +13 -7
  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/__init__.py +15 -0
  17. mistralai/extra/observability/otel.py +372 -0
  18. mistralai/extra/run/context.py +33 -43
  19. mistralai/extra/run/result.py +29 -30
  20. mistralai/extra/run/tools.py +34 -23
  21. mistralai/extra/struct_chat.py +15 -8
  22. mistralai/extra/utils/response_format.py +5 -3
  23. mistralai/files.py +6 -0
  24. mistralai/fim.py +17 -5
  25. mistralai/mistral_agents.py +229 -1
  26. mistralai/mistral_jobs.py +39 -13
  27. mistralai/models/__init__.py +99 -3
  28. mistralai/models/agent.py +15 -2
  29. mistralai/models/agentconversation.py +11 -3
  30. mistralai/models/agentcreationrequest.py +6 -2
  31. mistralai/models/agents_api_v1_agents_deleteop.py +16 -0
  32. mistralai/models/agents_api_v1_agents_getop.py +40 -3
  33. mistralai/models/agents_api_v1_agents_listop.py +72 -2
  34. mistralai/models/agents_api_v1_conversations_deleteop.py +18 -0
  35. mistralai/models/agents_api_v1_conversations_listop.py +39 -2
  36. mistralai/models/agentscompletionrequest.py +21 -6
  37. mistralai/models/agentscompletionstreamrequest.py +21 -6
  38. mistralai/models/agentupdaterequest.py +18 -2
  39. mistralai/models/audioencoding.py +13 -0
  40. mistralai/models/audioformat.py +19 -0
  41. mistralai/models/audiotranscriptionrequest.py +2 -0
  42. mistralai/models/batchjobin.py +26 -5
  43. mistralai/models/batchjobout.py +5 -0
  44. mistralai/models/batchrequest.py +48 -0
  45. mistralai/models/chatcompletionrequest.py +22 -5
  46. mistralai/models/chatcompletionstreamrequest.py +22 -5
  47. mistralai/models/classificationrequest.py +37 -3
  48. mistralai/models/conversationrequest.py +15 -4
  49. mistralai/models/conversationrestartrequest.py +50 -2
  50. mistralai/models/conversationrestartstreamrequest.py +50 -2
  51. mistralai/models/conversationstreamrequest.py +15 -4
  52. mistralai/models/documentout.py +26 -10
  53. mistralai/models/documentupdatein.py +24 -3
  54. mistralai/models/embeddingrequest.py +19 -11
  55. mistralai/models/files_api_routes_list_filesop.py +7 -0
  56. mistralai/models/fimcompletionrequest.py +8 -9
  57. mistralai/models/fimcompletionstreamrequest.py +8 -9
  58. mistralai/models/jobs_api_routes_batch_get_batch_jobop.py +40 -3
  59. mistralai/models/libraries_documents_list_v1op.py +15 -2
  60. mistralai/models/libraryout.py +10 -7
  61. mistralai/models/listfilesout.py +35 -4
  62. mistralai/models/modelcapabilities.py +13 -4
  63. mistralai/models/modelconversation.py +8 -2
  64. mistralai/models/ocrpageobject.py +26 -5
  65. mistralai/models/ocrrequest.py +17 -1
  66. mistralai/models/ocrtableobject.py +31 -0
  67. mistralai/models/prediction.py +4 -0
  68. mistralai/models/requestsource.py +7 -0
  69. mistralai/models/responseformat.py +4 -2
  70. mistralai/models/responseformats.py +0 -1
  71. mistralai/models/sharingdelete.py +36 -5
  72. mistralai/models/sharingin.py +36 -5
  73. mistralai/models/sharingout.py +3 -3
  74. mistralai/models/toolexecutiondeltaevent.py +13 -4
  75. mistralai/models/toolexecutiondoneevent.py +13 -4
  76. mistralai/models/toolexecutionentry.py +9 -4
  77. mistralai/models/toolexecutionstartedevent.py +13 -4
  78. mistralai/models/toolfilechunk.py +11 -4
  79. mistralai/models/toolreferencechunk.py +13 -4
  80. mistralai/models_.py +2 -14
  81. mistralai/ocr.py +18 -0
  82. mistralai/transcriptions.py +4 -4
  83. {mistralai-1.9.11.dist-info → mistralai-1.10.1.dist-info}/METADATA +162 -152
  84. {mistralai-1.9.11.dist-info → mistralai-1.10.1.dist-info}/RECORD +168 -144
  85. {mistralai-1.9.11.dist-info → mistralai-1.10.1.dist-info}/WHEEL +1 -1
  86. mistralai_azure/_version.py +3 -3
  87. mistralai_azure/basesdk.py +15 -5
  88. mistralai_azure/chat.py +59 -98
  89. mistralai_azure/models/__init__.py +50 -3
  90. mistralai_azure/models/chatcompletionrequest.py +16 -4
  91. mistralai_azure/models/chatcompletionstreamrequest.py +16 -4
  92. mistralai_azure/models/httpvalidationerror.py +11 -6
  93. mistralai_azure/models/mistralazureerror.py +26 -0
  94. mistralai_azure/models/no_response_error.py +13 -0
  95. mistralai_azure/models/prediction.py +4 -0
  96. mistralai_azure/models/responseformat.py +4 -2
  97. mistralai_azure/models/responseformats.py +0 -1
  98. mistralai_azure/models/responsevalidationerror.py +25 -0
  99. mistralai_azure/models/sdkerror.py +30 -14
  100. mistralai_azure/models/systemmessage.py +7 -3
  101. mistralai_azure/models/systemmessagecontentchunks.py +21 -0
  102. mistralai_azure/models/thinkchunk.py +35 -0
  103. mistralai_azure/ocr.py +15 -36
  104. mistralai_azure/utils/__init__.py +18 -5
  105. mistralai_azure/utils/eventstreaming.py +10 -0
  106. mistralai_azure/utils/serializers.py +3 -2
  107. mistralai_azure/utils/unmarshal_json_response.py +24 -0
  108. mistralai_gcp/_hooks/types.py +7 -0
  109. mistralai_gcp/_version.py +4 -4
  110. mistralai_gcp/basesdk.py +27 -25
  111. mistralai_gcp/chat.py +75 -98
  112. mistralai_gcp/fim.py +39 -74
  113. mistralai_gcp/httpclient.py +6 -16
  114. mistralai_gcp/models/__init__.py +321 -116
  115. mistralai_gcp/models/assistantmessage.py +1 -1
  116. mistralai_gcp/models/chatcompletionrequest.py +36 -7
  117. mistralai_gcp/models/chatcompletionresponse.py +6 -6
  118. mistralai_gcp/models/chatcompletionstreamrequest.py +36 -7
  119. mistralai_gcp/models/completionresponsestreamchoice.py +1 -1
  120. mistralai_gcp/models/deltamessage.py +1 -1
  121. mistralai_gcp/models/fimcompletionrequest.py +3 -9
  122. mistralai_gcp/models/fimcompletionresponse.py +6 -6
  123. mistralai_gcp/models/fimcompletionstreamrequest.py +3 -9
  124. mistralai_gcp/models/httpvalidationerror.py +11 -6
  125. mistralai_gcp/models/imageurl.py +1 -1
  126. mistralai_gcp/models/jsonschema.py +1 -1
  127. mistralai_gcp/models/mistralgcperror.py +26 -0
  128. mistralai_gcp/models/mistralpromptmode.py +8 -0
  129. mistralai_gcp/models/no_response_error.py +13 -0
  130. mistralai_gcp/models/prediction.py +4 -0
  131. mistralai_gcp/models/responseformat.py +5 -3
  132. mistralai_gcp/models/responseformats.py +0 -1
  133. mistralai_gcp/models/responsevalidationerror.py +25 -0
  134. mistralai_gcp/models/sdkerror.py +30 -14
  135. mistralai_gcp/models/systemmessage.py +7 -3
  136. mistralai_gcp/models/systemmessagecontentchunks.py +21 -0
  137. mistralai_gcp/models/thinkchunk.py +35 -0
  138. mistralai_gcp/models/toolmessage.py +1 -1
  139. mistralai_gcp/models/usageinfo.py +71 -8
  140. mistralai_gcp/models/usermessage.py +1 -1
  141. mistralai_gcp/sdk.py +12 -10
  142. mistralai_gcp/sdkconfiguration.py +0 -7
  143. mistralai_gcp/types/basemodel.py +3 -3
  144. mistralai_gcp/utils/__init__.py +143 -45
  145. mistralai_gcp/utils/datetimes.py +23 -0
  146. mistralai_gcp/utils/enums.py +67 -27
  147. mistralai_gcp/utils/eventstreaming.py +10 -0
  148. mistralai_gcp/utils/forms.py +49 -28
  149. mistralai_gcp/utils/serializers.py +33 -3
  150. mistralai_gcp/utils/unmarshal_json_response.py +24 -0
  151. {mistralai-1.9.11.dist-info → mistralai-1.10.1.dist-info}/licenses/LICENSE +0 -0
@@ -41,6 +41,10 @@ if TYPE_CHECKING:
41
41
  AgentHandoffStartedEventType,
42
42
  AgentHandoffStartedEventTypedDict,
43
43
  )
44
+ from .agents_api_v1_agents_deleteop import (
45
+ AgentsAPIV1AgentsDeleteRequest,
46
+ AgentsAPIV1AgentsDeleteRequestTypedDict,
47
+ )
44
48
  from .agents_api_v1_agents_getop import (
45
49
  AgentsAPIV1AgentsGetRequest,
46
50
  AgentsAPIV1AgentsGetRequestTypedDict,
@@ -65,6 +69,10 @@ if TYPE_CHECKING:
65
69
  AgentsAPIV1ConversationsAppendRequest,
66
70
  AgentsAPIV1ConversationsAppendRequestTypedDict,
67
71
  )
72
+ from .agents_api_v1_conversations_deleteop import (
73
+ AgentsAPIV1ConversationsDeleteRequest,
74
+ AgentsAPIV1ConversationsDeleteRequestTypedDict,
75
+ )
68
76
  from .agents_api_v1_conversations_getop import (
69
77
  AgentsAPIV1ConversationsGetRequest,
70
78
  AgentsAPIV1ConversationsGetRequestTypedDict,
@@ -133,6 +141,8 @@ if TYPE_CHECKING:
133
141
  AssistantMessageTypedDict,
134
142
  )
135
143
  from .audiochunk import AudioChunk, AudioChunkType, AudioChunkTypedDict
144
+ from .audioencoding import AudioEncoding
145
+ from .audioformat import AudioFormat, AudioFormatTypedDict
136
146
  from .audiotranscriptionrequest import (
137
147
  AudioTranscriptionRequest,
138
148
  AudioTranscriptionRequestTypedDict,
@@ -147,6 +157,7 @@ if TYPE_CHECKING:
147
157
  from .batchjobout import BatchJobOut, BatchJobOutObject, BatchJobOutTypedDict
148
158
  from .batchjobsout import BatchJobsOut, BatchJobsOutObject, BatchJobsOutTypedDict
149
159
  from .batchjobstatus import BatchJobStatus
160
+ from .batchrequest import BatchRequest, BatchRequestTypedDict
150
161
  from .builtinconnectors import BuiltInConnectors
151
162
  from .chatclassificationrequest import (
152
163
  ChatClassificationRequest,
@@ -374,7 +385,12 @@ if TYPE_CHECKING:
374
385
  )
375
386
  from .documentout import DocumentOut, DocumentOutTypedDict
376
387
  from .documenttextcontent import DocumentTextContent, DocumentTextContentTypedDict
377
- from .documentupdatein import DocumentUpdateIn, DocumentUpdateInTypedDict
388
+ from .documentupdatein import (
389
+ Attributes,
390
+ AttributesTypedDict,
391
+ DocumentUpdateIn,
392
+ DocumentUpdateInTypedDict,
393
+ )
378
394
  from .documenturlchunk import (
379
395
  DocumentURLChunk,
380
396
  DocumentURLChunkType,
@@ -720,8 +736,15 @@ if TYPE_CHECKING:
720
736
  from .ocrimageobject import OCRImageObject, OCRImageObjectTypedDict
721
737
  from .ocrpagedimensions import OCRPageDimensions, OCRPageDimensionsTypedDict
722
738
  from .ocrpageobject import OCRPageObject, OCRPageObjectTypedDict
723
- from .ocrrequest import Document, DocumentTypedDict, OCRRequest, OCRRequestTypedDict
739
+ from .ocrrequest import (
740
+ Document,
741
+ DocumentTypedDict,
742
+ OCRRequest,
743
+ OCRRequestTypedDict,
744
+ TableFormat,
745
+ )
724
746
  from .ocrresponse import OCRResponse, OCRResponseTypedDict
747
+ from .ocrtableobject import Format, OCRTableObject, OCRTableObjectTypedDict
725
748
  from .ocrusageinfo import OCRUsageInfo, OCRUsageInfoTypedDict
726
749
  from .outputcontentchunks import OutputContentChunks, OutputContentChunksTypedDict
727
750
  from .paginationinfo import PaginationInfo, PaginationInfoTypedDict
@@ -732,6 +755,7 @@ if TYPE_CHECKING:
732
755
  ReferenceChunkType,
733
756
  ReferenceChunkTypedDict,
734
757
  )
758
+ from .requestsource import RequestSource
735
759
  from .responsedoneevent import (
736
760
  ResponseDoneEvent,
737
761
  ResponseDoneEventType,
@@ -792,15 +816,21 @@ if TYPE_CHECKING:
792
816
  from .toolchoiceenum import ToolChoiceEnum
793
817
  from .toolexecutiondeltaevent import (
794
818
  ToolExecutionDeltaEvent,
819
+ ToolExecutionDeltaEventName,
820
+ ToolExecutionDeltaEventNameTypedDict,
795
821
  ToolExecutionDeltaEventType,
796
822
  ToolExecutionDeltaEventTypedDict,
797
823
  )
798
824
  from .toolexecutiondoneevent import (
799
825
  ToolExecutionDoneEvent,
826
+ ToolExecutionDoneEventName,
827
+ ToolExecutionDoneEventNameTypedDict,
800
828
  ToolExecutionDoneEventType,
801
829
  ToolExecutionDoneEventTypedDict,
802
830
  )
803
831
  from .toolexecutionentry import (
832
+ Name,
833
+ NameTypedDict,
804
834
  ToolExecutionEntry,
805
835
  ToolExecutionEntryObject,
806
836
  ToolExecutionEntryType,
@@ -808,10 +838,18 @@ if TYPE_CHECKING:
808
838
  )
809
839
  from .toolexecutionstartedevent import (
810
840
  ToolExecutionStartedEvent,
841
+ ToolExecutionStartedEventName,
842
+ ToolExecutionStartedEventNameTypedDict,
811
843
  ToolExecutionStartedEventType,
812
844
  ToolExecutionStartedEventTypedDict,
813
845
  )
814
- from .toolfilechunk import ToolFileChunk, ToolFileChunkType, ToolFileChunkTypedDict
846
+ from .toolfilechunk import (
847
+ ToolFileChunk,
848
+ ToolFileChunkTool,
849
+ ToolFileChunkToolTypedDict,
850
+ ToolFileChunkType,
851
+ ToolFileChunkTypedDict,
852
+ )
815
853
  from .toolmessage import (
816
854
  ToolMessage,
817
855
  ToolMessageContent,
@@ -821,6 +859,8 @@ if TYPE_CHECKING:
821
859
  )
822
860
  from .toolreferencechunk import (
823
861
  ToolReferenceChunk,
862
+ ToolReferenceChunkTool,
863
+ ToolReferenceChunkToolTypedDict,
824
864
  ToolReferenceChunkType,
825
865
  ToolReferenceChunkTypedDict,
826
866
  )
@@ -928,6 +968,8 @@ __all__ = [
928
968
  "AgentUpdateRequestTools",
929
969
  "AgentUpdateRequestToolsTypedDict",
930
970
  "AgentUpdateRequestTypedDict",
971
+ "AgentsAPIV1AgentsDeleteRequest",
972
+ "AgentsAPIV1AgentsDeleteRequestTypedDict",
931
973
  "AgentsAPIV1AgentsGetRequest",
932
974
  "AgentsAPIV1AgentsGetRequestTypedDict",
933
975
  "AgentsAPIV1AgentsListRequest",
@@ -940,6 +982,8 @@ __all__ = [
940
982
  "AgentsAPIV1ConversationsAppendRequestTypedDict",
941
983
  "AgentsAPIV1ConversationsAppendStreamRequest",
942
984
  "AgentsAPIV1ConversationsAppendStreamRequestTypedDict",
985
+ "AgentsAPIV1ConversationsDeleteRequest",
986
+ "AgentsAPIV1ConversationsDeleteRequestTypedDict",
943
987
  "AgentsAPIV1ConversationsGetRequest",
944
988
  "AgentsAPIV1ConversationsGetRequestTypedDict",
945
989
  "AgentsAPIV1ConversationsGetResponseV1ConversationsGet",
@@ -980,9 +1024,14 @@ __all__ = [
980
1024
  "AssistantMessageContentTypedDict",
981
1025
  "AssistantMessageRole",
982
1026
  "AssistantMessageTypedDict",
1027
+ "Attributes",
1028
+ "AttributesTypedDict",
983
1029
  "AudioChunk",
984
1030
  "AudioChunkType",
985
1031
  "AudioChunkTypedDict",
1032
+ "AudioEncoding",
1033
+ "AudioFormat",
1034
+ "AudioFormatTypedDict",
986
1035
  "AudioTranscriptionRequest",
987
1036
  "AudioTranscriptionRequestStream",
988
1037
  "AudioTranscriptionRequestStreamTypedDict",
@@ -1001,6 +1050,8 @@ __all__ = [
1001
1050
  "BatchJobsOut",
1002
1051
  "BatchJobsOutObject",
1003
1052
  "BatchJobsOutTypedDict",
1053
+ "BatchRequest",
1054
+ "BatchRequestTypedDict",
1004
1055
  "BuiltInConnectors",
1005
1056
  "ChatClassificationRequest",
1006
1057
  "ChatClassificationRequestTypedDict",
@@ -1211,6 +1262,7 @@ __all__ = [
1211
1262
  "FilesAPIRoutesUploadFileMultiPartBodyParamsTypedDict",
1212
1263
  "FineTuneableModelType",
1213
1264
  "FinishReason",
1265
+ "Format",
1214
1266
  "Function",
1215
1267
  "FunctionCall",
1216
1268
  "FunctionCallEntry",
@@ -1412,6 +1464,8 @@ __all__ = [
1412
1464
  "ModerationObjectTypedDict",
1413
1465
  "ModerationResponse",
1414
1466
  "ModerationResponseTypedDict",
1467
+ "Name",
1468
+ "NameTypedDict",
1415
1469
  "NoResponseError",
1416
1470
  "OCRImageObject",
1417
1471
  "OCRImageObjectTypedDict",
@@ -1423,6 +1477,8 @@ __all__ = [
1423
1477
  "OCRRequestTypedDict",
1424
1478
  "OCRResponse",
1425
1479
  "OCRResponseTypedDict",
1480
+ "OCRTableObject",
1481
+ "OCRTableObjectTypedDict",
1426
1482
  "OCRUsageInfo",
1427
1483
  "OCRUsageInfoTypedDict",
1428
1484
  "Object",
@@ -1444,6 +1500,7 @@ __all__ = [
1444
1500
  "ReferenceChunkTypedDict",
1445
1501
  "Repositories",
1446
1502
  "RepositoriesTypedDict",
1503
+ "RequestSource",
1447
1504
  "Response1",
1448
1505
  "Response1TypedDict",
1449
1506
  "ResponseBody",
@@ -1490,6 +1547,7 @@ __all__ = [
1490
1547
  "SystemMessageContentChunksTypedDict",
1491
1548
  "SystemMessageContentTypedDict",
1492
1549
  "SystemMessageTypedDict",
1550
+ "TableFormat",
1493
1551
  "TextChunk",
1494
1552
  "TextChunkType",
1495
1553
  "TextChunkTypedDict",
@@ -1506,9 +1564,13 @@ __all__ = [
1506
1564
  "ToolChoiceEnum",
1507
1565
  "ToolChoiceTypedDict",
1508
1566
  "ToolExecutionDeltaEvent",
1567
+ "ToolExecutionDeltaEventName",
1568
+ "ToolExecutionDeltaEventNameTypedDict",
1509
1569
  "ToolExecutionDeltaEventType",
1510
1570
  "ToolExecutionDeltaEventTypedDict",
1511
1571
  "ToolExecutionDoneEvent",
1572
+ "ToolExecutionDoneEventName",
1573
+ "ToolExecutionDoneEventNameTypedDict",
1512
1574
  "ToolExecutionDoneEventType",
1513
1575
  "ToolExecutionDoneEventTypedDict",
1514
1576
  "ToolExecutionEntry",
@@ -1516,9 +1578,13 @@ __all__ = [
1516
1578
  "ToolExecutionEntryType",
1517
1579
  "ToolExecutionEntryTypedDict",
1518
1580
  "ToolExecutionStartedEvent",
1581
+ "ToolExecutionStartedEventName",
1582
+ "ToolExecutionStartedEventNameTypedDict",
1519
1583
  "ToolExecutionStartedEventType",
1520
1584
  "ToolExecutionStartedEventTypedDict",
1521
1585
  "ToolFileChunk",
1586
+ "ToolFileChunkTool",
1587
+ "ToolFileChunkToolTypedDict",
1522
1588
  "ToolFileChunkType",
1523
1589
  "ToolFileChunkTypedDict",
1524
1590
  "ToolMessage",
@@ -1527,6 +1593,8 @@ __all__ = [
1527
1593
  "ToolMessageRole",
1528
1594
  "ToolMessageTypedDict",
1529
1595
  "ToolReferenceChunk",
1596
+ "ToolReferenceChunkTool",
1597
+ "ToolReferenceChunkToolTypedDict",
1530
1598
  "ToolReferenceChunkType",
1531
1599
  "ToolReferenceChunkTypedDict",
1532
1600
  "ToolTypedDict",
@@ -1612,6 +1680,8 @@ _dynamic_imports: dict[str, str] = {
1612
1680
  "AgentHandoffStartedEvent": ".agenthandoffstartedevent",
1613
1681
  "AgentHandoffStartedEventType": ".agenthandoffstartedevent",
1614
1682
  "AgentHandoffStartedEventTypedDict": ".agenthandoffstartedevent",
1683
+ "AgentsAPIV1AgentsDeleteRequest": ".agents_api_v1_agents_deleteop",
1684
+ "AgentsAPIV1AgentsDeleteRequestTypedDict": ".agents_api_v1_agents_deleteop",
1615
1685
  "AgentsAPIV1AgentsGetRequest": ".agents_api_v1_agents_getop",
1616
1686
  "AgentsAPIV1AgentsGetRequestTypedDict": ".agents_api_v1_agents_getop",
1617
1687
  "AgentsAPIV1AgentsListRequest": ".agents_api_v1_agents_listop",
@@ -1624,6 +1694,8 @@ _dynamic_imports: dict[str, str] = {
1624
1694
  "AgentsAPIV1ConversationsAppendStreamRequestTypedDict": ".agents_api_v1_conversations_append_streamop",
1625
1695
  "AgentsAPIV1ConversationsAppendRequest": ".agents_api_v1_conversations_appendop",
1626
1696
  "AgentsAPIV1ConversationsAppendRequestTypedDict": ".agents_api_v1_conversations_appendop",
1697
+ "AgentsAPIV1ConversationsDeleteRequest": ".agents_api_v1_conversations_deleteop",
1698
+ "AgentsAPIV1ConversationsDeleteRequestTypedDict": ".agents_api_v1_conversations_deleteop",
1627
1699
  "AgentsAPIV1ConversationsGetRequest": ".agents_api_v1_conversations_getop",
1628
1700
  "AgentsAPIV1ConversationsGetRequestTypedDict": ".agents_api_v1_conversations_getop",
1629
1701
  "AgentsAPIV1ConversationsGetResponseV1ConversationsGet": ".agents_api_v1_conversations_getop",
@@ -1672,6 +1744,9 @@ _dynamic_imports: dict[str, str] = {
1672
1744
  "AudioChunk": ".audiochunk",
1673
1745
  "AudioChunkType": ".audiochunk",
1674
1746
  "AudioChunkTypedDict": ".audiochunk",
1747
+ "AudioEncoding": ".audioencoding",
1748
+ "AudioFormat": ".audioformat",
1749
+ "AudioFormatTypedDict": ".audioformat",
1675
1750
  "AudioTranscriptionRequest": ".audiotranscriptionrequest",
1676
1751
  "AudioTranscriptionRequestTypedDict": ".audiotranscriptionrequest",
1677
1752
  "AudioTranscriptionRequestStream": ".audiotranscriptionrequeststream",
@@ -1690,6 +1765,8 @@ _dynamic_imports: dict[str, str] = {
1690
1765
  "BatchJobsOutObject": ".batchjobsout",
1691
1766
  "BatchJobsOutTypedDict": ".batchjobsout",
1692
1767
  "BatchJobStatus": ".batchjobstatus",
1768
+ "BatchRequest": ".batchrequest",
1769
+ "BatchRequestTypedDict": ".batchrequest",
1693
1770
  "BuiltInConnectors": ".builtinconnectors",
1694
1771
  "ChatClassificationRequest": ".chatclassificationrequest",
1695
1772
  "ChatClassificationRequestTypedDict": ".chatclassificationrequest",
@@ -1860,6 +1937,8 @@ _dynamic_imports: dict[str, str] = {
1860
1937
  "DocumentOutTypedDict": ".documentout",
1861
1938
  "DocumentTextContent": ".documenttextcontent",
1862
1939
  "DocumentTextContentTypedDict": ".documenttextcontent",
1940
+ "Attributes": ".documentupdatein",
1941
+ "AttributesTypedDict": ".documentupdatein",
1863
1942
  "DocumentUpdateIn": ".documentupdatein",
1864
1943
  "DocumentUpdateInTypedDict": ".documentupdatein",
1865
1944
  "DocumentURLChunk": ".documenturlchunk",
@@ -2126,8 +2205,12 @@ _dynamic_imports: dict[str, str] = {
2126
2205
  "DocumentTypedDict": ".ocrrequest",
2127
2206
  "OCRRequest": ".ocrrequest",
2128
2207
  "OCRRequestTypedDict": ".ocrrequest",
2208
+ "TableFormat": ".ocrrequest",
2129
2209
  "OCRResponse": ".ocrresponse",
2130
2210
  "OCRResponseTypedDict": ".ocrresponse",
2211
+ "Format": ".ocrtableobject",
2212
+ "OCRTableObject": ".ocrtableobject",
2213
+ "OCRTableObjectTypedDict": ".ocrtableobject",
2131
2214
  "OCRUsageInfo": ".ocrusageinfo",
2132
2215
  "OCRUsageInfoTypedDict": ".ocrusageinfo",
2133
2216
  "OutputContentChunks": ".outputcontentchunks",
@@ -2141,6 +2224,7 @@ _dynamic_imports: dict[str, str] = {
2141
2224
  "ReferenceChunk": ".referencechunk",
2142
2225
  "ReferenceChunkType": ".referencechunk",
2143
2226
  "ReferenceChunkTypedDict": ".referencechunk",
2227
+ "RequestSource": ".requestsource",
2144
2228
  "ResponseDoneEvent": ".responsedoneevent",
2145
2229
  "ResponseDoneEventType": ".responsedoneevent",
2146
2230
  "ResponseDoneEventTypedDict": ".responsedoneevent",
@@ -2197,19 +2281,29 @@ _dynamic_imports: dict[str, str] = {
2197
2281
  "ToolChoiceTypedDict": ".toolchoice",
2198
2282
  "ToolChoiceEnum": ".toolchoiceenum",
2199
2283
  "ToolExecutionDeltaEvent": ".toolexecutiondeltaevent",
2284
+ "ToolExecutionDeltaEventName": ".toolexecutiondeltaevent",
2285
+ "ToolExecutionDeltaEventNameTypedDict": ".toolexecutiondeltaevent",
2200
2286
  "ToolExecutionDeltaEventType": ".toolexecutiondeltaevent",
2201
2287
  "ToolExecutionDeltaEventTypedDict": ".toolexecutiondeltaevent",
2202
2288
  "ToolExecutionDoneEvent": ".toolexecutiondoneevent",
2289
+ "ToolExecutionDoneEventName": ".toolexecutiondoneevent",
2290
+ "ToolExecutionDoneEventNameTypedDict": ".toolexecutiondoneevent",
2203
2291
  "ToolExecutionDoneEventType": ".toolexecutiondoneevent",
2204
2292
  "ToolExecutionDoneEventTypedDict": ".toolexecutiondoneevent",
2293
+ "Name": ".toolexecutionentry",
2294
+ "NameTypedDict": ".toolexecutionentry",
2205
2295
  "ToolExecutionEntry": ".toolexecutionentry",
2206
2296
  "ToolExecutionEntryObject": ".toolexecutionentry",
2207
2297
  "ToolExecutionEntryType": ".toolexecutionentry",
2208
2298
  "ToolExecutionEntryTypedDict": ".toolexecutionentry",
2209
2299
  "ToolExecutionStartedEvent": ".toolexecutionstartedevent",
2300
+ "ToolExecutionStartedEventName": ".toolexecutionstartedevent",
2301
+ "ToolExecutionStartedEventNameTypedDict": ".toolexecutionstartedevent",
2210
2302
  "ToolExecutionStartedEventType": ".toolexecutionstartedevent",
2211
2303
  "ToolExecutionStartedEventTypedDict": ".toolexecutionstartedevent",
2212
2304
  "ToolFileChunk": ".toolfilechunk",
2305
+ "ToolFileChunkTool": ".toolfilechunk",
2306
+ "ToolFileChunkToolTypedDict": ".toolfilechunk",
2213
2307
  "ToolFileChunkType": ".toolfilechunk",
2214
2308
  "ToolFileChunkTypedDict": ".toolfilechunk",
2215
2309
  "ToolMessage": ".toolmessage",
@@ -2218,6 +2312,8 @@ _dynamic_imports: dict[str, str] = {
2218
2312
  "ToolMessageRole": ".toolmessage",
2219
2313
  "ToolMessageTypedDict": ".toolmessage",
2220
2314
  "ToolReferenceChunk": ".toolreferencechunk",
2315
+ "ToolReferenceChunkTool": ".toolreferencechunk",
2316
+ "ToolReferenceChunkToolTypedDict": ".toolreferencechunk",
2221
2317
  "ToolReferenceChunkType": ".toolreferencechunk",
2222
2318
  "ToolReferenceChunkTypedDict": ".toolreferencechunk",
2223
2319
  "ToolTypes": ".tooltypes",
mistralai/models/agent.py CHANGED
@@ -12,7 +12,7 @@ from datetime import datetime
12
12
  from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
13
13
  from mistralai.utils import get_discriminator
14
14
  from pydantic import Discriminator, Tag, model_serializer
15
- from typing import List, Literal, Optional, Union
15
+ from typing import Any, Dict, List, Literal, Optional, Union
16
16
  from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
17
17
 
18
18
 
@@ -50,8 +50,11 @@ class AgentTypedDict(TypedDict):
50
50
  name: str
51
51
  id: str
52
52
  version: int
53
+ versions: List[int]
53
54
  created_at: datetime
54
55
  updated_at: datetime
56
+ deployment_chat: bool
57
+ source: str
55
58
  instructions: NotRequired[Nullable[str]]
56
59
  r"""Instruction prompt the model will follow during the conversation."""
57
60
  tools: NotRequired[List[AgentToolsTypedDict]]
@@ -60,6 +63,7 @@ class AgentTypedDict(TypedDict):
60
63
  r"""White-listed arguments from the completion API"""
61
64
  description: NotRequired[Nullable[str]]
62
65
  handoffs: NotRequired[Nullable[List[str]]]
66
+ metadata: NotRequired[Nullable[Dict[str, Any]]]
63
67
  object: NotRequired[AgentObject]
64
68
 
65
69
 
@@ -72,10 +76,16 @@ class Agent(BaseModel):
72
76
 
73
77
  version: int
74
78
 
79
+ versions: List[int]
80
+
75
81
  created_at: datetime
76
82
 
77
83
  updated_at: datetime
78
84
 
85
+ deployment_chat: bool
86
+
87
+ source: str
88
+
79
89
  instructions: OptionalNullable[str] = UNSET
80
90
  r"""Instruction prompt the model will follow during the conversation."""
81
91
 
@@ -89,6 +99,8 @@ class Agent(BaseModel):
89
99
 
90
100
  handoffs: OptionalNullable[List[str]] = UNSET
91
101
 
102
+ metadata: OptionalNullable[Dict[str, Any]] = UNSET
103
+
92
104
  object: Optional[AgentObject] = "agent"
93
105
 
94
106
  @model_serializer(mode="wrap")
@@ -99,9 +111,10 @@ class Agent(BaseModel):
99
111
  "completion_args",
100
112
  "description",
101
113
  "handoffs",
114
+ "metadata",
102
115
  "object",
103
116
  ]
104
- nullable_fields = ["instructions", "description", "handoffs"]
117
+ nullable_fields = ["instructions", "description", "handoffs", "metadata"]
105
118
  null_default_fields = []
106
119
 
107
120
  serialized = handler(self)
@@ -4,7 +4,7 @@ from __future__ import annotations
4
4
  from datetime import datetime
5
5
  from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
6
6
  from pydantic import model_serializer
7
- from typing import Literal, Optional
7
+ from typing import Any, Dict, Literal, Optional
8
8
  from typing_extensions import NotRequired, TypedDict
9
9
 
10
10
 
@@ -20,7 +20,10 @@ class AgentConversationTypedDict(TypedDict):
20
20
  r"""Name given to the conversation."""
21
21
  description: NotRequired[Nullable[str]]
22
22
  r"""Description of the what the conversation is about."""
23
+ metadata: NotRequired[Nullable[Dict[str, Any]]]
24
+ r"""Custom metadata for the conversation."""
23
25
  object: NotRequired[AgentConversationObject]
26
+ agent_version: NotRequired[Nullable[int]]
24
27
 
25
28
 
26
29
  class AgentConversation(BaseModel):
@@ -38,12 +41,17 @@ class AgentConversation(BaseModel):
38
41
  description: OptionalNullable[str] = UNSET
39
42
  r"""Description of the what the conversation is about."""
40
43
 
44
+ metadata: OptionalNullable[Dict[str, Any]] = UNSET
45
+ r"""Custom metadata for the conversation."""
46
+
41
47
  object: Optional[AgentConversationObject] = "conversation"
42
48
 
49
+ agent_version: OptionalNullable[int] = UNSET
50
+
43
51
  @model_serializer(mode="wrap")
44
52
  def serialize_model(self, handler):
45
- optional_fields = ["name", "description", "object"]
46
- nullable_fields = ["name", "description"]
53
+ optional_fields = ["name", "description", "metadata", "object", "agent_version"]
54
+ nullable_fields = ["name", "description", "metadata", "agent_version"]
47
55
  null_default_fields = []
48
56
 
49
57
  serialized = handler(self)
@@ -11,7 +11,7 @@ from .websearchtool import WebSearchTool, WebSearchToolTypedDict
11
11
  from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
12
12
  from mistralai.utils import get_discriminator
13
13
  from pydantic import Discriminator, Tag, model_serializer
14
- from typing import List, Optional, Union
14
+ from typing import Any, Dict, List, Optional, Union
15
15
  from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
16
16
 
17
17
 
@@ -52,6 +52,7 @@ class AgentCreationRequestTypedDict(TypedDict):
52
52
  r"""White-listed arguments from the completion API"""
53
53
  description: NotRequired[Nullable[str]]
54
54
  handoffs: NotRequired[Nullable[List[str]]]
55
+ metadata: NotRequired[Nullable[Dict[str, Any]]]
55
56
 
56
57
 
57
58
  class AgentCreationRequest(BaseModel):
@@ -72,6 +73,8 @@ class AgentCreationRequest(BaseModel):
72
73
 
73
74
  handoffs: OptionalNullable[List[str]] = UNSET
74
75
 
76
+ metadata: OptionalNullable[Dict[str, Any]] = UNSET
77
+
75
78
  @model_serializer(mode="wrap")
76
79
  def serialize_model(self, handler):
77
80
  optional_fields = [
@@ -80,8 +83,9 @@ class AgentCreationRequest(BaseModel):
80
83
  "completion_args",
81
84
  "description",
82
85
  "handoffs",
86
+ "metadata",
83
87
  ]
84
- nullable_fields = ["instructions", "description", "handoffs"]
88
+ nullable_fields = ["instructions", "description", "handoffs", "metadata"]
85
89
  null_default_fields = []
86
90
 
87
91
  serialized = handler(self)
@@ -0,0 +1,16 @@
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 AgentsAPIV1AgentsDeleteRequestTypedDict(TypedDict):
10
+ agent_id: str
11
+
12
+
13
+ class AgentsAPIV1AgentsDeleteRequest(BaseModel):
14
+ agent_id: Annotated[
15
+ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
16
+ ]
@@ -1,16 +1,53 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
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
4
+ from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
5
+ from mistralai.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata
6
+ from pydantic import model_serializer
7
+ from typing_extensions import Annotated, NotRequired, TypedDict
7
8
 
8
9
 
9
10
  class AgentsAPIV1AgentsGetRequestTypedDict(TypedDict):
10
11
  agent_id: str
12
+ agent_version: NotRequired[Nullable[int]]
11
13
 
12
14
 
13
15
  class AgentsAPIV1AgentsGetRequest(BaseModel):
14
16
  agent_id: Annotated[
15
17
  str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
16
18
  ]
19
+
20
+ agent_version: Annotated[
21
+ OptionalNullable[int],
22
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
23
+ ] = UNSET
24
+
25
+ @model_serializer(mode="wrap")
26
+ def serialize_model(self, handler):
27
+ optional_fields = ["agent_version"]
28
+ nullable_fields = ["agent_version"]
29
+ null_default_fields = []
30
+
31
+ serialized = handler(self)
32
+
33
+ m = {}
34
+
35
+ for n, f in type(self).model_fields.items():
36
+ k = f.alias or n
37
+ val = serialized.get(k)
38
+ serialized.pop(k, None)
39
+
40
+ optional_nullable = k in optional_fields and k in nullable_fields
41
+ is_set = (
42
+ self.__pydantic_fields_set__.intersection({n})
43
+ or k in null_default_fields
44
+ ) # pylint: disable=no-member
45
+
46
+ if val is not None and val != UNSET_SENTINEL:
47
+ m[k] = val
48
+ elif val != UNSET_SENTINEL and (
49
+ not k in optional_fields or (optional_nullable and is_set)
50
+ ):
51
+ m[k] = val
52
+
53
+ return m
@@ -1,15 +1,22 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from mistralai.types import BaseModel
4
+ from .requestsource import RequestSource
5
+ from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
5
6
  from mistralai.utils import FieldMetadata, QueryParamMetadata
6
- from typing import Optional
7
+ from pydantic import model_serializer
8
+ from typing import Any, Dict, List, Optional
7
9
  from typing_extensions import Annotated, NotRequired, TypedDict
8
10
 
9
11
 
10
12
  class AgentsAPIV1AgentsListRequestTypedDict(TypedDict):
11
13
  page: NotRequired[int]
12
14
  page_size: NotRequired[int]
15
+ deployment_chat: NotRequired[Nullable[bool]]
16
+ sources: NotRequired[Nullable[List[RequestSource]]]
17
+ name: NotRequired[Nullable[str]]
18
+ id: NotRequired[Nullable[str]]
19
+ metadata: NotRequired[Nullable[Dict[str, Any]]]
13
20
 
14
21
 
15
22
  class AgentsAPIV1AgentsListRequest(BaseModel):
@@ -22,3 +29,66 @@ class AgentsAPIV1AgentsListRequest(BaseModel):
22
29
  Optional[int],
23
30
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
24
31
  ] = 20
32
+
33
+ deployment_chat: Annotated[
34
+ OptionalNullable[bool],
35
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
36
+ ] = UNSET
37
+
38
+ sources: Annotated[
39
+ OptionalNullable[List[RequestSource]],
40
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
41
+ ] = UNSET
42
+
43
+ name: Annotated[
44
+ OptionalNullable[str],
45
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
46
+ ] = UNSET
47
+
48
+ id: Annotated[
49
+ OptionalNullable[str],
50
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
51
+ ] = UNSET
52
+
53
+ metadata: Annotated[
54
+ OptionalNullable[Dict[str, Any]],
55
+ FieldMetadata(query=QueryParamMetadata(serialization="json")),
56
+ ] = UNSET
57
+
58
+ @model_serializer(mode="wrap")
59
+ def serialize_model(self, handler):
60
+ optional_fields = [
61
+ "page",
62
+ "page_size",
63
+ "deployment_chat",
64
+ "sources",
65
+ "name",
66
+ "id",
67
+ "metadata",
68
+ ]
69
+ nullable_fields = ["deployment_chat", "sources", "name", "id", "metadata"]
70
+ null_default_fields = []
71
+
72
+ serialized = handler(self)
73
+
74
+ m = {}
75
+
76
+ for n, f in type(self).model_fields.items():
77
+ k = f.alias or n
78
+ val = serialized.get(k)
79
+ serialized.pop(k, None)
80
+
81
+ optional_nullable = k in optional_fields and k in nullable_fields
82
+ is_set = (
83
+ self.__pydantic_fields_set__.intersection({n})
84
+ or k in null_default_fields
85
+ ) # pylint: disable=no-member
86
+
87
+ if val is not None and val != UNSET_SENTINEL:
88
+ m[k] = val
89
+ elif val != UNSET_SENTINEL and (
90
+ not k in optional_fields or (optional_nullable and is_set)
91
+ ):
92
+ m[k] = val
93
+
94
+ return m
@@ -0,0 +1,18 @@
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 AgentsAPIV1ConversationsDeleteRequestTypedDict(TypedDict):
10
+ conversation_id: str
11
+ r"""ID of the conversation from which we are fetching metadata."""
12
+
13
+
14
+ class AgentsAPIV1ConversationsDeleteRequest(BaseModel):
15
+ conversation_id: Annotated[
16
+ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
17
+ ]
18
+ r"""ID of the conversation from which we are fetching metadata."""