mistralai 1.10.0__py3-none-any.whl → 1.11.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/tracing.py +28 -3
- mistralai/_version.py +3 -3
- mistralai/accesses.py +22 -12
- mistralai/agents.py +88 -44
- mistralai/basesdk.py +6 -0
- mistralai/chat.py +96 -40
- mistralai/classifiers.py +48 -23
- mistralai/conversations.py +186 -64
- mistralai/documents.py +72 -26
- mistralai/embeddings.py +24 -9
- mistralai/extra/README.md +1 -1
- mistralai/extra/mcp/auth.py +10 -11
- mistralai/extra/mcp/base.py +17 -16
- mistralai/extra/mcp/sse.py +13 -15
- mistralai/extra/mcp/stdio.py +5 -6
- mistralai/extra/observability/otel.py +47 -68
- mistralai/extra/run/context.py +33 -43
- mistralai/extra/run/result.py +29 -30
- mistralai/extra/run/tools.py +8 -9
- mistralai/extra/struct_chat.py +15 -8
- mistralai/extra/utils/response_format.py +5 -3
- mistralai/files.py +58 -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 +438 -30
- mistralai/mistral_jobs.py +62 -17
- mistralai/models/__init__.py +46 -1
- mistralai/models/agent.py +1 -1
- mistralai/models/agentconversation.py +1 -1
- mistralai/models/agenthandoffdoneevent.py +1 -1
- mistralai/models/agenthandoffentry.py +3 -2
- mistralai/models/agenthandoffstartedevent.py +1 -1
- mistralai/models/agents_api_v1_agents_get_versionop.py +21 -0
- mistralai/models/agents_api_v1_agents_list_versionsop.py +33 -0
- mistralai/models/agents_api_v1_agents_listop.py +5 -1
- mistralai/models/agents_api_v1_conversations_listop.py +1 -1
- 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 +18 -0
- mistralai/models/audioformat.py +17 -0
- mistralai/models/basemodelcard.py +1 -1
- mistralai/models/batchjobin.py +18 -9
- mistralai/models/batchjobout.py +6 -1
- mistralai/models/batchjobsout.py +1 -1
- mistralai/models/batchrequest.py +48 -0
- mistralai/models/chatcompletionchoice.py +10 -5
- mistralai/models/chatcompletionrequest.py +2 -5
- mistralai/models/chatcompletionstreamrequest.py +2 -5
- mistralai/models/classificationrequest.py +37 -3
- 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 +5 -1
- mistralai/models/conversationresponse.py +2 -1
- mistralai/models/conversationrestartrequest.py +4 -1
- mistralai/models/conversationrestartstreamrequest.py +4 -1
- mistralai/models/conversationstreamrequest.py +5 -1
- mistralai/models/documentlibrarytool.py +1 -1
- mistralai/models/documenturlchunk.py +1 -1
- mistralai/models/embeddingdtype.py +7 -1
- mistralai/models/embeddingrequest.py +11 -3
- 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 +4 -11
- 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/jobs_api_routes_batch_get_batch_jobop.py +40 -3
- 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 +1 -1
- 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/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 +1 -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 +13 -5
- mistralai/models/toolmessage.py +1 -1
- mistralai/models/toolreferencechunk.py +15 -5
- mistralai/models/tooltypes.py +1 -1
- mistralai/models/transcriptionsegmentchunk.py +1 -1
- mistralai/models/transcriptionstreamdone.py +1 -1
- mistralai/models/transcriptionstreamlanguage.py +1 -1
- mistralai/models/transcriptionstreamsegmentdelta.py +1 -1
- 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 +28 -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.0.dist-info → mistralai-1.11.1.dist-info}/METADATA +144 -159
- mistralai-1.11.1.dist-info/RECORD +495 -0
- {mistralai-1.10.0.dist-info → mistralai-1.11.1.dist-info}/WHEEL +1 -1
- mistralai_azure/_version.py +3 -3
- mistralai_azure/basesdk.py +21 -5
- mistralai_azure/chat.py +82 -109
- mistralai_azure/httpclient.py +0 -1
- mistralai_azure/models/__init__.py +66 -4
- mistralai_azure/models/assistantmessage.py +1 -1
- mistralai_azure/models/chatcompletionchoice.py +10 -7
- mistralai_azure/models/chatcompletionrequest.py +24 -10
- mistralai_azure/models/chatcompletionstreamrequest.py +24 -10
- mistralai_azure/models/completionresponsestreamchoice.py +11 -7
- mistralai_azure/models/documenturlchunk.py +1 -1
- mistralai_azure/models/httpvalidationerror.py +15 -8
- mistralai_azure/models/imageurlchunk.py +1 -1
- mistralai_azure/models/mistralazureerror.py +30 -0
- mistralai_azure/models/mistralpromptmode.py +1 -1
- mistralai_azure/models/no_response_error.py +17 -0
- mistralai_azure/models/ocrpageobject.py +32 -5
- mistralai_azure/models/ocrrequest.py +20 -1
- mistralai_azure/models/ocrtableobject.py +34 -0
- mistralai_azure/models/prediction.py +4 -0
- mistralai_azure/models/referencechunk.py +1 -1
- mistralai_azure/models/responseformat.py +4 -2
- mistralai_azure/models/responseformats.py +5 -2
- mistralai_azure/models/responsevalidationerror.py +27 -0
- mistralai_azure/models/sdkerror.py +32 -14
- mistralai_azure/models/systemmessage.py +8 -4
- mistralai_azure/models/systemmessagecontentchunks.py +21 -0
- mistralai_azure/models/textchunk.py +1 -1
- mistralai_azure/models/thinkchunk.py +35 -0
- 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 +39 -40
- mistralai_azure/types/basemodel.py +41 -3
- mistralai_azure/utils/__init__.py +18 -8
- mistralai_azure/utils/annotations.py +32 -8
- mistralai_azure/utils/enums.py +60 -0
- mistralai_azure/utils/eventstreaming.py +10 -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 +3 -22
- mistralai_azure/utils/unmarshal_json_response.py +38 -0
- mistralai_gcp/_hooks/types.py +7 -0
- mistralai_gcp/_version.py +4 -4
- mistralai_gcp/basesdk.py +33 -25
- mistralai_gcp/chat.py +98 -109
- mistralai_gcp/fim.py +62 -85
- mistralai_gcp/httpclient.py +6 -17
- mistralai_gcp/models/__init__.py +321 -116
- mistralai_gcp/models/assistantmessage.py +2 -2
- mistralai_gcp/models/chatcompletionchoice.py +10 -7
- mistralai_gcp/models/chatcompletionrequest.py +38 -7
- mistralai_gcp/models/chatcompletionresponse.py +6 -6
- mistralai_gcp/models/chatcompletionstreamrequest.py +38 -7
- mistralai_gcp/models/completionresponsestreamchoice.py +12 -8
- mistralai_gcp/models/deltamessage.py +1 -1
- mistralai_gcp/models/fimcompletionrequest.py +9 -10
- mistralai_gcp/models/fimcompletionresponse.py +6 -6
- mistralai_gcp/models/fimcompletionstreamrequest.py +9 -10
- mistralai_gcp/models/httpvalidationerror.py +15 -8
- mistralai_gcp/models/imageurl.py +1 -1
- mistralai_gcp/models/imageurlchunk.py +1 -1
- mistralai_gcp/models/jsonschema.py +1 -1
- mistralai_gcp/models/mistralgcperror.py +30 -0
- mistralai_gcp/models/mistralpromptmode.py +8 -0
- mistralai_gcp/models/no_response_error.py +17 -0
- mistralai_gcp/models/prediction.py +4 -0
- mistralai_gcp/models/referencechunk.py +1 -1
- mistralai_gcp/models/responseformat.py +5 -3
- mistralai_gcp/models/responseformats.py +5 -2
- mistralai_gcp/models/responsevalidationerror.py +27 -0
- mistralai_gcp/models/sdkerror.py +32 -14
- mistralai_gcp/models/systemmessage.py +8 -4
- mistralai_gcp/models/systemmessagecontentchunks.py +21 -0
- mistralai_gcp/models/textchunk.py +1 -1
- mistralai_gcp/models/thinkchunk.py +35 -0
- 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 +2 -2
- mistralai_gcp/models/tooltypes.py +1 -1
- mistralai_gcp/models/usageinfo.py +71 -8
- mistralai_gcp/models/usermessage.py +2 -2
- mistralai_gcp/sdk.py +12 -10
- mistralai_gcp/sdkconfiguration.py +0 -7
- mistralai_gcp/types/basemodel.py +41 -3
- mistralai_gcp/utils/__init__.py +141 -46
- mistralai_gcp/utils/annotations.py +32 -8
- mistralai_gcp/utils/datetimes.py +23 -0
- mistralai_gcp/utils/enums.py +125 -25
- mistralai_gcp/utils/eventstreaming.py +10 -0
- mistralai_gcp/utils/forms.py +62 -30
- 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 +33 -23
- mistralai_gcp/utils/unmarshal_json_response.py +38 -0
- mistralai-1.10.0.dist-info/RECORD +0 -475
- {mistralai-1.10.0.dist-info → mistralai-1.11.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -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
|
|
|
@@ -48,11 +46,11 @@ class RetrieveFileOut(BaseModel):
|
|
|
48
46
|
filename: str
|
|
49
47
|
r"""The name of the uploaded file."""
|
|
50
48
|
|
|
51
|
-
purpose:
|
|
49
|
+
purpose: FilePurpose
|
|
52
50
|
|
|
53
|
-
sample_type:
|
|
51
|
+
sample_type: SampleType
|
|
54
52
|
|
|
55
|
-
source:
|
|
53
|
+
source: Source
|
|
56
54
|
|
|
57
55
|
deleted: bool
|
|
58
56
|
|
mistralai/models/sampletype.py
CHANGED
|
@@ -6,6 +6,12 @@ from typing import Literal, Union
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
SampleType = Union[
|
|
9
|
-
Literal[
|
|
9
|
+
Literal[
|
|
10
|
+
"pretrain",
|
|
11
|
+
"instruct",
|
|
12
|
+
"batch_request",
|
|
13
|
+
"batch_result",
|
|
14
|
+
"batch_error",
|
|
15
|
+
],
|
|
10
16
|
UnrecognizedStr,
|
|
11
17
|
]
|
mistralai/models/sdkerror.py
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import httpx
|
|
4
4
|
from typing import Optional
|
|
5
|
+
from dataclasses import dataclass
|
|
5
6
|
|
|
6
7
|
from mistralai.models import MistralError
|
|
7
8
|
|
|
8
9
|
MAX_MESSAGE_LEN = 10_000
|
|
9
10
|
|
|
10
11
|
|
|
12
|
+
@dataclass(unsafe_hash=True)
|
|
11
13
|
class SDKError(MistralError):
|
|
12
14
|
"""The fallback error class if no more specific error class is matched."""
|
|
13
15
|
|
mistralai/models/shareenum.py
CHANGED
|
@@ -3,10 +3,8 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from .entitytype import EntityType
|
|
5
5
|
from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
6
|
-
from mistralai.utils import validate_open_enum
|
|
7
6
|
from pydantic import model_serializer
|
|
8
|
-
from
|
|
9
|
-
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
7
|
+
from typing_extensions import NotRequired, TypedDict
|
|
10
8
|
|
|
11
9
|
|
|
12
10
|
class SharingDeleteTypedDict(TypedDict):
|
|
@@ -21,7 +19,7 @@ class SharingDelete(BaseModel):
|
|
|
21
19
|
share_with_uuid: str
|
|
22
20
|
r"""The id of the entity (user, workspace or organization) to share with"""
|
|
23
21
|
|
|
24
|
-
share_with_type:
|
|
22
|
+
share_with_type: EntityType
|
|
25
23
|
r"""The type of entity, used to share a library."""
|
|
26
24
|
|
|
27
25
|
org_id: OptionalNullable[str] = UNSET
|
mistralai/models/sharingin.py
CHANGED
|
@@ -4,10 +4,8 @@ from __future__ import annotations
|
|
|
4
4
|
from .entitytype import EntityType
|
|
5
5
|
from .shareenum import ShareEnum
|
|
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
|
|
10
|
-
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
8
|
+
from typing_extensions import NotRequired, TypedDict
|
|
11
9
|
|
|
12
10
|
|
|
13
11
|
class SharingInTypedDict(TypedDict):
|
|
@@ -20,12 +18,12 @@ class SharingInTypedDict(TypedDict):
|
|
|
20
18
|
|
|
21
19
|
|
|
22
20
|
class SharingIn(BaseModel):
|
|
23
|
-
level:
|
|
21
|
+
level: ShareEnum
|
|
24
22
|
|
|
25
23
|
share_with_uuid: str
|
|
26
24
|
r"""The id of the entity (user, workspace or organization) to share with"""
|
|
27
25
|
|
|
28
|
-
share_with_type:
|
|
26
|
+
share_with_type: EntityType
|
|
29
27
|
r"""The type of entity, used to share a library."""
|
|
30
28
|
|
|
31
29
|
org_id: OptionalNullable[str] = UNSET
|
mistralai/models/source.py
CHANGED
|
@@ -5,4 +5,11 @@ from mistralai.types import UnrecognizedStr
|
|
|
5
5
|
from typing import Literal, Union
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
Source = Union[
|
|
8
|
+
Source = Union[
|
|
9
|
+
Literal[
|
|
10
|
+
"upload",
|
|
11
|
+
"repository",
|
|
12
|
+
"mistral",
|
|
13
|
+
],
|
|
14
|
+
UnrecognizedStr,
|
|
15
|
+
]
|
mistralai/models/textchunk.py
CHANGED
mistralai/models/thinkchunk.py
CHANGED
mistralai/models/tool.py
CHANGED
|
@@ -4,10 +4,8 @@ from __future__ import annotations
|
|
|
4
4
|
from .function import Function, FunctionTypedDict
|
|
5
5
|
from .tooltypes import ToolTypes
|
|
6
6
|
from mistralai.types import BaseModel
|
|
7
|
-
from mistralai.utils import validate_open_enum
|
|
8
|
-
from pydantic.functional_validators import PlainValidator
|
|
9
7
|
from typing import Optional
|
|
10
|
-
from typing_extensions import
|
|
8
|
+
from typing_extensions import NotRequired, TypedDict
|
|
11
9
|
|
|
12
10
|
|
|
13
11
|
class ToolTypedDict(TypedDict):
|
|
@@ -18,6 +16,4 @@ class ToolTypedDict(TypedDict):
|
|
|
18
16
|
class Tool(BaseModel):
|
|
19
17
|
function: Function
|
|
20
18
|
|
|
21
|
-
type:
|
|
22
|
-
None
|
|
23
|
-
)
|
|
19
|
+
type: Optional[ToolTypes] = None
|
mistralai/models/toolcall.py
CHANGED
|
@@ -4,10 +4,8 @@ from __future__ import annotations
|
|
|
4
4
|
from .functioncall import FunctionCall, FunctionCallTypedDict
|
|
5
5
|
from .tooltypes import ToolTypes
|
|
6
6
|
from mistralai.types import BaseModel
|
|
7
|
-
from mistralai.utils import validate_open_enum
|
|
8
|
-
from pydantic.functional_validators import PlainValidator
|
|
9
7
|
from typing import Optional
|
|
10
|
-
from typing_extensions import
|
|
8
|
+
from typing_extensions import NotRequired, TypedDict
|
|
11
9
|
|
|
12
10
|
|
|
13
11
|
class ToolCallTypedDict(TypedDict):
|
|
@@ -22,8 +20,6 @@ class ToolCall(BaseModel):
|
|
|
22
20
|
|
|
23
21
|
id: Optional[str] = "null"
|
|
24
22
|
|
|
25
|
-
type:
|
|
26
|
-
None
|
|
27
|
-
)
|
|
23
|
+
type: Optional[ToolTypes] = None
|
|
28
24
|
|
|
29
25
|
index: Optional[int] = 0
|
mistralai/models/toolchoice.py
CHANGED
|
@@ -4,10 +4,8 @@ from __future__ import annotations
|
|
|
4
4
|
from .functionname import FunctionName, FunctionNameTypedDict
|
|
5
5
|
from .tooltypes import ToolTypes
|
|
6
6
|
from mistralai.types import BaseModel
|
|
7
|
-
from mistralai.utils import validate_open_enum
|
|
8
|
-
from pydantic.functional_validators import PlainValidator
|
|
9
7
|
from typing import Optional
|
|
10
|
-
from typing_extensions import
|
|
8
|
+
from typing_extensions import NotRequired, TypedDict
|
|
11
9
|
|
|
12
10
|
|
|
13
11
|
class ToolChoiceTypedDict(TypedDict):
|
|
@@ -24,6 +22,4 @@ class ToolChoice(BaseModel):
|
|
|
24
22
|
function: FunctionName
|
|
25
23
|
r"""this restriction of `Function` is used to select a specific function to call"""
|
|
26
24
|
|
|
27
|
-
type:
|
|
28
|
-
None
|
|
29
|
-
)
|
|
25
|
+
type: Optional[ToolTypes] = None
|
|
@@ -8,7 +8,8 @@ from typing import Literal, Optional, Union
|
|
|
8
8
|
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
ToolExecutionDeltaEventType = Literal["tool.execution.delta"]
|
|
11
|
+
ToolExecutionDeltaEventType = Literal["tool.execution.delta",]
|
|
12
|
+
|
|
12
13
|
|
|
13
14
|
ToolExecutionDeltaEventNameTypedDict = TypeAliasType(
|
|
14
15
|
"ToolExecutionDeltaEventNameTypedDict", Union[BuiltInConnectors, str]
|
|
@@ -8,7 +8,8 @@ from typing import Any, Dict, Literal, Optional, Union
|
|
|
8
8
|
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
ToolExecutionDoneEventType = Literal["tool.execution.done"]
|
|
11
|
+
ToolExecutionDoneEventType = Literal["tool.execution.done",]
|
|
12
|
+
|
|
12
13
|
|
|
13
14
|
ToolExecutionDoneEventNameTypedDict = TypeAliasType(
|
|
14
15
|
"ToolExecutionDoneEventNameTypedDict", Union[BuiltInConnectors, str]
|
|
@@ -9,9 +9,11 @@ from typing import Any, Dict, Literal, Optional, Union
|
|
|
9
9
|
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
ToolExecutionEntryObject = Literal["entry"]
|
|
12
|
+
ToolExecutionEntryObject = Literal["entry",]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
ToolExecutionEntryType = Literal["tool.execution",]
|
|
13
16
|
|
|
14
|
-
ToolExecutionEntryType = Literal["tool.execution"]
|
|
15
17
|
|
|
16
18
|
NameTypedDict = TypeAliasType("NameTypedDict", Union[BuiltInConnectors, str])
|
|
17
19
|
|
|
@@ -8,7 +8,8 @@ from typing import Literal, Optional, Union
|
|
|
8
8
|
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
ToolExecutionStartedEventType = Literal["tool.execution.started"]
|
|
11
|
+
ToolExecutionStartedEventType = Literal["tool.execution.started",]
|
|
12
|
+
|
|
12
13
|
|
|
13
14
|
ToolExecutionStartedEventNameTypedDict = TypeAliasType(
|
|
14
15
|
"ToolExecutionStartedEventNameTypedDict", Union[BuiltInConnectors, str]
|
|
@@ -4,15 +4,23 @@ from __future__ import annotations
|
|
|
4
4
|
from .builtinconnectors import BuiltInConnectors
|
|
5
5
|
from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
6
6
|
from pydantic import model_serializer
|
|
7
|
-
from typing import Literal, Optional
|
|
8
|
-
from typing_extensions import NotRequired, TypedDict
|
|
7
|
+
from typing import Literal, Optional, Union
|
|
8
|
+
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
ToolFileChunkType = Literal["tool_file"]
|
|
11
|
+
ToolFileChunkType = Literal["tool_file",]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
ToolFileChunkToolTypedDict = TypeAliasType(
|
|
15
|
+
"ToolFileChunkToolTypedDict", Union[BuiltInConnectors, str]
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
ToolFileChunkTool = TypeAliasType("ToolFileChunkTool", Union[BuiltInConnectors, str])
|
|
12
20
|
|
|
13
21
|
|
|
14
22
|
class ToolFileChunkTypedDict(TypedDict):
|
|
15
|
-
tool:
|
|
23
|
+
tool: ToolFileChunkToolTypedDict
|
|
16
24
|
file_id: str
|
|
17
25
|
type: NotRequired[ToolFileChunkType]
|
|
18
26
|
file_name: NotRequired[Nullable[str]]
|
|
@@ -20,7 +28,7 @@ class ToolFileChunkTypedDict(TypedDict):
|
|
|
20
28
|
|
|
21
29
|
|
|
22
30
|
class ToolFileChunk(BaseModel):
|
|
23
|
-
tool:
|
|
31
|
+
tool: ToolFileChunkTool
|
|
24
32
|
|
|
25
33
|
file_id: str
|
|
26
34
|
|
mistralai/models/toolmessage.py
CHANGED
|
@@ -16,7 +16,7 @@ ToolMessageContentTypedDict = TypeAliasType(
|
|
|
16
16
|
ToolMessageContent = TypeAliasType("ToolMessageContent", Union[str, List[ContentChunk]])
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
ToolMessageRole = Literal["tool"]
|
|
19
|
+
ToolMessageRole = Literal["tool",]
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class ToolMessageTypedDict(TypedDict):
|
|
@@ -4,15 +4,25 @@ from __future__ import annotations
|
|
|
4
4
|
from .builtinconnectors import BuiltInConnectors
|
|
5
5
|
from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
6
6
|
from pydantic import model_serializer
|
|
7
|
-
from typing import Literal, Optional
|
|
8
|
-
from typing_extensions import NotRequired, TypedDict
|
|
7
|
+
from typing import Literal, Optional, Union
|
|
8
|
+
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
ToolReferenceChunkType = Literal["tool_reference"]
|
|
11
|
+
ToolReferenceChunkType = Literal["tool_reference",]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
ToolReferenceChunkToolTypedDict = TypeAliasType(
|
|
15
|
+
"ToolReferenceChunkToolTypedDict", Union[BuiltInConnectors, str]
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
ToolReferenceChunkTool = TypeAliasType(
|
|
20
|
+
"ToolReferenceChunkTool", Union[BuiltInConnectors, str]
|
|
21
|
+
)
|
|
12
22
|
|
|
13
23
|
|
|
14
24
|
class ToolReferenceChunkTypedDict(TypedDict):
|
|
15
|
-
tool:
|
|
25
|
+
tool: ToolReferenceChunkToolTypedDict
|
|
16
26
|
title: str
|
|
17
27
|
type: NotRequired[ToolReferenceChunkType]
|
|
18
28
|
url: NotRequired[Nullable[str]]
|
|
@@ -21,7 +31,7 @@ class ToolReferenceChunkTypedDict(TypedDict):
|
|
|
21
31
|
|
|
22
32
|
|
|
23
33
|
class ToolReferenceChunk(BaseModel):
|
|
24
|
-
tool:
|
|
34
|
+
tool: ToolReferenceChunkTool
|
|
25
35
|
|
|
26
36
|
title: str
|
|
27
37
|
|
mistralai/models/tooltypes.py
CHANGED
|
@@ -13,7 +13,7 @@ from typing import Any, Dict, List, Literal, Optional
|
|
|
13
13
|
from typing_extensions import NotRequired, TypedDict
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
TranscriptionStreamDoneType = Literal["transcription.done"]
|
|
16
|
+
TranscriptionStreamDoneType = Literal["transcription.done",]
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
class TranscriptionStreamDoneTypedDict(TypedDict):
|
|
@@ -8,7 +8,7 @@ from typing import Any, Dict, Literal, Optional
|
|
|
8
8
|
from typing_extensions import NotRequired, TypedDict
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
TranscriptionStreamLanguageType = Literal["transcription.language"]
|
|
11
|
+
TranscriptionStreamLanguageType = Literal["transcription.language",]
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class TranscriptionStreamLanguageTypedDict(TypedDict):
|
|
@@ -8,7 +8,7 @@ from typing import Any, Dict, Literal, Optional
|
|
|
8
8
|
from typing_extensions import NotRequired, TypedDict
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
TranscriptionStreamSegmentDeltaType = Literal["transcription.segment"]
|
|
11
|
+
TranscriptionStreamSegmentDeltaType = Literal["transcription.segment",]
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class TranscriptionStreamSegmentDeltaTypedDict(TypedDict):
|
|
@@ -8,7 +8,7 @@ from typing import Any, Dict, Literal, Optional
|
|
|
8
8
|
from typing_extensions import NotRequired, TypedDict
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
TranscriptionStreamTextDeltaType = Literal["transcription.text.delta"]
|
|
11
|
+
TranscriptionStreamTextDeltaType = Literal["transcription.text.delta",]
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class TranscriptionStreamTextDeltaTypedDict(TypedDict):
|
|
@@ -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 UploadFileOut(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/usermessage.py
CHANGED
|
@@ -16,7 +16,7 @@ UserMessageContentTypedDict = TypeAliasType(
|
|
|
16
16
|
UserMessageContent = TypeAliasType("UserMessageContent", Union[str, List[ContentChunk]])
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
UserMessageRole = Literal["user"]
|
|
19
|
+
UserMessageRole = Literal["user",]
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class UserMessageTypedDict(TypedDict):
|
|
@@ -6,7 +6,7 @@ from typing import Literal, Optional
|
|
|
6
6
|
from typing_extensions import NotRequired, TypedDict
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
WebSearchPremiumToolType = Literal["web_search_premium"]
|
|
9
|
+
WebSearchPremiumToolType = Literal["web_search_premium",]
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class WebSearchPremiumToolTypedDict(TypedDict):
|