mistralai 1.1.0__py3-none-any.whl → 1.2.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/__init__.py +4 -0
- mistralai/_version.py +12 -0
- mistralai/agents.py +56 -22
- mistralai/batch.py +17 -0
- mistralai/chat.py +64 -30
- mistralai/classifiers.py +396 -0
- mistralai/embeddings.py +10 -6
- mistralai/files.py +252 -19
- mistralai/fim.py +40 -30
- mistralai/jobs.py +40 -20
- mistralai/mistral_jobs.py +733 -0
- mistralai/models/__init__.py +108 -18
- mistralai/models/agentscompletionrequest.py +27 -10
- mistralai/models/agentscompletionstreamrequest.py +27 -10
- mistralai/models/apiendpoint.py +9 -0
- mistralai/models/archiveftmodelout.py +11 -5
- mistralai/models/assistantmessage.py +11 -6
- mistralai/models/basemodelcard.py +22 -6
- mistralai/models/batcherror.py +17 -0
- mistralai/models/batchjobin.py +58 -0
- mistralai/models/batchjobout.py +117 -0
- mistralai/models/batchjobsout.py +30 -0
- mistralai/models/batchjobstatus.py +15 -0
- mistralai/models/chatclassificationrequest.py +104 -0
- mistralai/models/chatcompletionchoice.py +9 -4
- mistralai/models/chatcompletionrequest.py +32 -13
- mistralai/models/chatcompletionresponse.py +2 -2
- mistralai/models/chatcompletionstreamrequest.py +32 -13
- mistralai/models/checkpointout.py +1 -1
- mistralai/models/classificationobject.py +21 -0
- mistralai/models/classificationrequest.py +59 -0
- mistralai/models/classificationresponse.py +21 -0
- mistralai/models/completionchunk.py +2 -2
- mistralai/models/completionevent.py +1 -1
- mistralai/models/completionresponsestreamchoice.py +11 -5
- mistralai/models/delete_model_v1_models_model_id_deleteop.py +1 -2
- mistralai/models/deletefileout.py +1 -1
- mistralai/models/deletemodelout.py +2 -2
- mistralai/models/deltamessage.py +14 -7
- mistralai/models/detailedjobout.py +11 -5
- mistralai/models/embeddingrequest.py +5 -5
- mistralai/models/embeddingresponse.py +2 -1
- mistralai/models/embeddingresponsedata.py +2 -2
- mistralai/models/eventout.py +2 -2
- mistralai/models/filepurpose.py +8 -0
- mistralai/models/files_api_routes_delete_fileop.py +1 -2
- mistralai/models/files_api_routes_download_fileop.py +16 -0
- mistralai/models/files_api_routes_list_filesop.py +96 -0
- mistralai/models/files_api_routes_retrieve_fileop.py +1 -2
- mistralai/models/files_api_routes_upload_fileop.py +9 -9
- mistralai/models/fileschema.py +7 -21
- mistralai/models/fimcompletionrequest.py +20 -13
- mistralai/models/fimcompletionresponse.py +2 -2
- mistralai/models/fimcompletionstreamrequest.py +20 -13
- mistralai/models/ftmodelcapabilitiesout.py +2 -2
- mistralai/models/ftmodelcard.py +24 -6
- mistralai/models/ftmodelout.py +9 -5
- mistralai/models/function.py +2 -2
- mistralai/models/functioncall.py +2 -1
- mistralai/models/functionname.py +1 -1
- mistralai/models/githubrepositoryin.py +11 -5
- mistralai/models/githubrepositoryout.py +11 -5
- mistralai/models/httpvalidationerror.py +0 -2
- mistralai/models/imageurl.py +1 -2
- mistralai/models/imageurlchunk.py +11 -5
- mistralai/models/jobin.py +2 -2
- mistralai/models/jobmetadataout.py +1 -2
- mistralai/models/jobout.py +10 -5
- mistralai/models/jobs_api_routes_batch_cancel_batch_jobop.py +16 -0
- mistralai/models/jobs_api_routes_batch_get_batch_jobop.py +16 -0
- mistralai/models/jobs_api_routes_batch_get_batch_jobsop.py +95 -0
- mistralai/models/jobs_api_routes_fine_tuning_archive_fine_tuned_modelop.py +1 -2
- mistralai/models/jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop.py +1 -2
- mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobop.py +1 -2
- mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobsop.py +2 -2
- mistralai/models/jobs_api_routes_fine_tuning_start_fine_tuning_jobop.py +1 -2
- mistralai/models/jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelop.py +1 -2
- mistralai/models/jobs_api_routes_fine_tuning_update_fine_tuned_modelop.py +1 -2
- mistralai/models/jobsout.py +9 -5
- mistralai/models/legacyjobmetadataout.py +12 -5
- mistralai/models/listfilesout.py +5 -1
- mistralai/models/metricout.py +1 -2
- mistralai/models/modelcapabilities.py +2 -2
- mistralai/models/modellist.py +2 -2
- mistralai/models/responseformat.py +2 -2
- mistralai/models/retrieve_model_v1_models_model_id_getop.py +2 -2
- mistralai/models/retrievefileout.py +10 -21
- mistralai/models/sampletype.py +6 -2
- mistralai/models/security.py +2 -2
- mistralai/models/source.py +3 -2
- mistralai/models/systemmessage.py +6 -6
- mistralai/models/textchunk.py +9 -5
- mistralai/models/tool.py +2 -2
- mistralai/models/toolcall.py +2 -2
- mistralai/models/toolchoice.py +2 -2
- mistralai/models/toolmessage.py +2 -2
- mistralai/models/trainingfile.py +2 -2
- mistralai/models/trainingparameters.py +7 -2
- mistralai/models/trainingparametersin.py +7 -2
- mistralai/models/unarchiveftmodelout.py +11 -5
- mistralai/models/updateftmodelin.py +1 -2
- mistralai/models/uploadfileout.py +7 -21
- mistralai/models/usageinfo.py +1 -1
- mistralai/models/usermessage.py +36 -5
- mistralai/models/validationerror.py +2 -1
- mistralai/models/wandbintegration.py +11 -5
- mistralai/models/wandbintegrationout.py +12 -6
- mistralai/models_.py +48 -24
- mistralai/sdk.py +7 -0
- mistralai/sdkconfiguration.py +7 -7
- mistralai/utils/__init__.py +8 -0
- mistralai/utils/annotations.py +13 -2
- mistralai/utils/serializers.py +25 -0
- {mistralai-1.1.0.dist-info → mistralai-1.2.1.dist-info}/METADATA +90 -14
- mistralai-1.2.1.dist-info/RECORD +276 -0
- {mistralai-1.1.0.dist-info → mistralai-1.2.1.dist-info}/WHEEL +1 -1
- mistralai_azure/__init__.py +4 -0
- mistralai_azure/_version.py +12 -0
- mistralai_azure/chat.py +64 -30
- mistralai_azure/models/__init__.py +9 -3
- mistralai_azure/models/assistantmessage.py +11 -6
- mistralai_azure/models/chatcompletionchoice.py +10 -5
- mistralai_azure/models/chatcompletionrequest.py +32 -13
- mistralai_azure/models/chatcompletionresponse.py +2 -2
- mistralai_azure/models/chatcompletionstreamrequest.py +32 -13
- mistralai_azure/models/completionchunk.py +2 -2
- mistralai_azure/models/completionevent.py +1 -1
- mistralai_azure/models/completionresponsestreamchoice.py +9 -4
- mistralai_azure/models/deltamessage.py +14 -7
- mistralai_azure/models/function.py +2 -2
- mistralai_azure/models/functioncall.py +2 -1
- mistralai_azure/models/functionname.py +1 -1
- mistralai_azure/models/httpvalidationerror.py +0 -2
- mistralai_azure/models/responseformat.py +2 -2
- mistralai_azure/models/security.py +1 -2
- mistralai_azure/models/systemmessage.py +6 -6
- mistralai_azure/models/textchunk.py +9 -5
- mistralai_azure/models/tool.py +2 -2
- mistralai_azure/models/toolcall.py +2 -2
- mistralai_azure/models/toolchoice.py +2 -2
- mistralai_azure/models/toolmessage.py +2 -2
- mistralai_azure/models/usageinfo.py +1 -1
- mistralai_azure/models/usermessage.py +36 -5
- mistralai_azure/models/validationerror.py +2 -1
- mistralai_azure/sdkconfiguration.py +7 -7
- mistralai_azure/utils/__init__.py +8 -0
- mistralai_azure/utils/annotations.py +13 -2
- mistralai_azure/utils/serializers.py +25 -0
- mistralai_gcp/__init__.py +4 -0
- mistralai_gcp/_version.py +12 -0
- mistralai_gcp/chat.py +64 -30
- mistralai_gcp/fim.py +40 -30
- mistralai_gcp/models/__init__.py +9 -3
- mistralai_gcp/models/assistantmessage.py +11 -6
- mistralai_gcp/models/chatcompletionchoice.py +10 -5
- mistralai_gcp/models/chatcompletionrequest.py +32 -13
- mistralai_gcp/models/chatcompletionresponse.py +2 -2
- mistralai_gcp/models/chatcompletionstreamrequest.py +32 -13
- mistralai_gcp/models/completionchunk.py +2 -2
- mistralai_gcp/models/completionevent.py +1 -1
- mistralai_gcp/models/completionresponsestreamchoice.py +9 -4
- mistralai_gcp/models/deltamessage.py +14 -7
- mistralai_gcp/models/fimcompletionrequest.py +20 -13
- mistralai_gcp/models/fimcompletionresponse.py +2 -2
- mistralai_gcp/models/fimcompletionstreamrequest.py +20 -13
- mistralai_gcp/models/function.py +2 -2
- mistralai_gcp/models/functioncall.py +2 -1
- mistralai_gcp/models/functionname.py +1 -1
- mistralai_gcp/models/httpvalidationerror.py +0 -2
- mistralai_gcp/models/responseformat.py +2 -2
- mistralai_gcp/models/security.py +1 -2
- mistralai_gcp/models/systemmessage.py +6 -6
- mistralai_gcp/models/textchunk.py +9 -5
- mistralai_gcp/models/tool.py +2 -2
- mistralai_gcp/models/toolcall.py +2 -2
- mistralai_gcp/models/toolchoice.py +2 -2
- mistralai_gcp/models/toolmessage.py +2 -2
- mistralai_gcp/models/usageinfo.py +1 -1
- mistralai_gcp/models/usermessage.py +36 -5
- mistralai_gcp/models/validationerror.py +2 -1
- mistralai_gcp/sdk.py +20 -11
- mistralai_gcp/sdkconfiguration.py +7 -7
- mistralai_gcp/utils/__init__.py +8 -0
- mistralai_gcp/utils/annotations.py +13 -2
- mistralai_gcp/utils/serializers.py +25 -0
- mistralai-1.1.0.dist-info/RECORD +0 -254
- {mistralai-1.1.0.dist-info → mistralai-1.2.1.dist-info}/LICENSE +0 -0
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
5
|
+
from mistralai.utils import validate_const
|
|
5
6
|
import pydantic
|
|
6
7
|
from pydantic import model_serializer
|
|
7
|
-
from
|
|
8
|
-
from
|
|
8
|
+
from pydantic.functional_validators import AfterValidator
|
|
9
|
+
from typing import Literal, Optional
|
|
10
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
WandbIntegrationType = Literal["wandb"]
|
|
@@ -16,6 +18,7 @@ class WandbIntegrationTypedDict(TypedDict):
|
|
|
16
18
|
r"""The name of the project that the new run will be created under."""
|
|
17
19
|
api_key: str
|
|
18
20
|
r"""The WandB API key to use for authentication."""
|
|
21
|
+
type: WandbIntegrationType
|
|
19
22
|
name: NotRequired[Nullable[str]]
|
|
20
23
|
r"""A display name to set for the run. If not set, will use the job ID as the name."""
|
|
21
24
|
run_name: NotRequired[Nullable[str]]
|
|
@@ -28,9 +31,12 @@ class WandbIntegration(BaseModel):
|
|
|
28
31
|
api_key: str
|
|
29
32
|
r"""The WandB API key to use for authentication."""
|
|
30
33
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
TYPE: Annotated[
|
|
35
|
+
Annotated[
|
|
36
|
+
Optional[WandbIntegrationType], AfterValidator(validate_const("wandb"))
|
|
37
|
+
],
|
|
38
|
+
pydantic.Field(alias="type"),
|
|
39
|
+
] = "wandb"
|
|
34
40
|
|
|
35
41
|
name: OptionalNullable[str] = UNSET
|
|
36
42
|
r"""A display name to set for the run. If not set, will use the job ID as the name."""
|
|
@@ -2,18 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
5
|
+
from mistralai.utils import validate_const
|
|
5
6
|
import pydantic
|
|
6
7
|
from pydantic import model_serializer
|
|
7
|
-
from
|
|
8
|
-
from
|
|
8
|
+
from pydantic.functional_validators import AfterValidator
|
|
9
|
+
from typing import Literal, Optional
|
|
10
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
9
11
|
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
WandbIntegrationOutType = Literal["wandb"]
|
|
12
14
|
|
|
13
15
|
|
|
14
16
|
class WandbIntegrationOutTypedDict(TypedDict):
|
|
15
17
|
project: str
|
|
16
18
|
r"""The name of the project that the new run will be created under."""
|
|
19
|
+
type: WandbIntegrationOutType
|
|
17
20
|
name: NotRequired[Nullable[str]]
|
|
18
21
|
r"""A display name to set for the run. If not set, will use the job ID as the name."""
|
|
19
22
|
run_name: NotRequired[Nullable[str]]
|
|
@@ -23,9 +26,12 @@ class WandbIntegrationOut(BaseModel):
|
|
|
23
26
|
project: str
|
|
24
27
|
r"""The name of the project that the new run will be created under."""
|
|
25
28
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
TYPE: Annotated[
|
|
30
|
+
Annotated[
|
|
31
|
+
Optional[WandbIntegrationOutType], AfterValidator(validate_const("wandb"))
|
|
32
|
+
],
|
|
33
|
+
pydantic.Field(alias="type"),
|
|
34
|
+
] = "wandb"
|
|
29
35
|
|
|
30
36
|
name: OptionalNullable[str] = UNSET
|
|
31
37
|
r"""A display name to set for the run. If not set, will use the job ID as the name."""
|
mistralai/models_.py
CHANGED
|
@@ -76,15 +76,17 @@ class Models(BaseSDK):
|
|
|
76
76
|
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
|
77
77
|
raise models.HTTPValidationError(data=data)
|
|
78
78
|
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
|
79
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
79
80
|
raise models.SDKError(
|
|
80
|
-
"API error occurred", http_res.status_code,
|
|
81
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
81
82
|
)
|
|
82
83
|
|
|
83
84
|
content_type = http_res.headers.get("Content-Type")
|
|
85
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
84
86
|
raise models.SDKError(
|
|
85
87
|
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
86
88
|
http_res.status_code,
|
|
87
|
-
|
|
89
|
+
http_res_text,
|
|
88
90
|
http_res,
|
|
89
91
|
)
|
|
90
92
|
|
|
@@ -153,15 +155,17 @@ class Models(BaseSDK):
|
|
|
153
155
|
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
|
154
156
|
raise models.HTTPValidationError(data=data)
|
|
155
157
|
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
|
158
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
156
159
|
raise models.SDKError(
|
|
157
|
-
"API error occurred", http_res.status_code,
|
|
160
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
158
161
|
)
|
|
159
162
|
|
|
160
163
|
content_type = http_res.headers.get("Content-Type")
|
|
164
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
161
165
|
raise models.SDKError(
|
|
162
166
|
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
163
167
|
http_res.status_code,
|
|
164
|
-
|
|
168
|
+
http_res_text,
|
|
165
169
|
http_res,
|
|
166
170
|
)
|
|
167
171
|
|
|
@@ -244,15 +248,17 @@ class Models(BaseSDK):
|
|
|
244
248
|
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
|
245
249
|
raise models.HTTPValidationError(data=data)
|
|
246
250
|
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
|
251
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
247
252
|
raise models.SDKError(
|
|
248
|
-
"API error occurred", http_res.status_code,
|
|
253
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
249
254
|
)
|
|
250
255
|
|
|
251
256
|
content_type = http_res.headers.get("Content-Type")
|
|
257
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
252
258
|
raise models.SDKError(
|
|
253
259
|
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
254
260
|
http_res.status_code,
|
|
255
|
-
|
|
261
|
+
http_res_text,
|
|
256
262
|
http_res,
|
|
257
263
|
)
|
|
258
264
|
|
|
@@ -335,15 +341,17 @@ class Models(BaseSDK):
|
|
|
335
341
|
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
|
336
342
|
raise models.HTTPValidationError(data=data)
|
|
337
343
|
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
|
344
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
338
345
|
raise models.SDKError(
|
|
339
|
-
"API error occurred", http_res.status_code,
|
|
346
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
340
347
|
)
|
|
341
348
|
|
|
342
349
|
content_type = http_res.headers.get("Content-Type")
|
|
350
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
343
351
|
raise models.SDKError(
|
|
344
352
|
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
345
353
|
http_res.status_code,
|
|
346
|
-
|
|
354
|
+
http_res_text,
|
|
347
355
|
http_res,
|
|
348
356
|
)
|
|
349
357
|
|
|
@@ -419,15 +427,17 @@ class Models(BaseSDK):
|
|
|
419
427
|
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
|
420
428
|
raise models.HTTPValidationError(data=data)
|
|
421
429
|
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
|
430
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
422
431
|
raise models.SDKError(
|
|
423
|
-
"API error occurred", http_res.status_code,
|
|
432
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
424
433
|
)
|
|
425
434
|
|
|
426
435
|
content_type = http_res.headers.get("Content-Type")
|
|
436
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
427
437
|
raise models.SDKError(
|
|
428
438
|
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
429
439
|
http_res.status_code,
|
|
430
|
-
|
|
440
|
+
http_res_text,
|
|
431
441
|
http_res,
|
|
432
442
|
)
|
|
433
443
|
|
|
@@ -503,15 +513,17 @@ class Models(BaseSDK):
|
|
|
503
513
|
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
|
504
514
|
raise models.HTTPValidationError(data=data)
|
|
505
515
|
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
|
516
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
506
517
|
raise models.SDKError(
|
|
507
|
-
"API error occurred", http_res.status_code,
|
|
518
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
508
519
|
)
|
|
509
520
|
|
|
510
521
|
content_type = http_res.headers.get("Content-Type")
|
|
522
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
511
523
|
raise models.SDKError(
|
|
512
524
|
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
513
525
|
http_res.status_code,
|
|
514
|
-
|
|
526
|
+
http_res_text,
|
|
515
527
|
http_res,
|
|
516
528
|
)
|
|
517
529
|
|
|
@@ -594,15 +606,17 @@ class Models(BaseSDK):
|
|
|
594
606
|
if utils.match_response(http_res, "200", "application/json"):
|
|
595
607
|
return utils.unmarshal_json(http_res.text, Optional[models.FTModelOut])
|
|
596
608
|
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
|
609
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
597
610
|
raise models.SDKError(
|
|
598
|
-
"API error occurred", http_res.status_code,
|
|
611
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
599
612
|
)
|
|
600
613
|
|
|
601
614
|
content_type = http_res.headers.get("Content-Type")
|
|
615
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
602
616
|
raise models.SDKError(
|
|
603
617
|
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
604
618
|
http_res.status_code,
|
|
605
|
-
|
|
619
|
+
http_res_text,
|
|
606
620
|
http_res,
|
|
607
621
|
)
|
|
608
622
|
|
|
@@ -685,15 +699,17 @@ class Models(BaseSDK):
|
|
|
685
699
|
if utils.match_response(http_res, "200", "application/json"):
|
|
686
700
|
return utils.unmarshal_json(http_res.text, Optional[models.FTModelOut])
|
|
687
701
|
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
|
702
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
688
703
|
raise models.SDKError(
|
|
689
|
-
"API error occurred", http_res.status_code,
|
|
704
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
690
705
|
)
|
|
691
706
|
|
|
692
707
|
content_type = http_res.headers.get("Content-Type")
|
|
708
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
693
709
|
raise models.SDKError(
|
|
694
710
|
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
695
711
|
http_res.status_code,
|
|
696
|
-
|
|
712
|
+
http_res_text,
|
|
697
713
|
http_res,
|
|
698
714
|
)
|
|
699
715
|
|
|
@@ -767,15 +783,17 @@ class Models(BaseSDK):
|
|
|
767
783
|
http_res.text, Optional[models.ArchiveFTModelOut]
|
|
768
784
|
)
|
|
769
785
|
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
|
786
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
770
787
|
raise models.SDKError(
|
|
771
|
-
"API error occurred", http_res.status_code,
|
|
788
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
772
789
|
)
|
|
773
790
|
|
|
774
791
|
content_type = http_res.headers.get("Content-Type")
|
|
792
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
775
793
|
raise models.SDKError(
|
|
776
794
|
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
777
795
|
http_res.status_code,
|
|
778
|
-
|
|
796
|
+
http_res_text,
|
|
779
797
|
http_res,
|
|
780
798
|
)
|
|
781
799
|
|
|
@@ -849,15 +867,17 @@ class Models(BaseSDK):
|
|
|
849
867
|
http_res.text, Optional[models.ArchiveFTModelOut]
|
|
850
868
|
)
|
|
851
869
|
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
|
870
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
852
871
|
raise models.SDKError(
|
|
853
|
-
"API error occurred", http_res.status_code,
|
|
872
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
854
873
|
)
|
|
855
874
|
|
|
856
875
|
content_type = http_res.headers.get("Content-Type")
|
|
876
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
857
877
|
raise models.SDKError(
|
|
858
878
|
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
859
879
|
http_res.status_code,
|
|
860
|
-
|
|
880
|
+
http_res_text,
|
|
861
881
|
http_res,
|
|
862
882
|
)
|
|
863
883
|
|
|
@@ -931,15 +951,17 @@ class Models(BaseSDK):
|
|
|
931
951
|
http_res.text, Optional[models.UnarchiveFTModelOut]
|
|
932
952
|
)
|
|
933
953
|
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
|
954
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
934
955
|
raise models.SDKError(
|
|
935
|
-
"API error occurred", http_res.status_code,
|
|
956
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
936
957
|
)
|
|
937
958
|
|
|
938
959
|
content_type = http_res.headers.get("Content-Type")
|
|
960
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
939
961
|
raise models.SDKError(
|
|
940
962
|
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
941
963
|
http_res.status_code,
|
|
942
|
-
|
|
964
|
+
http_res_text,
|
|
943
965
|
http_res,
|
|
944
966
|
)
|
|
945
967
|
|
|
@@ -1013,14 +1035,16 @@ class Models(BaseSDK):
|
|
|
1013
1035
|
http_res.text, Optional[models.UnarchiveFTModelOut]
|
|
1014
1036
|
)
|
|
1015
1037
|
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
|
1038
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1016
1039
|
raise models.SDKError(
|
|
1017
|
-
"API error occurred", http_res.status_code,
|
|
1040
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1018
1041
|
)
|
|
1019
1042
|
|
|
1020
1043
|
content_type = http_res.headers.get("Content-Type")
|
|
1044
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1021
1045
|
raise models.SDKError(
|
|
1022
1046
|
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1023
1047
|
http_res.status_code,
|
|
1024
|
-
|
|
1048
|
+
http_res_text,
|
|
1025
1049
|
http_res,
|
|
1026
1050
|
)
|
mistralai/sdk.py
CHANGED
|
@@ -9,7 +9,9 @@ import httpx
|
|
|
9
9
|
from mistralai import models, utils
|
|
10
10
|
from mistralai._hooks import SDKHooks
|
|
11
11
|
from mistralai.agents import Agents
|
|
12
|
+
from mistralai.batch import Batch
|
|
12
13
|
from mistralai.chat import Chat
|
|
14
|
+
from mistralai.classifiers import Classifiers
|
|
13
15
|
from mistralai.embeddings import Embeddings
|
|
14
16
|
from mistralai.files import Files
|
|
15
17
|
from mistralai.fim import Fim
|
|
@@ -27,6 +29,7 @@ class Mistral(BaseSDK):
|
|
|
27
29
|
files: Files
|
|
28
30
|
r"""Files API"""
|
|
29
31
|
fine_tuning: FineTuning
|
|
32
|
+
batch: Batch
|
|
30
33
|
chat: Chat
|
|
31
34
|
r"""Chat Completion API."""
|
|
32
35
|
fim: Fim
|
|
@@ -35,6 +38,8 @@ class Mistral(BaseSDK):
|
|
|
35
38
|
r"""Agents API."""
|
|
36
39
|
embeddings: Embeddings
|
|
37
40
|
r"""Embeddings API."""
|
|
41
|
+
classifiers: Classifiers
|
|
42
|
+
r"""Classifiers API."""
|
|
38
43
|
|
|
39
44
|
def __init__(
|
|
40
45
|
self,
|
|
@@ -118,7 +123,9 @@ class Mistral(BaseSDK):
|
|
|
118
123
|
self.models = Models(self.sdk_configuration)
|
|
119
124
|
self.files = Files(self.sdk_configuration)
|
|
120
125
|
self.fine_tuning = FineTuning(self.sdk_configuration)
|
|
126
|
+
self.batch = Batch(self.sdk_configuration)
|
|
121
127
|
self.chat = Chat(self.sdk_configuration)
|
|
122
128
|
self.fim = Fim(self.sdk_configuration)
|
|
123
129
|
self.agents = Agents(self.sdk_configuration)
|
|
124
130
|
self.embeddings = Embeddings(self.sdk_configuration)
|
|
131
|
+
self.classifiers = Classifiers(self.sdk_configuration)
|
mistralai/sdkconfiguration.py
CHANGED
|
@@ -10,10 +10,10 @@ from pydantic import Field
|
|
|
10
10
|
from typing import Callable, Dict, Optional, Tuple, Union
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
r"""Production server"""
|
|
13
|
+
SERVER_EU = "eu"
|
|
14
|
+
r"""EU Production server"""
|
|
15
15
|
SERVERS = {
|
|
16
|
-
|
|
16
|
+
SERVER_EU: "https://api.mistral.ai",
|
|
17
17
|
}
|
|
18
18
|
"""Contains the list of servers available to the SDK"""
|
|
19
19
|
|
|
@@ -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.1
|
|
32
|
-
gen_version: str = "2.
|
|
33
|
-
user_agent: str = "speakeasy-sdk/python 1.1
|
|
31
|
+
sdk_version: str = "1.2.1"
|
|
32
|
+
gen_version: str = "2.452.0"
|
|
33
|
+
user_agent: str = "speakeasy-sdk/python 1.2.1 2.452.0 0.0.2 mistralai"
|
|
34
34
|
retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET)
|
|
35
35
|
timeout_ms: Optional[int] = None
|
|
36
36
|
|
|
@@ -41,7 +41,7 @@ class SDKConfiguration:
|
|
|
41
41
|
if self.server_url is not None and self.server_url:
|
|
42
42
|
return remove_suffix(self.server_url, "/"), {}
|
|
43
43
|
if not self.server:
|
|
44
|
-
self.server =
|
|
44
|
+
self.server = SERVER_EU
|
|
45
45
|
|
|
46
46
|
if self.server not in SERVERS:
|
|
47
47
|
raise ValueError(f'Invalid server "{self.server}"')
|
mistralai/utils/__init__.py
CHANGED
|
@@ -28,6 +28,10 @@ from .serializers import (
|
|
|
28
28
|
serialize_float,
|
|
29
29
|
serialize_int,
|
|
30
30
|
stream_to_text,
|
|
31
|
+
stream_to_text_async,
|
|
32
|
+
stream_to_bytes,
|
|
33
|
+
stream_to_bytes_async,
|
|
34
|
+
validate_const,
|
|
31
35
|
validate_decimal,
|
|
32
36
|
validate_float,
|
|
33
37
|
validate_int,
|
|
@@ -81,10 +85,14 @@ __all__ = [
|
|
|
81
85
|
"serialize_request_body",
|
|
82
86
|
"SerializedRequestBody",
|
|
83
87
|
"stream_to_text",
|
|
88
|
+
"stream_to_text_async",
|
|
89
|
+
"stream_to_bytes",
|
|
90
|
+
"stream_to_bytes_async",
|
|
84
91
|
"template_url",
|
|
85
92
|
"unmarshal",
|
|
86
93
|
"unmarshal_json",
|
|
87
94
|
"validate_decimal",
|
|
95
|
+
"validate_const",
|
|
88
96
|
"validate_float",
|
|
89
97
|
"validate_int",
|
|
90
98
|
"validate_open_enum",
|
mistralai/utils/annotations.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
|
+
from enum import Enum
|
|
3
4
|
from typing import Any
|
|
4
5
|
|
|
5
6
|
def get_discriminator(model: Any, fieldname: str, key: str) -> str:
|
|
@@ -10,10 +11,20 @@ def get_discriminator(model: Any, fieldname: str, key: str) -> str:
|
|
|
10
11
|
raise ValueError(f'Could not find discriminator key {key} in {model}') from e
|
|
11
12
|
|
|
12
13
|
if hasattr(model, fieldname):
|
|
13
|
-
|
|
14
|
+
attr = getattr(model, fieldname)
|
|
15
|
+
|
|
16
|
+
if isinstance(attr, Enum):
|
|
17
|
+
return f'{attr.value}'
|
|
18
|
+
|
|
19
|
+
return f'{attr}'
|
|
14
20
|
|
|
15
21
|
fieldname = fieldname.upper()
|
|
16
22
|
if hasattr(model, fieldname):
|
|
17
|
-
|
|
23
|
+
attr = getattr(model, fieldname)
|
|
24
|
+
|
|
25
|
+
if isinstance(attr, Enum):
|
|
26
|
+
return f'{attr.value}'
|
|
27
|
+
|
|
28
|
+
return f'{attr}'
|
|
18
29
|
|
|
19
30
|
raise ValueError(f'Could not find discriminator field {fieldname} in {model}')
|
mistralai/utils/serializers.py
CHANGED
|
@@ -116,6 +116,19 @@ def validate_open_enum(is_int: bool):
|
|
|
116
116
|
return validate
|
|
117
117
|
|
|
118
118
|
|
|
119
|
+
def validate_const(v):
|
|
120
|
+
def validate(c):
|
|
121
|
+
if is_optional_type(type(c)) and c is None:
|
|
122
|
+
return None
|
|
123
|
+
|
|
124
|
+
if v != c:
|
|
125
|
+
raise ValueError(f"Expected {v}")
|
|
126
|
+
|
|
127
|
+
return c
|
|
128
|
+
|
|
129
|
+
return validate
|
|
130
|
+
|
|
131
|
+
|
|
119
132
|
def unmarshal_json(raw, typ: Any) -> Any:
|
|
120
133
|
return unmarshal(from_json(raw), typ)
|
|
121
134
|
|
|
@@ -172,6 +185,18 @@ def stream_to_text(stream: httpx.Response) -> str:
|
|
|
172
185
|
return "".join(stream.iter_text())
|
|
173
186
|
|
|
174
187
|
|
|
188
|
+
async def stream_to_text_async(stream: httpx.Response) -> str:
|
|
189
|
+
return "".join([chunk async for chunk in stream.aiter_text()])
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
def stream_to_bytes(stream: httpx.Response) -> bytes:
|
|
193
|
+
return stream.content
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
async def stream_to_bytes_async(stream: httpx.Response) -> bytes:
|
|
197
|
+
return await stream.aread()
|
|
198
|
+
|
|
199
|
+
|
|
175
200
|
def get_pydantic_model(data: Any, typ: Any) -> Any:
|
|
176
201
|
if not _contains_pydantic_model(data):
|
|
177
202
|
return unmarshal(data, typ)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: mistralai
|
|
3
|
-
Version: 1.1
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: Python Client SDK for the Mistral AI API.
|
|
5
5
|
Home-page: https://github.com/mistralai/client-python.git
|
|
6
6
|
Author: Mistral
|
|
@@ -11,6 +11,7 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.10
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
15
|
Provides-Extra: gcp
|
|
15
16
|
Requires-Dist: eval-type-backport (>=0.2.0,<0.3.0)
|
|
16
17
|
Requires-Dist: google-auth (==2.27.0) ; extra == "gcp"
|
|
@@ -205,7 +206,8 @@ s = Mistral(
|
|
|
205
206
|
|
|
206
207
|
res = s.agents.complete(messages=[
|
|
207
208
|
{
|
|
208
|
-
"content": "
|
|
209
|
+
"content": "Who is the best French painter? Answer in one short sentence.",
|
|
210
|
+
"role": "user",
|
|
209
211
|
},
|
|
210
212
|
], agent_id="<value>")
|
|
211
213
|
|
|
@@ -237,6 +239,53 @@ async def main():
|
|
|
237
239
|
# handle response
|
|
238
240
|
pass
|
|
239
241
|
|
|
242
|
+
asyncio.run(main())
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Create Embedding Request
|
|
246
|
+
|
|
247
|
+
This example shows how to create embedding request.
|
|
248
|
+
|
|
249
|
+
```python
|
|
250
|
+
# Synchronous Example
|
|
251
|
+
from mistralai import Mistral
|
|
252
|
+
import os
|
|
253
|
+
|
|
254
|
+
s = Mistral(
|
|
255
|
+
api_key=os.getenv("MISTRAL_API_KEY", ""),
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
res = s.embeddings.create(inputs=[
|
|
259
|
+
"Embed this sentence.",
|
|
260
|
+
"As well as this one.",
|
|
261
|
+
], model="Wrangler")
|
|
262
|
+
|
|
263
|
+
if res is not None:
|
|
264
|
+
# handle response
|
|
265
|
+
pass
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
</br>
|
|
269
|
+
|
|
270
|
+
The same SDK client can also be used to make asychronous requests by importing asyncio.
|
|
271
|
+
```python
|
|
272
|
+
# Asynchronous Example
|
|
273
|
+
import asyncio
|
|
274
|
+
from mistralai import Mistral
|
|
275
|
+
import os
|
|
276
|
+
|
|
277
|
+
async def main():
|
|
278
|
+
s = Mistral(
|
|
279
|
+
api_key=os.getenv("MISTRAL_API_KEY", ""),
|
|
280
|
+
)
|
|
281
|
+
res = await s.embeddings.create_async(inputs=[
|
|
282
|
+
"Embed this sentence.",
|
|
283
|
+
"As well as this one.",
|
|
284
|
+
], model="Wrangler")
|
|
285
|
+
if res is not None:
|
|
286
|
+
# handle response
|
|
287
|
+
pass
|
|
288
|
+
|
|
240
289
|
asyncio.run(main())
|
|
241
290
|
```
|
|
242
291
|
<!-- End SDK Example Usage [usage] -->
|
|
@@ -347,11 +396,26 @@ The documentation for the GCP SDK is available [here](https://github.com/mistral
|
|
|
347
396
|
* [complete](https://github.com/mistralai/client-python/blob/master/docs/sdks/agents/README.md#complete) - Agents Completion
|
|
348
397
|
* [stream](https://github.com/mistralai/client-python/blob/master/docs/sdks/agents/README.md#stream) - Stream Agents completion
|
|
349
398
|
|
|
399
|
+
### [batch](https://github.com/mistralai/client-python/blob/master/docs/sdks/batch/README.md)
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
#### [batch.jobs](https://github.com/mistralai/client-python/blob/master/docs/sdks/mistraljobs/README.md)
|
|
403
|
+
|
|
404
|
+
* [list](https://github.com/mistralai/client-python/blob/master/docs/sdks/mistraljobs/README.md#list) - Get Batch Jobs
|
|
405
|
+
* [create](https://github.com/mistralai/client-python/blob/master/docs/sdks/mistraljobs/README.md#create) - Create Batch Job
|
|
406
|
+
* [get](https://github.com/mistralai/client-python/blob/master/docs/sdks/mistraljobs/README.md#get) - Get Batch Job
|
|
407
|
+
* [cancel](https://github.com/mistralai/client-python/blob/master/docs/sdks/mistraljobs/README.md#cancel) - Cancel Batch Job
|
|
408
|
+
|
|
350
409
|
### [chat](https://github.com/mistralai/client-python/blob/master/docs/sdks/chat/README.md)
|
|
351
410
|
|
|
352
411
|
* [complete](https://github.com/mistralai/client-python/blob/master/docs/sdks/chat/README.md#complete) - Chat Completion
|
|
353
412
|
* [stream](https://github.com/mistralai/client-python/blob/master/docs/sdks/chat/README.md#stream) - Stream chat completion
|
|
354
413
|
|
|
414
|
+
### [classifiers](https://github.com/mistralai/client-python/blob/master/docs/sdks/classifiers/README.md)
|
|
415
|
+
|
|
416
|
+
* [moderate](https://github.com/mistralai/client-python/blob/master/docs/sdks/classifiers/README.md#moderate) - Moderations
|
|
417
|
+
* [moderate_chat](https://github.com/mistralai/client-python/blob/master/docs/sdks/classifiers/README.md#moderate_chat) - Moderations Chat
|
|
418
|
+
|
|
355
419
|
### [embeddings](https://github.com/mistralai/client-python/blob/master/docs/sdks/embeddings/README.md)
|
|
356
420
|
|
|
357
421
|
* [create](https://github.com/mistralai/client-python/blob/master/docs/sdks/embeddings/README.md#create) - Embeddings
|
|
@@ -362,6 +426,7 @@ The documentation for the GCP SDK is available [here](https://github.com/mistral
|
|
|
362
426
|
* [list](https://github.com/mistralai/client-python/blob/master/docs/sdks/files/README.md#list) - List Files
|
|
363
427
|
* [retrieve](https://github.com/mistralai/client-python/blob/master/docs/sdks/files/README.md#retrieve) - Retrieve File
|
|
364
428
|
* [delete](https://github.com/mistralai/client-python/blob/master/docs/sdks/files/README.md#delete) - Delete File
|
|
429
|
+
* [download](https://github.com/mistralai/client-python/blob/master/docs/sdks/files/README.md#download) - Download File
|
|
365
430
|
|
|
366
431
|
### [fim](https://github.com/mistralai/client-python/blob/master/docs/sdks/fim/README.md)
|
|
367
432
|
|
|
@@ -504,12 +569,23 @@ if res is not None:
|
|
|
504
569
|
<!-- Start Error Handling [errors] -->
|
|
505
570
|
## Error Handling
|
|
506
571
|
|
|
507
|
-
Handling errors in this SDK should largely match your expectations.
|
|
572
|
+
Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception.
|
|
573
|
+
|
|
574
|
+
By default, an API error will raise a models.SDKError exception, which has the following properties:
|
|
575
|
+
|
|
576
|
+
| Property | Type | Description |
|
|
577
|
+
|-----------------|------------------|-----------------------|
|
|
578
|
+
| `.status_code` | *int* | The HTTP status code |
|
|
579
|
+
| `.message` | *str* | The error message |
|
|
580
|
+
| `.raw_response` | *httpx.Response* | The raw HTTP response |
|
|
581
|
+
| `.body` | *str* | The response content |
|
|
582
|
+
|
|
583
|
+
When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `list_async` method may raise the following exceptions:
|
|
508
584
|
|
|
509
|
-
| Error
|
|
510
|
-
| -------------------------- |
|
|
511
|
-
| models.HTTPValidationError | 422
|
|
512
|
-
| models.SDKError |
|
|
585
|
+
| Error Type | Status Code | Content Type |
|
|
586
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
587
|
+
| models.HTTPValidationError | 422 | application/json |
|
|
588
|
+
| models.SDKError | 4XX, 5XX | \*/\* |
|
|
513
589
|
|
|
514
590
|
### Example
|
|
515
591
|
|
|
@@ -545,9 +621,9 @@ except models.SDKError as e:
|
|
|
545
621
|
|
|
546
622
|
You can override the default server globally by passing a server name to the `server: str` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers:
|
|
547
623
|
|
|
548
|
-
| Name
|
|
549
|
-
|
|
|
550
|
-
| `
|
|
624
|
+
| Name | Server | Variables |
|
|
625
|
+
| ----- | ------ | --------- |
|
|
626
|
+
| `eu` | `https://api.mistral.ai` | None |
|
|
551
627
|
|
|
552
628
|
#### Example
|
|
553
629
|
|
|
@@ -556,7 +632,7 @@ from mistralai import Mistral
|
|
|
556
632
|
import os
|
|
557
633
|
|
|
558
634
|
s = Mistral(
|
|
559
|
-
server="
|
|
635
|
+
server="eu",
|
|
560
636
|
api_key=os.getenv("MISTRAL_API_KEY", ""),
|
|
561
637
|
)
|
|
562
638
|
|
|
@@ -678,9 +754,9 @@ s = Mistral(async_client=CustomClient(httpx.AsyncClient()))
|
|
|
678
754
|
|
|
679
755
|
This SDK supports the following security scheme globally:
|
|
680
756
|
|
|
681
|
-
| Name
|
|
682
|
-
|
|
|
683
|
-
| `api_key`
|
|
757
|
+
| Name | Type | Scheme | Environment Variable |
|
|
758
|
+
| -------------------- | -------------------- | -------------------- | -------------------- |
|
|
759
|
+
| `api_key` | http | HTTP Bearer | `MISTRAL_API_KEY` |
|
|
684
760
|
|
|
685
761
|
To authenticate with the API the `api_key` parameter must be set when initializing the SDK client instance. For example:
|
|
686
762
|
```python
|