mistralai 1.0.0rc1__py3-none-any.whl → 1.0.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/agents.py +434 -0
- mistralai/basesdk.py +43 -6
- mistralai/chat.py +29 -34
- mistralai/client.py +1 -1
- mistralai/embeddings.py +4 -4
- mistralai/files.py +10 -10
- mistralai/fim.py +17 -18
- mistralai/fine_tuning.py +10 -849
- mistralai/jobs.py +844 -0
- mistralai/models/__init__.py +6 -4
- mistralai/models/agentscompletionrequest.py +96 -0
- mistralai/models/agentscompletionstreamrequest.py +92 -0
- mistralai/models/assistantmessage.py +4 -9
- mistralai/models/chatcompletionchoice.py +4 -15
- mistralai/models/chatcompletionrequest.py +25 -30
- mistralai/models/chatcompletionstreamrequest.py +25 -30
- mistralai/models/completionresponsestreamchoice.py +4 -9
- mistralai/models/delete_model_v1_models_model_id_deleteop.py +2 -0
- mistralai/models/deltamessage.py +7 -12
- mistralai/models/detailedjobout.py +4 -9
- mistralai/models/embeddingrequest.py +12 -17
- mistralai/models/eventout.py +4 -9
- mistralai/models/fileschema.py +4 -9
- mistralai/models/fimcompletionrequest.py +19 -24
- mistralai/models/fimcompletionstreamrequest.py +19 -24
- mistralai/models/ftmodelout.py +4 -9
- mistralai/models/functioncall.py +9 -3
- mistralai/models/githubrepositoryin.py +4 -9
- mistralai/models/githubrepositoryout.py +4 -9
- mistralai/models/httpvalidationerror.py +1 -1
- mistralai/models/jobin.py +4 -9
- mistralai/models/jobmetadataout.py +4 -9
- mistralai/models/jobout.py +4 -9
- mistralai/models/jobs_api_routes_fine_tuning_archive_fine_tuned_modelop.py +2 -0
- mistralai/models/jobs_api_routes_fine_tuning_create_fine_tuning_jobop.py +1 -59
- mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobsop.py +4 -9
- mistralai/models/jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelop.py +2 -0
- mistralai/models/jobs_api_routes_fine_tuning_update_fine_tuned_modelop.py +2 -0
- mistralai/models/legacyjobmetadataout.py +4 -9
- mistralai/models/metricout.py +4 -9
- mistralai/models/modelcard.py +4 -9
- mistralai/models/retrieve_model_v1_models_model_id_getop.py +2 -0
- mistralai/models/retrievefileout.py +4 -9
- mistralai/models/security.py +4 -4
- mistralai/models/systemmessage.py +6 -6
- mistralai/models/toolmessage.py +4 -9
- mistralai/models/trainingparameters.py +4 -9
- mistralai/models/trainingparametersin.py +4 -9
- mistralai/models/updateftmodelin.py +4 -9
- mistralai/models/uploadfileout.py +4 -9
- mistralai/models/usermessage.py +6 -6
- mistralai/models/validationerror.py +6 -6
- mistralai/models/wandbintegration.py +4 -9
- mistralai/models/wandbintegrationout.py +4 -9
- mistralai/models_.py +24 -24
- mistralai/sdk.py +14 -6
- mistralai/sdkconfiguration.py +5 -4
- mistralai/types/basemodel.py +10 -6
- mistralai/utils/__init__.py +4 -0
- mistralai/utils/eventstreaming.py +8 -9
- mistralai/utils/logger.py +16 -0
- mistralai/utils/retries.py +2 -2
- mistralai/utils/security.py +5 -2
- {mistralai-1.0.0rc1.dist-info → mistralai-1.0.1.dist-info}/METADATA +153 -69
- {mistralai-1.0.0rc1.dist-info → mistralai-1.0.1.dist-info}/RECORD +114 -107
- mistralai_azure/basesdk.py +42 -4
- mistralai_azure/chat.py +15 -20
- mistralai_azure/models/__init__.py +3 -3
- mistralai_azure/models/assistantmessage.py +4 -9
- mistralai_azure/models/chatcompletionchoice.py +4 -15
- mistralai_azure/models/chatcompletionrequest.py +21 -26
- mistralai_azure/models/chatcompletionstreamrequest.py +21 -26
- mistralai_azure/models/completionresponsestreamchoice.py +4 -9
- mistralai_azure/models/deltamessage.py +7 -12
- mistralai_azure/models/functioncall.py +9 -3
- mistralai_azure/models/httpvalidationerror.py +1 -1
- mistralai_azure/models/systemmessage.py +6 -6
- mistralai_azure/models/toolmessage.py +4 -9
- mistralai_azure/models/usermessage.py +6 -6
- mistralai_azure/models/validationerror.py +6 -6
- mistralai_azure/sdk.py +7 -2
- mistralai_azure/sdkconfiguration.py +5 -4
- mistralai_azure/types/basemodel.py +10 -6
- mistralai_azure/utils/__init__.py +4 -0
- mistralai_azure/utils/eventstreaming.py +8 -9
- mistralai_azure/utils/logger.py +16 -0
- mistralai_azure/utils/retries.py +2 -2
- mistralai_gcp/basesdk.py +42 -4
- mistralai_gcp/chat.py +12 -17
- mistralai_gcp/fim.py +12 -13
- mistralai_gcp/models/__init__.py +3 -3
- mistralai_gcp/models/assistantmessage.py +4 -9
- mistralai_gcp/models/chatcompletionchoice.py +4 -15
- mistralai_gcp/models/chatcompletionrequest.py +23 -28
- mistralai_gcp/models/chatcompletionstreamrequest.py +23 -28
- mistralai_gcp/models/completionresponsestreamchoice.py +4 -9
- mistralai_gcp/models/deltamessage.py +7 -12
- mistralai_gcp/models/fimcompletionrequest.py +19 -24
- mistralai_gcp/models/fimcompletionstreamrequest.py +19 -24
- mistralai_gcp/models/functioncall.py +9 -3
- mistralai_gcp/models/httpvalidationerror.py +1 -1
- mistralai_gcp/models/systemmessage.py +6 -6
- mistralai_gcp/models/toolmessage.py +4 -9
- mistralai_gcp/models/usermessage.py +6 -6
- mistralai_gcp/models/validationerror.py +6 -6
- mistralai_gcp/sdk.py +9 -0
- mistralai_gcp/sdkconfiguration.py +5 -4
- mistralai_gcp/types/basemodel.py +10 -6
- mistralai_gcp/utils/__init__.py +4 -0
- mistralai_gcp/utils/eventstreaming.py +8 -9
- mistralai_gcp/utils/logger.py +16 -0
- mistralai_gcp/utils/retries.py +2 -2
- {mistralai-1.0.0rc1.dist-info → mistralai-1.0.1.dist-info}/LICENSE +0 -0
- {mistralai-1.0.0rc1.dist-info → mistralai-1.0.1.dist-info}/WHEEL +0 -0
mistralai_gcp/utils/__init__.py
CHANGED
|
@@ -34,6 +34,7 @@ from .serializers import (
|
|
|
34
34
|
)
|
|
35
35
|
from .url import generate_url, template_url, remove_suffix
|
|
36
36
|
from .values import get_global_from_env, match_content_type, match_status_codes, match_response
|
|
37
|
+
from .logger import Logger, get_body_content, NoOpLogger
|
|
37
38
|
|
|
38
39
|
__all__ = [
|
|
39
40
|
"BackoffStrategy",
|
|
@@ -41,6 +42,7 @@ __all__ = [
|
|
|
41
42
|
"find_metadata",
|
|
42
43
|
"FormMetadata",
|
|
43
44
|
"generate_url",
|
|
45
|
+
"get_body_content",
|
|
44
46
|
"get_discriminator",
|
|
45
47
|
"get_global_from_env",
|
|
46
48
|
"get_headers",
|
|
@@ -49,11 +51,13 @@ __all__ = [
|
|
|
49
51
|
"get_response_headers",
|
|
50
52
|
"get_security",
|
|
51
53
|
"HeaderMetadata",
|
|
54
|
+
"Logger",
|
|
52
55
|
"marshal_json",
|
|
53
56
|
"match_content_type",
|
|
54
57
|
"match_status_codes",
|
|
55
58
|
"match_response",
|
|
56
59
|
"MultipartFormMetadata",
|
|
60
|
+
"NoOpLogger",
|
|
57
61
|
"OpenEnumMeta",
|
|
58
62
|
"PathParamMetadata",
|
|
59
63
|
"QueryParamMetadata",
|
|
@@ -147,15 +147,14 @@ def _parse_event(
|
|
|
147
147
|
data = data[:-1]
|
|
148
148
|
event.data = data
|
|
149
149
|
|
|
150
|
-
|
|
151
|
-
data.isnumeric()
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
or data
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
):
|
|
150
|
+
data_is_primitive = (
|
|
151
|
+
data.isnumeric() or data == "true" or data == "false" or data == "null"
|
|
152
|
+
)
|
|
153
|
+
data_is_json = (
|
|
154
|
+
data.startswith("{") or data.startswith("[") or data.startswith('"')
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
if data_is_primitive or data_is_json:
|
|
159
158
|
try:
|
|
160
159
|
event.data = json.loads(data)
|
|
161
160
|
except Exception:
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
import httpx
|
|
4
|
+
from typing import Any, Protocol
|
|
5
|
+
|
|
6
|
+
class Logger(Protocol):
|
|
7
|
+
def debug(self, msg: str, *args: Any, **kwargs: Any) -> None:
|
|
8
|
+
pass
|
|
9
|
+
|
|
10
|
+
class NoOpLogger:
|
|
11
|
+
def debug(self, msg: str, *args: Any, **kwargs: Any) -> None:
|
|
12
|
+
pass
|
|
13
|
+
|
|
14
|
+
def get_body_content(req: httpx.Request) -> str:
|
|
15
|
+
return "<streaming body>" if not hasattr(req, "_content") else str(req.content)
|
|
16
|
+
|
mistralai_gcp/utils/retries.py
CHANGED
|
@@ -76,7 +76,7 @@ def retry(func, retries: Retries):
|
|
|
76
76
|
|
|
77
77
|
status_major = res.status_code / 100
|
|
78
78
|
|
|
79
|
-
if
|
|
79
|
+
if code_range <= status_major < code_range + 1:
|
|
80
80
|
raise TemporaryError(res)
|
|
81
81
|
else:
|
|
82
82
|
parsed_code = int(code)
|
|
@@ -125,7 +125,7 @@ async def retry_async(func, retries: Retries):
|
|
|
125
125
|
|
|
126
126
|
status_major = res.status_code / 100
|
|
127
127
|
|
|
128
|
-
if
|
|
128
|
+
if code_range <= status_major < code_range + 1:
|
|
129
129
|
raise TemporaryError(res)
|
|
130
130
|
else:
|
|
131
131
|
parsed_code = int(code)
|
|
File without changes
|
|
File without changes
|