mistralai 1.5.0__py3-none-any.whl → 1.5.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/_version.py +2 -2
- mistralai/chat.py +5 -5
- mistralai/classifiers.py +27 -25
- mistralai/embeddings.py +2 -8
- mistralai/fim.py +5 -5
- mistralai/models/__init__.py +38 -16
- mistralai/models/assistantmessage.py +2 -0
- mistralai/models/chatcompletionrequest.py +3 -10
- mistralai/models/chatcompletionstreamrequest.py +3 -10
- mistralai/models/chatmoderationrequest.py +86 -0
- mistralai/models/classificationrequest.py +7 -36
- mistralai/models/contentchunk.py +8 -1
- mistralai/models/documenturlchunk.py +62 -0
- mistralai/models/embeddingrequest.py +1 -37
- mistralai/models/fimcompletionrequest.py +2 -3
- mistralai/models/fimcompletionstreamrequest.py +2 -3
- mistralai/models/ocrimageobject.py +77 -0
- mistralai/models/ocrpagedimensions.py +25 -0
- mistralai/models/ocrpageobject.py +64 -0
- mistralai/models/ocrrequest.py +97 -0
- mistralai/models/ocrresponse.py +26 -0
- mistralai/models/ocrusageinfo.py +51 -0
- mistralai/models/prediction.py +4 -5
- mistralai/ocr.py +238 -0
- mistralai/sdk.py +4 -0
- {mistralai-1.5.0.dist-info → mistralai-1.5.1.dist-info}/METADATA +5 -1
- {mistralai-1.5.0.dist-info → mistralai-1.5.1.dist-info}/RECORD +29 -21
- {mistralai-1.5.0.dist-info → mistralai-1.5.1.dist-info}/WHEEL +1 -1
- mistralai/models/chatclassificationrequest.py +0 -113
- {mistralai-1.5.0.dist-info → mistralai-1.5.1.dist-info}/LICENSE +0 -0
mistralai/ocr.py
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from .basesdk import BaseSDK
|
|
4
|
+
from mistralai import models, utils
|
|
5
|
+
from mistralai._hooks import HookContext
|
|
6
|
+
from mistralai.types import Nullable, OptionalNullable, UNSET
|
|
7
|
+
from mistralai.utils import get_security_from_env
|
|
8
|
+
from typing import Any, List, Mapping, Optional, Union
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Ocr(BaseSDK):
|
|
12
|
+
r"""OCR API"""
|
|
13
|
+
|
|
14
|
+
def process(
|
|
15
|
+
self,
|
|
16
|
+
*,
|
|
17
|
+
model: Nullable[str],
|
|
18
|
+
document: Union[models.Document, models.DocumentTypedDict],
|
|
19
|
+
id: Optional[str] = None,
|
|
20
|
+
pages: OptionalNullable[List[int]] = UNSET,
|
|
21
|
+
include_image_base64: OptionalNullable[bool] = UNSET,
|
|
22
|
+
image_limit: OptionalNullable[int] = UNSET,
|
|
23
|
+
image_min_size: OptionalNullable[int] = UNSET,
|
|
24
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
25
|
+
server_url: Optional[str] = None,
|
|
26
|
+
timeout_ms: Optional[int] = None,
|
|
27
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
28
|
+
) -> models.OCRResponse:
|
|
29
|
+
r"""OCR
|
|
30
|
+
|
|
31
|
+
:param model:
|
|
32
|
+
:param document: Document to run OCR on
|
|
33
|
+
:param id:
|
|
34
|
+
:param pages: Specific pages user wants to process in various formats: single number, range, or list of both. Starts from 0
|
|
35
|
+
:param include_image_base64: Include image URLs in response
|
|
36
|
+
:param image_limit: Max images to extract
|
|
37
|
+
:param image_min_size: Minimum height and width of image to extract
|
|
38
|
+
:param retries: Override the default retry configuration for this method
|
|
39
|
+
:param server_url: Override the default server URL for this method
|
|
40
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
41
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
42
|
+
"""
|
|
43
|
+
base_url = None
|
|
44
|
+
url_variables = None
|
|
45
|
+
if timeout_ms is None:
|
|
46
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
47
|
+
|
|
48
|
+
if server_url is not None:
|
|
49
|
+
base_url = server_url
|
|
50
|
+
|
|
51
|
+
request = models.OCRRequest(
|
|
52
|
+
model=model,
|
|
53
|
+
id=id,
|
|
54
|
+
document=utils.get_pydantic_model(document, models.Document),
|
|
55
|
+
pages=pages,
|
|
56
|
+
include_image_base64=include_image_base64,
|
|
57
|
+
image_limit=image_limit,
|
|
58
|
+
image_min_size=image_min_size,
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
req = self._build_request(
|
|
62
|
+
method="POST",
|
|
63
|
+
path="/v1/ocr",
|
|
64
|
+
base_url=base_url,
|
|
65
|
+
url_variables=url_variables,
|
|
66
|
+
request=request,
|
|
67
|
+
request_body_required=True,
|
|
68
|
+
request_has_path_params=False,
|
|
69
|
+
request_has_query_params=True,
|
|
70
|
+
user_agent_header="user-agent",
|
|
71
|
+
accept_header_value="application/json",
|
|
72
|
+
http_headers=http_headers,
|
|
73
|
+
security=self.sdk_configuration.security,
|
|
74
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
75
|
+
request, False, False, "json", models.OCRRequest
|
|
76
|
+
),
|
|
77
|
+
timeout_ms=timeout_ms,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
if retries == UNSET:
|
|
81
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
82
|
+
retries = self.sdk_configuration.retry_config
|
|
83
|
+
|
|
84
|
+
retry_config = None
|
|
85
|
+
if isinstance(retries, utils.RetryConfig):
|
|
86
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
87
|
+
|
|
88
|
+
http_res = self.do_request(
|
|
89
|
+
hook_ctx=HookContext(
|
|
90
|
+
operation_id="ocr_v1_ocr_post",
|
|
91
|
+
oauth2_scopes=[],
|
|
92
|
+
security_source=get_security_from_env(
|
|
93
|
+
self.sdk_configuration.security, models.Security
|
|
94
|
+
),
|
|
95
|
+
),
|
|
96
|
+
request=req,
|
|
97
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
98
|
+
retry_config=retry_config,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
data: Any = None
|
|
102
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
103
|
+
return utils.unmarshal_json(http_res.text, models.OCRResponse)
|
|
104
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
105
|
+
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
|
106
|
+
raise models.HTTPValidationError(data=data)
|
|
107
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
108
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
109
|
+
raise models.SDKError(
|
|
110
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
111
|
+
)
|
|
112
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
113
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
114
|
+
raise models.SDKError(
|
|
115
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
content_type = http_res.headers.get("Content-Type")
|
|
119
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
120
|
+
raise models.SDKError(
|
|
121
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
122
|
+
http_res.status_code,
|
|
123
|
+
http_res_text,
|
|
124
|
+
http_res,
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
async def process_async(
|
|
128
|
+
self,
|
|
129
|
+
*,
|
|
130
|
+
model: Nullable[str],
|
|
131
|
+
document: Union[models.Document, models.DocumentTypedDict],
|
|
132
|
+
id: Optional[str] = None,
|
|
133
|
+
pages: OptionalNullable[List[int]] = UNSET,
|
|
134
|
+
include_image_base64: OptionalNullable[bool] = UNSET,
|
|
135
|
+
image_limit: OptionalNullable[int] = UNSET,
|
|
136
|
+
image_min_size: OptionalNullable[int] = UNSET,
|
|
137
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
138
|
+
server_url: Optional[str] = None,
|
|
139
|
+
timeout_ms: Optional[int] = None,
|
|
140
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
141
|
+
) -> models.OCRResponse:
|
|
142
|
+
r"""OCR
|
|
143
|
+
|
|
144
|
+
:param model:
|
|
145
|
+
:param document: Document to run OCR on
|
|
146
|
+
:param id:
|
|
147
|
+
:param pages: Specific pages user wants to process in various formats: single number, range, or list of both. Starts from 0
|
|
148
|
+
:param include_image_base64: Include image URLs in response
|
|
149
|
+
:param image_limit: Max images to extract
|
|
150
|
+
:param image_min_size: Minimum height and width of image to extract
|
|
151
|
+
:param retries: Override the default retry configuration for this method
|
|
152
|
+
:param server_url: Override the default server URL for this method
|
|
153
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
154
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
155
|
+
"""
|
|
156
|
+
base_url = None
|
|
157
|
+
url_variables = None
|
|
158
|
+
if timeout_ms is None:
|
|
159
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
160
|
+
|
|
161
|
+
if server_url is not None:
|
|
162
|
+
base_url = server_url
|
|
163
|
+
|
|
164
|
+
request = models.OCRRequest(
|
|
165
|
+
model=model,
|
|
166
|
+
id=id,
|
|
167
|
+
document=utils.get_pydantic_model(document, models.Document),
|
|
168
|
+
pages=pages,
|
|
169
|
+
include_image_base64=include_image_base64,
|
|
170
|
+
image_limit=image_limit,
|
|
171
|
+
image_min_size=image_min_size,
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
req = self._build_request_async(
|
|
175
|
+
method="POST",
|
|
176
|
+
path="/v1/ocr",
|
|
177
|
+
base_url=base_url,
|
|
178
|
+
url_variables=url_variables,
|
|
179
|
+
request=request,
|
|
180
|
+
request_body_required=True,
|
|
181
|
+
request_has_path_params=False,
|
|
182
|
+
request_has_query_params=True,
|
|
183
|
+
user_agent_header="user-agent",
|
|
184
|
+
accept_header_value="application/json",
|
|
185
|
+
http_headers=http_headers,
|
|
186
|
+
security=self.sdk_configuration.security,
|
|
187
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
188
|
+
request, False, False, "json", models.OCRRequest
|
|
189
|
+
),
|
|
190
|
+
timeout_ms=timeout_ms,
|
|
191
|
+
)
|
|
192
|
+
|
|
193
|
+
if retries == UNSET:
|
|
194
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
195
|
+
retries = self.sdk_configuration.retry_config
|
|
196
|
+
|
|
197
|
+
retry_config = None
|
|
198
|
+
if isinstance(retries, utils.RetryConfig):
|
|
199
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
200
|
+
|
|
201
|
+
http_res = await self.do_request_async(
|
|
202
|
+
hook_ctx=HookContext(
|
|
203
|
+
operation_id="ocr_v1_ocr_post",
|
|
204
|
+
oauth2_scopes=[],
|
|
205
|
+
security_source=get_security_from_env(
|
|
206
|
+
self.sdk_configuration.security, models.Security
|
|
207
|
+
),
|
|
208
|
+
),
|
|
209
|
+
request=req,
|
|
210
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
211
|
+
retry_config=retry_config,
|
|
212
|
+
)
|
|
213
|
+
|
|
214
|
+
data: Any = None
|
|
215
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
216
|
+
return utils.unmarshal_json(http_res.text, models.OCRResponse)
|
|
217
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
218
|
+
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
|
219
|
+
raise models.HTTPValidationError(data=data)
|
|
220
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
221
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
222
|
+
raise models.SDKError(
|
|
223
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
224
|
+
)
|
|
225
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
226
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
227
|
+
raise models.SDKError(
|
|
228
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
229
|
+
)
|
|
230
|
+
|
|
231
|
+
content_type = http_res.headers.get("Content-Type")
|
|
232
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
233
|
+
raise models.SDKError(
|
|
234
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
235
|
+
http_res.status_code,
|
|
236
|
+
http_res_text,
|
|
237
|
+
http_res,
|
|
238
|
+
)
|
mistralai/sdk.py
CHANGED
|
@@ -17,6 +17,7 @@ from mistralai.files import Files
|
|
|
17
17
|
from mistralai.fim import Fim
|
|
18
18
|
from mistralai.fine_tuning import FineTuning
|
|
19
19
|
from mistralai.models_ import Models
|
|
20
|
+
from mistralai.ocr import Ocr
|
|
20
21
|
from mistralai.types import OptionalNullable, UNSET
|
|
21
22
|
from typing import Any, Callable, Dict, Optional, Union, cast
|
|
22
23
|
import weakref
|
|
@@ -41,6 +42,8 @@ class Mistral(BaseSDK):
|
|
|
41
42
|
r"""Embeddings API."""
|
|
42
43
|
classifiers: Classifiers
|
|
43
44
|
r"""Classifiers API."""
|
|
45
|
+
ocr: Ocr
|
|
46
|
+
r"""OCR API"""
|
|
44
47
|
|
|
45
48
|
def __init__(
|
|
46
49
|
self,
|
|
@@ -139,6 +142,7 @@ class Mistral(BaseSDK):
|
|
|
139
142
|
self.agents = Agents(self.sdk_configuration)
|
|
140
143
|
self.embeddings = Embeddings(self.sdk_configuration)
|
|
141
144
|
self.classifiers = Classifiers(self.sdk_configuration)
|
|
145
|
+
self.ocr = Ocr(self.sdk_configuration)
|
|
142
146
|
|
|
143
147
|
def __enter__(self):
|
|
144
148
|
return self
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: mistralai
|
|
3
|
-
Version: 1.5.
|
|
3
|
+
Version: 1.5.1
|
|
4
4
|
Summary: Python Client SDK for the Mistral AI API.
|
|
5
5
|
Author: Mistral
|
|
6
6
|
Requires-Python: >=3.8
|
|
@@ -467,6 +467,10 @@ The documentation for the GCP SDK is available [here](https://github.com/mistral
|
|
|
467
467
|
* [archive](https://github.com/mistralai/client-python/blob/master/docs/sdks/models/README.md#archive) - Archive Fine Tuned Model
|
|
468
468
|
* [unarchive](https://github.com/mistralai/client-python/blob/master/docs/sdks/models/README.md#unarchive) - Unarchive Fine Tuned Model
|
|
469
469
|
|
|
470
|
+
### [ocr](https://github.com/mistralai/client-python/blob/master/docs/sdks/ocr/README.md)
|
|
471
|
+
|
|
472
|
+
* [process](https://github.com/mistralai/client-python/blob/master/docs/sdks/ocr/README.md#process) - OCR
|
|
473
|
+
|
|
470
474
|
</details>
|
|
471
475
|
<!-- End Available Resources and Operations [operations] -->
|
|
472
476
|
|
|
@@ -131,15 +131,15 @@ mistralai/_hooks/deprecation_warning.py,sha256=eyEOf7-o9uqqNWJnufD2RXp3dYrGV4in9
|
|
|
131
131
|
mistralai/_hooks/registration.py,sha256=ML0W-XbE4WYdJ4eGks_XxF2aLCJTaIWjQATFGzFwvyU,861
|
|
132
132
|
mistralai/_hooks/sdkhooks.py,sha256=s-orhdvnV89TmI3QiPC2LWQtYeM9RrsG1CTll-fYZmQ,2559
|
|
133
133
|
mistralai/_hooks/types.py,sha256=vUkTVk_TSaK10aEj368KYWvnd4T5EsawixMcTro_UHc,2570
|
|
134
|
-
mistralai/_version.py,sha256=
|
|
134
|
+
mistralai/_version.py,sha256=pBAiPZarkMWJ_MM3cNcwKrR6I5rxAjX8exNV9MXZ99Y,460
|
|
135
135
|
mistralai/agents.py,sha256=63-FJfMJ_9Qb0O0-uorAJM8km4FHpCEjjIk14margM8,31392
|
|
136
136
|
mistralai/async_client.py,sha256=KUdYxIIqoD6L7vB0EGwUR6lQ0NK5iCTHjnLVR9CVcJY,355
|
|
137
137
|
mistralai/basesdk.py,sha256=da0sFeLR-ztU5-fuGJ4TMqUnnqSzXbPAjpNgKI52tBk,11999
|
|
138
138
|
mistralai/batch.py,sha256=YN4D0Duwrap9Ysmp_lRpADYp1Znay7THE_z8ERGvDds,501
|
|
139
|
-
mistralai/chat.py,sha256=
|
|
140
|
-
mistralai/classifiers.py,sha256=
|
|
139
|
+
mistralai/chat.py,sha256=TpFLC7pprrJ3rf3pL3RQRbFeruuihu_Vo9sRKLr2koU,39289
|
|
140
|
+
mistralai/classifiers.py,sha256=VpnCqw1H4saN_6-xjT8592lQIs5GNfZ9s5UvcacG5v0,16808
|
|
141
141
|
mistralai/client.py,sha256=hrPg-LciKMKiascF0WbRRmqQyCv1lb2yDh6j-aaKVNo,509
|
|
142
|
-
mistralai/embeddings.py,sha256=
|
|
142
|
+
mistralai/embeddings.py,sha256=aCjn43G2gzV2GSNap0xmNxAN5_xygC_9QFT4lMbZhAM,8244
|
|
143
143
|
mistralai/extra/README.md,sha256=BTS9fy0ijkiUP7ZVoFQ7FVBxHtXIXqucYZyy_ucFjo4,1739
|
|
144
144
|
mistralai/extra/__init__.py,sha256=MHf0pUgLc9Sb7eTUE31JlE2FKMxfQupmJ_iR8UkgQ9w,360
|
|
145
145
|
mistralai/extra/struct_chat.py,sha256=ZkpdExC5rgC-nBZ44hQIVhQmK6lYMk36RBSFPZMFaIg,2157
|
|
@@ -150,42 +150,43 @@ mistralai/extra/utils/__init__.py,sha256=SExo5t_hx0ybiQhVJIG3r3hOA-Pfny3lIO_WsqN
|
|
|
150
150
|
mistralai/extra/utils/_pydantic_helper.py,sha256=kU_HbsSl1qGXnrrHnBcxun2MtHowu8eBp3jYMyFsPWw,859
|
|
151
151
|
mistralai/extra/utils/response_format.py,sha256=OiIpNXMODKJ6U2QDCXxPHBoVtXzXF7jtBzCLmI4t_CU,907
|
|
152
152
|
mistralai/files.py,sha256=E1-MxJc-84IdKrc-0k-bvYNa7OSoNFCQ7wBX9tMnFb8,44359
|
|
153
|
-
mistralai/fim.py,sha256=
|
|
153
|
+
mistralai/fim.py,sha256=14IVw1I6OkNVHx6g7cgXlwp5ZxuTku_8BNRL8FYntG0,27239
|
|
154
154
|
mistralai/fine_tuning.py,sha256=UENQqfE054VEsAYxdruV-TBLFIFfO-joXNznH08GUvE,477
|
|
155
155
|
mistralai/httpclient.py,sha256=N-D-srtDBykpfyVKacTY4upDGvNLqdWlEYqhJvta99E,4194
|
|
156
156
|
mistralai/jobs.py,sha256=SVNlvn8XGaCkNJ5tKOKci5QLavacmkNqoYeIGF4ik0Q,43481
|
|
157
157
|
mistralai/mistral_jobs.py,sha256=2ScKd2Tv79-MWxEQkrqr53Ikya8rmTbSiJ96judp7DY,30166
|
|
158
|
-
mistralai/models/__init__.py,sha256=
|
|
158
|
+
mistralai/models/__init__.py,sha256=39Owsya5LkbCsZIu_EUeXPq2WWcKVl0Fg1A6Ce-6vxI,22771
|
|
159
159
|
mistralai/models/agentscompletionrequest.py,sha256=2tV6_p33zLCfBD7EzlAVeSjG0E_pknbVZlbQFM3Lulc,7794
|
|
160
160
|
mistralai/models/agentscompletionstreamrequest.py,sha256=D1fla5nnnwNKXwHG1w4XVGnqaEvx6sOuhTXdP_e65sM,7239
|
|
161
161
|
mistralai/models/apiendpoint.py,sha256=Hvar5leWsJR_FYb0UzRlSw3vRdBZhk_6BR5r2pIb214,400
|
|
162
162
|
mistralai/models/archiveftmodelout.py,sha256=dQx1J91UA06pjk2r7okhKMyBBePmHal7SPpn6Y_wEsY,820
|
|
163
|
-
mistralai/models/assistantmessage.py,sha256=
|
|
163
|
+
mistralai/models/assistantmessage.py,sha256=pmOhSINRB8sJ11lNtfKEL0k6-JnTEJ7cjlWW9D0pIMM,2624
|
|
164
164
|
mistralai/models/basemodelcard.py,sha256=nv-xjoZFCuIdjKBl98dVH5puT7qh0AC2MaE7WTsMxfs,2985
|
|
165
165
|
mistralai/models/batcherror.py,sha256=tThkO9B-g-6eDSBCm1Emd-zDI4B3mk2vAl0L1MI3pdQ,390
|
|
166
166
|
mistralai/models/batchjobin.py,sha256=1GDaaHJeGVo71F4HVZkTdX92bmr3DieNB0ZuHFzBIeE,1850
|
|
167
167
|
mistralai/models/batchjobout.py,sha256=AXFSgDFGY_1LFVHtVdp66y08DUZCxsZtZ_NzTAJYDWM,3067
|
|
168
168
|
mistralai/models/batchjobsout.py,sha256=Tq6bcb4_-fcW8C9AOnfJN8_sTy1NQhDn82qFOKdFPcg,868
|
|
169
169
|
mistralai/models/batchjobstatus.py,sha256=WlrIl5vWQGfLmgQA91_9CnCMKhWN6Lli458fT-4Asj4,294
|
|
170
|
-
mistralai/models/chatclassificationrequest.py,sha256=WYthWiE7euFSeJYJRQJMXmxbWzGDl8kpF4yyLO9ZJaE,3225
|
|
171
170
|
mistralai/models/chatcompletionchoice.py,sha256=6iIFLZj2KYx0HFfzS3-E3sNXG6mPEAlDyXxIA5iZI_U,849
|
|
172
|
-
mistralai/models/chatcompletionrequest.py,sha256=
|
|
171
|
+
mistralai/models/chatcompletionrequest.py,sha256=Qm2b3Ohv3hQi4N6bGn53EsdiHDmwK8BL4JFT06R3VT4,9651
|
|
173
172
|
mistralai/models/chatcompletionresponse.py,sha256=sLE-_Bx9W5rH2-HE2fBWPVbJbmBWx_jSY2mJ3KBEn6w,792
|
|
174
|
-
mistralai/models/chatcompletionstreamrequest.py,sha256=
|
|
173
|
+
mistralai/models/chatcompletionstreamrequest.py,sha256=5IPSsJC51NdNdQ3uZrVnHx0eIZUvFEIeJ9CD6T53Bz4,9339
|
|
174
|
+
mistralai/models/chatmoderationrequest.py,sha256=LX-dhlYxecEzChSTt4jo4DA8lC4DEp5brgaiksTGF-o,2367
|
|
175
175
|
mistralai/models/checkpointout.py,sha256=A2kXS8-VT_1lbg3brifVjZD6tXdsET8vLqBm2a-yXgA,1109
|
|
176
176
|
mistralai/models/classificationobject.py,sha256=JqaKo3AQD4t5X12ZnHjJ6K3Y6LXUn94uGdLJSoGr8vY,665
|
|
177
|
-
mistralai/models/classificationrequest.py,sha256=
|
|
177
|
+
mistralai/models/classificationrequest.py,sha256=FqQfSrGYwLUjVw78Ft7tbmhAkUN0FqolCn4MNArOuR8,922
|
|
178
178
|
mistralai/models/classificationresponse.py,sha256=TeBV7mH0nvLswPdLhv4ZaDTsXvuVYJqSe5Uci7qVSMA,649
|
|
179
179
|
mistralai/models/completionchunk.py,sha256=Cdq-FBWa1oBhrxapoOAj8qr6xmkeIPsfPQSbjeK6NLY,871
|
|
180
180
|
mistralai/models/completionevent.py,sha256=rFc5dJBRnNOzspI95Jhkjd9WyM476u48cN0T1Vh-Cxw,399
|
|
181
181
|
mistralai/models/completionresponsestreamchoice.py,sha256=gw5-_iOyznuimumDtBV65E3zwUW0KH1OHP55dGCAsAA,1927
|
|
182
|
-
mistralai/models/contentchunk.py,sha256=
|
|
182
|
+
mistralai/models/contentchunk.py,sha256=V8-d2u9ReICA6uXZwJTUXu88VfKRIAsLRO6o113Mcw8,1073
|
|
183
183
|
mistralai/models/delete_model_v1_models_model_id_deleteop.py,sha256=lnVRFX-G0jkn1dCFC89sXY2Pj_w4QfMDeF1tPjS4hWE,602
|
|
184
184
|
mistralai/models/deletefileout.py,sha256=s3a-H2RgFQ9HX0kYSmP6GwmwE1jghz7dBj-3G0NBVSY,587
|
|
185
185
|
mistralai/models/deletemodelout.py,sha256=W_crO0WtksoKUgq5s9Yh8zS8RxSuyKYQCBt1i8vB1sE,693
|
|
186
186
|
mistralai/models/deltamessage.py,sha256=7NtvEjdmBOl86rwOx7x2fcCCJSzIF8K6-eu-G9Wr9PI,1939
|
|
187
187
|
mistralai/models/detailedjobout.py,sha256=aw3xmCM6E2kE1cPI5MtLZOdbtaP7FLBeHZG7ACtlEKg,4862
|
|
188
|
-
mistralai/models/
|
|
188
|
+
mistralai/models/documenturlchunk.py,sha256=NbUo4DOQteGfA5koBA_jj1DfyLwxoXq43QE5RVrAhoM,1934
|
|
189
|
+
mistralai/models/embeddingrequest.py,sha256=d8l83jwIfTBtiXYWxCwAnZaTp_fptmZ9SbPBFr2mK5g,826
|
|
189
190
|
mistralai/models/embeddingresponse.py,sha256=te6E_LYEzRjHJ9QREmsFp5PeNP2J_8ALVjyb1T20pNA,663
|
|
190
191
|
mistralai/models/embeddingresponsedata.py,sha256=fJ3mrZqyBBBE40a6iegOJX3DVDfgyMRq23ByeGSTLFk,534
|
|
191
192
|
mistralai/models/eventout.py,sha256=TouRJeISBLphMTPHfgSOpuoOmbGDVohPOrdgHyExMpw,1633
|
|
@@ -198,9 +199,9 @@ mistralai/models/files_api_routes_retrieve_fileop.py,sha256=8DjSbYqUqFoPq-qcNXyV
|
|
|
198
199
|
mistralai/models/files_api_routes_upload_fileop.py,sha256=gIGH5xcPryWYkj1FmNv_0-9He-QB_rRf1a5nUYBNDTU,2213
|
|
199
200
|
mistralai/models/fileschema.py,sha256=n_IjCdNOrC2fuzkv75wJn01XvqGTmPK3JqAFSHaOiMA,2597
|
|
200
201
|
mistralai/models/filesignedurl.py,sha256=VwvuhzhJulAB99Qxz6zr-2F1aINosAfaSxU0IhytDSU,289
|
|
201
|
-
mistralai/models/fimcompletionrequest.py,sha256=
|
|
202
|
+
mistralai/models/fimcompletionrequest.py,sha256=wWDCkQ_PMnjB8DrIuIvVJlPGqQtTpVDHt4p7xJ204Ug,6565
|
|
202
203
|
mistralai/models/fimcompletionresponse.py,sha256=_QwzRuL3KuKkyrA4Fxp366SW0H0EzOA7f4FLkWLm-PM,790
|
|
203
|
-
mistralai/models/fimcompletionstreamrequest.py,sha256=
|
|
204
|
+
mistralai/models/fimcompletionstreamrequest.py,sha256=fxuR8FDOWMwIqlYU9ttAfGeRdVgTz4l2k26_OEfxelg,5944
|
|
204
205
|
mistralai/models/ftmodelcapabilitiesout.py,sha256=H1kKEChUPgYT31ZQUz0tn9NRa7Z3hRZlh-sFfDYvBos,648
|
|
205
206
|
mistralai/models/ftmodelcard.py,sha256=G3dioHDMOhbI5HIw5gCaxZDb1sCthBzkXIAYMNHwya8,3300
|
|
206
207
|
mistralai/models/ftmodelout.py,sha256=dw-y8KKT_7rzW6tu10gfc1YKB8-Kpw4e4zy23z_U1d4,2530
|
|
@@ -233,7 +234,13 @@ mistralai/models/listfilesout.py,sha256=tW2fNabLKcftc5kytkjwVaChlOzWRL4FKtNzDak9
|
|
|
233
234
|
mistralai/models/metricout.py,sha256=dXQMMU4Nk6-Zr06Jx1TWilFi6cOwiVLjSanCFn0cPxo,2034
|
|
234
235
|
mistralai/models/modelcapabilities.py,sha256=No-Dl09zT1sG4MxsWnx4s8Yo1tUeMQ7k-HR_iQFIMFc,703
|
|
235
236
|
mistralai/models/modellist.py,sha256=D4Y784kQkx0ARhofFrpEqGLfxa-jTY8ev0TQMrD_n8I,995
|
|
236
|
-
mistralai/models/
|
|
237
|
+
mistralai/models/ocrimageobject.py,sha256=QDylsNCXy78rWLHuE4CrnQAPXnubz0-FN1wQXtsVsDA,2534
|
|
238
|
+
mistralai/models/ocrpagedimensions.py,sha256=oP4v80I8d6ZELSZt6cRoECd6uIONgdyCeeFalm-4OvM,609
|
|
239
|
+
mistralai/models/ocrpageobject.py,sha256=s0OzcCA0cLTFYahNOr0-r4ds7WOsXYhEx-QcNLngW7M,2085
|
|
240
|
+
mistralai/models/ocrrequest.py,sha256=KKFFvxsGsOQKAYFpuZ02-VsiJWNawlIIz-7dPPtNklU,3112
|
|
241
|
+
mistralai/models/ocrresponse.py,sha256=JpI9Yl6fYeGf6Wsn4M4Z-i6Ir2qAlMKFQnVXqsLiC5Y,752
|
|
242
|
+
mistralai/models/ocrusageinfo.py,sha256=cWtxHxXyJn3U1qJgG-XU-1xfC7poGHvhVtPqdrFrfII,1571
|
|
243
|
+
mistralai/models/prediction.py,sha256=BgWbbeSi1eD9Rh1xk8srXlRgD7Xooj8nLsbSQ21pNRo,718
|
|
237
244
|
mistralai/models/referencechunk.py,sha256=A9vV5pZv-tUqGlswdu0HOyCYy0Q-UIJY0Oc9ZfM6XJA,519
|
|
238
245
|
mistralai/models/responseformat.py,sha256=-TAPGth3_FAiNl-kuE4COI5cSP5fxQ7xewFSV989i58,2225
|
|
239
246
|
mistralai/models/responseformats.py,sha256=O9lwS2M9m53DsRxTC4uRP12SvRhgaQoMjIYsDys5A7s,503
|
|
@@ -263,8 +270,9 @@ mistralai/models/validationerror.py,sha256=DouDBJmBhbW4KPsF5rZEyBdnB_adC-l32kuHC
|
|
|
263
270
|
mistralai/models/wandbintegration.py,sha256=BkLD3r08ToZkMAhPXdnC7bfOGr3banKqt1wVKMGehUQ,2406
|
|
264
271
|
mistralai/models/wandbintegrationout.py,sha256=C0HpS8jJGnACs7eWnuIq0qJEroIUAbjkvzfSSkSKS7Q,2274
|
|
265
272
|
mistralai/models_.py,sha256=r0etSSUChK7hxxf7ZyhoeloyE8TyPRL1s5Jh4Jgukbw,44394
|
|
273
|
+
mistralai/ocr.py,sha256=aMro4iLNC7Jr65N2A-3DVcs1AIWNUOG_9n_5zAD4V2M,9703
|
|
266
274
|
mistralai/py.typed,sha256=zrp19r0G21lr2yRiMC0f8MFkQFGj9wMpSbboePMg8KM,59
|
|
267
|
-
mistralai/sdk.py,sha256=
|
|
275
|
+
mistralai/sdk.py,sha256=ZStm1fV-bzMxVgnkmsHpi1hyY0603xTTwSecv0oPyzg,5842
|
|
268
276
|
mistralai/sdkconfiguration.py,sha256=sx6U1xgxFbflhJdOBAeI7isId-8wlMd8NK9pi-JGs1o,1789
|
|
269
277
|
mistralai/types/__init__.py,sha256=RArOwSgeeTIva6h-4ttjXwMUeCkz10nAFBL9D-QljI4,377
|
|
270
278
|
mistralai/types/basemodel.py,sha256=PexI39iKiOkIlobB8Ueo0yn8PLHp6_wb-WO-zelNDZY,1170
|
|
@@ -284,7 +292,7 @@ mistralai/utils/serializers.py,sha256=BSJT7kBOkNBFyP7KREyMoe14JGbgijD1M6AXFMbdmc
|
|
|
284
292
|
mistralai/utils/url.py,sha256=BgGPgcTA6MRK4bF8fjP2dUopN3NzEzxWMXPBVg8NQUA,5254
|
|
285
293
|
mistralai/utils/values.py,sha256=_89YXPTI_BU6SXJBzFR4pIzTCBPQW9tsOTN1jeBBIDs,3428
|
|
286
294
|
mistralai/version.py,sha256=iosXhlXclBwBqlADFKEilxAC2wWKbtuBKi87AmPi7s8,196
|
|
287
|
-
mistralai-1.5.
|
|
288
|
-
mistralai-1.5.
|
|
289
|
-
mistralai-1.5.
|
|
290
|
-
mistralai-1.5.
|
|
295
|
+
mistralai-1.5.1.dist-info/LICENSE,sha256=rUtQ_9GD0OyLPlb-2uWVdfE87hzudMRmsW-tS-0DK-0,11340
|
|
296
|
+
mistralai-1.5.1.dist-info/METADATA,sha256=3SyFjKQU-IBkJmJuUV-2BUDEPXSRaS5Z9PmJvmK65Og,29449
|
|
297
|
+
mistralai-1.5.1.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
|
298
|
+
mistralai-1.5.1.dist-info/RECORD,,
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
from .assistantmessage import AssistantMessage, AssistantMessageTypedDict
|
|
5
|
-
from .systemmessage import SystemMessage, SystemMessageTypedDict
|
|
6
|
-
from .toolmessage import ToolMessage, ToolMessageTypedDict
|
|
7
|
-
from .usermessage import UserMessage, UserMessageTypedDict
|
|
8
|
-
from mistralai.types import BaseModel, Nullable, UNSET_SENTINEL
|
|
9
|
-
from mistralai.utils import get_discriminator
|
|
10
|
-
import pydantic
|
|
11
|
-
from pydantic import Discriminator, Tag, model_serializer
|
|
12
|
-
from typing import List, Union
|
|
13
|
-
from typing_extensions import Annotated, TypeAliasType, TypedDict
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
TwoTypedDict = TypeAliasType(
|
|
17
|
-
"TwoTypedDict",
|
|
18
|
-
Union[
|
|
19
|
-
SystemMessageTypedDict,
|
|
20
|
-
UserMessageTypedDict,
|
|
21
|
-
AssistantMessageTypedDict,
|
|
22
|
-
ToolMessageTypedDict,
|
|
23
|
-
],
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Two = Annotated[
|
|
28
|
-
Union[
|
|
29
|
-
Annotated[AssistantMessage, Tag("assistant")],
|
|
30
|
-
Annotated[SystemMessage, Tag("system")],
|
|
31
|
-
Annotated[ToolMessage, Tag("tool")],
|
|
32
|
-
Annotated[UserMessage, Tag("user")],
|
|
33
|
-
],
|
|
34
|
-
Discriminator(lambda m: get_discriminator(m, "role", "role")),
|
|
35
|
-
]
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
OneTypedDict = TypeAliasType(
|
|
39
|
-
"OneTypedDict",
|
|
40
|
-
Union[
|
|
41
|
-
SystemMessageTypedDict,
|
|
42
|
-
UserMessageTypedDict,
|
|
43
|
-
AssistantMessageTypedDict,
|
|
44
|
-
ToolMessageTypedDict,
|
|
45
|
-
],
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
One = Annotated[
|
|
50
|
-
Union[
|
|
51
|
-
Annotated[AssistantMessage, Tag("assistant")],
|
|
52
|
-
Annotated[SystemMessage, Tag("system")],
|
|
53
|
-
Annotated[ToolMessage, Tag("tool")],
|
|
54
|
-
Annotated[UserMessage, Tag("user")],
|
|
55
|
-
],
|
|
56
|
-
Discriminator(lambda m: get_discriminator(m, "role", "role")),
|
|
57
|
-
]
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
ChatClassificationRequestInputsTypedDict = TypeAliasType(
|
|
61
|
-
"ChatClassificationRequestInputsTypedDict",
|
|
62
|
-
Union[List[OneTypedDict], List[List[TwoTypedDict]]],
|
|
63
|
-
)
|
|
64
|
-
r"""Chat to classify"""
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
ChatClassificationRequestInputs = TypeAliasType(
|
|
68
|
-
"ChatClassificationRequestInputs", Union[List[One], List[List[Two]]]
|
|
69
|
-
)
|
|
70
|
-
r"""Chat to classify"""
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
class ChatClassificationRequestTypedDict(TypedDict):
|
|
74
|
-
inputs: ChatClassificationRequestInputsTypedDict
|
|
75
|
-
r"""Chat to classify"""
|
|
76
|
-
model: Nullable[str]
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
class ChatClassificationRequest(BaseModel):
|
|
80
|
-
inputs: Annotated[ChatClassificationRequestInputs, pydantic.Field(alias="input")]
|
|
81
|
-
r"""Chat to classify"""
|
|
82
|
-
|
|
83
|
-
model: Nullable[str]
|
|
84
|
-
|
|
85
|
-
@model_serializer(mode="wrap")
|
|
86
|
-
def serialize_model(self, handler):
|
|
87
|
-
optional_fields = []
|
|
88
|
-
nullable_fields = ["model"]
|
|
89
|
-
null_default_fields = []
|
|
90
|
-
|
|
91
|
-
serialized = handler(self)
|
|
92
|
-
|
|
93
|
-
m = {}
|
|
94
|
-
|
|
95
|
-
for n, f in self.model_fields.items():
|
|
96
|
-
k = f.alias or n
|
|
97
|
-
val = serialized.get(k)
|
|
98
|
-
serialized.pop(k, None)
|
|
99
|
-
|
|
100
|
-
optional_nullable = k in optional_fields and k in nullable_fields
|
|
101
|
-
is_set = (
|
|
102
|
-
self.__pydantic_fields_set__.intersection({n})
|
|
103
|
-
or k in null_default_fields
|
|
104
|
-
) # pylint: disable=no-member
|
|
105
|
-
|
|
106
|
-
if val is not None and val != UNSET_SENTINEL:
|
|
107
|
-
m[k] = val
|
|
108
|
-
elif val != UNSET_SENTINEL and (
|
|
109
|
-
not k in optional_fields or (optional_nullable and is_set)
|
|
110
|
-
):
|
|
111
|
-
m[k] = val
|
|
112
|
-
|
|
113
|
-
return m
|
|
File without changes
|