mistralai 1.2.3__py3-none-any.whl → 1.2.5__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/custom_user_agent.py +7 -1
- mistralai/_version.py +1 -1
- mistralai/agents.py +5 -5
- mistralai/chat.py +5 -5
- mistralai/files.py +166 -0
- mistralai/fim.py +5 -5
- mistralai/httpclient.py +6 -0
- mistralai/jobs.py +2 -2
- mistralai/models/__init__.py +9 -2
- mistralai/models/agentscompletionrequest.py +23 -11
- mistralai/models/agentscompletionstreamrequest.py +23 -13
- mistralai/models/apiendpoint.py +11 -3
- mistralai/models/assistantmessage.py +7 -3
- mistralai/models/batchjobin.py +4 -2
- mistralai/models/chatclassificationrequest.py +26 -17
- mistralai/models/chatcompletionrequest.py +19 -11
- mistralai/models/chatcompletionstreamrequest.py +23 -13
- mistralai/models/classificationrequest.py +7 -3
- mistralai/models/contentchunk.py +5 -4
- mistralai/models/deltamessage.py +5 -3
- mistralai/models/detailedjobout.py +2 -3
- mistralai/models/embeddingrequest.py +3 -3
- mistralai/models/files_api_routes_get_signed_urlop.py +25 -0
- mistralai/models/filesignedurl.py +13 -0
- mistralai/models/fimcompletionrequest.py +7 -3
- mistralai/models/fimcompletionstreamrequest.py +7 -3
- mistralai/models/functioncall.py +3 -3
- mistralai/models/imageurlchunk.py +9 -14
- mistralai/models/jobin.py +2 -3
- mistralai/models/jobout.py +2 -3
- mistralai/models/jobs_api_routes_fine_tuning_create_fine_tuning_jobop.py +9 -4
- mistralai/models/modellist.py +4 -2
- mistralai/models/referencechunk.py +3 -11
- mistralai/models/retrieve_model_v1_models_model_id_getop.py +5 -4
- mistralai/models/systemmessage.py +7 -3
- mistralai/models/textchunk.py +3 -9
- mistralai/models/toolmessage.py +5 -3
- mistralai/models/usermessage.py +5 -3
- mistralai/models/validationerror.py +3 -3
- mistralai/sdk.py +14 -0
- mistralai/sdkconfiguration.py +3 -3
- mistralai/utils/annotations.py +42 -17
- mistralai/utils/eventstreaming.py +61 -1
- {mistralai-1.2.3.dist-info → mistralai-1.2.5.dist-info}/METADATA +181 -176
- {mistralai-1.2.3.dist-info → mistralai-1.2.5.dist-info}/RECORD +87 -86
- mistralai_azure/_hooks/custom_user_agent.py +8 -2
- mistralai_azure/chat.py +5 -5
- mistralai_azure/httpclient.py +6 -0
- mistralai_azure/models/assistantmessage.py +7 -3
- mistralai_azure/models/chatcompletionrequest.py +23 -11
- mistralai_azure/models/chatcompletionstreamrequest.py +19 -13
- mistralai_azure/models/contentchunk.py +4 -2
- mistralai_azure/models/deltamessage.py +5 -3
- mistralai_azure/models/functioncall.py +3 -3
- mistralai_azure/models/referencechunk.py +3 -11
- mistralai_azure/models/systemmessage.py +7 -3
- mistralai_azure/models/textchunk.py +3 -9
- mistralai_azure/models/toolmessage.py +5 -3
- mistralai_azure/models/usermessage.py +5 -3
- mistralai_azure/models/validationerror.py +3 -3
- mistralai_azure/sdkconfiguration.py +2 -2
- mistralai_azure/utils/annotations.py +42 -17
- mistralai_azure/utils/eventstreaming.py +61 -1
- mistralai_gcp/_hooks/custom_user_agent.py +7 -1
- mistralai_gcp/chat.py +5 -5
- mistralai_gcp/fim.py +5 -5
- mistralai_gcp/httpclient.py +6 -0
- mistralai_gcp/models/assistantmessage.py +7 -3
- mistralai_gcp/models/chatcompletionrequest.py +23 -11
- mistralai_gcp/models/chatcompletionstreamrequest.py +19 -13
- mistralai_gcp/models/contentchunk.py +4 -2
- mistralai_gcp/models/deltamessage.py +5 -3
- mistralai_gcp/models/fimcompletionrequest.py +7 -3
- mistralai_gcp/models/fimcompletionstreamrequest.py +7 -3
- mistralai_gcp/models/functioncall.py +3 -3
- mistralai_gcp/models/referencechunk.py +3 -11
- mistralai_gcp/models/systemmessage.py +7 -3
- mistralai_gcp/models/textchunk.py +3 -9
- mistralai_gcp/models/toolmessage.py +5 -3
- mistralai_gcp/models/usermessage.py +5 -3
- mistralai_gcp/models/validationerror.py +3 -3
- mistralai_gcp/sdk.py +5 -4
- mistralai_gcp/sdkconfiguration.py +2 -2
- mistralai_gcp/utils/annotations.py +42 -17
- mistralai_gcp/utils/eventstreaming.py +61 -1
- mistralai/models/finetuneablemodel.py +0 -14
- {mistralai-1.2.3.dist-info → mistralai-1.2.5.dist-info}/LICENSE +0 -0
- {mistralai-1.2.3.dist-info → mistralai-1.2.5.dist-info}/WHEEL +0 -0
|
@@ -13,23 +13,26 @@ from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_
|
|
|
13
13
|
from mistralai.utils import get_discriminator
|
|
14
14
|
from pydantic import Discriminator, Tag, model_serializer
|
|
15
15
|
from typing import List, Optional, Union
|
|
16
|
-
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
16
|
+
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
StopTypedDict = Union[str, List[str]]
|
|
19
|
+
StopTypedDict = TypeAliasType("StopTypedDict", Union[str, List[str]])
|
|
20
20
|
r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array"""
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
Stop = Union[str, List[str]]
|
|
23
|
+
Stop = TypeAliasType("Stop", Union[str, List[str]])
|
|
24
24
|
r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array"""
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
MessagesTypedDict =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
MessagesTypedDict = TypeAliasType(
|
|
28
|
+
"MessagesTypedDict",
|
|
29
|
+
Union[
|
|
30
|
+
SystemMessageTypedDict,
|
|
31
|
+
UserMessageTypedDict,
|
|
32
|
+
AssistantMessageTypedDict,
|
|
33
|
+
ToolMessageTypedDict,
|
|
34
|
+
],
|
|
35
|
+
)
|
|
33
36
|
|
|
34
37
|
|
|
35
38
|
Messages = Annotated[
|
|
@@ -43,10 +46,15 @@ Messages = Annotated[
|
|
|
43
46
|
]
|
|
44
47
|
|
|
45
48
|
|
|
46
|
-
ChatCompletionRequestToolChoiceTypedDict =
|
|
49
|
+
ChatCompletionRequestToolChoiceTypedDict = TypeAliasType(
|
|
50
|
+
"ChatCompletionRequestToolChoiceTypedDict",
|
|
51
|
+
Union[ToolChoiceTypedDict, ToolChoiceEnum],
|
|
52
|
+
)
|
|
47
53
|
|
|
48
54
|
|
|
49
|
-
ChatCompletionRequestToolChoice =
|
|
55
|
+
ChatCompletionRequestToolChoice = TypeAliasType(
|
|
56
|
+
"ChatCompletionRequestToolChoice", Union[ToolChoice, ToolChoiceEnum]
|
|
57
|
+
)
|
|
50
58
|
|
|
51
59
|
|
|
52
60
|
class ChatCompletionRequestTypedDict(TypedDict):
|
|
@@ -13,23 +13,30 @@ from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_
|
|
|
13
13
|
from mistralai.utils import get_discriminator
|
|
14
14
|
from pydantic import Discriminator, Tag, model_serializer
|
|
15
15
|
from typing import List, Optional, Union
|
|
16
|
-
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
16
|
+
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
ChatCompletionStreamRequestStopTypedDict =
|
|
19
|
+
ChatCompletionStreamRequestStopTypedDict = TypeAliasType(
|
|
20
|
+
"ChatCompletionStreamRequestStopTypedDict", Union[str, List[str]]
|
|
21
|
+
)
|
|
20
22
|
r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array"""
|
|
21
23
|
|
|
22
24
|
|
|
23
|
-
ChatCompletionStreamRequestStop =
|
|
25
|
+
ChatCompletionStreamRequestStop = TypeAliasType(
|
|
26
|
+
"ChatCompletionStreamRequestStop", Union[str, List[str]]
|
|
27
|
+
)
|
|
24
28
|
r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array"""
|
|
25
29
|
|
|
26
30
|
|
|
27
|
-
ChatCompletionStreamRequestMessagesTypedDict =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
ChatCompletionStreamRequestMessagesTypedDict = TypeAliasType(
|
|
32
|
+
"ChatCompletionStreamRequestMessagesTypedDict",
|
|
33
|
+
Union[
|
|
34
|
+
SystemMessageTypedDict,
|
|
35
|
+
UserMessageTypedDict,
|
|
36
|
+
AssistantMessageTypedDict,
|
|
37
|
+
ToolMessageTypedDict,
|
|
38
|
+
],
|
|
39
|
+
)
|
|
33
40
|
|
|
34
41
|
|
|
35
42
|
ChatCompletionStreamRequestMessages = Annotated[
|
|
@@ -43,12 +50,15 @@ ChatCompletionStreamRequestMessages = Annotated[
|
|
|
43
50
|
]
|
|
44
51
|
|
|
45
52
|
|
|
46
|
-
ChatCompletionStreamRequestToolChoiceTypedDict =
|
|
47
|
-
|
|
48
|
-
]
|
|
53
|
+
ChatCompletionStreamRequestToolChoiceTypedDict = TypeAliasType(
|
|
54
|
+
"ChatCompletionStreamRequestToolChoiceTypedDict",
|
|
55
|
+
Union[ToolChoiceTypedDict, ToolChoiceEnum],
|
|
56
|
+
)
|
|
49
57
|
|
|
50
58
|
|
|
51
|
-
ChatCompletionStreamRequestToolChoice =
|
|
59
|
+
ChatCompletionStreamRequestToolChoice = TypeAliasType(
|
|
60
|
+
"ChatCompletionStreamRequestToolChoice", Union[ToolChoice, ToolChoiceEnum]
|
|
61
|
+
)
|
|
52
62
|
|
|
53
63
|
|
|
54
64
|
class ChatCompletionStreamRequestTypedDict(TypedDict):
|
|
@@ -5,14 +5,18 @@ from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from pydantic import model_serializer
|
|
7
7
|
from typing import List, Union
|
|
8
|
-
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
8
|
+
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
ClassificationRequestInputsTypedDict =
|
|
11
|
+
ClassificationRequestInputsTypedDict = TypeAliasType(
|
|
12
|
+
"ClassificationRequestInputsTypedDict", Union[str, List[str]]
|
|
13
|
+
)
|
|
12
14
|
r"""Text to classify."""
|
|
13
15
|
|
|
14
16
|
|
|
15
|
-
ClassificationRequestInputs =
|
|
17
|
+
ClassificationRequestInputs = TypeAliasType(
|
|
18
|
+
"ClassificationRequestInputs", Union[str, List[str]]
|
|
19
|
+
)
|
|
16
20
|
r"""Text to classify."""
|
|
17
21
|
|
|
18
22
|
|
mistralai/models/contentchunk.py
CHANGED
|
@@ -7,12 +7,13 @@ from .textchunk import TextChunk, TextChunkTypedDict
|
|
|
7
7
|
from mistralai.utils import get_discriminator
|
|
8
8
|
from pydantic import Discriminator, Tag
|
|
9
9
|
from typing import Union
|
|
10
|
-
from typing_extensions import Annotated
|
|
10
|
+
from typing_extensions import Annotated, TypeAliasType
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
ContentChunkTypedDict =
|
|
14
|
-
|
|
15
|
-
]
|
|
13
|
+
ContentChunkTypedDict = TypeAliasType(
|
|
14
|
+
"ContentChunkTypedDict",
|
|
15
|
+
Union[TextChunkTypedDict, ImageURLChunkTypedDict, ReferenceChunkTypedDict],
|
|
16
|
+
)
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
ContentChunk = Annotated[
|
mistralai/models/deltamessage.py
CHANGED
|
@@ -6,13 +6,15 @@ from .toolcall import ToolCall, ToolCallTypedDict
|
|
|
6
6
|
from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
7
7
|
from pydantic import model_serializer
|
|
8
8
|
from typing import List, Union
|
|
9
|
-
from typing_extensions import NotRequired, TypedDict
|
|
9
|
+
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
ContentTypedDict =
|
|
12
|
+
ContentTypedDict = TypeAliasType(
|
|
13
|
+
"ContentTypedDict", Union[str, List[ContentChunkTypedDict]]
|
|
14
|
+
)
|
|
13
15
|
|
|
14
16
|
|
|
15
|
-
Content = Union[str, List[ContentChunk]]
|
|
17
|
+
Content = TypeAliasType("Content", Union[str, List[ContentChunk]])
|
|
16
18
|
|
|
17
19
|
|
|
18
20
|
class DeltaMessageTypedDict(TypedDict):
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from .checkpointout import CheckpointOut, CheckpointOutTypedDict
|
|
5
5
|
from .eventout import EventOut, EventOutTypedDict
|
|
6
|
-
from .finetuneablemodel import FineTuneableModel
|
|
7
6
|
from .githubrepositoryout import GithubRepositoryOut, GithubRepositoryOutTypedDict
|
|
8
7
|
from .jobmetadataout import JobMetadataOut, JobMetadataOutTypedDict
|
|
9
8
|
from .trainingparameters import TrainingParameters, TrainingParametersTypedDict
|
|
@@ -48,7 +47,7 @@ class DetailedJobOutTypedDict(TypedDict):
|
|
|
48
47
|
id: str
|
|
49
48
|
auto_start: bool
|
|
50
49
|
hyperparameters: TrainingParametersTypedDict
|
|
51
|
-
model:
|
|
50
|
+
model: str
|
|
52
51
|
r"""The name of the model to fine-tune."""
|
|
53
52
|
status: DetailedJobOutStatus
|
|
54
53
|
job_type: str
|
|
@@ -75,7 +74,7 @@ class DetailedJobOut(BaseModel):
|
|
|
75
74
|
|
|
76
75
|
hyperparameters: TrainingParameters
|
|
77
76
|
|
|
78
|
-
model:
|
|
77
|
+
model: str
|
|
79
78
|
r"""The name of the model to fine-tune."""
|
|
80
79
|
|
|
81
80
|
status: DetailedJobOutStatus
|
|
@@ -5,14 +5,14 @@ from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from pydantic import model_serializer
|
|
7
7
|
from typing import List, Optional, Union
|
|
8
|
-
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
8
|
+
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
InputsTypedDict = Union[str, List[str]]
|
|
11
|
+
InputsTypedDict = TypeAliasType("InputsTypedDict", Union[str, List[str]])
|
|
12
12
|
r"""Text to embed."""
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
Inputs = Union[str, List[str]]
|
|
15
|
+
Inputs = TypeAliasType("Inputs", Union[str, List[str]])
|
|
16
16
|
r"""Text to embed."""
|
|
17
17
|
|
|
18
18
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from mistralai.types import BaseModel
|
|
5
|
+
from mistralai.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata
|
|
6
|
+
from typing import Optional
|
|
7
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class FilesAPIRoutesGetSignedURLRequestTypedDict(TypedDict):
|
|
11
|
+
file_id: str
|
|
12
|
+
expiry: NotRequired[int]
|
|
13
|
+
r"""Number of hours before the url becomes invalid. Defaults to 24h"""
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class FilesAPIRoutesGetSignedURLRequest(BaseModel):
|
|
17
|
+
file_id: Annotated[
|
|
18
|
+
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
expiry: Annotated[
|
|
22
|
+
Optional[int],
|
|
23
|
+
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
24
|
+
] = 24
|
|
25
|
+
r"""Number of hours before the url becomes invalid. Defaults to 24h"""
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from mistralai.types import BaseModel
|
|
5
|
+
from typing_extensions import TypedDict
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class FileSignedURLTypedDict(TypedDict):
|
|
9
|
+
url: str
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class FileSignedURL(BaseModel):
|
|
13
|
+
url: str
|
|
@@ -4,14 +4,18 @@ from __future__ import annotations
|
|
|
4
4
|
from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
5
5
|
from pydantic import model_serializer
|
|
6
6
|
from typing import List, Optional, Union
|
|
7
|
-
from typing_extensions import NotRequired, TypedDict
|
|
7
|
+
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
FIMCompletionRequestStopTypedDict =
|
|
10
|
+
FIMCompletionRequestStopTypedDict = TypeAliasType(
|
|
11
|
+
"FIMCompletionRequestStopTypedDict", Union[str, List[str]]
|
|
12
|
+
)
|
|
11
13
|
r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array"""
|
|
12
14
|
|
|
13
15
|
|
|
14
|
-
FIMCompletionRequestStop =
|
|
16
|
+
FIMCompletionRequestStop = TypeAliasType(
|
|
17
|
+
"FIMCompletionRequestStop", Union[str, List[str]]
|
|
18
|
+
)
|
|
15
19
|
r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array"""
|
|
16
20
|
|
|
17
21
|
|
|
@@ -4,14 +4,18 @@ from __future__ import annotations
|
|
|
4
4
|
from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
5
5
|
from pydantic import model_serializer
|
|
6
6
|
from typing import List, Optional, Union
|
|
7
|
-
from typing_extensions import NotRequired, TypedDict
|
|
7
|
+
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
FIMCompletionStreamRequestStopTypedDict =
|
|
10
|
+
FIMCompletionStreamRequestStopTypedDict = TypeAliasType(
|
|
11
|
+
"FIMCompletionStreamRequestStopTypedDict", Union[str, List[str]]
|
|
12
|
+
)
|
|
11
13
|
r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array"""
|
|
12
14
|
|
|
13
15
|
|
|
14
|
-
FIMCompletionStreamRequestStop =
|
|
16
|
+
FIMCompletionStreamRequestStop = TypeAliasType(
|
|
17
|
+
"FIMCompletionStreamRequestStop", Union[str, List[str]]
|
|
18
|
+
)
|
|
15
19
|
r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array"""
|
|
16
20
|
|
|
17
21
|
|
mistralai/models/functioncall.py
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from mistralai.types import BaseModel
|
|
5
5
|
from typing import Any, Dict, Union
|
|
6
|
-
from typing_extensions import TypedDict
|
|
6
|
+
from typing_extensions import TypeAliasType, TypedDict
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
ArgumentsTypedDict = Union[Dict[str, Any], str]
|
|
9
|
+
ArgumentsTypedDict = TypeAliasType("ArgumentsTypedDict", Union[Dict[str, Any], str])
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
Arguments = Union[Dict[str, Any], str]
|
|
12
|
+
Arguments = TypeAliasType("Arguments", Union[Dict[str, Any], str])
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class FunctionCallTypedDict(TypedDict):
|
|
@@ -3,26 +3,26 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from .imageurl import ImageURL, ImageURLTypedDict
|
|
5
5
|
from mistralai.types import BaseModel
|
|
6
|
-
from mistralai.utils import validate_const
|
|
7
|
-
import pydantic
|
|
8
|
-
from pydantic.functional_validators import AfterValidator
|
|
9
6
|
from typing import Literal, Optional, Union
|
|
10
|
-
from typing_extensions import
|
|
7
|
+
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
11
8
|
|
|
12
9
|
|
|
13
|
-
|
|
10
|
+
ImageURLChunkImageURLTypedDict = TypeAliasType(
|
|
11
|
+
"ImageURLChunkImageURLTypedDict", Union[ImageURLTypedDict, str]
|
|
12
|
+
)
|
|
13
|
+
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
ImageURLChunkImageURL = TypeAliasType("ImageURLChunkImageURL", Union[ImageURL, str])
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
ImageURLChunkType = Literal["image_url"]
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
class ImageURLChunkTypedDict(TypedDict):
|
|
22
22
|
r"""{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,iVBORw0"""
|
|
23
23
|
|
|
24
24
|
image_url: ImageURLChunkImageURLTypedDict
|
|
25
|
-
type: ImageURLChunkType
|
|
25
|
+
type: NotRequired[ImageURLChunkType]
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
class ImageURLChunk(BaseModel):
|
|
@@ -30,9 +30,4 @@ class ImageURLChunk(BaseModel):
|
|
|
30
30
|
|
|
31
31
|
image_url: ImageURLChunkImageURL
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
Annotated[
|
|
35
|
-
Optional[ImageURLChunkType], AfterValidator(validate_const("image_url"))
|
|
36
|
-
],
|
|
37
|
-
pydantic.Field(alias="type"),
|
|
38
|
-
] = "image_url"
|
|
33
|
+
type: Optional[ImageURLChunkType] = "image_url"
|
mistralai/models/jobin.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from .finetuneablemodel import FineTuneableModel
|
|
5
4
|
from .githubrepositoryin import GithubRepositoryIn, GithubRepositoryInTypedDict
|
|
6
5
|
from .trainingfile import TrainingFile, TrainingFileTypedDict
|
|
7
6
|
from .trainingparametersin import TrainingParametersIn, TrainingParametersInTypedDict
|
|
@@ -25,7 +24,7 @@ JobInRepositories = GithubRepositoryIn
|
|
|
25
24
|
|
|
26
25
|
|
|
27
26
|
class JobInTypedDict(TypedDict):
|
|
28
|
-
model:
|
|
27
|
+
model: str
|
|
29
28
|
r"""The name of the model to fine-tune."""
|
|
30
29
|
hyperparameters: TrainingParametersInTypedDict
|
|
31
30
|
r"""The fine-tuning hyperparameter settings used in a fine-tune job."""
|
|
@@ -42,7 +41,7 @@ class JobInTypedDict(TypedDict):
|
|
|
42
41
|
|
|
43
42
|
|
|
44
43
|
class JobIn(BaseModel):
|
|
45
|
-
model:
|
|
44
|
+
model: str
|
|
46
45
|
r"""The name of the model to fine-tune."""
|
|
47
46
|
|
|
48
47
|
hyperparameters: TrainingParametersIn
|
mistralai/models/jobout.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from .finetuneablemodel import FineTuneableModel
|
|
5
4
|
from .githubrepositoryout import GithubRepositoryOut, GithubRepositoryOutTypedDict
|
|
6
5
|
from .jobmetadataout import JobMetadataOut, JobMetadataOutTypedDict
|
|
7
6
|
from .trainingparameters import TrainingParameters, TrainingParametersTypedDict
|
|
@@ -49,7 +48,7 @@ class JobOutTypedDict(TypedDict):
|
|
|
49
48
|
r"""The ID of the job."""
|
|
50
49
|
auto_start: bool
|
|
51
50
|
hyperparameters: TrainingParametersTypedDict
|
|
52
|
-
model:
|
|
51
|
+
model: str
|
|
53
52
|
r"""The name of the model to fine-tune."""
|
|
54
53
|
status: Status
|
|
55
54
|
r"""The current status of the fine-tuning job."""
|
|
@@ -85,7 +84,7 @@ class JobOut(BaseModel):
|
|
|
85
84
|
|
|
86
85
|
hyperparameters: TrainingParameters
|
|
87
86
|
|
|
88
|
-
model:
|
|
87
|
+
model: str
|
|
89
88
|
r"""The name of the model to fine-tune."""
|
|
90
89
|
|
|
91
90
|
status: Status
|
|
@@ -4,13 +4,18 @@ from __future__ import annotations
|
|
|
4
4
|
from .jobout import JobOut, JobOutTypedDict
|
|
5
5
|
from .legacyjobmetadataout import LegacyJobMetadataOut, LegacyJobMetadataOutTypedDict
|
|
6
6
|
from typing import Union
|
|
7
|
+
from typing_extensions import TypeAliasType
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
JobsAPIRoutesFineTuningCreateFineTuningJobResponseTypedDict =
|
|
10
|
-
|
|
11
|
-
]
|
|
10
|
+
JobsAPIRoutesFineTuningCreateFineTuningJobResponseTypedDict = TypeAliasType(
|
|
11
|
+
"JobsAPIRoutesFineTuningCreateFineTuningJobResponseTypedDict",
|
|
12
|
+
Union[LegacyJobMetadataOutTypedDict, JobOutTypedDict],
|
|
13
|
+
)
|
|
12
14
|
r"""OK"""
|
|
13
15
|
|
|
14
16
|
|
|
15
|
-
JobsAPIRoutesFineTuningCreateFineTuningJobResponse =
|
|
17
|
+
JobsAPIRoutesFineTuningCreateFineTuningJobResponse = TypeAliasType(
|
|
18
|
+
"JobsAPIRoutesFineTuningCreateFineTuningJobResponse",
|
|
19
|
+
Union[LegacyJobMetadataOut, JobOut],
|
|
20
|
+
)
|
|
16
21
|
r"""OK"""
|
mistralai/models/modellist.py
CHANGED
|
@@ -7,10 +7,12 @@ from mistralai.types import BaseModel
|
|
|
7
7
|
from mistralai.utils import get_discriminator
|
|
8
8
|
from pydantic import Discriminator, Tag
|
|
9
9
|
from typing import List, Optional, Union
|
|
10
|
-
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
10
|
+
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
DataTypedDict =
|
|
13
|
+
DataTypedDict = TypeAliasType(
|
|
14
|
+
"DataTypedDict", Union[BaseModelCardTypedDict, FTModelCardTypedDict]
|
|
15
|
+
)
|
|
14
16
|
|
|
15
17
|
|
|
16
18
|
Data = Annotated[
|
|
@@ -2,11 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from mistralai.types import BaseModel
|
|
5
|
-
from mistralai.utils import validate_const
|
|
6
|
-
import pydantic
|
|
7
|
-
from pydantic.functional_validators import AfterValidator
|
|
8
5
|
from typing import List, Literal, Optional
|
|
9
|
-
from typing_extensions import
|
|
6
|
+
from typing_extensions import NotRequired, TypedDict
|
|
10
7
|
|
|
11
8
|
|
|
12
9
|
ReferenceChunkType = Literal["reference"]
|
|
@@ -14,15 +11,10 @@ ReferenceChunkType = Literal["reference"]
|
|
|
14
11
|
|
|
15
12
|
class ReferenceChunkTypedDict(TypedDict):
|
|
16
13
|
reference_ids: List[int]
|
|
17
|
-
type: ReferenceChunkType
|
|
14
|
+
type: NotRequired[ReferenceChunkType]
|
|
18
15
|
|
|
19
16
|
|
|
20
17
|
class ReferenceChunk(BaseModel):
|
|
21
18
|
reference_ids: List[int]
|
|
22
19
|
|
|
23
|
-
|
|
24
|
-
Annotated[
|
|
25
|
-
Optional[ReferenceChunkType], AfterValidator(validate_const("reference"))
|
|
26
|
-
],
|
|
27
|
-
pydantic.Field(alias="type"),
|
|
28
|
-
] = "reference"
|
|
20
|
+
type: Optional[ReferenceChunkType] = "reference"
|
|
@@ -7,7 +7,7 @@ from mistralai.types import BaseModel
|
|
|
7
7
|
from mistralai.utils import FieldMetadata, PathParamMetadata, get_discriminator
|
|
8
8
|
from pydantic import Discriminator, Tag
|
|
9
9
|
from typing import Union
|
|
10
|
-
from typing_extensions import Annotated, TypedDict
|
|
10
|
+
from typing_extensions import Annotated, TypeAliasType, TypedDict
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class RetrieveModelV1ModelsModelIDGetRequestTypedDict(TypedDict):
|
|
@@ -22,9 +22,10 @@ class RetrieveModelV1ModelsModelIDGetRequest(BaseModel):
|
|
|
22
22
|
r"""The ID of the model to retrieve."""
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGetTypedDict =
|
|
26
|
-
|
|
27
|
-
]
|
|
25
|
+
RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGetTypedDict = TypeAliasType(
|
|
26
|
+
"RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGetTypedDict",
|
|
27
|
+
Union[BaseModelCardTypedDict, FTModelCardTypedDict],
|
|
28
|
+
)
|
|
28
29
|
r"""Successful Response"""
|
|
29
30
|
|
|
30
31
|
|
|
@@ -4,13 +4,17 @@ from __future__ import annotations
|
|
|
4
4
|
from .textchunk import TextChunk, TextChunkTypedDict
|
|
5
5
|
from mistralai.types import BaseModel
|
|
6
6
|
from typing import List, Literal, Optional, Union
|
|
7
|
-
from typing_extensions import NotRequired, TypedDict
|
|
7
|
+
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
SystemMessageContentTypedDict =
|
|
10
|
+
SystemMessageContentTypedDict = TypeAliasType(
|
|
11
|
+
"SystemMessageContentTypedDict", Union[str, List[TextChunkTypedDict]]
|
|
12
|
+
)
|
|
11
13
|
|
|
12
14
|
|
|
13
|
-
SystemMessageContent =
|
|
15
|
+
SystemMessageContent = TypeAliasType(
|
|
16
|
+
"SystemMessageContent", Union[str, List[TextChunk]]
|
|
17
|
+
)
|
|
14
18
|
|
|
15
19
|
|
|
16
20
|
Role = Literal["system"]
|
mistralai/models/textchunk.py
CHANGED
|
@@ -2,11 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from mistralai.types import BaseModel
|
|
5
|
-
from mistralai.utils import validate_const
|
|
6
|
-
import pydantic
|
|
7
|
-
from pydantic.functional_validators import AfterValidator
|
|
8
5
|
from typing import Literal, Optional
|
|
9
|
-
from typing_extensions import
|
|
6
|
+
from typing_extensions import NotRequired, TypedDict
|
|
10
7
|
|
|
11
8
|
|
|
12
9
|
TextChunkType = Literal["text"]
|
|
@@ -14,13 +11,10 @@ TextChunkType = Literal["text"]
|
|
|
14
11
|
|
|
15
12
|
class TextChunkTypedDict(TypedDict):
|
|
16
13
|
text: str
|
|
17
|
-
type: TextChunkType
|
|
14
|
+
type: NotRequired[TextChunkType]
|
|
18
15
|
|
|
19
16
|
|
|
20
17
|
class TextChunk(BaseModel):
|
|
21
18
|
text: str
|
|
22
19
|
|
|
23
|
-
|
|
24
|
-
Annotated[Optional[TextChunkType], AfterValidator(validate_const("text"))],
|
|
25
|
-
pydantic.Field(alias="type"),
|
|
26
|
-
] = "text"
|
|
20
|
+
type: Optional[TextChunkType] = "text"
|
mistralai/models/toolmessage.py
CHANGED
|
@@ -5,13 +5,15 @@ from .contentchunk import ContentChunk, ContentChunkTypedDict
|
|
|
5
5
|
from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
6
6
|
from pydantic import model_serializer
|
|
7
7
|
from typing import List, Literal, Optional, Union
|
|
8
|
-
from typing_extensions import NotRequired, TypedDict
|
|
8
|
+
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
ToolMessageContentTypedDict =
|
|
11
|
+
ToolMessageContentTypedDict = TypeAliasType(
|
|
12
|
+
"ToolMessageContentTypedDict", Union[str, List[ContentChunkTypedDict]]
|
|
13
|
+
)
|
|
12
14
|
|
|
13
15
|
|
|
14
|
-
ToolMessageContent = Union[str, List[ContentChunk]]
|
|
16
|
+
ToolMessageContent = TypeAliasType("ToolMessageContent", Union[str, List[ContentChunk]])
|
|
15
17
|
|
|
16
18
|
|
|
17
19
|
ToolMessageRole = Literal["tool"]
|
mistralai/models/usermessage.py
CHANGED
|
@@ -5,13 +5,15 @@ from .contentchunk import ContentChunk, ContentChunkTypedDict
|
|
|
5
5
|
from mistralai.types import BaseModel, Nullable, UNSET_SENTINEL
|
|
6
6
|
from pydantic import model_serializer
|
|
7
7
|
from typing import List, Literal, Optional, Union
|
|
8
|
-
from typing_extensions import NotRequired, TypedDict
|
|
8
|
+
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
UserMessageContentTypedDict =
|
|
11
|
+
UserMessageContentTypedDict = TypeAliasType(
|
|
12
|
+
"UserMessageContentTypedDict", Union[str, List[ContentChunkTypedDict]]
|
|
13
|
+
)
|
|
12
14
|
|
|
13
15
|
|
|
14
|
-
UserMessageContent = Union[str, List[ContentChunk]]
|
|
16
|
+
UserMessageContent = TypeAliasType("UserMessageContent", Union[str, List[ContentChunk]])
|
|
15
17
|
|
|
16
18
|
|
|
17
19
|
UserMessageRole = Literal["user"]
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from mistralai.types import BaseModel
|
|
5
5
|
from typing import List, Union
|
|
6
|
-
from typing_extensions import TypedDict
|
|
6
|
+
from typing_extensions import TypeAliasType, TypedDict
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
LocTypedDict = Union[str, int]
|
|
9
|
+
LocTypedDict = TypeAliasType("LocTypedDict", Union[str, int])
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
Loc = Union[str, int]
|
|
12
|
+
Loc = TypeAliasType("Loc", Union[str, int])
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class ValidationErrorTypedDict(TypedDict):
|
mistralai/sdk.py
CHANGED
|
@@ -129,3 +129,17 @@ class Mistral(BaseSDK):
|
|
|
129
129
|
self.agents = Agents(self.sdk_configuration)
|
|
130
130
|
self.embeddings = Embeddings(self.sdk_configuration)
|
|
131
131
|
self.classifiers = Classifiers(self.sdk_configuration)
|
|
132
|
+
|
|
133
|
+
def __enter__(self):
|
|
134
|
+
return self
|
|
135
|
+
|
|
136
|
+
async def __aenter__(self):
|
|
137
|
+
return self
|
|
138
|
+
|
|
139
|
+
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
140
|
+
if self.sdk_configuration.client is not None:
|
|
141
|
+
self.sdk_configuration.client.close()
|
|
142
|
+
|
|
143
|
+
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
|
144
|
+
if self.sdk_configuration.async_client is not None:
|
|
145
|
+
await self.sdk_configuration.async_client.aclose()
|
mistralai/sdkconfiguration.py
CHANGED
|
@@ -28,9 +28,9 @@ class SDKConfiguration:
|
|
|
28
28
|
server: Optional[str] = ""
|
|
29
29
|
language: str = "python"
|
|
30
30
|
openapi_doc_version: str = "0.0.2"
|
|
31
|
-
sdk_version: str = "1.2.
|
|
32
|
-
gen_version: str = "2.
|
|
33
|
-
user_agent: str = "speakeasy-sdk/python 1.2.
|
|
31
|
+
sdk_version: str = "1.2.5"
|
|
32
|
+
gen_version: str = "2.470.1"
|
|
33
|
+
user_agent: str = "speakeasy-sdk/python 1.2.5 2.470.1 0.0.2 mistralai"
|
|
34
34
|
retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET)
|
|
35
35
|
timeout_ms: Optional[int] = None
|
|
36
36
|
|