mistralai 1.8.1__py3-none-any.whl → 1.9.1__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/agents.py +16 -0
- mistralai/basesdk.py +12 -20
- mistralai/beta.py +1 -1
- mistralai/chat.py +16 -0
- mistralai/classifiers.py +8 -0
- mistralai/conversations.py +35 -15
- mistralai/embeddings.py +2 -0
- mistralai/extra/run/context.py +2 -4
- mistralai/files.py +12 -0
- mistralai/fim.py +4 -0
- mistralai/httpclient.py +6 -16
- mistralai/jobs.py +10 -0
- mistralai/mistral_agents.py +10 -0
- mistralai/mistral_jobs.py +8 -0
- mistralai/models/__init__.py +1357 -722
- 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 +13 -3
- mistralai/models/agentscompletionstreamrequest.py +13 -3
- mistralai/models/agentupdaterequest.py +1 -1
- mistralai/models/assistantmessage.py +1 -1
- mistralai/models/basemodelcard.py +8 -6
- mistralai/models/batchjobin.py +1 -1
- mistralai/models/batchjobout.py +1 -1
- mistralai/models/chatcompletionrequest.py +20 -3
- mistralai/models/chatcompletionstreamrequest.py +20 -3
- 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/conversationrequest.py +1 -1
- mistralai/models/conversationstreamrequest.py +1 -1
- mistralai/models/conversationusageinfo.py +1 -1
- mistralai/models/deltamessage.py +1 -1
- mistralai/models/documenturlchunk.py +1 -1
- mistralai/models/embeddingrequest.py +1 -1
- mistralai/models/eventout.py +1 -1
- mistralai/models/filechunk.py +23 -0
- mistralai/models/files_api_routes_list_filesop.py +1 -1
- mistralai/models/fileschema.py +1 -1
- mistralai/models/fimcompletionrequest.py +1 -1
- mistralai/models/fimcompletionstreamrequest.py +1 -1
- mistralai/models/ftmodelcard.py +9 -6
- 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/messageinputentry.py +4 -4
- mistralai/models/messageoutputentry.py +1 -1
- mistralai/models/messageoutputevent.py +1 -1
- mistralai/models/metricout.py +1 -1
- mistralai/models/mistralpromptmode.py +8 -0
- 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/responseformat.py +1 -1
- mistralai/models/retrievefileout.py +1 -1
- mistralai/models/toolexecutionentry.py +1 -1
- mistralai/models/toolfilechunk.py +1 -1
- mistralai/models/toolmessage.py +1 -1
- mistralai/models/toolreferencechunk.py +1 -1
- 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.1.dist-info → mistralai-1.9.1.dist-info}/METADATA +13 -6
- {mistralai-1.8.1.dist-info → mistralai-1.9.1.dist-info}/RECORD +111 -108
- {mistralai-1.8.1.dist-info → mistralai-1.9.1.dist-info}/LICENSE +0 -0
- {mistralai-1.8.1.dist-info → mistralai-1.9.1.dist-info}/WHEEL +0 -0
mistralai/models/deltamessage.py
CHANGED
mistralai/models/eventout.py
CHANGED
|
@@ -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"
|
mistralai/models/fileschema.py
CHANGED
mistralai/models/ftmodelcard.py
CHANGED
|
@@ -12,9 +12,6 @@ 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
|
-
|
|
18
15
|
class FTModelCardTypedDict(TypedDict):
|
|
19
16
|
r"""Extra fields for fine-tuned models."""
|
|
20
17
|
|
|
@@ -30,8 +27,9 @@ class FTModelCardTypedDict(TypedDict):
|
|
|
30
27
|
max_context_length: NotRequired[int]
|
|
31
28
|
aliases: NotRequired[List[str]]
|
|
32
29
|
deprecation: NotRequired[Nullable[datetime]]
|
|
30
|
+
deprecation_replacement_model: NotRequired[Nullable[str]]
|
|
33
31
|
default_model_temperature: NotRequired[Nullable[float]]
|
|
34
|
-
type:
|
|
32
|
+
type: Literal["fine-tuned"]
|
|
35
33
|
archived: NotRequired[bool]
|
|
36
34
|
|
|
37
35
|
|
|
@@ -62,11 +60,14 @@ class FTModelCard(BaseModel):
|
|
|
62
60
|
|
|
63
61
|
deprecation: OptionalNullable[datetime] = UNSET
|
|
64
62
|
|
|
63
|
+
deprecation_replacement_model: OptionalNullable[str] = UNSET
|
|
64
|
+
|
|
65
65
|
default_model_temperature: OptionalNullable[float] = UNSET
|
|
66
66
|
|
|
67
67
|
TYPE: Annotated[
|
|
68
68
|
Annotated[
|
|
69
|
-
Optional[
|
|
69
|
+
Optional[Literal["fine-tuned"]],
|
|
70
|
+
AfterValidator(validate_const("fine-tuned")),
|
|
70
71
|
],
|
|
71
72
|
pydantic.Field(alias="type"),
|
|
72
73
|
] = "fine-tuned"
|
|
@@ -84,6 +85,7 @@ class FTModelCard(BaseModel):
|
|
|
84
85
|
"max_context_length",
|
|
85
86
|
"aliases",
|
|
86
87
|
"deprecation",
|
|
88
|
+
"deprecation_replacement_model",
|
|
87
89
|
"default_model_temperature",
|
|
88
90
|
"type",
|
|
89
91
|
"archived",
|
|
@@ -92,6 +94,7 @@ class FTModelCard(BaseModel):
|
|
|
92
94
|
"name",
|
|
93
95
|
"description",
|
|
94
96
|
"deprecation",
|
|
97
|
+
"deprecation_replacement_model",
|
|
95
98
|
"default_model_temperature",
|
|
96
99
|
]
|
|
97
100
|
null_default_fields = []
|
|
@@ -100,7 +103,7 @@ class FTModelCard(BaseModel):
|
|
|
100
103
|
|
|
101
104
|
m = {}
|
|
102
105
|
|
|
103
|
-
for n, f in self.model_fields.items():
|
|
106
|
+
for n, f in type(self).model_fields.items():
|
|
104
107
|
k = f.alias or n
|
|
105
108
|
val = serialized.get(k)
|
|
106
109
|
serialized.pop(k, None)
|
mistralai/models/imageurl.py
CHANGED
mistralai/models/inputentries.py
CHANGED
|
@@ -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[
|
|
16
|
+
Union[
|
|
17
|
+
MessageInputEntryTypedDict,
|
|
18
|
+
FunctionResultEntryTypedDict,
|
|
19
|
+
ToolExecutionEntryTypedDict,
|
|
20
|
+
FunctionCallEntryTypedDict,
|
|
21
|
+
MessageOutputEntryTypedDict,
|
|
22
|
+
AgentHandoffEntryTypedDict,
|
|
23
|
+
],
|
|
13
24
|
)
|
|
14
25
|
|
|
15
26
|
|
|
16
27
|
InputEntries = TypeAliasType(
|
|
17
|
-
"InputEntries",
|
|
28
|
+
"InputEntries",
|
|
29
|
+
Union[
|
|
30
|
+
MessageInputEntry,
|
|
31
|
+
FunctionResultEntry,
|
|
32
|
+
ToolExecutionEntry,
|
|
33
|
+
FunctionCallEntry,
|
|
34
|
+
MessageOutputEntry,
|
|
35
|
+
AgentHandoffEntry,
|
|
36
|
+
],
|
|
18
37
|
)
|
mistralai/models/jobin.py
CHANGED
|
@@ -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)
|
mistralai/models/jsonschema.py
CHANGED
|
@@ -14,7 +14,7 @@ from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
|
14
14
|
|
|
15
15
|
Object = Literal["entry"]
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Type = Literal["message.input"]
|
|
18
18
|
|
|
19
19
|
MessageInputEntryRole = Literal["assistant", "user"]
|
|
20
20
|
|
|
@@ -35,7 +35,7 @@ class MessageInputEntryTypedDict(TypedDict):
|
|
|
35
35
|
role: MessageInputEntryRole
|
|
36
36
|
content: MessageInputEntryContentTypedDict
|
|
37
37
|
object: NotRequired[Object]
|
|
38
|
-
type: NotRequired[
|
|
38
|
+
type: NotRequired[Type]
|
|
39
39
|
created_at: NotRequired[datetime]
|
|
40
40
|
completed_at: NotRequired[Nullable[datetime]]
|
|
41
41
|
id: NotRequired[str]
|
|
@@ -50,7 +50,7 @@ class MessageInputEntry(BaseModel):
|
|
|
50
50
|
|
|
51
51
|
object: Optional[Object] = "entry"
|
|
52
52
|
|
|
53
|
-
type: Optional[
|
|
53
|
+
type: Optional[Type] = "message.input"
|
|
54
54
|
|
|
55
55
|
created_at: Optional[datetime] = None
|
|
56
56
|
|
|
@@ -68,7 +68,7 @@ class MessageInputEntry(BaseModel):
|
|
|
68
68
|
|
|
69
69
|
m = {}
|
|
70
70
|
|
|
71
|
-
for n, f in self.model_fields.items():
|
|
71
|
+
for n, f in type(self).model_fields.items():
|
|
72
72
|
k = f.alias or n
|
|
73
73
|
val = serialized.get(k)
|
|
74
74
|
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
mistralai/models/toolmessage.py
CHANGED
mistralai/models/usermessage.py
CHANGED