mistralai 1.8.2__py3-none-any.whl → 1.9.2__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 (152) hide show
  1. mistralai/_hooks/types.py +7 -0
  2. mistralai/_version.py +3 -3
  3. mistralai/accesses.py +672 -0
  4. mistralai/agents.py +8 -4
  5. mistralai/basesdk.py +12 -20
  6. mistralai/beta.py +4 -0
  7. mistralai/chat.py +8 -4
  8. mistralai/classifiers.py +8 -0
  9. mistralai/conversations.py +34 -14
  10. mistralai/documents.py +2136 -0
  11. mistralai/embeddings.py +2 -0
  12. mistralai/extra/run/context.py +2 -4
  13. mistralai/files.py +14 -2
  14. mistralai/fim.py +4 -0
  15. mistralai/httpclient.py +6 -16
  16. mistralai/jobs.py +10 -0
  17. mistralai/libraries.py +1041 -0
  18. mistralai/mistral_agents.py +10 -0
  19. mistralai/mistral_jobs.py +8 -0
  20. mistralai/models/__init__.py +1578 -721
  21. mistralai/models/agent.py +1 -1
  22. mistralai/models/agentconversation.py +1 -1
  23. mistralai/models/agentcreationrequest.py +1 -1
  24. mistralai/models/agenthandoffentry.py +1 -1
  25. mistralai/models/agents_api_v1_conversations_getop.py +2 -0
  26. mistralai/models/agents_api_v1_conversations_historyop.py +2 -0
  27. mistralai/models/agents_api_v1_conversations_messagesop.py +2 -0
  28. mistralai/models/agents_api_v1_conversations_restart_streamop.py +2 -0
  29. mistralai/models/agents_api_v1_conversations_restartop.py +2 -0
  30. mistralai/models/agentscompletionrequest.py +3 -1
  31. mistralai/models/agentscompletionstreamrequest.py +3 -1
  32. mistralai/models/agentupdaterequest.py +1 -1
  33. mistralai/models/assistantmessage.py +1 -1
  34. mistralai/models/basemodelcard.py +6 -1
  35. mistralai/models/batchjobin.py +1 -1
  36. mistralai/models/batchjobout.py +1 -1
  37. mistralai/models/chatcompletionrequest.py +3 -1
  38. mistralai/models/chatcompletionstreamrequest.py +3 -1
  39. mistralai/models/classifierdetailedjobout.py +1 -1
  40. mistralai/models/classifierftmodelout.py +1 -1
  41. mistralai/models/classifierjobout.py +1 -1
  42. mistralai/models/classifiertargetin.py +1 -1
  43. mistralai/models/classifiertrainingparameters.py +1 -1
  44. mistralai/models/classifiertrainingparametersin.py +1 -1
  45. mistralai/models/completionargs.py +1 -1
  46. mistralai/models/completiondetailedjobout.py +1 -1
  47. mistralai/models/completionftmodelout.py +1 -1
  48. mistralai/models/completionjobout.py +1 -1
  49. mistralai/models/completionresponsestreamchoice.py +1 -1
  50. mistralai/models/completiontrainingparameters.py +1 -1
  51. mistralai/models/completiontrainingparametersin.py +1 -1
  52. mistralai/models/contentchunk.py +3 -0
  53. mistralai/models/conversationevents.py +6 -0
  54. mistralai/models/conversationhistory.py +4 -4
  55. mistralai/models/conversationrequest.py +1 -1
  56. mistralai/models/conversationstreamrequest.py +1 -1
  57. mistralai/models/conversationusageinfo.py +1 -1
  58. mistralai/models/deltamessage.py +1 -1
  59. mistralai/models/documentout.py +105 -0
  60. mistralai/models/documenttextcontent.py +13 -0
  61. mistralai/models/documentupdatein.py +44 -0
  62. mistralai/models/documenturlchunk.py +1 -1
  63. mistralai/models/embeddingrequest.py +1 -1
  64. mistralai/models/entitytype.py +9 -0
  65. mistralai/models/eventout.py +1 -1
  66. mistralai/models/file.py +33 -0
  67. mistralai/models/filechunk.py +23 -0
  68. mistralai/models/files_api_routes_list_filesop.py +1 -1
  69. mistralai/models/files_api_routes_upload_fileop.py +2 -27
  70. mistralai/models/fileschema.py +1 -1
  71. mistralai/models/fimcompletionrequest.py +1 -1
  72. mistralai/models/fimcompletionstreamrequest.py +1 -1
  73. mistralai/models/ftmodelcard.py +6 -1
  74. mistralai/models/functioncallentry.py +1 -1
  75. mistralai/models/functionresultentry.py +1 -1
  76. mistralai/models/githubrepositoryin.py +1 -1
  77. mistralai/models/githubrepositoryout.py +1 -1
  78. mistralai/models/imageurl.py +1 -1
  79. mistralai/models/inputentries.py +21 -2
  80. mistralai/models/jobin.py +1 -1
  81. mistralai/models/jobmetadataout.py +1 -1
  82. mistralai/models/jobs_api_routes_batch_get_batch_jobsop.py +1 -1
  83. mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobsop.py +1 -1
  84. mistralai/models/jsonschema.py +1 -1
  85. mistralai/models/legacyjobmetadataout.py +1 -1
  86. mistralai/models/libraries_delete_v1op.py +16 -0
  87. mistralai/models/libraries_documents_delete_v1op.py +21 -0
  88. mistralai/models/libraries_documents_get_extracted_text_signed_url_v1op.py +21 -0
  89. mistralai/models/libraries_documents_get_signed_url_v1op.py +21 -0
  90. mistralai/models/libraries_documents_get_status_v1op.py +21 -0
  91. mistralai/models/libraries_documents_get_text_content_v1op.py +21 -0
  92. mistralai/models/libraries_documents_get_v1op.py +21 -0
  93. mistralai/models/libraries_documents_list_v1op.py +78 -0
  94. mistralai/models/libraries_documents_reprocess_v1op.py +21 -0
  95. mistralai/models/libraries_documents_update_v1op.py +28 -0
  96. mistralai/models/libraries_documents_upload_v1op.py +56 -0
  97. mistralai/models/libraries_get_v1op.py +16 -0
  98. mistralai/models/libraries_share_create_v1op.py +22 -0
  99. mistralai/models/libraries_share_delete_v1op.py +23 -0
  100. mistralai/models/libraries_share_list_v1op.py +16 -0
  101. mistralai/models/libraries_update_v1op.py +23 -0
  102. mistralai/models/libraryin.py +50 -0
  103. mistralai/models/libraryinupdate.py +47 -0
  104. mistralai/models/libraryout.py +107 -0
  105. mistralai/models/listdocumentout.py +19 -0
  106. mistralai/models/listlibraryout.py +15 -0
  107. mistralai/models/listsharingout.py +15 -0
  108. mistralai/models/messageinputentry.py +12 -2
  109. mistralai/models/messageoutputentry.py +1 -1
  110. mistralai/models/messageoutputevent.py +1 -1
  111. mistralai/models/metricout.py +1 -1
  112. mistralai/models/modelcapabilities.py +3 -0
  113. mistralai/models/modelconversation.py +1 -1
  114. mistralai/models/ocrimageobject.py +1 -1
  115. mistralai/models/ocrpageobject.py +1 -1
  116. mistralai/models/ocrrequest.py +5 -3
  117. mistralai/models/ocrresponse.py +1 -1
  118. mistralai/models/ocrusageinfo.py +1 -1
  119. mistralai/models/paginationinfo.py +25 -0
  120. mistralai/models/processingstatusout.py +16 -0
  121. mistralai/models/responseformat.py +1 -1
  122. mistralai/models/retrievefileout.py +1 -1
  123. mistralai/models/shareenum.py +8 -0
  124. mistralai/models/sharingdelete.py +26 -0
  125. mistralai/models/sharingin.py +30 -0
  126. mistralai/models/sharingout.py +59 -0
  127. mistralai/models/ssetypes.py +1 -0
  128. mistralai/models/toolexecutiondeltaevent.py +34 -0
  129. mistralai/models/toolexecutionentry.py +4 -1
  130. mistralai/models/toolexecutionstartedevent.py +3 -0
  131. mistralai/models/toolfilechunk.py +1 -1
  132. mistralai/models/toolmessage.py +1 -1
  133. mistralai/models/toolreferencechunk.py +8 -5
  134. mistralai/models/updateftmodelin.py +1 -1
  135. mistralai/models/uploadfileout.py +1 -1
  136. mistralai/models/usermessage.py +1 -1
  137. mistralai/models/wandbintegration.py +1 -1
  138. mistralai/models/wandbintegrationout.py +1 -1
  139. mistralai/models_.py +14 -2
  140. mistralai/ocr.py +2 -0
  141. mistralai/sdk.py +68 -40
  142. mistralai/sdkconfiguration.py +0 -7
  143. mistralai/types/basemodel.py +3 -3
  144. mistralai/utils/__init__.py +131 -45
  145. mistralai/utils/datetimes.py +23 -0
  146. mistralai/utils/enums.py +67 -27
  147. mistralai/utils/forms.py +49 -28
  148. mistralai/utils/serializers.py +32 -3
  149. {mistralai-1.8.2.dist-info → mistralai-1.9.2.dist-info}/METADATA +41 -7
  150. {mistralai-1.8.2.dist-info → mistralai-1.9.2.dist-info}/RECORD +152 -113
  151. {mistralai-1.8.2.dist-info → mistralai-1.9.2.dist-info}/LICENSE +0 -0
  152. {mistralai-1.8.2.dist-info → mistralai-1.9.2.dist-info}/WHEEL +0 -0
@@ -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 LibrariesDocumentsReprocessV1RequestTypedDict(TypedDict):
10
+ library_id: str
11
+ document_id: str
12
+
13
+
14
+ class LibrariesDocumentsReprocessV1Request(BaseModel):
15
+ library_id: Annotated[
16
+ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
17
+ ]
18
+
19
+ document_id: Annotated[
20
+ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
21
+ ]
@@ -0,0 +1,28 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .documentupdatein import DocumentUpdateIn, DocumentUpdateInTypedDict
5
+ from mistralai.types import BaseModel
6
+ from mistralai.utils import FieldMetadata, PathParamMetadata, RequestMetadata
7
+ from typing_extensions import Annotated, TypedDict
8
+
9
+
10
+ class LibrariesDocumentsUpdateV1RequestTypedDict(TypedDict):
11
+ library_id: str
12
+ document_id: str
13
+ document_update_in: DocumentUpdateInTypedDict
14
+
15
+
16
+ class LibrariesDocumentsUpdateV1Request(BaseModel):
17
+ library_id: Annotated[
18
+ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
19
+ ]
20
+
21
+ document_id: Annotated[
22
+ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
23
+ ]
24
+
25
+ document_update_in: Annotated[
26
+ DocumentUpdateIn,
27
+ FieldMetadata(request=RequestMetadata(media_type="application/json")),
28
+ ]
@@ -0,0 +1,56 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .file import File, FileTypedDict
5
+ from mistralai.types import BaseModel
6
+ from mistralai.utils import (
7
+ FieldMetadata,
8
+ MultipartFormMetadata,
9
+ PathParamMetadata,
10
+ RequestMetadata,
11
+ )
12
+ from typing_extensions import Annotated, TypedDict
13
+
14
+
15
+ class LibrariesDocumentsUploadV1DocumentUploadTypedDict(TypedDict):
16
+ file: FileTypedDict
17
+ r"""The File object (not file name) to be uploaded.
18
+ To upload a file and specify a custom file name you should format your request as such:
19
+ ```bash
20
+ file=@path/to/your/file.jsonl;filename=custom_name.jsonl
21
+ ```
22
+ Otherwise, you can just keep the original file name:
23
+ ```bash
24
+ file=@path/to/your/file.jsonl
25
+ ```
26
+ """
27
+
28
+
29
+ class LibrariesDocumentsUploadV1DocumentUpload(BaseModel):
30
+ file: Annotated[File, FieldMetadata(multipart=MultipartFormMetadata(file=True))]
31
+ r"""The File object (not file name) to be uploaded.
32
+ To upload a file and specify a custom file name you should format your request as such:
33
+ ```bash
34
+ file=@path/to/your/file.jsonl;filename=custom_name.jsonl
35
+ ```
36
+ Otherwise, you can just keep the original file name:
37
+ ```bash
38
+ file=@path/to/your/file.jsonl
39
+ ```
40
+ """
41
+
42
+
43
+ class LibrariesDocumentsUploadV1RequestTypedDict(TypedDict):
44
+ library_id: str
45
+ request_body: LibrariesDocumentsUploadV1DocumentUploadTypedDict
46
+
47
+
48
+ class LibrariesDocumentsUploadV1Request(BaseModel):
49
+ library_id: Annotated[
50
+ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
51
+ ]
52
+
53
+ request_body: Annotated[
54
+ LibrariesDocumentsUploadV1DocumentUpload,
55
+ FieldMetadata(request=RequestMetadata(media_type="multipart/form-data")),
56
+ ]
@@ -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 LibrariesGetV1RequestTypedDict(TypedDict):
10
+ library_id: str
11
+
12
+
13
+ class LibrariesGetV1Request(BaseModel):
14
+ library_id: Annotated[
15
+ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
16
+ ]
@@ -0,0 +1,22 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .sharingin import SharingIn, SharingInTypedDict
5
+ from mistralai.types import BaseModel
6
+ from mistralai.utils import FieldMetadata, PathParamMetadata, RequestMetadata
7
+ from typing_extensions import Annotated, TypedDict
8
+
9
+
10
+ class LibrariesShareCreateV1RequestTypedDict(TypedDict):
11
+ library_id: str
12
+ sharing_in: SharingInTypedDict
13
+
14
+
15
+ class LibrariesShareCreateV1Request(BaseModel):
16
+ library_id: Annotated[
17
+ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
18
+ ]
19
+
20
+ sharing_in: Annotated[
21
+ SharingIn, FieldMetadata(request=RequestMetadata(media_type="application/json"))
22
+ ]
@@ -0,0 +1,23 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .sharingdelete import SharingDelete, SharingDeleteTypedDict
5
+ from mistralai.types import BaseModel
6
+ from mistralai.utils import FieldMetadata, PathParamMetadata, RequestMetadata
7
+ from typing_extensions import Annotated, TypedDict
8
+
9
+
10
+ class LibrariesShareDeleteV1RequestTypedDict(TypedDict):
11
+ library_id: str
12
+ sharing_delete: SharingDeleteTypedDict
13
+
14
+
15
+ class LibrariesShareDeleteV1Request(BaseModel):
16
+ library_id: Annotated[
17
+ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
18
+ ]
19
+
20
+ sharing_delete: Annotated[
21
+ SharingDelete,
22
+ FieldMetadata(request=RequestMetadata(media_type="application/json")),
23
+ ]
@@ -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 LibrariesShareListV1RequestTypedDict(TypedDict):
10
+ library_id: str
11
+
12
+
13
+ class LibrariesShareListV1Request(BaseModel):
14
+ library_id: Annotated[
15
+ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
16
+ ]
@@ -0,0 +1,23 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .libraryinupdate import LibraryInUpdate, LibraryInUpdateTypedDict
5
+ from mistralai.types import BaseModel
6
+ from mistralai.utils import FieldMetadata, PathParamMetadata, RequestMetadata
7
+ from typing_extensions import Annotated, TypedDict
8
+
9
+
10
+ class LibrariesUpdateV1RequestTypedDict(TypedDict):
11
+ library_id: str
12
+ library_in_update: LibraryInUpdateTypedDict
13
+
14
+
15
+ class LibrariesUpdateV1Request(BaseModel):
16
+ library_id: Annotated[
17
+ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
18
+ ]
19
+
20
+ library_in_update: Annotated[
21
+ LibraryInUpdate,
22
+ FieldMetadata(request=RequestMetadata(media_type="application/json")),
23
+ ]
@@ -0,0 +1,50 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
5
+ from pydantic import model_serializer
6
+ from typing_extensions import NotRequired, TypedDict
7
+
8
+
9
+ class LibraryInTypedDict(TypedDict):
10
+ name: str
11
+ description: NotRequired[Nullable[str]]
12
+ chunk_size: NotRequired[Nullable[int]]
13
+
14
+
15
+ class LibraryIn(BaseModel):
16
+ name: str
17
+
18
+ description: OptionalNullable[str] = UNSET
19
+
20
+ chunk_size: OptionalNullable[int] = UNSET
21
+
22
+ @model_serializer(mode="wrap")
23
+ def serialize_model(self, handler):
24
+ optional_fields = ["description", "chunk_size"]
25
+ nullable_fields = ["description", "chunk_size"]
26
+ null_default_fields = []
27
+
28
+ serialized = handler(self)
29
+
30
+ m = {}
31
+
32
+ for n, f in type(self).model_fields.items():
33
+ k = f.alias or n
34
+ val = serialized.get(k)
35
+ serialized.pop(k, None)
36
+
37
+ optional_nullable = k in optional_fields and k in nullable_fields
38
+ is_set = (
39
+ self.__pydantic_fields_set__.intersection({n})
40
+ or k in null_default_fields
41
+ ) # pylint: disable=no-member
42
+
43
+ if val is not None and val != UNSET_SENTINEL:
44
+ m[k] = val
45
+ elif val != UNSET_SENTINEL and (
46
+ not k in optional_fields or (optional_nullable and is_set)
47
+ ):
48
+ m[k] = val
49
+
50
+ return m
@@ -0,0 +1,47 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
5
+ from pydantic import model_serializer
6
+ from typing_extensions import NotRequired, TypedDict
7
+
8
+
9
+ class LibraryInUpdateTypedDict(TypedDict):
10
+ name: NotRequired[Nullable[str]]
11
+ description: NotRequired[Nullable[str]]
12
+
13
+
14
+ class LibraryInUpdate(BaseModel):
15
+ name: OptionalNullable[str] = UNSET
16
+
17
+ description: OptionalNullable[str] = UNSET
18
+
19
+ @model_serializer(mode="wrap")
20
+ def serialize_model(self, handler):
21
+ optional_fields = ["name", "description"]
22
+ nullable_fields = ["name", "description"]
23
+ null_default_fields = []
24
+
25
+ serialized = handler(self)
26
+
27
+ m = {}
28
+
29
+ for n, f in type(self).model_fields.items():
30
+ k = f.alias or n
31
+ val = serialized.get(k)
32
+ serialized.pop(k, None)
33
+
34
+ optional_nullable = k in optional_fields and k in nullable_fields
35
+ is_set = (
36
+ self.__pydantic_fields_set__.intersection({n})
37
+ or k in null_default_fields
38
+ ) # pylint: disable=no-member
39
+
40
+ if val is not None and val != UNSET_SENTINEL:
41
+ m[k] = val
42
+ elif val != UNSET_SENTINEL and (
43
+ not k in optional_fields or (optional_nullable and is_set)
44
+ ):
45
+ m[k] = val
46
+
47
+ return m
@@ -0,0 +1,107 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from datetime import datetime
5
+ from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
6
+ from pydantic import model_serializer
7
+ from typing_extensions import NotRequired, TypedDict
8
+
9
+
10
+ class LibraryOutTypedDict(TypedDict):
11
+ id: str
12
+ name: str
13
+ created_at: datetime
14
+ updated_at: datetime
15
+ owner_id: str
16
+ owner_type: str
17
+ total_size: int
18
+ nb_documents: int
19
+ chunk_size: Nullable[int]
20
+ emoji: NotRequired[Nullable[str]]
21
+ description: NotRequired[Nullable[str]]
22
+ generated_name: NotRequired[Nullable[str]]
23
+ generated_description: NotRequired[Nullable[str]]
24
+ explicit_user_members_count: NotRequired[Nullable[int]]
25
+ explicit_workspace_members_count: NotRequired[Nullable[int]]
26
+ org_sharing_role: NotRequired[Nullable[str]]
27
+
28
+
29
+ class LibraryOut(BaseModel):
30
+ id: str
31
+
32
+ name: str
33
+
34
+ created_at: datetime
35
+
36
+ updated_at: datetime
37
+
38
+ owner_id: str
39
+
40
+ owner_type: str
41
+
42
+ total_size: int
43
+
44
+ nb_documents: int
45
+
46
+ chunk_size: Nullable[int]
47
+
48
+ emoji: OptionalNullable[str] = UNSET
49
+
50
+ description: OptionalNullable[str] = UNSET
51
+
52
+ generated_name: OptionalNullable[str] = UNSET
53
+
54
+ generated_description: OptionalNullable[str] = UNSET
55
+
56
+ explicit_user_members_count: OptionalNullable[int] = UNSET
57
+
58
+ explicit_workspace_members_count: OptionalNullable[int] = UNSET
59
+
60
+ org_sharing_role: OptionalNullable[str] = UNSET
61
+
62
+ @model_serializer(mode="wrap")
63
+ def serialize_model(self, handler):
64
+ optional_fields = [
65
+ "emoji",
66
+ "description",
67
+ "generated_name",
68
+ "generated_description",
69
+ "explicit_user_members_count",
70
+ "explicit_workspace_members_count",
71
+ "org_sharing_role",
72
+ ]
73
+ nullable_fields = [
74
+ "chunk_size",
75
+ "emoji",
76
+ "description",
77
+ "generated_name",
78
+ "generated_description",
79
+ "explicit_user_members_count",
80
+ "explicit_workspace_members_count",
81
+ "org_sharing_role",
82
+ ]
83
+ null_default_fields = []
84
+
85
+ serialized = handler(self)
86
+
87
+ m = {}
88
+
89
+ for n, f in type(self).model_fields.items():
90
+ k = f.alias or n
91
+ val = serialized.get(k)
92
+ serialized.pop(k, None)
93
+
94
+ optional_nullable = k in optional_fields and k in nullable_fields
95
+ is_set = (
96
+ self.__pydantic_fields_set__.intersection({n})
97
+ or k in null_default_fields
98
+ ) # pylint: disable=no-member
99
+
100
+ if val is not None and val != UNSET_SENTINEL:
101
+ m[k] = val
102
+ elif val != UNSET_SENTINEL and (
103
+ not k in optional_fields or (optional_nullable and is_set)
104
+ ):
105
+ m[k] = val
106
+
107
+ return m
@@ -0,0 +1,19 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .documentout import DocumentOut, DocumentOutTypedDict
5
+ from .paginationinfo import PaginationInfo, PaginationInfoTypedDict
6
+ from mistralai.types import BaseModel
7
+ from typing import List
8
+ from typing_extensions import TypedDict
9
+
10
+
11
+ class ListDocumentOutTypedDict(TypedDict):
12
+ pagination: PaginationInfoTypedDict
13
+ data: List[DocumentOutTypedDict]
14
+
15
+
16
+ class ListDocumentOut(BaseModel):
17
+ pagination: PaginationInfo
18
+
19
+ data: List[DocumentOut]
@@ -0,0 +1,15 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .libraryout import LibraryOut, LibraryOutTypedDict
5
+ from mistralai.types import BaseModel
6
+ from typing import List
7
+ from typing_extensions import TypedDict
8
+
9
+
10
+ class ListLibraryOutTypedDict(TypedDict):
11
+ data: List[LibraryOutTypedDict]
12
+
13
+
14
+ class ListLibraryOut(BaseModel):
15
+ data: List[LibraryOut]
@@ -0,0 +1,15 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .sharingout import SharingOut, SharingOutTypedDict
5
+ from mistralai.types import BaseModel
6
+ from typing import List
7
+ from typing_extensions import TypedDict
8
+
9
+
10
+ class ListSharingOutTypedDict(TypedDict):
11
+ data: List[SharingOutTypedDict]
12
+
13
+
14
+ class ListSharingOut(BaseModel):
15
+ data: List[SharingOut]
@@ -39,6 +39,7 @@ class MessageInputEntryTypedDict(TypedDict):
39
39
  created_at: NotRequired[datetime]
40
40
  completed_at: NotRequired[Nullable[datetime]]
41
41
  id: NotRequired[str]
42
+ prefix: NotRequired[bool]
42
43
 
43
44
 
44
45
  class MessageInputEntry(BaseModel):
@@ -58,9 +59,18 @@ class MessageInputEntry(BaseModel):
58
59
 
59
60
  id: Optional[str] = None
60
61
 
62
+ prefix: Optional[bool] = False
63
+
61
64
  @model_serializer(mode="wrap")
62
65
  def serialize_model(self, handler):
63
- optional_fields = ["object", "type", "created_at", "completed_at", "id"]
66
+ optional_fields = [
67
+ "object",
68
+ "type",
69
+ "created_at",
70
+ "completed_at",
71
+ "id",
72
+ "prefix",
73
+ ]
64
74
  nullable_fields = ["completed_at"]
65
75
  null_default_fields = []
66
76
 
@@ -68,7 +78,7 @@ class MessageInputEntry(BaseModel):
68
78
 
69
79
  m = {}
70
80
 
71
- for n, f in self.model_fields.items():
81
+ for n, f in type(self).model_fields.items():
72
82
  k = f.alias or n
73
83
  val = serialized.get(k)
74
84
  serialized.pop(k, None)
@@ -79,7 +79,7 @@ class MessageOutputEntry(BaseModel):
79
79
 
80
80
  m = {}
81
81
 
82
- for n, f in self.model_fields.items():
82
+ for n, f in type(self).model_fields.items():
83
83
  k = f.alias or n
84
84
  val = serialized.get(k)
85
85
  serialized.pop(k, None)
@@ -72,7 +72,7 @@ class MessageOutputEvent(BaseModel):
72
72
 
73
73
  m = {}
74
74
 
75
- for n, f in self.model_fields.items():
75
+ for n, f in type(self).model_fields.items():
76
76
  k = f.alias or n
77
77
  val = serialized.get(k)
78
78
  serialized.pop(k, None)
@@ -33,7 +33,7 @@ class MetricOut(BaseModel):
33
33
 
34
34
  m = {}
35
35
 
36
- for n, f in self.model_fields.items():
36
+ for n, f in type(self).model_fields.items():
37
37
  k = f.alias or n
38
38
  val = serialized.get(k)
39
39
  serialized.pop(k, None)
@@ -12,6 +12,7 @@ class ModelCapabilitiesTypedDict(TypedDict):
12
12
  function_calling: NotRequired[bool]
13
13
  fine_tuning: NotRequired[bool]
14
14
  vision: NotRequired[bool]
15
+ classification: NotRequired[bool]
15
16
 
16
17
 
17
18
  class ModelCapabilities(BaseModel):
@@ -24,3 +25,5 @@ class ModelCapabilities(BaseModel):
24
25
  fine_tuning: Optional[bool] = False
25
26
 
26
27
  vision: Optional[bool] = False
28
+
29
+ classification: Optional[bool] = False
@@ -106,7 +106,7 @@ class ModelConversation(BaseModel):
106
106
 
107
107
  m = {}
108
108
 
109
- for n, f in self.model_fields.items():
109
+ for n, f in type(self).model_fields.items():
110
110
  k = f.alias or n
111
111
  val = serialized.get(k)
112
112
  serialized.pop(k, None)
@@ -62,7 +62,7 @@ class OCRImageObject(BaseModel):
62
62
 
63
63
  m = {}
64
64
 
65
- for n, f in self.model_fields.items():
65
+ for n, f in type(self).model_fields.items():
66
66
  k = f.alias or n
67
67
  val = serialized.get(k)
68
68
  serialized.pop(k, None)
@@ -43,7 +43,7 @@ class OCRPageObject(BaseModel):
43
43
 
44
44
  m = {}
45
45
 
46
- for n, f in self.model_fields.items():
46
+ for n, f in type(self).model_fields.items():
47
47
  k = f.alias or n
48
48
  val = serialized.get(k)
49
49
  serialized.pop(k, None)
@@ -2,6 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
  from .documenturlchunk import DocumentURLChunk, DocumentURLChunkTypedDict
5
+ from .filechunk import FileChunk, FileChunkTypedDict
5
6
  from .imageurlchunk import ImageURLChunk, ImageURLChunkTypedDict
6
7
  from .responseformat import ResponseFormat, ResponseFormatTypedDict
7
8
  from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
@@ -11,12 +12,13 @@ from typing_extensions import NotRequired, TypeAliasType, TypedDict
11
12
 
12
13
 
13
14
  DocumentTypedDict = TypeAliasType(
14
- "DocumentTypedDict", Union[ImageURLChunkTypedDict, DocumentURLChunkTypedDict]
15
+ "DocumentTypedDict",
16
+ Union[FileChunkTypedDict, ImageURLChunkTypedDict, DocumentURLChunkTypedDict],
15
17
  )
16
18
  r"""Document to run OCR on"""
17
19
 
18
20
 
19
- Document = TypeAliasType("Document", Union[ImageURLChunk, DocumentURLChunk])
21
+ Document = TypeAliasType("Document", Union[FileChunk, ImageURLChunk, DocumentURLChunk])
20
22
  r"""Document to run OCR on"""
21
23
 
22
24
 
@@ -91,7 +93,7 @@ class OCRRequest(BaseModel):
91
93
 
92
94
  m = {}
93
95
 
94
- for n, f in self.model_fields.items():
96
+ for n, f in type(self).model_fields.items():
95
97
  k = f.alias or n
96
98
  val = serialized.get(k)
97
99
  serialized.pop(k, None)
@@ -41,7 +41,7 @@ class OCRResponse(BaseModel):
41
41
 
42
42
  m = {}
43
43
 
44
- for n, f in self.model_fields.items():
44
+ for n, f in type(self).model_fields.items():
45
45
  k = f.alias or n
46
46
  val = serialized.get(k)
47
47
  serialized.pop(k, None)
@@ -30,7 +30,7 @@ class OCRUsageInfo(BaseModel):
30
30
 
31
31
  m = {}
32
32
 
33
- for n, f in self.model_fields.items():
33
+ for n, f in type(self).model_fields.items():
34
34
  k = f.alias or n
35
35
  val = serialized.get(k)
36
36
  serialized.pop(k, None)
@@ -0,0 +1,25 @@
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_extensions import TypedDict
6
+
7
+
8
+ class PaginationInfoTypedDict(TypedDict):
9
+ total_items: int
10
+ total_pages: int
11
+ current_page: int
12
+ page_size: int
13
+ has_more: bool
14
+
15
+
16
+ class PaginationInfo(BaseModel):
17
+ total_items: int
18
+
19
+ total_pages: int
20
+
21
+ current_page: int
22
+
23
+ page_size: int
24
+
25
+ has_more: bool