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
|
@@ -0,0 +1,33 @@
|
|
|
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, QueryParamMetadata
|
|
6
|
+
from typing import Optional
|
|
7
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AgentsAPIV1AgentsListVersionsRequestTypedDict(TypedDict):
|
|
11
|
+
agent_id: str
|
|
12
|
+
page: NotRequired[int]
|
|
13
|
+
r"""Page number (0-indexed)"""
|
|
14
|
+
page_size: NotRequired[int]
|
|
15
|
+
r"""Number of versions per page"""
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class AgentsAPIV1AgentsListVersionsRequest(BaseModel):
|
|
19
|
+
agent_id: Annotated[
|
|
20
|
+
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
page: Annotated[
|
|
24
|
+
Optional[int],
|
|
25
|
+
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
26
|
+
] = 0
|
|
27
|
+
r"""Page number (0-indexed)"""
|
|
28
|
+
|
|
29
|
+
page_size: Annotated[
|
|
30
|
+
Optional[int],
|
|
31
|
+
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
32
|
+
] = 20
|
|
33
|
+
r"""Number of versions per page"""
|
|
@@ -11,7 +11,9 @@ from typing_extensions import Annotated, NotRequired, TypedDict
|
|
|
11
11
|
|
|
12
12
|
class AgentsAPIV1AgentsListRequestTypedDict(TypedDict):
|
|
13
13
|
page: NotRequired[int]
|
|
14
|
+
r"""Page number (0-indexed)"""
|
|
14
15
|
page_size: NotRequired[int]
|
|
16
|
+
r"""Number of agents per page"""
|
|
15
17
|
deployment_chat: NotRequired[Nullable[bool]]
|
|
16
18
|
sources: NotRequired[Nullable[List[RequestSource]]]
|
|
17
19
|
name: NotRequired[Nullable[str]]
|
|
@@ -24,11 +26,13 @@ class AgentsAPIV1AgentsListRequest(BaseModel):
|
|
|
24
26
|
Optional[int],
|
|
25
27
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
26
28
|
] = 0
|
|
29
|
+
r"""Page number (0-indexed)"""
|
|
27
30
|
|
|
28
31
|
page_size: Annotated[
|
|
29
32
|
Optional[int],
|
|
30
33
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
31
34
|
] = 20
|
|
35
|
+
r"""Number of agents per page"""
|
|
32
36
|
|
|
33
37
|
deployment_chat: Annotated[
|
|
34
38
|
OptionalNullable[bool],
|
|
@@ -12,9 +12,8 @@ from .toolchoiceenum import ToolChoiceEnum
|
|
|
12
12
|
from .toolmessage import ToolMessage, ToolMessageTypedDict
|
|
13
13
|
from .usermessage import UserMessage, UserMessageTypedDict
|
|
14
14
|
from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
15
|
-
from mistralai.utils import get_discriminator
|
|
15
|
+
from mistralai.utils import get_discriminator
|
|
16
16
|
from pydantic import Discriminator, Tag, model_serializer
|
|
17
|
-
from pydantic.functional_validators import PlainValidator
|
|
18
17
|
from typing import Any, Dict, List, Optional, Union
|
|
19
18
|
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
20
19
|
|
|
@@ -137,9 +136,7 @@ class AgentsCompletionRequest(BaseModel):
|
|
|
137
136
|
|
|
138
137
|
parallel_tool_calls: Optional[bool] = None
|
|
139
138
|
|
|
140
|
-
prompt_mode:
|
|
141
|
-
OptionalNullable[MistralPromptMode], PlainValidator(validate_open_enum(False))
|
|
142
|
-
] = UNSET
|
|
139
|
+
prompt_mode: OptionalNullable[MistralPromptMode] = UNSET
|
|
143
140
|
r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used."""
|
|
144
141
|
|
|
145
142
|
@model_serializer(mode="wrap")
|
|
@@ -12,9 +12,8 @@ from .toolchoiceenum import ToolChoiceEnum
|
|
|
12
12
|
from .toolmessage import ToolMessage, ToolMessageTypedDict
|
|
13
13
|
from .usermessage import UserMessage, UserMessageTypedDict
|
|
14
14
|
from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
15
|
-
from mistralai.utils import get_discriminator
|
|
15
|
+
from mistralai.utils import get_discriminator
|
|
16
16
|
from pydantic import Discriminator, Tag, model_serializer
|
|
17
|
-
from pydantic.functional_validators import PlainValidator
|
|
18
17
|
from typing import Any, Dict, List, Optional, Union
|
|
19
18
|
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
20
19
|
|
|
@@ -135,9 +134,7 @@ class AgentsCompletionStreamRequest(BaseModel):
|
|
|
135
134
|
|
|
136
135
|
parallel_tool_calls: Optional[bool] = None
|
|
137
136
|
|
|
138
|
-
prompt_mode:
|
|
139
|
-
OptionalNullable[MistralPromptMode], PlainValidator(validate_open_enum(False))
|
|
140
|
-
] = UNSET
|
|
137
|
+
prompt_mode: OptionalNullable[MistralPromptMode] = UNSET
|
|
141
138
|
r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used."""
|
|
142
139
|
|
|
143
140
|
@model_serializer(mode="wrap")
|
mistralai/models/audiochunk.py
CHANGED
|
@@ -7,7 +7,12 @@ from typing import Literal, Union
|
|
|
7
7
|
|
|
8
8
|
AudioEncoding = Union[
|
|
9
9
|
Literal[
|
|
10
|
-
"pcm_s16le",
|
|
10
|
+
"pcm_s16le",
|
|
11
|
+
"pcm_s32le",
|
|
12
|
+
"pcm_f16le",
|
|
13
|
+
"pcm_f32le",
|
|
14
|
+
"pcm_mulaw",
|
|
15
|
+
"pcm_alaw",
|
|
11
16
|
],
|
|
12
17
|
UnrecognizedStr,
|
|
13
18
|
]
|
mistralai/models/audioformat.py
CHANGED
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from .audioencoding import AudioEncoding
|
|
5
5
|
from mistralai.types import BaseModel
|
|
6
|
-
from
|
|
7
|
-
from pydantic.functional_validators import PlainValidator
|
|
8
|
-
from typing_extensions import Annotated, TypedDict
|
|
6
|
+
from typing_extensions import TypedDict
|
|
9
7
|
|
|
10
8
|
|
|
11
9
|
class AudioFormatTypedDict(TypedDict):
|
|
@@ -14,6 +12,6 @@ class AudioFormatTypedDict(TypedDict):
|
|
|
14
12
|
|
|
15
13
|
|
|
16
14
|
class AudioFormat(BaseModel):
|
|
17
|
-
encoding:
|
|
15
|
+
encoding: AudioEncoding
|
|
18
16
|
|
|
19
17
|
sample_rate: int
|
|
@@ -24,6 +24,8 @@ class AudioTranscriptionRequestTypedDict(TypedDict):
|
|
|
24
24
|
r"""Language of the audio, e.g. 'en'. Providing the language can boost accuracy."""
|
|
25
25
|
temperature: NotRequired[Nullable[float]]
|
|
26
26
|
stream: Literal[False]
|
|
27
|
+
diarize: NotRequired[bool]
|
|
28
|
+
context_bias: NotRequired[List[str]]
|
|
27
29
|
timestamp_granularities: NotRequired[List[TimestampGranularity]]
|
|
28
30
|
r"""Granularities of timestamps to include in the response."""
|
|
29
31
|
|
|
@@ -55,6 +57,10 @@ class AudioTranscriptionRequest(BaseModel):
|
|
|
55
57
|
FieldMetadata(multipart=True),
|
|
56
58
|
] = False
|
|
57
59
|
|
|
60
|
+
diarize: Annotated[Optional[bool], FieldMetadata(multipart=True)] = False
|
|
61
|
+
|
|
62
|
+
context_bias: Annotated[Optional[List[str]], FieldMetadata(multipart=True)] = None
|
|
63
|
+
|
|
58
64
|
timestamp_granularities: Annotated[
|
|
59
65
|
Optional[List[TimestampGranularity]], FieldMetadata(multipart=True)
|
|
60
66
|
] = None
|
|
@@ -69,6 +75,8 @@ class AudioTranscriptionRequest(BaseModel):
|
|
|
69
75
|
"language",
|
|
70
76
|
"temperature",
|
|
71
77
|
"stream",
|
|
78
|
+
"diarize",
|
|
79
|
+
"context_bias",
|
|
72
80
|
"timestamp_granularities",
|
|
73
81
|
]
|
|
74
82
|
nullable_fields = ["file_url", "file_id", "language", "temperature"]
|
|
@@ -23,6 +23,8 @@ class AudioTranscriptionRequestStreamTypedDict(TypedDict):
|
|
|
23
23
|
r"""Language of the audio, e.g. 'en'. Providing the language can boost accuracy."""
|
|
24
24
|
temperature: NotRequired[Nullable[float]]
|
|
25
25
|
stream: Literal[True]
|
|
26
|
+
diarize: NotRequired[bool]
|
|
27
|
+
context_bias: NotRequired[List[str]]
|
|
26
28
|
timestamp_granularities: NotRequired[List[TimestampGranularity]]
|
|
27
29
|
r"""Granularities of timestamps to include in the response."""
|
|
28
30
|
|
|
@@ -53,6 +55,10 @@ class AudioTranscriptionRequestStream(BaseModel):
|
|
|
53
55
|
FieldMetadata(multipart=True),
|
|
54
56
|
] = True
|
|
55
57
|
|
|
58
|
+
diarize: Annotated[Optional[bool], FieldMetadata(multipart=True)] = False
|
|
59
|
+
|
|
60
|
+
context_bias: Annotated[Optional[List[str]], FieldMetadata(multipart=True)] = None
|
|
61
|
+
|
|
56
62
|
timestamp_granularities: Annotated[
|
|
57
63
|
Optional[List[TimestampGranularity]], FieldMetadata(multipart=True)
|
|
58
64
|
] = None
|
|
@@ -67,6 +73,8 @@ class AudioTranscriptionRequestStream(BaseModel):
|
|
|
67
73
|
"language",
|
|
68
74
|
"temperature",
|
|
69
75
|
"stream",
|
|
76
|
+
"diarize",
|
|
77
|
+
"context_bias",
|
|
70
78
|
"timestamp_granularities",
|
|
71
79
|
]
|
|
72
80
|
nullable_fields = ["file_url", "file_id", "language", "temperature"]
|
mistralai/models/batchjobin.py
CHANGED
|
@@ -4,11 +4,9 @@ from __future__ import annotations
|
|
|
4
4
|
from .apiendpoint import APIEndpoint
|
|
5
5
|
from .batchrequest import BatchRequest, BatchRequestTypedDict
|
|
6
6
|
from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
7
|
-
from mistralai.utils import validate_open_enum
|
|
8
7
|
from pydantic import model_serializer
|
|
9
|
-
from pydantic.functional_validators import PlainValidator
|
|
10
8
|
from typing import Dict, List, Optional
|
|
11
|
-
from typing_extensions import
|
|
9
|
+
from typing_extensions import NotRequired, TypedDict
|
|
12
10
|
|
|
13
11
|
|
|
14
12
|
class BatchJobInTypedDict(TypedDict):
|
|
@@ -27,7 +25,7 @@ class BatchJobInTypedDict(TypedDict):
|
|
|
27
25
|
|
|
28
26
|
|
|
29
27
|
class BatchJobIn(BaseModel):
|
|
30
|
-
endpoint:
|
|
28
|
+
endpoint: APIEndpoint
|
|
31
29
|
|
|
32
30
|
input_files: OptionalNullable[List[str]] = UNSET
|
|
33
31
|
r"""The list of input files to be used for batch inference, these files should be `jsonl` files, containing the input data corresponding to the bory request for the batch inference in a \"body\" field. An example of such file is the following: ```json {\"custom_id\": \"0\", \"body\": {\"max_tokens\": 100, \"messages\": [{\"role\": \"user\", \"content\": \"What is the best French cheese?\"}]}} {\"custom_id\": \"1\", \"body\": {\"max_tokens\": 100, \"messages\": [{\"role\": \"user\", \"content\": \"What is the best French wine?\"}]}} ```"""
|
mistralai/models/batchjobout.py
CHANGED
mistralai/models/batchjobsout.py
CHANGED
|
@@ -3,14 +3,19 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from .assistantmessage import AssistantMessage, AssistantMessageTypedDict
|
|
5
5
|
from mistralai.types import BaseModel, UnrecognizedStr
|
|
6
|
-
from mistralai.utils import validate_open_enum
|
|
7
|
-
from pydantic.functional_validators import PlainValidator
|
|
8
6
|
from typing import Literal, Union
|
|
9
|
-
from typing_extensions import
|
|
7
|
+
from typing_extensions import TypedDict
|
|
10
8
|
|
|
11
9
|
|
|
12
10
|
FinishReason = Union[
|
|
13
|
-
Literal[
|
|
11
|
+
Literal[
|
|
12
|
+
"stop",
|
|
13
|
+
"length",
|
|
14
|
+
"model_length",
|
|
15
|
+
"error",
|
|
16
|
+
"tool_calls",
|
|
17
|
+
],
|
|
18
|
+
UnrecognizedStr,
|
|
14
19
|
]
|
|
15
20
|
|
|
16
21
|
|
|
@@ -25,4 +30,4 @@ class ChatCompletionChoice(BaseModel):
|
|
|
25
30
|
|
|
26
31
|
message: AssistantMessage
|
|
27
32
|
|
|
28
|
-
finish_reason:
|
|
33
|
+
finish_reason: FinishReason
|
|
@@ -12,9 +12,8 @@ from .toolchoiceenum import ToolChoiceEnum
|
|
|
12
12
|
from .toolmessage import ToolMessage, ToolMessageTypedDict
|
|
13
13
|
from .usermessage import UserMessage, UserMessageTypedDict
|
|
14
14
|
from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
15
|
-
from mistralai.utils import get_discriminator
|
|
15
|
+
from mistralai.utils import get_discriminator
|
|
16
16
|
from pydantic import Discriminator, Tag, model_serializer
|
|
17
|
-
from pydantic.functional_validators import PlainValidator
|
|
18
17
|
from typing import Any, Dict, List, Optional, Union
|
|
19
18
|
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
20
19
|
|
|
@@ -153,9 +152,7 @@ class ChatCompletionRequest(BaseModel):
|
|
|
153
152
|
parallel_tool_calls: Optional[bool] = None
|
|
154
153
|
r"""Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel."""
|
|
155
154
|
|
|
156
|
-
prompt_mode:
|
|
157
|
-
OptionalNullable[MistralPromptMode], PlainValidator(validate_open_enum(False))
|
|
158
|
-
] = UNSET
|
|
155
|
+
prompt_mode: OptionalNullable[MistralPromptMode] = UNSET
|
|
159
156
|
r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used."""
|
|
160
157
|
|
|
161
158
|
safe_prompt: Optional[bool] = None
|
|
@@ -12,9 +12,8 @@ from .toolchoiceenum import ToolChoiceEnum
|
|
|
12
12
|
from .toolmessage import ToolMessage, ToolMessageTypedDict
|
|
13
13
|
from .usermessage import UserMessage, UserMessageTypedDict
|
|
14
14
|
from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
15
|
-
from mistralai.utils import get_discriminator
|
|
15
|
+
from mistralai.utils import get_discriminator
|
|
16
16
|
from pydantic import Discriminator, Tag, model_serializer
|
|
17
|
-
from pydantic.functional_validators import PlainValidator
|
|
18
17
|
from typing import Any, Dict, List, Optional, Union
|
|
19
18
|
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
20
19
|
|
|
@@ -155,9 +154,7 @@ class ChatCompletionStreamRequest(BaseModel):
|
|
|
155
154
|
parallel_tool_calls: Optional[bool] = None
|
|
156
155
|
r"""Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel."""
|
|
157
156
|
|
|
158
|
-
prompt_mode:
|
|
159
|
-
OptionalNullable[MistralPromptMode], PlainValidator(validate_open_enum(False))
|
|
160
|
-
] = UNSET
|
|
157
|
+
prompt_mode: OptionalNullable[MistralPromptMode] = UNSET
|
|
161
158
|
r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used."""
|
|
162
159
|
|
|
163
160
|
safe_prompt: Optional[bool] = None
|
|
@@ -29,7 +29,9 @@ ClassifierDetailedJobOutStatus = Literal[
|
|
|
29
29
|
"CANCELLATION_REQUESTED",
|
|
30
30
|
]
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
|
|
33
|
+
ClassifierDetailedJobOutObject = Literal["job",]
|
|
34
|
+
|
|
33
35
|
|
|
34
36
|
ClassifierDetailedJobOutIntegrationsTypedDict = WandbIntegrationOutTypedDict
|
|
35
37
|
|
|
@@ -37,7 +39,7 @@ ClassifierDetailedJobOutIntegrationsTypedDict = WandbIntegrationOutTypedDict
|
|
|
37
39
|
ClassifierDetailedJobOutIntegrations = WandbIntegrationOut
|
|
38
40
|
|
|
39
41
|
|
|
40
|
-
ClassifierDetailedJobOutJobType = Literal["classifier"]
|
|
42
|
+
ClassifierDetailedJobOutJobType = Literal["classifier",]
|
|
41
43
|
|
|
42
44
|
|
|
43
45
|
class ClassifierDetailedJobOutTypedDict(TypedDict):
|
|
@@ -12,9 +12,10 @@ from typing import List, Literal, Optional
|
|
|
12
12
|
from typing_extensions import NotRequired, TypedDict
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
ClassifierFTModelOutObject = Literal["model"]
|
|
15
|
+
ClassifierFTModelOutObject = Literal["model",]
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
ClassifierFTModelOutModelType = Literal["classifier",]
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
class ClassifierFTModelOutTypedDict(TypedDict):
|
|
@@ -27,16 +27,18 @@ ClassifierJobOutStatus = Literal[
|
|
|
27
27
|
]
|
|
28
28
|
r"""The current status of the fine-tuning job."""
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
|
|
31
|
+
ClassifierJobOutObject = Literal["job",]
|
|
31
32
|
r"""The object type of the fine-tuning job."""
|
|
32
33
|
|
|
34
|
+
|
|
33
35
|
ClassifierJobOutIntegrationsTypedDict = WandbIntegrationOutTypedDict
|
|
34
36
|
|
|
35
37
|
|
|
36
38
|
ClassifierJobOutIntegrations = WandbIntegrationOut
|
|
37
39
|
|
|
38
40
|
|
|
39
|
-
ClassifierJobOutJobType = Literal["classifier"]
|
|
41
|
+
ClassifierJobOutJobType = Literal["classifier",]
|
|
40
42
|
r"""The type of job (`FT` for fine-tuning)."""
|
|
41
43
|
|
|
42
44
|
|
|
@@ -29,7 +29,9 @@ CompletionDetailedJobOutStatus = Literal[
|
|
|
29
29
|
"CANCELLATION_REQUESTED",
|
|
30
30
|
]
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
|
|
33
|
+
CompletionDetailedJobOutObject = Literal["job",]
|
|
34
|
+
|
|
33
35
|
|
|
34
36
|
CompletionDetailedJobOutIntegrationsTypedDict = WandbIntegrationOutTypedDict
|
|
35
37
|
|
|
@@ -37,7 +39,8 @@ CompletionDetailedJobOutIntegrationsTypedDict = WandbIntegrationOutTypedDict
|
|
|
37
39
|
CompletionDetailedJobOutIntegrations = WandbIntegrationOut
|
|
38
40
|
|
|
39
41
|
|
|
40
|
-
CompletionDetailedJobOutJobType = Literal["completion"]
|
|
42
|
+
CompletionDetailedJobOutJobType = Literal["completion",]
|
|
43
|
+
|
|
41
44
|
|
|
42
45
|
CompletionDetailedJobOutRepositoriesTypedDict = GithubRepositoryOutTypedDict
|
|
43
46
|
|
|
@@ -11,9 +11,10 @@ from typing import List, Literal, Optional
|
|
|
11
11
|
from typing_extensions import NotRequired, TypedDict
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
CompletionFTModelOutObject = Literal["model"]
|
|
14
|
+
CompletionFTModelOutObject = Literal["model",]
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
ModelType = Literal["completion",]
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
class CompletionFTModelOutTypedDict(TypedDict):
|
|
@@ -28,18 +28,21 @@ Status = Literal[
|
|
|
28
28
|
]
|
|
29
29
|
r"""The current status of the fine-tuning job."""
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
|
|
32
|
+
CompletionJobOutObject = Literal["job",]
|
|
32
33
|
r"""The object type of the fine-tuning job."""
|
|
33
34
|
|
|
35
|
+
|
|
34
36
|
IntegrationsTypedDict = WandbIntegrationOutTypedDict
|
|
35
37
|
|
|
36
38
|
|
|
37
39
|
Integrations = WandbIntegrationOut
|
|
38
40
|
|
|
39
41
|
|
|
40
|
-
JobType = Literal["completion"]
|
|
42
|
+
JobType = Literal["completion",]
|
|
41
43
|
r"""The type of job (`FT` for fine-tuning)."""
|
|
42
44
|
|
|
45
|
+
|
|
43
46
|
RepositoriesTypedDict = GithubRepositoryOutTypedDict
|
|
44
47
|
|
|
45
48
|
|
|
@@ -3,15 +3,19 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from .deltamessage import DeltaMessage, DeltaMessageTypedDict
|
|
5
5
|
from mistralai.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr
|
|
6
|
-
from mistralai.utils import validate_open_enum
|
|
7
6
|
from pydantic import model_serializer
|
|
8
|
-
from pydantic.functional_validators import PlainValidator
|
|
9
7
|
from typing import Literal, Union
|
|
10
|
-
from typing_extensions import
|
|
8
|
+
from typing_extensions import TypedDict
|
|
11
9
|
|
|
12
10
|
|
|
13
11
|
CompletionResponseStreamChoiceFinishReason = Union[
|
|
14
|
-
Literal[
|
|
12
|
+
Literal[
|
|
13
|
+
"stop",
|
|
14
|
+
"length",
|
|
15
|
+
"error",
|
|
16
|
+
"tool_calls",
|
|
17
|
+
],
|
|
18
|
+
UnrecognizedStr,
|
|
15
19
|
]
|
|
16
20
|
|
|
17
21
|
|
|
@@ -26,10 +30,7 @@ class CompletionResponseStreamChoice(BaseModel):
|
|
|
26
30
|
|
|
27
31
|
delta: DeltaMessage
|
|
28
32
|
|
|
29
|
-
finish_reason:
|
|
30
|
-
Nullable[CompletionResponseStreamChoiceFinishReason],
|
|
31
|
-
PlainValidator(validate_open_enum(False)),
|
|
32
|
-
]
|
|
33
|
+
finish_reason: Nullable[CompletionResponseStreamChoiceFinishReason]
|
|
33
34
|
|
|
34
35
|
@model_serializer(mode="wrap")
|
|
35
36
|
def serialize_model(self, handler):
|
|
@@ -8,7 +8,10 @@ from typing import Literal, Optional
|
|
|
8
8
|
from typing_extensions import NotRequired, TypedDict
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
ConversationAppendRequestHandoffExecution = Literal[
|
|
11
|
+
ConversationAppendRequestHandoffExecution = Literal[
|
|
12
|
+
"client",
|
|
13
|
+
"server",
|
|
14
|
+
]
|
|
12
15
|
|
|
13
16
|
|
|
14
17
|
class ConversationAppendRequestTypedDict(TypedDict):
|
|
@@ -8,7 +8,10 @@ from typing import Literal, Optional
|
|
|
8
8
|
from typing_extensions import NotRequired, TypedDict
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
ConversationAppendStreamRequestHandoffExecution = Literal[
|
|
11
|
+
ConversationAppendStreamRequestHandoffExecution = Literal[
|
|
12
|
+
"client",
|
|
13
|
+
"server",
|
|
14
|
+
]
|
|
12
15
|
|
|
13
16
|
|
|
14
17
|
class ConversationAppendStreamRequestTypedDict(TypedDict):
|
|
@@ -12,7 +12,8 @@ from typing import List, Literal, Optional, Union
|
|
|
12
12
|
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
ConversationHistoryObject = Literal["conversation.history"]
|
|
15
|
+
ConversationHistoryObject = Literal["conversation.history",]
|
|
16
|
+
|
|
16
17
|
|
|
17
18
|
EntriesTypedDict = TypeAliasType(
|
|
18
19
|
"EntriesTypedDict",
|
|
@@ -7,7 +7,7 @@ from typing import List, Literal, Optional
|
|
|
7
7
|
from typing_extensions import NotRequired, TypedDict
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
ConversationMessagesObject = Literal["conversation.messages"]
|
|
10
|
+
ConversationMessagesObject = Literal["conversation.messages",]
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class ConversationMessagesTypedDict(TypedDict):
|
|
@@ -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
|
-
HandoffExecution = Literal[
|
|
19
|
+
HandoffExecution = Literal[
|
|
20
|
+
"client",
|
|
21
|
+
"server",
|
|
22
|
+
]
|
|
23
|
+
|
|
20
24
|
|
|
21
25
|
ToolsTypedDict = TypeAliasType(
|
|
22
26
|
"ToolsTypedDict",
|
|
@@ -44,6 +48,12 @@ Tools = Annotated[
|
|
|
44
48
|
]
|
|
45
49
|
|
|
46
50
|
|
|
51
|
+
AgentVersionTypedDict = TypeAliasType("AgentVersionTypedDict", Union[str, int])
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
AgentVersion = TypeAliasType("AgentVersion", Union[str, int])
|
|
55
|
+
|
|
56
|
+
|
|
47
57
|
class ConversationRequestTypedDict(TypedDict):
|
|
48
58
|
inputs: ConversationInputsTypedDict
|
|
49
59
|
stream: NotRequired[bool]
|
|
@@ -57,7 +67,7 @@ class ConversationRequestTypedDict(TypedDict):
|
|
|
57
67
|
description: NotRequired[Nullable[str]]
|
|
58
68
|
metadata: NotRequired[Nullable[Dict[str, Any]]]
|
|
59
69
|
agent_id: NotRequired[Nullable[str]]
|
|
60
|
-
agent_version: NotRequired[Nullable[
|
|
70
|
+
agent_version: NotRequired[Nullable[AgentVersionTypedDict]]
|
|
61
71
|
model: NotRequired[Nullable[str]]
|
|
62
72
|
|
|
63
73
|
|
|
@@ -85,7 +95,7 @@ class ConversationRequest(BaseModel):
|
|
|
85
95
|
|
|
86
96
|
agent_id: OptionalNullable[str] = UNSET
|
|
87
97
|
|
|
88
|
-
agent_version: OptionalNullable[
|
|
98
|
+
agent_version: OptionalNullable[AgentVersion] = UNSET
|
|
89
99
|
|
|
90
100
|
model: OptionalNullable[str] = UNSET
|
|
91
101
|
|
|
@@ -11,7 +11,8 @@ from typing import List, Literal, Optional, Union
|
|
|
11
11
|
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
ConversationResponseObject = Literal["conversation.response"]
|
|
14
|
+
ConversationResponseObject = Literal["conversation.response",]
|
|
15
|
+
|
|
15
16
|
|
|
16
17
|
OutputsTypedDict = TypeAliasType(
|
|
17
18
|
"OutputsTypedDict",
|