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,13 @@
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 DocumentTextContentTypedDict(TypedDict):
9
+ text: str
10
+
11
+
12
+ class DocumentTextContent(BaseModel):
13
+ text: str
@@ -0,0 +1,44 @@
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 DocumentUpdateInTypedDict(TypedDict):
10
+ name: NotRequired[Nullable[str]]
11
+
12
+
13
+ class DocumentUpdateIn(BaseModel):
14
+ name: OptionalNullable[str] = UNSET
15
+
16
+ @model_serializer(mode="wrap")
17
+ def serialize_model(self, handler):
18
+ optional_fields = ["name"]
19
+ nullable_fields = ["name"]
20
+ null_default_fields = []
21
+
22
+ serialized = handler(self)
23
+
24
+ m = {}
25
+
26
+ for n, f in type(self).model_fields.items():
27
+ k = f.alias or n
28
+ val = serialized.get(k)
29
+ serialized.pop(k, None)
30
+
31
+ optional_nullable = k in optional_fields and k in nullable_fields
32
+ is_set = (
33
+ self.__pydantic_fields_set__.intersection({n})
34
+ or k in null_default_fields
35
+ ) # pylint: disable=no-member
36
+
37
+ if val is not None and val != UNSET_SENTINEL:
38
+ m[k] = val
39
+ elif val != UNSET_SENTINEL and (
40
+ not k in optional_fields or (optional_nullable and is_set)
41
+ ):
42
+ m[k] = val
43
+
44
+ return m
@@ -35,7 +35,7 @@ class DocumentURLChunk(BaseModel):
35
35
 
36
36
  m = {}
37
37
 
38
- for n, f in self.model_fields.items():
38
+ for n, f in type(self).model_fields.items():
39
39
  k = f.alias or n
40
40
  val = serialized.get(k)
41
41
  serialized.pop(k, None)
@@ -51,7 +51,7 @@ class EmbeddingRequest(BaseModel):
51
51
 
52
52
  m = {}
53
53
 
54
- for n, f in self.model_fields.items():
54
+ for n, f in type(self).model_fields.items():
55
55
  k = f.alias or n
56
56
  val = serialized.get(k)
57
57
  serialized.pop(k, None)
@@ -0,0 +1,9 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from mistralai.types import UnrecognizedStr
5
+ from typing import Literal, Union
6
+
7
+
8
+ EntityType = Union[Literal["User", "Workspace", "Org"], UnrecognizedStr]
9
+ r"""The type of entity, used to share a library."""
@@ -34,7 +34,7 @@ class EventOut(BaseModel):
34
34
 
35
35
  m = {}
36
36
 
37
- for n, f in self.model_fields.items():
37
+ for n, f in type(self).model_fields.items():
38
38
  k = f.alias or n
39
39
  val = serialized.get(k)
40
40
  serialized.pop(k, None)
@@ -0,0 +1,33 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ import io
5
+ from mistralai.types import BaseModel
6
+ from mistralai.utils import FieldMetadata, MultipartFormMetadata
7
+ import pydantic
8
+ from typing import IO, Optional, Union
9
+ from typing_extensions import Annotated, NotRequired, TypedDict
10
+
11
+
12
+ class FileTypedDict(TypedDict):
13
+ file_name: str
14
+ content: Union[bytes, IO[bytes], io.BufferedReader]
15
+ content_type: NotRequired[str]
16
+
17
+
18
+ class File(BaseModel):
19
+ file_name: Annotated[
20
+ str, pydantic.Field(alias="fileName"), FieldMetadata(multipart=True)
21
+ ]
22
+
23
+ content: Annotated[
24
+ Union[bytes, IO[bytes], io.BufferedReader],
25
+ pydantic.Field(alias=""),
26
+ FieldMetadata(multipart=MultipartFormMetadata(content=True)),
27
+ ]
28
+
29
+ content_type: Annotated[
30
+ Optional[str],
31
+ pydantic.Field(alias="Content-Type"),
32
+ FieldMetadata(multipart=True),
33
+ ] = None
@@ -0,0 +1,23 @@
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 validate_const
6
+ import pydantic
7
+ from pydantic.functional_validators import AfterValidator
8
+ from typing import Literal, Optional
9
+ from typing_extensions import Annotated, TypedDict
10
+
11
+
12
+ class FileChunkTypedDict(TypedDict):
13
+ file_id: str
14
+ type: Literal["file"]
15
+
16
+
17
+ class FileChunk(BaseModel):
18
+ file_id: str
19
+
20
+ TYPE: Annotated[
21
+ Annotated[Optional[Literal["file"]], AfterValidator(validate_const("file"))],
22
+ pydantic.Field(alias="type"),
23
+ ] = "file"
@@ -75,7 +75,7 @@ class FilesAPIRoutesListFilesRequest(BaseModel):
75
75
 
76
76
  m = {}
77
77
 
78
- for n, f in self.model_fields.items():
78
+ for n, f in type(self).model_fields.items():
79
79
  k = f.alias or n
80
80
  val = serialized.get(k)
81
81
  serialized.pop(k, None)
@@ -1,40 +1,15 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
+ from .file import File, FileTypedDict
4
5
  from .filepurpose import FilePurpose
5
- import io
6
6
  from mistralai.types import BaseModel
7
7
  from mistralai.utils import FieldMetadata, MultipartFormMetadata, validate_open_enum
8
- import pydantic
9
8
  from pydantic.functional_validators import PlainValidator
10
- from typing import IO, Optional, Union
9
+ from typing import Optional
11
10
  from typing_extensions import Annotated, NotRequired, TypedDict
12
11
 
13
12
 
14
- class FileTypedDict(TypedDict):
15
- file_name: str
16
- content: Union[bytes, IO[bytes], io.BufferedReader]
17
- content_type: NotRequired[str]
18
-
19
-
20
- class File(BaseModel):
21
- file_name: Annotated[
22
- str, pydantic.Field(alias="fileName"), FieldMetadata(multipart=True)
23
- ]
24
-
25
- content: Annotated[
26
- Union[bytes, IO[bytes], io.BufferedReader],
27
- pydantic.Field(alias=""),
28
- FieldMetadata(multipart=MultipartFormMetadata(content=True)),
29
- ]
30
-
31
- content_type: Annotated[
32
- Optional[str],
33
- pydantic.Field(alias="Content-Type"),
34
- FieldMetadata(multipart=True),
35
- ] = None
36
-
37
-
38
13
  class FilesAPIRoutesUploadFileMultiPartBodyParamsTypedDict(TypedDict):
39
14
  file: FileTypedDict
40
15
  r"""The File object (not file name) to be uploaded.
@@ -63,7 +63,7 @@ class FileSchema(BaseModel):
63
63
 
64
64
  m = {}
65
65
 
66
- for n, f in self.model_fields.items():
66
+ for n, f in type(self).model_fields.items():
67
67
  k = f.alias or n
68
68
  val = serialized.get(k)
69
69
  serialized.pop(k, None)
@@ -104,7 +104,7 @@ class FIMCompletionRequest(BaseModel):
104
104
 
105
105
  m = {}
106
106
 
107
- for n, f in self.model_fields.items():
107
+ for n, f in type(self).model_fields.items():
108
108
  k = f.alias or n
109
109
  val = serialized.get(k)
110
110
  serialized.pop(k, None)
@@ -102,7 +102,7 @@ class FIMCompletionStreamRequest(BaseModel):
102
102
 
103
103
  m = {}
104
104
 
105
- for n, f in self.model_fields.items():
105
+ for n, f in type(self).model_fields.items():
106
106
  k = f.alias or n
107
107
  val = serialized.get(k)
108
108
  serialized.pop(k, None)
@@ -30,6 +30,7 @@ class FTModelCardTypedDict(TypedDict):
30
30
  max_context_length: NotRequired[int]
31
31
  aliases: NotRequired[List[str]]
32
32
  deprecation: NotRequired[Nullable[datetime]]
33
+ deprecation_replacement_model: NotRequired[Nullable[str]]
33
34
  default_model_temperature: NotRequired[Nullable[float]]
34
35
  type: FTModelCardType
35
36
  archived: NotRequired[bool]
@@ -62,6 +63,8 @@ class FTModelCard(BaseModel):
62
63
 
63
64
  deprecation: OptionalNullable[datetime] = UNSET
64
65
 
66
+ deprecation_replacement_model: OptionalNullable[str] = UNSET
67
+
65
68
  default_model_temperature: OptionalNullable[float] = UNSET
66
69
 
67
70
  TYPE: Annotated[
@@ -84,6 +87,7 @@ class FTModelCard(BaseModel):
84
87
  "max_context_length",
85
88
  "aliases",
86
89
  "deprecation",
90
+ "deprecation_replacement_model",
87
91
  "default_model_temperature",
88
92
  "type",
89
93
  "archived",
@@ -92,6 +96,7 @@ class FTModelCard(BaseModel):
92
96
  "name",
93
97
  "description",
94
98
  "deprecation",
99
+ "deprecation_replacement_model",
95
100
  "default_model_temperature",
96
101
  ]
97
102
  null_default_fields = []
@@ -100,7 +105,7 @@ class FTModelCard(BaseModel):
100
105
 
101
106
  m = {}
102
107
 
103
- for n, f in self.model_fields.items():
108
+ for n, f in type(self).model_fields.items():
104
109
  k = f.alias or n
105
110
  val = serialized.get(k)
106
111
  serialized.pop(k, None)
@@ -55,7 +55,7 @@ class FunctionCallEntry(BaseModel):
55
55
 
56
56
  m = {}
57
57
 
58
- for n, f in self.model_fields.items():
58
+ for n, f in type(self).model_fields.items():
59
59
  k = f.alias or n
60
60
  val = serialized.get(k)
61
61
  serialized.pop(k, None)
@@ -48,7 +48,7 @@ class FunctionResultEntry(BaseModel):
48
48
 
49
49
  m = {}
50
50
 
51
- for n, f in self.model_fields.items():
51
+ for n, f in type(self).model_fields.items():
52
52
  k = f.alias or n
53
53
  val = serialized.get(k)
54
54
  serialized.pop(k, None)
@@ -42,7 +42,7 @@ class GithubRepositoryIn(BaseModel):
42
42
 
43
43
  m = {}
44
44
 
45
- for n, f in self.model_fields.items():
45
+ for n, f in type(self).model_fields.items():
46
46
  k = f.alias or n
47
47
  val = serialized.get(k)
48
48
  serialized.pop(k, None)
@@ -42,7 +42,7 @@ class GithubRepositoryOut(BaseModel):
42
42
 
43
43
  m = {}
44
44
 
45
- for n, f in self.model_fields.items():
45
+ for n, f in type(self).model_fields.items():
46
46
  k = f.alias or n
47
47
  val = serialized.get(k)
48
48
  serialized.pop(k, None)
@@ -26,7 +26,7 @@ class ImageURL(BaseModel):
26
26
 
27
27
  m = {}
28
28
 
29
- for n, f in self.model_fields.items():
29
+ for n, f in type(self).model_fields.items():
30
30
  k = f.alias or n
31
31
  val = serialized.get(k)
32
32
  serialized.pop(k, None)
@@ -1,18 +1,37 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
+ from .agenthandoffentry import AgentHandoffEntry, AgentHandoffEntryTypedDict
5
+ from .functioncallentry import FunctionCallEntry, FunctionCallEntryTypedDict
4
6
  from .functionresultentry import FunctionResultEntry, FunctionResultEntryTypedDict
5
7
  from .messageinputentry import MessageInputEntry, MessageInputEntryTypedDict
8
+ from .messageoutputentry import MessageOutputEntry, MessageOutputEntryTypedDict
9
+ from .toolexecutionentry import ToolExecutionEntry, ToolExecutionEntryTypedDict
6
10
  from typing import Union
7
11
  from typing_extensions import TypeAliasType
8
12
 
9
13
 
10
14
  InputEntriesTypedDict = TypeAliasType(
11
15
  "InputEntriesTypedDict",
12
- Union[MessageInputEntryTypedDict, FunctionResultEntryTypedDict],
16
+ Union[
17
+ FunctionResultEntryTypedDict,
18
+ MessageInputEntryTypedDict,
19
+ FunctionCallEntryTypedDict,
20
+ ToolExecutionEntryTypedDict,
21
+ MessageOutputEntryTypedDict,
22
+ AgentHandoffEntryTypedDict,
23
+ ],
13
24
  )
14
25
 
15
26
 
16
27
  InputEntries = TypeAliasType(
17
- "InputEntries", Union[MessageInputEntry, FunctionResultEntry]
28
+ "InputEntries",
29
+ Union[
30
+ FunctionResultEntry,
31
+ MessageInputEntry,
32
+ FunctionCallEntry,
33
+ ToolExecutionEntry,
34
+ MessageOutputEntry,
35
+ AgentHandoffEntry,
36
+ ],
18
37
  )
mistralai/models/jobin.py CHANGED
@@ -120,7 +120,7 @@ class JobIn(BaseModel):
120
120
 
121
121
  m = {}
122
122
 
123
- for n, f in self.model_fields.items():
123
+ for n, f in type(self).model_fields.items():
124
124
  k = f.alias or n
125
125
  val = serialized.get(k)
126
126
  serialized.pop(k, None)
@@ -57,7 +57,7 @@ class JobMetadataOut(BaseModel):
57
57
 
58
58
  m = {}
59
59
 
60
- for n, f in self.model_fields.items():
60
+ for n, f in type(self).model_fields.items():
61
61
  k = f.alias or n
62
62
  val = serialized.get(k)
63
63
  serialized.pop(k, None)
@@ -74,7 +74,7 @@ class JobsAPIRoutesBatchGetBatchJobsRequest(BaseModel):
74
74
 
75
75
  m = {}
76
76
 
77
- for n, f in self.model_fields.items():
77
+ for n, f in type(self).model_fields.items():
78
78
  k = f.alias or n
79
79
  val = serialized.get(k)
80
80
  serialized.pop(k, None)
@@ -135,7 +135,7 @@ class JobsAPIRoutesFineTuningGetFineTuningJobsRequest(BaseModel):
135
135
 
136
136
  m = {}
137
137
 
138
- for n, f in self.model_fields.items():
138
+ for n, f in type(self).model_fields.items():
139
139
  k = f.alias or n
140
140
  val = serialized.get(k)
141
141
  serialized.pop(k, None)
@@ -34,7 +34,7 @@ class JSONSchema(BaseModel):
34
34
 
35
35
  m = {}
36
36
 
37
- for n, f in self.model_fields.items():
37
+ for n, f in type(self).model_fields.items():
38
38
  k = f.alias or n
39
39
  val = serialized.get(k)
40
40
  serialized.pop(k, None)
@@ -98,7 +98,7 @@ class LegacyJobMetadataOut(BaseModel):
98
98
 
99
99
  m = {}
100
100
 
101
- for n, f in self.model_fields.items():
101
+ for n, f in type(self).model_fields.items():
102
102
  k = f.alias or n
103
103
  val = serialized.get(k)
104
104
  serialized.pop(k, None)
@@ -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 LibrariesDeleteV1RequestTypedDict(TypedDict):
10
+ library_id: str
11
+
12
+
13
+ class LibrariesDeleteV1Request(BaseModel):
14
+ library_id: Annotated[
15
+ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
16
+ ]
@@ -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 LibrariesDocumentsDeleteV1RequestTypedDict(TypedDict):
10
+ library_id: str
11
+ document_id: str
12
+
13
+
14
+ class LibrariesDocumentsDeleteV1Request(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,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 LibrariesDocumentsGetExtractedTextSignedURLV1RequestTypedDict(TypedDict):
10
+ library_id: str
11
+ document_id: str
12
+
13
+
14
+ class LibrariesDocumentsGetExtractedTextSignedURLV1Request(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,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 LibrariesDocumentsGetSignedURLV1RequestTypedDict(TypedDict):
10
+ library_id: str
11
+ document_id: str
12
+
13
+
14
+ class LibrariesDocumentsGetSignedURLV1Request(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,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 LibrariesDocumentsGetStatusV1RequestTypedDict(TypedDict):
10
+ library_id: str
11
+ document_id: str
12
+
13
+
14
+ class LibrariesDocumentsGetStatusV1Request(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,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 LibrariesDocumentsGetTextContentV1RequestTypedDict(TypedDict):
10
+ library_id: str
11
+ document_id: str
12
+
13
+
14
+ class LibrariesDocumentsGetTextContentV1Request(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,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 LibrariesDocumentsGetV1RequestTypedDict(TypedDict):
10
+ library_id: str
11
+ document_id: str
12
+
13
+
14
+ class LibrariesDocumentsGetV1Request(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,78 @@
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 mistralai.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata
6
+ from pydantic import model_serializer
7
+ from typing import Optional
8
+ from typing_extensions import Annotated, NotRequired, TypedDict
9
+
10
+
11
+ class LibrariesDocumentsListV1RequestTypedDict(TypedDict):
12
+ library_id: str
13
+ search: NotRequired[Nullable[str]]
14
+ page_size: NotRequired[int]
15
+ page: NotRequired[int]
16
+ sort_by: NotRequired[str]
17
+ sort_order: NotRequired[str]
18
+
19
+
20
+ class LibrariesDocumentsListV1Request(BaseModel):
21
+ library_id: Annotated[
22
+ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
23
+ ]
24
+
25
+ search: Annotated[
26
+ OptionalNullable[str],
27
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
28
+ ] = UNSET
29
+
30
+ page_size: Annotated[
31
+ Optional[int],
32
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
33
+ ] = 100
34
+
35
+ page: Annotated[
36
+ Optional[int],
37
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
38
+ ] = 0
39
+
40
+ sort_by: Annotated[
41
+ Optional[str],
42
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
43
+ ] = "created_at"
44
+
45
+ sort_order: Annotated[
46
+ Optional[str],
47
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
48
+ ] = "desc"
49
+
50
+ @model_serializer(mode="wrap")
51
+ def serialize_model(self, handler):
52
+ optional_fields = ["search", "page_size", "page", "sort_by", "sort_order"]
53
+ nullable_fields = ["search"]
54
+ null_default_fields = []
55
+
56
+ serialized = handler(self)
57
+
58
+ m = {}
59
+
60
+ for n, f in type(self).model_fields.items():
61
+ k = f.alias or n
62
+ val = serialized.get(k)
63
+ serialized.pop(k, None)
64
+
65
+ optional_nullable = k in optional_fields and k in nullable_fields
66
+ is_set = (
67
+ self.__pydantic_fields_set__.intersection({n})
68
+ or k in null_default_fields
69
+ ) # pylint: disable=no-member
70
+
71
+ if val is not None and val != UNSET_SENTINEL:
72
+ m[k] = val
73
+ elif val != UNSET_SENTINEL and (
74
+ not k in optional_fields or (optional_nullable and is_set)
75
+ ):
76
+ m[k] = val
77
+
78
+ return m