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.
- mistralai/_hooks/types.py +7 -0
- mistralai/_version.py +3 -3
- mistralai/accesses.py +672 -0
- mistralai/agents.py +8 -4
- mistralai/basesdk.py +12 -20
- mistralai/beta.py +4 -0
- mistralai/chat.py +8 -4
- mistralai/classifiers.py +8 -0
- mistralai/conversations.py +34 -14
- mistralai/documents.py +2136 -0
- mistralai/embeddings.py +2 -0
- mistralai/extra/run/context.py +2 -4
- mistralai/files.py +14 -2
- mistralai/fim.py +4 -0
- mistralai/httpclient.py +6 -16
- mistralai/jobs.py +10 -0
- mistralai/libraries.py +1041 -0
- mistralai/mistral_agents.py +10 -0
- mistralai/mistral_jobs.py +8 -0
- mistralai/models/__init__.py +1578 -721
- mistralai/models/agent.py +1 -1
- mistralai/models/agentconversation.py +1 -1
- mistralai/models/agentcreationrequest.py +1 -1
- mistralai/models/agenthandoffentry.py +1 -1
- mistralai/models/agents_api_v1_conversations_getop.py +2 -0
- mistralai/models/agents_api_v1_conversations_historyop.py +2 -0
- mistralai/models/agents_api_v1_conversations_messagesop.py +2 -0
- mistralai/models/agents_api_v1_conversations_restart_streamop.py +2 -0
- mistralai/models/agents_api_v1_conversations_restartop.py +2 -0
- mistralai/models/agentscompletionrequest.py +3 -1
- mistralai/models/agentscompletionstreamrequest.py +3 -1
- mistralai/models/agentupdaterequest.py +1 -1
- mistralai/models/assistantmessage.py +1 -1
- mistralai/models/basemodelcard.py +6 -1
- mistralai/models/batchjobin.py +1 -1
- mistralai/models/batchjobout.py +1 -1
- mistralai/models/chatcompletionrequest.py +3 -1
- mistralai/models/chatcompletionstreamrequest.py +3 -1
- mistralai/models/classifierdetailedjobout.py +1 -1
- mistralai/models/classifierftmodelout.py +1 -1
- mistralai/models/classifierjobout.py +1 -1
- mistralai/models/classifiertargetin.py +1 -1
- mistralai/models/classifiertrainingparameters.py +1 -1
- mistralai/models/classifiertrainingparametersin.py +1 -1
- mistralai/models/completionargs.py +1 -1
- mistralai/models/completiondetailedjobout.py +1 -1
- mistralai/models/completionftmodelout.py +1 -1
- mistralai/models/completionjobout.py +1 -1
- mistralai/models/completionresponsestreamchoice.py +1 -1
- mistralai/models/completiontrainingparameters.py +1 -1
- mistralai/models/completiontrainingparametersin.py +1 -1
- mistralai/models/contentchunk.py +3 -0
- mistralai/models/conversationevents.py +6 -0
- mistralai/models/conversationhistory.py +4 -4
- mistralai/models/conversationrequest.py +1 -1
- mistralai/models/conversationstreamrequest.py +1 -1
- mistralai/models/conversationusageinfo.py +1 -1
- mistralai/models/deltamessage.py +1 -1
- mistralai/models/documentout.py +105 -0
- mistralai/models/documenttextcontent.py +13 -0
- mistralai/models/documentupdatein.py +44 -0
- mistralai/models/documenturlchunk.py +1 -1
- mistralai/models/embeddingrequest.py +1 -1
- mistralai/models/entitytype.py +9 -0
- mistralai/models/eventout.py +1 -1
- mistralai/models/file.py +33 -0
- mistralai/models/filechunk.py +23 -0
- mistralai/models/files_api_routes_list_filesop.py +1 -1
- mistralai/models/files_api_routes_upload_fileop.py +2 -27
- mistralai/models/fileschema.py +1 -1
- mistralai/models/fimcompletionrequest.py +1 -1
- mistralai/models/fimcompletionstreamrequest.py +1 -1
- mistralai/models/ftmodelcard.py +6 -1
- mistralai/models/functioncallentry.py +1 -1
- mistralai/models/functionresultentry.py +1 -1
- mistralai/models/githubrepositoryin.py +1 -1
- mistralai/models/githubrepositoryout.py +1 -1
- mistralai/models/imageurl.py +1 -1
- mistralai/models/inputentries.py +21 -2
- mistralai/models/jobin.py +1 -1
- mistralai/models/jobmetadataout.py +1 -1
- mistralai/models/jobs_api_routes_batch_get_batch_jobsop.py +1 -1
- mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobsop.py +1 -1
- mistralai/models/jsonschema.py +1 -1
- mistralai/models/legacyjobmetadataout.py +1 -1
- mistralai/models/libraries_delete_v1op.py +16 -0
- mistralai/models/libraries_documents_delete_v1op.py +21 -0
- mistralai/models/libraries_documents_get_extracted_text_signed_url_v1op.py +21 -0
- mistralai/models/libraries_documents_get_signed_url_v1op.py +21 -0
- mistralai/models/libraries_documents_get_status_v1op.py +21 -0
- mistralai/models/libraries_documents_get_text_content_v1op.py +21 -0
- mistralai/models/libraries_documents_get_v1op.py +21 -0
- mistralai/models/libraries_documents_list_v1op.py +78 -0
- mistralai/models/libraries_documents_reprocess_v1op.py +21 -0
- mistralai/models/libraries_documents_update_v1op.py +28 -0
- mistralai/models/libraries_documents_upload_v1op.py +56 -0
- mistralai/models/libraries_get_v1op.py +16 -0
- mistralai/models/libraries_share_create_v1op.py +22 -0
- mistralai/models/libraries_share_delete_v1op.py +23 -0
- mistralai/models/libraries_share_list_v1op.py +16 -0
- mistralai/models/libraries_update_v1op.py +23 -0
- mistralai/models/libraryin.py +50 -0
- mistralai/models/libraryinupdate.py +47 -0
- mistralai/models/libraryout.py +107 -0
- mistralai/models/listdocumentout.py +19 -0
- mistralai/models/listlibraryout.py +15 -0
- mistralai/models/listsharingout.py +15 -0
- mistralai/models/messageinputentry.py +12 -2
- mistralai/models/messageoutputentry.py +1 -1
- mistralai/models/messageoutputevent.py +1 -1
- mistralai/models/metricout.py +1 -1
- mistralai/models/modelcapabilities.py +3 -0
- mistralai/models/modelconversation.py +1 -1
- mistralai/models/ocrimageobject.py +1 -1
- mistralai/models/ocrpageobject.py +1 -1
- mistralai/models/ocrrequest.py +5 -3
- mistralai/models/ocrresponse.py +1 -1
- mistralai/models/ocrusageinfo.py +1 -1
- mistralai/models/paginationinfo.py +25 -0
- mistralai/models/processingstatusout.py +16 -0
- mistralai/models/responseformat.py +1 -1
- mistralai/models/retrievefileout.py +1 -1
- mistralai/models/shareenum.py +8 -0
- mistralai/models/sharingdelete.py +26 -0
- mistralai/models/sharingin.py +30 -0
- mistralai/models/sharingout.py +59 -0
- mistralai/models/ssetypes.py +1 -0
- mistralai/models/toolexecutiondeltaevent.py +34 -0
- mistralai/models/toolexecutionentry.py +4 -1
- mistralai/models/toolexecutionstartedevent.py +3 -0
- mistralai/models/toolfilechunk.py +1 -1
- mistralai/models/toolmessage.py +1 -1
- mistralai/models/toolreferencechunk.py +8 -5
- mistralai/models/updateftmodelin.py +1 -1
- mistralai/models/uploadfileout.py +1 -1
- mistralai/models/usermessage.py +1 -1
- mistralai/models/wandbintegration.py +1 -1
- mistralai/models/wandbintegrationout.py +1 -1
- mistralai/models_.py +14 -2
- mistralai/ocr.py +2 -0
- mistralai/sdk.py +68 -40
- mistralai/sdkconfiguration.py +0 -7
- mistralai/types/basemodel.py +3 -3
- mistralai/utils/__init__.py +131 -45
- mistralai/utils/datetimes.py +23 -0
- mistralai/utils/enums.py +67 -27
- mistralai/utils/forms.py +49 -28
- mistralai/utils/serializers.py +32 -3
- {mistralai-1.8.2.dist-info → mistralai-1.9.2.dist-info}/METADATA +41 -7
- {mistralai-1.8.2.dist-info → mistralai-1.9.2.dist-info}/RECORD +152 -113
- {mistralai-1.8.2.dist-info → mistralai-1.9.2.dist-info}/LICENSE +0 -0
- {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 = [
|
|
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)
|
mistralai/models/metricout.py
CHANGED
|
@@ -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
|
mistralai/models/ocrrequest.py
CHANGED
|
@@ -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",
|
|
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)
|
mistralai/models/ocrresponse.py
CHANGED
mistralai/models/ocrusageinfo.py
CHANGED
|
@@ -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
|