mistralai 1.9.1__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/_version.py +2 -2
- mistralai/accesses.py +672 -0
- mistralai/beta.py +4 -0
- mistralai/documents.py +2136 -0
- mistralai/files.py +2 -2
- mistralai/libraries.py +1041 -0
- mistralai/models/__init__.py +232 -8
- mistralai/models/basemodelcard.py +5 -2
- mistralai/models/conversationevents.py +6 -0
- mistralai/models/conversationhistory.py +4 -4
- mistralai/models/documentout.py +105 -0
- mistralai/models/documenttextcontent.py +13 -0
- mistralai/models/documentupdatein.py +44 -0
- mistralai/models/entitytype.py +9 -0
- mistralai/models/file.py +33 -0
- mistralai/models/files_api_routes_upload_fileop.py +2 -27
- mistralai/models/ftmodelcard.py +5 -3
- mistralai/models/inputentries.py +4 -4
- 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 +14 -4
- mistralai/models/paginationinfo.py +25 -0
- mistralai/models/processingstatusout.py +16 -0
- 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 +3 -0
- mistralai/models/toolexecutionstartedevent.py +3 -0
- mistralai/models/toolreferencechunk.py +7 -4
- {mistralai-1.9.1.dist-info → mistralai-1.9.2.dist-info}/METADATA +29 -2
- {mistralai-1.9.1.dist-info → mistralai-1.9.2.dist-info}/RECORD +56 -19
- {mistralai-1.9.1.dist-info → mistralai-1.9.2.dist-info}/LICENSE +0 -0
- {mistralai-1.9.1.dist-info → mistralai-1.9.2.dist-info}/WHEEL +0 -0
|
@@ -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
|
|
@@ -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."""
|
mistralai/models/file.py
ADDED
|
@@ -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
|
|
@@ -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
|
|
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.
|
mistralai/models/ftmodelcard.py
CHANGED
|
@@ -12,6 +12,9 @@ from typing import List, Literal, Optional
|
|
|
12
12
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
13
13
|
|
|
14
14
|
|
|
15
|
+
FTModelCardType = Literal["fine-tuned"]
|
|
16
|
+
|
|
17
|
+
|
|
15
18
|
class FTModelCardTypedDict(TypedDict):
|
|
16
19
|
r"""Extra fields for fine-tuned models."""
|
|
17
20
|
|
|
@@ -29,7 +32,7 @@ class FTModelCardTypedDict(TypedDict):
|
|
|
29
32
|
deprecation: NotRequired[Nullable[datetime]]
|
|
30
33
|
deprecation_replacement_model: NotRequired[Nullable[str]]
|
|
31
34
|
default_model_temperature: NotRequired[Nullable[float]]
|
|
32
|
-
type:
|
|
35
|
+
type: FTModelCardType
|
|
33
36
|
archived: NotRequired[bool]
|
|
34
37
|
|
|
35
38
|
|
|
@@ -66,8 +69,7 @@ class FTModelCard(BaseModel):
|
|
|
66
69
|
|
|
67
70
|
TYPE: Annotated[
|
|
68
71
|
Annotated[
|
|
69
|
-
Optional[
|
|
70
|
-
AfterValidator(validate_const("fine-tuned")),
|
|
72
|
+
Optional[FTModelCardType], AfterValidator(validate_const("fine-tuned"))
|
|
71
73
|
],
|
|
72
74
|
pydantic.Field(alias="type"),
|
|
73
75
|
] = "fine-tuned"
|
mistralai/models/inputentries.py
CHANGED
|
@@ -14,10 +14,10 @@ from typing_extensions import TypeAliasType
|
|
|
14
14
|
InputEntriesTypedDict = TypeAliasType(
|
|
15
15
|
"InputEntriesTypedDict",
|
|
16
16
|
Union[
|
|
17
|
-
MessageInputEntryTypedDict,
|
|
18
17
|
FunctionResultEntryTypedDict,
|
|
19
|
-
|
|
18
|
+
MessageInputEntryTypedDict,
|
|
20
19
|
FunctionCallEntryTypedDict,
|
|
20
|
+
ToolExecutionEntryTypedDict,
|
|
21
21
|
MessageOutputEntryTypedDict,
|
|
22
22
|
AgentHandoffEntryTypedDict,
|
|
23
23
|
],
|
|
@@ -27,10 +27,10 @@ InputEntriesTypedDict = TypeAliasType(
|
|
|
27
27
|
InputEntries = TypeAliasType(
|
|
28
28
|
"InputEntries",
|
|
29
29
|
Union[
|
|
30
|
-
MessageInputEntry,
|
|
31
30
|
FunctionResultEntry,
|
|
32
|
-
|
|
31
|
+
MessageInputEntry,
|
|
33
32
|
FunctionCallEntry,
|
|
33
|
+
ToolExecutionEntry,
|
|
34
34
|
MessageOutputEntry,
|
|
35
35
|
AgentHandoffEntry,
|
|
36
36
|
],
|
|
@@ -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
|
|
@@ -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
|
+
]
|