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,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]
|
|
@@ -14,7 +14,7 @@ from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
|
14
14
|
|
|
15
15
|
Object = Literal["entry"]
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
MessageInputEntryType = Literal["message.input"]
|
|
18
18
|
|
|
19
19
|
MessageInputEntryRole = Literal["assistant", "user"]
|
|
20
20
|
|
|
@@ -35,10 +35,11 @@ class MessageInputEntryTypedDict(TypedDict):
|
|
|
35
35
|
role: MessageInputEntryRole
|
|
36
36
|
content: MessageInputEntryContentTypedDict
|
|
37
37
|
object: NotRequired[Object]
|
|
38
|
-
type: NotRequired[
|
|
38
|
+
type: NotRequired[MessageInputEntryType]
|
|
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):
|
|
@@ -50,7 +51,7 @@ class MessageInputEntry(BaseModel):
|
|
|
50
51
|
|
|
51
52
|
object: Optional[Object] = "entry"
|
|
52
53
|
|
|
53
|
-
type: Optional[
|
|
54
|
+
type: Optional[MessageInputEntryType] = "message.input"
|
|
54
55
|
|
|
55
56
|
created_at: Optional[datetime] = None
|
|
56
57
|
|
|
@@ -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
|
|
|
@@ -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
|
|
@@ -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 typing_extensions import TypedDict
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ProcessingStatusOutTypedDict(TypedDict):
|
|
9
|
+
document_id: str
|
|
10
|
+
processing_status: str
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ProcessingStatusOut(BaseModel):
|
|
14
|
+
document_id: str
|
|
15
|
+
|
|
16
|
+
processing_status: str
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .entitytype import EntityType
|
|
5
|
+
from mistralai.types import BaseModel
|
|
6
|
+
from mistralai.utils import validate_open_enum
|
|
7
|
+
from pydantic.functional_validators import PlainValidator
|
|
8
|
+
from typing_extensions import Annotated, TypedDict
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class SharingDeleteTypedDict(TypedDict):
|
|
12
|
+
org_id: str
|
|
13
|
+
share_with_uuid: str
|
|
14
|
+
r"""The id of the entity (user, workspace or organization) to share with"""
|
|
15
|
+
share_with_type: EntityType
|
|
16
|
+
r"""The type of entity, used to share a library."""
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class SharingDelete(BaseModel):
|
|
20
|
+
org_id: str
|
|
21
|
+
|
|
22
|
+
share_with_uuid: str
|
|
23
|
+
r"""The id of the entity (user, workspace or organization) to share with"""
|
|
24
|
+
|
|
25
|
+
share_with_type: Annotated[EntityType, PlainValidator(validate_open_enum(False))]
|
|
26
|
+
r"""The type of entity, used to share a library."""
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .entitytype import EntityType
|
|
5
|
+
from .shareenum import ShareEnum
|
|
6
|
+
from mistralai.types import BaseModel
|
|
7
|
+
from mistralai.utils import validate_open_enum
|
|
8
|
+
from pydantic.functional_validators import PlainValidator
|
|
9
|
+
from typing_extensions import Annotated, TypedDict
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class SharingInTypedDict(TypedDict):
|
|
13
|
+
org_id: str
|
|
14
|
+
level: ShareEnum
|
|
15
|
+
share_with_uuid: str
|
|
16
|
+
r"""The id of the entity (user, workspace or organization) to share with"""
|
|
17
|
+
share_with_type: EntityType
|
|
18
|
+
r"""The type of entity, used to share a library."""
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class SharingIn(BaseModel):
|
|
22
|
+
org_id: str
|
|
23
|
+
|
|
24
|
+
level: Annotated[ShareEnum, PlainValidator(validate_open_enum(False))]
|
|
25
|
+
|
|
26
|
+
share_with_uuid: str
|
|
27
|
+
r"""The id of the entity (user, workspace or organization) to share with"""
|
|
28
|
+
|
|
29
|
+
share_with_type: Annotated[EntityType, PlainValidator(validate_open_enum(False))]
|
|
30
|
+
r"""The type of entity, used to share a library."""
|
|
@@ -0,0 +1,59 @@
|
|
|
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 SharingOutTypedDict(TypedDict):
|
|
10
|
+
library_id: str
|
|
11
|
+
org_id: str
|
|
12
|
+
role: str
|
|
13
|
+
share_with_type: str
|
|
14
|
+
share_with_uuid: str
|
|
15
|
+
user_id: NotRequired[Nullable[str]]
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class SharingOut(BaseModel):
|
|
19
|
+
library_id: str
|
|
20
|
+
|
|
21
|
+
org_id: str
|
|
22
|
+
|
|
23
|
+
role: str
|
|
24
|
+
|
|
25
|
+
share_with_type: str
|
|
26
|
+
|
|
27
|
+
share_with_uuid: str
|
|
28
|
+
|
|
29
|
+
user_id: OptionalNullable[str] = UNSET
|
|
30
|
+
|
|
31
|
+
@model_serializer(mode="wrap")
|
|
32
|
+
def serialize_model(self, handler):
|
|
33
|
+
optional_fields = ["user_id"]
|
|
34
|
+
nullable_fields = ["user_id"]
|
|
35
|
+
null_default_fields = []
|
|
36
|
+
|
|
37
|
+
serialized = handler(self)
|
|
38
|
+
|
|
39
|
+
m = {}
|
|
40
|
+
|
|
41
|
+
for n, f in type(self).model_fields.items():
|
|
42
|
+
k = f.alias or n
|
|
43
|
+
val = serialized.get(k)
|
|
44
|
+
serialized.pop(k, None)
|
|
45
|
+
|
|
46
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
47
|
+
is_set = (
|
|
48
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
49
|
+
or k in null_default_fields
|
|
50
|
+
) # pylint: disable=no-member
|
|
51
|
+
|
|
52
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
53
|
+
m[k] = val
|
|
54
|
+
elif val != UNSET_SENTINEL and (
|
|
55
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
56
|
+
):
|
|
57
|
+
m[k] = val
|
|
58
|
+
|
|
59
|
+
return m
|
mistralai/models/ssetypes.py
CHANGED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .builtinconnectors import BuiltInConnectors
|
|
5
|
+
from datetime import datetime
|
|
6
|
+
from mistralai.types import BaseModel
|
|
7
|
+
from typing import Literal, Optional
|
|
8
|
+
from typing_extensions import NotRequired, TypedDict
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
ToolExecutionDeltaEventType = Literal["tool.execution.delta"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class ToolExecutionDeltaEventTypedDict(TypedDict):
|
|
15
|
+
id: str
|
|
16
|
+
name: BuiltInConnectors
|
|
17
|
+
arguments: str
|
|
18
|
+
type: NotRequired[ToolExecutionDeltaEventType]
|
|
19
|
+
created_at: NotRequired[datetime]
|
|
20
|
+
output_index: NotRequired[int]
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class ToolExecutionDeltaEvent(BaseModel):
|
|
24
|
+
id: str
|
|
25
|
+
|
|
26
|
+
name: BuiltInConnectors
|
|
27
|
+
|
|
28
|
+
arguments: str
|
|
29
|
+
|
|
30
|
+
type: Optional[ToolExecutionDeltaEventType] = "tool.execution.delta"
|
|
31
|
+
|
|
32
|
+
created_at: Optional[datetime] = None
|
|
33
|
+
|
|
34
|
+
output_index: Optional[int] = 0
|
|
@@ -16,6 +16,7 @@ ToolExecutionEntryType = Literal["tool.execution"]
|
|
|
16
16
|
|
|
17
17
|
class ToolExecutionEntryTypedDict(TypedDict):
|
|
18
18
|
name: BuiltInConnectors
|
|
19
|
+
arguments: str
|
|
19
20
|
object: NotRequired[ToolExecutionEntryObject]
|
|
20
21
|
type: NotRequired[ToolExecutionEntryType]
|
|
21
22
|
created_at: NotRequired[datetime]
|
|
@@ -27,6 +28,8 @@ class ToolExecutionEntryTypedDict(TypedDict):
|
|
|
27
28
|
class ToolExecutionEntry(BaseModel):
|
|
28
29
|
name: BuiltInConnectors
|
|
29
30
|
|
|
31
|
+
arguments: str
|
|
32
|
+
|
|
30
33
|
object: Optional[ToolExecutionEntryObject] = "entry"
|
|
31
34
|
|
|
32
35
|
type: Optional[ToolExecutionEntryType] = "tool.execution"
|
|
@@ -14,6 +14,7 @@ ToolExecutionStartedEventType = Literal["tool.execution.started"]
|
|
|
14
14
|
class ToolExecutionStartedEventTypedDict(TypedDict):
|
|
15
15
|
id: str
|
|
16
16
|
name: BuiltInConnectors
|
|
17
|
+
arguments: str
|
|
17
18
|
type: NotRequired[ToolExecutionStartedEventType]
|
|
18
19
|
created_at: NotRequired[datetime]
|
|
19
20
|
output_index: NotRequired[int]
|
|
@@ -24,6 +25,8 @@ class ToolExecutionStartedEvent(BaseModel):
|
|
|
24
25
|
|
|
25
26
|
name: BuiltInConnectors
|
|
26
27
|
|
|
28
|
+
arguments: str
|
|
29
|
+
|
|
27
30
|
type: Optional[ToolExecutionStartedEventType] = "tool.execution.started"
|
|
28
31
|
|
|
29
32
|
created_at: Optional[datetime] = None
|
|
@@ -16,7 +16,8 @@ class ToolReferenceChunkTypedDict(TypedDict):
|
|
|
16
16
|
title: str
|
|
17
17
|
type: NotRequired[ToolReferenceChunkType]
|
|
18
18
|
url: NotRequired[Nullable[str]]
|
|
19
|
-
|
|
19
|
+
favicon: NotRequired[Nullable[str]]
|
|
20
|
+
description: NotRequired[Nullable[str]]
|
|
20
21
|
|
|
21
22
|
|
|
22
23
|
class ToolReferenceChunk(BaseModel):
|
|
@@ -28,12 +29,14 @@ class ToolReferenceChunk(BaseModel):
|
|
|
28
29
|
|
|
29
30
|
url: OptionalNullable[str] = UNSET
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
favicon: OptionalNullable[str] = UNSET
|
|
33
|
+
|
|
34
|
+
description: OptionalNullable[str] = UNSET
|
|
32
35
|
|
|
33
36
|
@model_serializer(mode="wrap")
|
|
34
37
|
def serialize_model(self, handler):
|
|
35
|
-
optional_fields = ["type", "url", "
|
|
36
|
-
nullable_fields = ["url", "
|
|
38
|
+
optional_fields = ["type", "url", "favicon", "description"]
|
|
39
|
+
nullable_fields = ["url", "favicon", "description"]
|
|
37
40
|
null_default_fields = []
|
|
38
41
|
|
|
39
42
|
serialized = handler(self)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: mistralai
|
|
3
|
-
Version: 1.9.
|
|
3
|
+
Version: 1.9.2
|
|
4
4
|
Summary: Python Client SDK for the Mistral AI API.
|
|
5
5
|
Author: Mistral
|
|
6
6
|
Requires-Python: >=3.9
|
|
@@ -495,6 +495,33 @@ The documentation for the GCP SDK is available [here](https://github.com/mistral
|
|
|
495
495
|
* [append_stream](https://github.com/mistralai/client-python/blob/master/docs/sdks/conversations/README.md#append_stream) - Append new entries to an existing conversation.
|
|
496
496
|
* [restart_stream](https://github.com/mistralai/client-python/blob/master/docs/sdks/conversations/README.md#restart_stream) - Restart a conversation starting from a given entry.
|
|
497
497
|
|
|
498
|
+
#### [beta.libraries](https://github.com/mistralai/client-python/blob/master/docs/sdks/libraries/README.md)
|
|
499
|
+
|
|
500
|
+
* [list](https://github.com/mistralai/client-python/blob/master/docs/sdks/libraries/README.md#list) - List all libraries you have access to.
|
|
501
|
+
* [create](https://github.com/mistralai/client-python/blob/master/docs/sdks/libraries/README.md#create) - Create a new Library.
|
|
502
|
+
* [get](https://github.com/mistralai/client-python/blob/master/docs/sdks/libraries/README.md#get) - Detailed information about a specific Library.
|
|
503
|
+
* [delete](https://github.com/mistralai/client-python/blob/master/docs/sdks/libraries/README.md#delete) - Delete a library and all of it's document.
|
|
504
|
+
* [update](https://github.com/mistralai/client-python/blob/master/docs/sdks/libraries/README.md#update) - Update a library.
|
|
505
|
+
|
|
506
|
+
#### [beta.libraries.accesses](https://github.com/mistralai/client-python/blob/master/docs/sdks/accesses/README.md)
|
|
507
|
+
|
|
508
|
+
* [list](https://github.com/mistralai/client-python/blob/master/docs/sdks/accesses/README.md#list) - List all of the access to this library.
|
|
509
|
+
* [update_or_create](https://github.com/mistralai/client-python/blob/master/docs/sdks/accesses/README.md#update_or_create) - Create or update an access level.
|
|
510
|
+
* [delete](https://github.com/mistralai/client-python/blob/master/docs/sdks/accesses/README.md#delete) - Delete an access level.
|
|
511
|
+
|
|
512
|
+
#### [beta.libraries.documents](https://github.com/mistralai/client-python/blob/master/docs/sdks/documents/README.md)
|
|
513
|
+
|
|
514
|
+
* [list](https://github.com/mistralai/client-python/blob/master/docs/sdks/documents/README.md#list) - List document in a given library.
|
|
515
|
+
* [upload](https://github.com/mistralai/client-python/blob/master/docs/sdks/documents/README.md#upload) - Upload a new document.
|
|
516
|
+
* [get](https://github.com/mistralai/client-python/blob/master/docs/sdks/documents/README.md#get) - Retrieve the metadata of a specific document.
|
|
517
|
+
* [update](https://github.com/mistralai/client-python/blob/master/docs/sdks/documents/README.md#update) - Update the metadata of a specific document.
|
|
518
|
+
* [delete](https://github.com/mistralai/client-python/blob/master/docs/sdks/documents/README.md#delete) - Delete a document.
|
|
519
|
+
* [text_content](https://github.com/mistralai/client-python/blob/master/docs/sdks/documents/README.md#text_content) - Retrieve the text content of a specific document.
|
|
520
|
+
* [status](https://github.com/mistralai/client-python/blob/master/docs/sdks/documents/README.md#status) - Retrieve the processing status of a specific document.
|
|
521
|
+
* [get_signed_url](https://github.com/mistralai/client-python/blob/master/docs/sdks/documents/README.md#get_signed_url) - Retrieve the signed URL of a specific document.
|
|
522
|
+
* [extracted_text_signed_url](https://github.com/mistralai/client-python/blob/master/docs/sdks/documents/README.md#extracted_text_signed_url) - Retrieve the signed URL of text extracted from a given document.
|
|
523
|
+
* [reprocess](https://github.com/mistralai/client-python/blob/master/docs/sdks/documents/README.md#reprocess) - Reprocess a document.
|
|
524
|
+
|
|
498
525
|
### [chat](https://github.com/mistralai/client-python/blob/master/docs/sdks/chat/README.md)
|
|
499
526
|
|
|
500
527
|
* [complete](https://github.com/mistralai/client-python/blob/master/docs/sdks/chat/README.md#complete) - Chat Completion
|
|
@@ -614,7 +641,7 @@ with Mistral(
|
|
|
614
641
|
api_key=os.getenv("MISTRAL_API_KEY", ""),
|
|
615
642
|
) as mistral:
|
|
616
643
|
|
|
617
|
-
res = mistral.
|
|
644
|
+
res = mistral.beta.libraries.documents.upload(library_id="a02150d9-5ee0-4877-b62c-28b1fcdf3b76", file={
|
|
618
645
|
"file_name": "example.file",
|
|
619
646
|
"content": open("example.file", "rb"),
|
|
620
647
|
})
|