mistralai 1.10.1__py3-none-any.whl → 1.12.0__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 +3 -3
- mistralai/accesses.py +22 -12
- mistralai/agents.py +88 -44
- mistralai/audio.py +20 -0
- mistralai/basesdk.py +6 -0
- mistralai/chat.py +96 -40
- mistralai/classifiers.py +35 -22
- mistralai/conversations.py +234 -72
- mistralai/documents.py +72 -26
- mistralai/embeddings.py +17 -8
- mistralai/extra/__init__.py +48 -0
- mistralai/extra/exceptions.py +49 -4
- mistralai/extra/realtime/__init__.py +25 -0
- mistralai/extra/realtime/connection.py +207 -0
- mistralai/extra/realtime/transcription.py +271 -0
- mistralai/files.py +64 -24
- mistralai/fim.py +20 -12
- mistralai/httpclient.py +0 -1
- mistralai/jobs.py +65 -26
- mistralai/libraries.py +20 -10
- mistralai/mistral_agents.py +825 -34
- mistralai/mistral_jobs.py +33 -14
- mistralai/models/__init__.py +119 -0
- mistralai/models/agent.py +1 -1
- mistralai/models/agentaliasresponse.py +23 -0
- mistralai/models/agentconversation.py +15 -5
- mistralai/models/agenthandoffdoneevent.py +1 -1
- mistralai/models/agenthandoffentry.py +3 -2
- mistralai/models/agenthandoffstartedevent.py +1 -1
- mistralai/models/agents_api_v1_agents_create_or_update_aliasop.py +26 -0
- mistralai/models/agents_api_v1_agents_get_versionop.py +21 -0
- mistralai/models/agents_api_v1_agents_getop.py +12 -3
- mistralai/models/agents_api_v1_agents_list_version_aliasesop.py +16 -0
- mistralai/models/agents_api_v1_agents_list_versionsop.py +33 -0
- mistralai/models/agents_api_v1_agents_listop.py +4 -0
- mistralai/models/agentscompletionrequest.py +2 -5
- mistralai/models/agentscompletionstreamrequest.py +2 -5
- mistralai/models/archiveftmodelout.py +1 -1
- mistralai/models/assistantmessage.py +1 -1
- mistralai/models/audiochunk.py +1 -1
- mistralai/models/audioencoding.py +6 -1
- mistralai/models/audioformat.py +2 -4
- mistralai/models/audiotranscriptionrequest.py +8 -0
- mistralai/models/audiotranscriptionrequeststream.py +8 -0
- mistralai/models/basemodelcard.py +1 -1
- mistralai/models/batchjobin.py +2 -4
- mistralai/models/batchjobout.py +1 -1
- mistralai/models/batchjobsout.py +1 -1
- mistralai/models/chatcompletionchoice.py +10 -5
- mistralai/models/chatcompletionrequest.py +2 -5
- mistralai/models/chatcompletionstreamrequest.py +2 -5
- mistralai/models/classifierdetailedjobout.py +4 -2
- mistralai/models/classifierftmodelout.py +3 -2
- mistralai/models/classifierjobout.py +4 -2
- mistralai/models/codeinterpretertool.py +1 -1
- mistralai/models/completiondetailedjobout.py +5 -2
- mistralai/models/completionftmodelout.py +3 -2
- mistralai/models/completionjobout.py +5 -2
- mistralai/models/completionresponsestreamchoice.py +9 -8
- mistralai/models/conversationappendrequest.py +4 -1
- mistralai/models/conversationappendstreamrequest.py +4 -1
- mistralai/models/conversationhistory.py +2 -1
- mistralai/models/conversationmessages.py +1 -1
- mistralai/models/conversationrequest.py +13 -3
- mistralai/models/conversationresponse.py +2 -1
- mistralai/models/conversationrestartrequest.py +22 -5
- mistralai/models/conversationrestartstreamrequest.py +24 -5
- mistralai/models/conversationstreamrequest.py +17 -3
- mistralai/models/documentlibrarytool.py +1 -1
- mistralai/models/documenturlchunk.py +1 -1
- mistralai/models/embeddingdtype.py +7 -1
- mistralai/models/encodingformat.py +4 -1
- mistralai/models/entitytype.py +8 -1
- mistralai/models/filepurpose.py +8 -1
- mistralai/models/files_api_routes_list_filesop.py +12 -12
- mistralai/models/files_api_routes_upload_fileop.py +2 -6
- mistralai/models/fileschema.py +3 -5
- mistralai/models/finetuneablemodeltype.py +4 -1
- mistralai/models/ftclassifierlossfunction.py +4 -1
- mistralai/models/ftmodelcard.py +1 -1
- mistralai/models/functioncallentry.py +3 -2
- mistralai/models/functioncallevent.py +1 -1
- mistralai/models/functionresultentry.py +3 -2
- mistralai/models/functiontool.py +1 -1
- mistralai/models/githubrepositoryin.py +1 -1
- mistralai/models/githubrepositoryout.py +1 -1
- mistralai/models/httpvalidationerror.py +4 -2
- mistralai/models/imagegenerationtool.py +1 -1
- mistralai/models/imageurlchunk.py +1 -1
- mistralai/models/jobsout.py +1 -1
- mistralai/models/legacyjobmetadataout.py +1 -1
- mistralai/models/messageinputentry.py +9 -3
- mistralai/models/messageoutputentry.py +6 -3
- mistralai/models/messageoutputevent.py +4 -2
- mistralai/models/mistralerror.py +11 -7
- mistralai/models/mistralpromptmode.py +5 -1
- mistralai/models/modelcapabilities.py +3 -0
- mistralai/models/modelconversation.py +1 -1
- mistralai/models/no_response_error.py +5 -1
- mistralai/models/ocrrequest.py +11 -1
- mistralai/models/ocrtableobject.py +4 -1
- mistralai/models/realtimetranscriptionerror.py +27 -0
- mistralai/models/realtimetranscriptionerrordetail.py +29 -0
- mistralai/models/realtimetranscriptionsession.py +20 -0
- mistralai/models/realtimetranscriptionsessioncreated.py +30 -0
- mistralai/models/realtimetranscriptionsessionupdated.py +30 -0
- mistralai/models/referencechunk.py +1 -1
- mistralai/models/requestsource.py +5 -1
- mistralai/models/responsedoneevent.py +1 -1
- mistralai/models/responseerrorevent.py +1 -1
- mistralai/models/responseformats.py +5 -1
- mistralai/models/responsestartedevent.py +1 -1
- mistralai/models/responsevalidationerror.py +2 -0
- mistralai/models/retrievefileout.py +3 -5
- mistralai/models/sampletype.py +7 -1
- mistralai/models/sdkerror.py +2 -0
- mistralai/models/shareenum.py +7 -1
- mistralai/models/sharingdelete.py +2 -4
- mistralai/models/sharingin.py +3 -5
- mistralai/models/source.py +8 -1
- mistralai/models/systemmessage.py +1 -1
- mistralai/models/textchunk.py +1 -1
- mistralai/models/thinkchunk.py +1 -1
- mistralai/models/timestampgranularity.py +4 -1
- mistralai/models/tool.py +2 -6
- mistralai/models/toolcall.py +2 -6
- mistralai/models/toolchoice.py +2 -6
- mistralai/models/toolchoiceenum.py +6 -1
- mistralai/models/toolexecutiondeltaevent.py +2 -1
- mistralai/models/toolexecutiondoneevent.py +2 -1
- mistralai/models/toolexecutionentry.py +4 -2
- mistralai/models/toolexecutionstartedevent.py +2 -1
- mistralai/models/toolfilechunk.py +2 -1
- mistralai/models/toolmessage.py +1 -1
- mistralai/models/toolreferencechunk.py +2 -1
- mistralai/models/tooltypes.py +1 -1
- mistralai/models/transcriptionsegmentchunk.py +42 -3
- mistralai/models/transcriptionstreamdone.py +1 -1
- mistralai/models/transcriptionstreamlanguage.py +1 -1
- mistralai/models/transcriptionstreamsegmentdelta.py +39 -3
- mistralai/models/transcriptionstreamtextdelta.py +1 -1
- mistralai/models/unarchiveftmodelout.py +1 -1
- mistralai/models/uploadfileout.py +3 -5
- mistralai/models/usermessage.py +1 -1
- mistralai/models/wandbintegration.py +1 -1
- mistralai/models/wandbintegrationout.py +1 -1
- mistralai/models/websearchpremiumtool.py +1 -1
- mistralai/models/websearchtool.py +1 -1
- mistralai/models_.py +24 -12
- mistralai/ocr.py +38 -10
- mistralai/sdk.py +2 -2
- mistralai/transcriptions.py +52 -12
- mistralai/types/basemodel.py +41 -3
- mistralai/utils/__init__.py +0 -3
- mistralai/utils/annotations.py +32 -8
- mistralai/utils/enums.py +60 -0
- mistralai/utils/forms.py +21 -10
- mistralai/utils/queryparams.py +14 -2
- mistralai/utils/requestbodies.py +3 -3
- mistralai/utils/retries.py +69 -5
- mistralai/utils/serializers.py +0 -20
- mistralai/utils/unmarshal_json_response.py +15 -1
- {mistralai-1.10.1.dist-info → mistralai-1.12.0.dist-info}/METADATA +28 -31
- {mistralai-1.10.1.dist-info → mistralai-1.12.0.dist-info}/RECORD +251 -237
- mistralai_azure/_version.py +3 -3
- mistralai_azure/basesdk.py +6 -0
- mistralai_azure/chat.py +27 -15
- mistralai_azure/httpclient.py +0 -1
- mistralai_azure/models/__init__.py +16 -1
- mistralai_azure/models/assistantmessage.py +1 -1
- mistralai_azure/models/chatcompletionchoice.py +10 -7
- mistralai_azure/models/chatcompletionrequest.py +8 -6
- mistralai_azure/models/chatcompletionstreamrequest.py +8 -6
- mistralai_azure/models/completionresponsestreamchoice.py +11 -7
- mistralai_azure/models/documenturlchunk.py +1 -1
- mistralai_azure/models/httpvalidationerror.py +4 -2
- mistralai_azure/models/imageurlchunk.py +1 -1
- mistralai_azure/models/mistralazureerror.py +11 -7
- mistralai_azure/models/mistralpromptmode.py +1 -1
- mistralai_azure/models/no_response_error.py +5 -1
- mistralai_azure/models/ocrpageobject.py +32 -5
- mistralai_azure/models/ocrrequest.py +20 -1
- mistralai_azure/models/ocrtableobject.py +34 -0
- mistralai_azure/models/referencechunk.py +1 -1
- mistralai_azure/models/responseformats.py +5 -1
- mistralai_azure/models/responsevalidationerror.py +2 -0
- mistralai_azure/models/sdkerror.py +2 -0
- mistralai_azure/models/systemmessage.py +1 -1
- mistralai_azure/models/textchunk.py +1 -1
- mistralai_azure/models/thinkchunk.py +1 -1
- mistralai_azure/models/tool.py +2 -6
- mistralai_azure/models/toolcall.py +2 -6
- mistralai_azure/models/toolchoice.py +2 -6
- mistralai_azure/models/toolchoiceenum.py +6 -1
- mistralai_azure/models/toolmessage.py +1 -1
- mistralai_azure/models/tooltypes.py +1 -1
- mistralai_azure/models/usermessage.py +1 -1
- mistralai_azure/ocr.py +26 -6
- mistralai_azure/types/basemodel.py +41 -3
- mistralai_azure/utils/__init__.py +0 -3
- mistralai_azure/utils/annotations.py +32 -8
- mistralai_azure/utils/enums.py +60 -0
- mistralai_azure/utils/forms.py +21 -10
- mistralai_azure/utils/queryparams.py +14 -2
- mistralai_azure/utils/requestbodies.py +3 -3
- mistralai_azure/utils/retries.py +69 -5
- mistralai_azure/utils/serializers.py +0 -20
- mistralai_azure/utils/unmarshal_json_response.py +15 -1
- mistralai_gcp/_version.py +3 -3
- mistralai_gcp/basesdk.py +6 -0
- mistralai_gcp/chat.py +27 -15
- mistralai_gcp/fim.py +27 -15
- mistralai_gcp/httpclient.py +0 -1
- mistralai_gcp/models/assistantmessage.py +1 -1
- mistralai_gcp/models/chatcompletionchoice.py +10 -7
- mistralai_gcp/models/chatcompletionrequest.py +8 -6
- mistralai_gcp/models/chatcompletionstreamrequest.py +8 -6
- mistralai_gcp/models/completionresponsestreamchoice.py +11 -7
- mistralai_gcp/models/fimcompletionrequest.py +6 -1
- mistralai_gcp/models/fimcompletionstreamrequest.py +6 -1
- mistralai_gcp/models/httpvalidationerror.py +4 -2
- mistralai_gcp/models/imageurlchunk.py +1 -1
- mistralai_gcp/models/mistralgcperror.py +11 -7
- mistralai_gcp/models/mistralpromptmode.py +1 -1
- mistralai_gcp/models/no_response_error.py +5 -1
- mistralai_gcp/models/referencechunk.py +1 -1
- mistralai_gcp/models/responseformats.py +5 -1
- mistralai_gcp/models/responsevalidationerror.py +2 -0
- mistralai_gcp/models/sdkerror.py +2 -0
- mistralai_gcp/models/systemmessage.py +1 -1
- mistralai_gcp/models/textchunk.py +1 -1
- mistralai_gcp/models/thinkchunk.py +1 -1
- mistralai_gcp/models/tool.py +2 -6
- mistralai_gcp/models/toolcall.py +2 -6
- mistralai_gcp/models/toolchoice.py +2 -6
- mistralai_gcp/models/toolchoiceenum.py +6 -1
- mistralai_gcp/models/toolmessage.py +1 -1
- mistralai_gcp/models/tooltypes.py +1 -1
- mistralai_gcp/models/usermessage.py +1 -1
- mistralai_gcp/types/basemodel.py +41 -3
- mistralai_gcp/utils/__init__.py +0 -3
- mistralai_gcp/utils/annotations.py +32 -8
- mistralai_gcp/utils/enums.py +60 -0
- mistralai_gcp/utils/forms.py +21 -10
- mistralai_gcp/utils/queryparams.py +14 -2
- mistralai_gcp/utils/requestbodies.py +3 -3
- mistralai_gcp/utils/retries.py +69 -5
- mistralai_gcp/utils/serializers.py +0 -20
- mistralai_gcp/utils/unmarshal_json_response.py +15 -1
- {mistralai-1.10.1.dist-info → mistralai-1.12.0.dist-info}/WHEEL +0 -0
- {mistralai-1.10.1.dist-info → mistralai-1.12.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -5,11 +5,26 @@ from .completionargs import CompletionArgs, CompletionArgsTypedDict
|
|
|
5
5
|
from .conversationinputs import ConversationInputs, ConversationInputsTypedDict
|
|
6
6
|
from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
7
7
|
from pydantic import model_serializer
|
|
8
|
-
from typing import Any, Dict, Literal, Optional
|
|
9
|
-
from typing_extensions import NotRequired, TypedDict
|
|
8
|
+
from typing import Any, Dict, Literal, Optional, Union
|
|
9
|
+
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
ConversationRestartRequestHandoffExecution = Literal[
|
|
12
|
+
ConversationRestartRequestHandoffExecution = Literal[
|
|
13
|
+
"client",
|
|
14
|
+
"server",
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
ConversationRestartRequestAgentVersionTypedDict = TypeAliasType(
|
|
19
|
+
"ConversationRestartRequestAgentVersionTypedDict", Union[str, int]
|
|
20
|
+
)
|
|
21
|
+
r"""Specific version of the agent to use when restarting. If not provided, uses the current version."""
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
ConversationRestartRequestAgentVersion = TypeAliasType(
|
|
25
|
+
"ConversationRestartRequestAgentVersion", Union[str, int]
|
|
26
|
+
)
|
|
27
|
+
r"""Specific version of the agent to use when restarting. If not provided, uses the current version."""
|
|
13
28
|
|
|
14
29
|
|
|
15
30
|
class ConversationRestartRequestTypedDict(TypedDict):
|
|
@@ -25,7 +40,9 @@ class ConversationRestartRequestTypedDict(TypedDict):
|
|
|
25
40
|
r"""White-listed arguments from the completion API"""
|
|
26
41
|
metadata: NotRequired[Nullable[Dict[str, Any]]]
|
|
27
42
|
r"""Custom metadata for the conversation."""
|
|
28
|
-
agent_version: NotRequired[
|
|
43
|
+
agent_version: NotRequired[
|
|
44
|
+
Nullable[ConversationRestartRequestAgentVersionTypedDict]
|
|
45
|
+
]
|
|
29
46
|
r"""Specific version of the agent to use when restarting. If not provided, uses the current version."""
|
|
30
47
|
|
|
31
48
|
|
|
@@ -49,7 +66,7 @@ class ConversationRestartRequest(BaseModel):
|
|
|
49
66
|
metadata: OptionalNullable[Dict[str, Any]] = UNSET
|
|
50
67
|
r"""Custom metadata for the conversation."""
|
|
51
68
|
|
|
52
|
-
agent_version: OptionalNullable[
|
|
69
|
+
agent_version: OptionalNullable[ConversationRestartRequestAgentVersion] = UNSET
|
|
53
70
|
r"""Specific version of the agent to use when restarting. If not provided, uses the current version."""
|
|
54
71
|
|
|
55
72
|
@model_serializer(mode="wrap")
|
|
@@ -5,11 +5,26 @@ from .completionargs import CompletionArgs, CompletionArgsTypedDict
|
|
|
5
5
|
from .conversationinputs import ConversationInputs, ConversationInputsTypedDict
|
|
6
6
|
from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
7
7
|
from pydantic import model_serializer
|
|
8
|
-
from typing import Any, Dict, Literal, Optional
|
|
9
|
-
from typing_extensions import NotRequired, TypedDict
|
|
8
|
+
from typing import Any, Dict, Literal, Optional, Union
|
|
9
|
+
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
ConversationRestartStreamRequestHandoffExecution = Literal[
|
|
12
|
+
ConversationRestartStreamRequestHandoffExecution = Literal[
|
|
13
|
+
"client",
|
|
14
|
+
"server",
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
ConversationRestartStreamRequestAgentVersionTypedDict = TypeAliasType(
|
|
19
|
+
"ConversationRestartStreamRequestAgentVersionTypedDict", Union[str, int]
|
|
20
|
+
)
|
|
21
|
+
r"""Specific version of the agent to use when restarting. If not provided, uses the current version."""
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
ConversationRestartStreamRequestAgentVersion = TypeAliasType(
|
|
25
|
+
"ConversationRestartStreamRequestAgentVersion", Union[str, int]
|
|
26
|
+
)
|
|
27
|
+
r"""Specific version of the agent to use when restarting. If not provided, uses the current version."""
|
|
13
28
|
|
|
14
29
|
|
|
15
30
|
class ConversationRestartStreamRequestTypedDict(TypedDict):
|
|
@@ -25,7 +40,9 @@ class ConversationRestartStreamRequestTypedDict(TypedDict):
|
|
|
25
40
|
r"""White-listed arguments from the completion API"""
|
|
26
41
|
metadata: NotRequired[Nullable[Dict[str, Any]]]
|
|
27
42
|
r"""Custom metadata for the conversation."""
|
|
28
|
-
agent_version: NotRequired[
|
|
43
|
+
agent_version: NotRequired[
|
|
44
|
+
Nullable[ConversationRestartStreamRequestAgentVersionTypedDict]
|
|
45
|
+
]
|
|
29
46
|
r"""Specific version of the agent to use when restarting. If not provided, uses the current version."""
|
|
30
47
|
|
|
31
48
|
|
|
@@ -51,7 +68,9 @@ class ConversationRestartStreamRequest(BaseModel):
|
|
|
51
68
|
metadata: OptionalNullable[Dict[str, Any]] = UNSET
|
|
52
69
|
r"""Custom metadata for the conversation."""
|
|
53
70
|
|
|
54
|
-
agent_version: OptionalNullable[
|
|
71
|
+
agent_version: OptionalNullable[ConversationRestartStreamRequestAgentVersion] = (
|
|
72
|
+
UNSET
|
|
73
|
+
)
|
|
55
74
|
r"""Specific version of the agent to use when restarting. If not provided, uses the current version."""
|
|
56
75
|
|
|
57
76
|
@model_serializer(mode="wrap")
|
|
@@ -16,7 +16,11 @@ from typing import Any, Dict, List, Literal, Optional, Union
|
|
|
16
16
|
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
ConversationStreamRequestHandoffExecution = Literal[
|
|
19
|
+
ConversationStreamRequestHandoffExecution = Literal[
|
|
20
|
+
"client",
|
|
21
|
+
"server",
|
|
22
|
+
]
|
|
23
|
+
|
|
20
24
|
|
|
21
25
|
ConversationStreamRequestToolsTypedDict = TypeAliasType(
|
|
22
26
|
"ConversationStreamRequestToolsTypedDict",
|
|
@@ -44,6 +48,16 @@ ConversationStreamRequestTools = Annotated[
|
|
|
44
48
|
]
|
|
45
49
|
|
|
46
50
|
|
|
51
|
+
ConversationStreamRequestAgentVersionTypedDict = TypeAliasType(
|
|
52
|
+
"ConversationStreamRequestAgentVersionTypedDict", Union[str, int]
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
ConversationStreamRequestAgentVersion = TypeAliasType(
|
|
57
|
+
"ConversationStreamRequestAgentVersion", Union[str, int]
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
|
|
47
61
|
class ConversationStreamRequestTypedDict(TypedDict):
|
|
48
62
|
inputs: ConversationInputsTypedDict
|
|
49
63
|
stream: NotRequired[bool]
|
|
@@ -57,7 +71,7 @@ class ConversationStreamRequestTypedDict(TypedDict):
|
|
|
57
71
|
description: NotRequired[Nullable[str]]
|
|
58
72
|
metadata: NotRequired[Nullable[Dict[str, Any]]]
|
|
59
73
|
agent_id: NotRequired[Nullable[str]]
|
|
60
|
-
agent_version: NotRequired[Nullable[
|
|
74
|
+
agent_version: NotRequired[Nullable[ConversationStreamRequestAgentVersionTypedDict]]
|
|
61
75
|
model: NotRequired[Nullable[str]]
|
|
62
76
|
|
|
63
77
|
|
|
@@ -87,7 +101,7 @@ class ConversationStreamRequest(BaseModel):
|
|
|
87
101
|
|
|
88
102
|
agent_id: OptionalNullable[str] = UNSET
|
|
89
103
|
|
|
90
|
-
agent_version: OptionalNullable[
|
|
104
|
+
agent_version: OptionalNullable[ConversationStreamRequestAgentVersion] = UNSET
|
|
91
105
|
|
|
92
106
|
model: OptionalNullable[str] = UNSET
|
|
93
107
|
|
|
@@ -6,7 +6,7 @@ from typing import List, Literal, Optional
|
|
|
6
6
|
from typing_extensions import NotRequired, TypedDict
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
DocumentLibraryToolType = Literal["document_library"]
|
|
9
|
+
DocumentLibraryToolType = Literal["document_library",]
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class DocumentLibraryToolTypedDict(TypedDict):
|
mistralai/models/entitytype.py
CHANGED
|
@@ -5,5 +5,12 @@ from mistralai.types import UnrecognizedStr
|
|
|
5
5
|
from typing import Literal, Union
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
EntityType = Union[
|
|
8
|
+
EntityType = Union[
|
|
9
|
+
Literal[
|
|
10
|
+
"User",
|
|
11
|
+
"Workspace",
|
|
12
|
+
"Org",
|
|
13
|
+
],
|
|
14
|
+
UnrecognizedStr,
|
|
15
|
+
]
|
|
9
16
|
r"""The type of entity, used to share a library."""
|
mistralai/models/filepurpose.py
CHANGED
|
@@ -5,4 +5,11 @@ from mistralai.types import UnrecognizedStr
|
|
|
5
5
|
from typing import Literal, Union
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
FilePurpose = Union[
|
|
8
|
+
FilePurpose = Union[
|
|
9
|
+
Literal[
|
|
10
|
+
"fine-tune",
|
|
11
|
+
"batch",
|
|
12
|
+
"ocr",
|
|
13
|
+
],
|
|
14
|
+
UnrecognizedStr,
|
|
15
|
+
]
|
|
@@ -5,9 +5,8 @@ from .filepurpose import FilePurpose
|
|
|
5
5
|
from .sampletype import SampleType
|
|
6
6
|
from .source import Source
|
|
7
7
|
from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
8
|
-
from mistralai.utils import FieldMetadata, QueryParamMetadata
|
|
8
|
+
from mistralai.utils import FieldMetadata, QueryParamMetadata
|
|
9
9
|
from pydantic import model_serializer
|
|
10
|
-
from pydantic.functional_validators import PlainValidator
|
|
11
10
|
from typing import List, Optional
|
|
12
11
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
13
12
|
|
|
@@ -20,6 +19,7 @@ class FilesAPIRoutesListFilesRequestTypedDict(TypedDict):
|
|
|
20
19
|
source: NotRequired[Nullable[List[Source]]]
|
|
21
20
|
search: NotRequired[Nullable[str]]
|
|
22
21
|
purpose: NotRequired[Nullable[FilePurpose]]
|
|
22
|
+
mimetypes: NotRequired[Nullable[List[str]]]
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
class FilesAPIRoutesListFilesRequest(BaseModel):
|
|
@@ -39,16 +39,12 @@ class FilesAPIRoutesListFilesRequest(BaseModel):
|
|
|
39
39
|
] = True
|
|
40
40
|
|
|
41
41
|
sample_type: Annotated[
|
|
42
|
-
OptionalNullable[
|
|
43
|
-
List[Annotated[SampleType, PlainValidator(validate_open_enum(False))]]
|
|
44
|
-
],
|
|
42
|
+
OptionalNullable[List[SampleType]],
|
|
45
43
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
46
44
|
] = UNSET
|
|
47
45
|
|
|
48
46
|
source: Annotated[
|
|
49
|
-
OptionalNullable[
|
|
50
|
-
List[Annotated[Source, PlainValidator(validate_open_enum(False))]]
|
|
51
|
-
],
|
|
47
|
+
OptionalNullable[List[Source]],
|
|
52
48
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
53
49
|
] = UNSET
|
|
54
50
|
|
|
@@ -58,9 +54,12 @@ class FilesAPIRoutesListFilesRequest(BaseModel):
|
|
|
58
54
|
] = UNSET
|
|
59
55
|
|
|
60
56
|
purpose: Annotated[
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
57
|
+
OptionalNullable[FilePurpose],
|
|
58
|
+
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
59
|
+
] = UNSET
|
|
60
|
+
|
|
61
|
+
mimetypes: Annotated[
|
|
62
|
+
OptionalNullable[List[str]],
|
|
64
63
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
65
64
|
] = UNSET
|
|
66
65
|
|
|
@@ -74,8 +73,9 @@ class FilesAPIRoutesListFilesRequest(BaseModel):
|
|
|
74
73
|
"source",
|
|
75
74
|
"search",
|
|
76
75
|
"purpose",
|
|
76
|
+
"mimetypes",
|
|
77
77
|
]
|
|
78
|
-
nullable_fields = ["sample_type", "source", "search", "purpose"]
|
|
78
|
+
nullable_fields = ["sample_type", "source", "search", "purpose", "mimetypes"]
|
|
79
79
|
null_default_fields = []
|
|
80
80
|
|
|
81
81
|
serialized = handler(self)
|
|
@@ -4,8 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
from .file import File, FileTypedDict
|
|
5
5
|
from .filepurpose import FilePurpose
|
|
6
6
|
from mistralai.types import BaseModel
|
|
7
|
-
from mistralai.utils import FieldMetadata, MultipartFormMetadata
|
|
8
|
-
from pydantic.functional_validators import PlainValidator
|
|
7
|
+
from mistralai.utils import FieldMetadata, MultipartFormMetadata
|
|
9
8
|
from typing import Optional
|
|
10
9
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
11
10
|
|
|
@@ -38,7 +37,4 @@ class FilesAPIRoutesUploadFileMultiPartBodyParams(BaseModel):
|
|
|
38
37
|
```
|
|
39
38
|
"""
|
|
40
39
|
|
|
41
|
-
purpose: Annotated[
|
|
42
|
-
Annotated[Optional[FilePurpose], PlainValidator(validate_open_enum(False))],
|
|
43
|
-
FieldMetadata(multipart=True),
|
|
44
|
-
] = None
|
|
40
|
+
purpose: Annotated[Optional[FilePurpose], FieldMetadata(multipart=True)] = None
|
mistralai/models/fileschema.py
CHANGED
|
@@ -5,10 +5,8 @@ from .filepurpose import FilePurpose
|
|
|
5
5
|
from .sampletype import SampleType
|
|
6
6
|
from .source import Source
|
|
7
7
|
from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
8
|
-
from mistralai.utils import validate_open_enum
|
|
9
8
|
import pydantic
|
|
10
9
|
from pydantic import model_serializer
|
|
11
|
-
from pydantic.functional_validators import PlainValidator
|
|
12
10
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
13
11
|
|
|
14
12
|
|
|
@@ -47,11 +45,11 @@ class FileSchema(BaseModel):
|
|
|
47
45
|
filename: str
|
|
48
46
|
r"""The name of the uploaded file."""
|
|
49
47
|
|
|
50
|
-
purpose:
|
|
48
|
+
purpose: FilePurpose
|
|
51
49
|
|
|
52
|
-
sample_type:
|
|
50
|
+
sample_type: SampleType
|
|
53
51
|
|
|
54
|
-
source:
|
|
52
|
+
source: Source
|
|
55
53
|
|
|
56
54
|
num_lines: OptionalNullable[int] = UNSET
|
|
57
55
|
|
mistralai/models/ftmodelcard.py
CHANGED
|
@@ -12,9 +12,10 @@ from typing import Literal, Optional
|
|
|
12
12
|
from typing_extensions import NotRequired, TypedDict
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
FunctionCallEntryObject = Literal["entry"]
|
|
15
|
+
FunctionCallEntryObject = Literal["entry",]
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
FunctionCallEntryType = Literal["function.call",]
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
class FunctionCallEntryTypedDict(TypedDict):
|
|
@@ -7,7 +7,7 @@ from typing import Literal, Optional
|
|
|
7
7
|
from typing_extensions import NotRequired, TypedDict
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
FunctionCallEventType = Literal["function.call.delta"]
|
|
10
|
+
FunctionCallEventType = Literal["function.call.delta",]
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class FunctionCallEventTypedDict(TypedDict):
|
|
@@ -8,9 +8,10 @@ from typing import Literal, Optional
|
|
|
8
8
|
from typing_extensions import NotRequired, TypedDict
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
FunctionResultEntryObject = Literal["entry"]
|
|
11
|
+
FunctionResultEntryObject = Literal["entry",]
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
|
|
14
|
+
FunctionResultEntryType = Literal["function.result",]
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
class FunctionResultEntryTypedDict(TypedDict):
|
mistralai/models/functiontool.py
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from .validationerror import ValidationError
|
|
5
|
+
from dataclasses import dataclass, field
|
|
5
6
|
import httpx
|
|
6
7
|
from mistralai.models import MistralError
|
|
7
8
|
from mistralai.types import BaseModel
|
|
@@ -12,8 +13,9 @@ class HTTPValidationErrorData(BaseModel):
|
|
|
12
13
|
detail: Optional[List[ValidationError]] = None
|
|
13
14
|
|
|
14
15
|
|
|
16
|
+
@dataclass(unsafe_hash=True)
|
|
15
17
|
class HTTPValidationError(MistralError):
|
|
16
|
-
data: HTTPValidationErrorData
|
|
18
|
+
data: HTTPValidationErrorData = field(hash=False)
|
|
17
19
|
|
|
18
20
|
def __init__(
|
|
19
21
|
self,
|
|
@@ -23,4 +25,4 @@ class HTTPValidationError(MistralError):
|
|
|
23
25
|
):
|
|
24
26
|
message = body or raw_response.text
|
|
25
27
|
super().__init__(message, raw_response, body)
|
|
26
|
-
self
|
|
28
|
+
object.__setattr__(self, "data", data)
|
|
@@ -15,7 +15,7 @@ ImageURLChunkImageURLTypedDict = TypeAliasType(
|
|
|
15
15
|
ImageURLChunkImageURL = TypeAliasType("ImageURLChunkImageURL", Union[ImageURL, str])
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
ImageURLChunkType = Literal["image_url"]
|
|
18
|
+
ImageURLChunkType = Literal["image_url",]
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
class ImageURLChunkTypedDict(TypedDict):
|
mistralai/models/jobsout.py
CHANGED
|
@@ -7,7 +7,7 @@ from typing import Literal, Optional
|
|
|
7
7
|
from typing_extensions import NotRequired, TypedDict
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
LegacyJobMetadataOutObject = Literal["job.metadata"]
|
|
10
|
+
LegacyJobMetadataOutObject = Literal["job.metadata",]
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class LegacyJobMetadataOutTypedDict(TypedDict):
|
|
@@ -12,11 +12,17 @@ from typing import List, Literal, Optional, Union
|
|
|
12
12
|
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
Object = Literal["entry"]
|
|
15
|
+
Object = Literal["entry",]
|
|
16
16
|
|
|
17
|
-
MessageInputEntryType = Literal["message.input"]
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
MessageInputEntryType = Literal["message.input",]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
MessageInputEntryRole = Literal[
|
|
22
|
+
"assistant",
|
|
23
|
+
"user",
|
|
24
|
+
]
|
|
25
|
+
|
|
20
26
|
|
|
21
27
|
MessageInputEntryContentTypedDict = TypeAliasType(
|
|
22
28
|
"MessageInputEntryContentTypedDict",
|
|
@@ -12,11 +12,14 @@ from typing import List, Literal, Optional, Union
|
|
|
12
12
|
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
MessageOutputEntryObject = Literal["entry"]
|
|
15
|
+
MessageOutputEntryObject = Literal["entry",]
|
|
16
16
|
|
|
17
|
-
MessageOutputEntryType = Literal["message.output"]
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
MessageOutputEntryType = Literal["message.output",]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
MessageOutputEntryRole = Literal["assistant",]
|
|
22
|
+
|
|
20
23
|
|
|
21
24
|
MessageOutputEntryContentTypedDict = TypeAliasType(
|
|
22
25
|
"MessageOutputEntryContentTypedDict",
|
|
@@ -9,9 +9,11 @@ from typing import Literal, Optional, Union
|
|
|
9
9
|
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
MessageOutputEventType = Literal["message.output.delta"]
|
|
12
|
+
MessageOutputEventType = Literal["message.output.delta",]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
MessageOutputEventRole = Literal["assistant",]
|
|
13
16
|
|
|
14
|
-
MessageOutputEventRole = Literal["assistant"]
|
|
15
17
|
|
|
16
18
|
MessageOutputEventContentTypedDict = TypeAliasType(
|
|
17
19
|
"MessageOutputEventContentTypedDict", Union[str, OutputContentChunksTypedDict]
|
mistralai/models/mistralerror.py
CHANGED
|
@@ -2,25 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
import httpx
|
|
4
4
|
from typing import Optional
|
|
5
|
+
from dataclasses import dataclass, field
|
|
5
6
|
|
|
6
7
|
|
|
8
|
+
@dataclass(unsafe_hash=True)
|
|
7
9
|
class MistralError(Exception):
|
|
8
10
|
"""The base class for all HTTP error responses."""
|
|
9
11
|
|
|
10
12
|
message: str
|
|
11
13
|
status_code: int
|
|
12
14
|
body: str
|
|
13
|
-
headers: httpx.Headers
|
|
14
|
-
raw_response: httpx.Response
|
|
15
|
+
headers: httpx.Headers = field(hash=False)
|
|
16
|
+
raw_response: httpx.Response = field(hash=False)
|
|
15
17
|
|
|
16
18
|
def __init__(
|
|
17
19
|
self, message: str, raw_response: httpx.Response, body: Optional[str] = None
|
|
18
20
|
):
|
|
19
|
-
self
|
|
20
|
-
self
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
object.__setattr__(self, "message", message)
|
|
22
|
+
object.__setattr__(self, "status_code", raw_response.status_code)
|
|
23
|
+
object.__setattr__(
|
|
24
|
+
self, "body", body if body is not None else raw_response.text
|
|
25
|
+
)
|
|
26
|
+
object.__setattr__(self, "headers", raw_response.headers)
|
|
27
|
+
object.__setattr__(self, "raw_response", raw_response)
|
|
24
28
|
|
|
25
29
|
def __str__(self):
|
|
26
30
|
return self.message
|
|
@@ -5,4 +5,8 @@ from mistralai.types import UnrecognizedStr
|
|
|
5
5
|
from typing import Literal, Union
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
MistralPromptMode = Union[Literal["reasoning"], UnrecognizedStr]
|
|
8
|
+
MistralPromptMode = Union[Literal["reasoning",], UnrecognizedStr]
|
|
9
|
+
r"""Available options to the prompt_mode argument on the chat completion endpoint.
|
|
10
|
+
Values represent high-level intent. Assignment to actual SPs is handled internally.
|
|
11
|
+
System prompt may include knowledge cutoff date, model capabilities, tone to use, safety guidelines, etc.
|
|
12
|
+
"""
|
|
@@ -16,6 +16,7 @@ class ModelCapabilitiesTypedDict(TypedDict):
|
|
|
16
16
|
classification: NotRequired[bool]
|
|
17
17
|
moderation: NotRequired[bool]
|
|
18
18
|
audio: NotRequired[bool]
|
|
19
|
+
audio_transcription: NotRequired[bool]
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
class ModelCapabilities(BaseModel):
|
|
@@ -36,3 +37,5 @@ class ModelCapabilities(BaseModel):
|
|
|
36
37
|
moderation: Optional[bool] = False
|
|
37
38
|
|
|
38
39
|
audio: Optional[bool] = False
|
|
40
|
+
|
|
41
|
+
audio_transcription: Optional[bool] = False
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@dataclass(unsafe_hash=True)
|
|
3
7
|
class NoResponseError(Exception):
|
|
4
8
|
"""Error raised when no HTTP response is received from the server."""
|
|
5
9
|
|
|
6
10
|
message: str
|
|
7
11
|
|
|
8
12
|
def __init__(self, message: str = "No response received"):
|
|
9
|
-
self
|
|
13
|
+
object.__setattr__(self, "message", message)
|
|
10
14
|
super().__init__(message)
|
|
11
15
|
|
|
12
16
|
def __str__(self):
|