mistralai 1.10.1__py3-none-any.whl → 1.11.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mistralai/_version.py +3 -3
- mistralai/accesses.py +22 -12
- mistralai/agents.py +88 -44
- mistralai/basesdk.py +6 -0
- mistralai/chat.py +96 -40
- mistralai/classifiers.py +35 -22
- mistralai/conversations.py +186 -64
- mistralai/documents.py +72 -26
- mistralai/embeddings.py +17 -8
- mistralai/files.py +58 -24
- mistralai/fim.py +20 -12
- mistralai/httpclient.py +0 -1
- mistralai/jobs.py +65 -26
- mistralai/libraries.py +20 -10
- mistralai/mistral_agents.py +438 -30
- mistralai/mistral_jobs.py +33 -14
- mistralai/models/__init__.py +16 -0
- mistralai/models/agent.py +1 -1
- mistralai/models/agentconversation.py +1 -1
- mistralai/models/agenthandoffdoneevent.py +1 -1
- mistralai/models/agenthandoffentry.py +3 -2
- mistralai/models/agenthandoffstartedevent.py +1 -1
- mistralai/models/agents_api_v1_agents_get_versionop.py +21 -0
- mistralai/models/agents_api_v1_agents_list_versionsop.py +33 -0
- mistralai/models/agents_api_v1_agents_listop.py +4 -0
- mistralai/models/agentscompletionrequest.py +2 -5
- mistralai/models/agentscompletionstreamrequest.py +2 -5
- mistralai/models/archiveftmodelout.py +1 -1
- mistralai/models/assistantmessage.py +1 -1
- mistralai/models/audiochunk.py +1 -1
- mistralai/models/audioencoding.py +6 -1
- mistralai/models/audioformat.py +2 -4
- mistralai/models/basemodelcard.py +1 -1
- mistralai/models/batchjobin.py +2 -4
- mistralai/models/batchjobout.py +1 -1
- mistralai/models/batchjobsout.py +1 -1
- mistralai/models/chatcompletionchoice.py +10 -5
- mistralai/models/chatcompletionrequest.py +2 -5
- mistralai/models/chatcompletionstreamrequest.py +2 -5
- mistralai/models/classifierdetailedjobout.py +4 -2
- mistralai/models/classifierftmodelout.py +3 -2
- mistralai/models/classifierjobout.py +4 -2
- mistralai/models/codeinterpretertool.py +1 -1
- mistralai/models/completiondetailedjobout.py +5 -2
- mistralai/models/completionftmodelout.py +3 -2
- mistralai/models/completionjobout.py +5 -2
- mistralai/models/completionresponsestreamchoice.py +9 -8
- mistralai/models/conversationappendrequest.py +4 -1
- mistralai/models/conversationappendstreamrequest.py +4 -1
- mistralai/models/conversationhistory.py +2 -1
- mistralai/models/conversationmessages.py +1 -1
- mistralai/models/conversationrequest.py +5 -1
- mistralai/models/conversationresponse.py +2 -1
- mistralai/models/conversationrestartrequest.py +4 -1
- mistralai/models/conversationrestartstreamrequest.py +4 -1
- mistralai/models/conversationstreamrequest.py +5 -1
- mistralai/models/documentlibrarytool.py +1 -1
- mistralai/models/documenturlchunk.py +1 -1
- mistralai/models/embeddingdtype.py +7 -1
- mistralai/models/encodingformat.py +4 -1
- mistralai/models/entitytype.py +8 -1
- mistralai/models/filepurpose.py +8 -1
- mistralai/models/files_api_routes_list_filesop.py +4 -11
- mistralai/models/files_api_routes_upload_fileop.py +2 -6
- mistralai/models/fileschema.py +3 -5
- mistralai/models/finetuneablemodeltype.py +4 -1
- mistralai/models/ftclassifierlossfunction.py +4 -1
- mistralai/models/ftmodelcard.py +1 -1
- mistralai/models/functioncallentry.py +3 -2
- mistralai/models/functioncallevent.py +1 -1
- mistralai/models/functionresultentry.py +3 -2
- mistralai/models/functiontool.py +1 -1
- mistralai/models/githubrepositoryin.py +1 -1
- mistralai/models/githubrepositoryout.py +1 -1
- mistralai/models/httpvalidationerror.py +4 -2
- mistralai/models/imagegenerationtool.py +1 -1
- mistralai/models/imageurlchunk.py +1 -1
- mistralai/models/jobsout.py +1 -1
- mistralai/models/legacyjobmetadataout.py +1 -1
- mistralai/models/messageinputentry.py +9 -3
- mistralai/models/messageoutputentry.py +6 -3
- mistralai/models/messageoutputevent.py +4 -2
- mistralai/models/mistralerror.py +11 -7
- mistralai/models/mistralpromptmode.py +1 -1
- mistralai/models/modelconversation.py +1 -1
- mistralai/models/no_response_error.py +5 -1
- mistralai/models/ocrrequest.py +11 -1
- mistralai/models/ocrtableobject.py +4 -1
- mistralai/models/referencechunk.py +1 -1
- mistralai/models/requestsource.py +5 -1
- mistralai/models/responsedoneevent.py +1 -1
- mistralai/models/responseerrorevent.py +1 -1
- mistralai/models/responseformats.py +5 -1
- mistralai/models/responsestartedevent.py +1 -1
- mistralai/models/responsevalidationerror.py +2 -0
- mistralai/models/retrievefileout.py +3 -5
- mistralai/models/sampletype.py +7 -1
- mistralai/models/sdkerror.py +2 -0
- mistralai/models/shareenum.py +7 -1
- mistralai/models/sharingdelete.py +2 -4
- mistralai/models/sharingin.py +3 -5
- mistralai/models/source.py +8 -1
- mistralai/models/systemmessage.py +1 -1
- mistralai/models/textchunk.py +1 -1
- mistralai/models/thinkchunk.py +1 -1
- mistralai/models/timestampgranularity.py +1 -1
- mistralai/models/tool.py +2 -6
- mistralai/models/toolcall.py +2 -6
- mistralai/models/toolchoice.py +2 -6
- mistralai/models/toolchoiceenum.py +6 -1
- mistralai/models/toolexecutiondeltaevent.py +2 -1
- mistralai/models/toolexecutiondoneevent.py +2 -1
- mistralai/models/toolexecutionentry.py +4 -2
- mistralai/models/toolexecutionstartedevent.py +2 -1
- mistralai/models/toolfilechunk.py +2 -1
- mistralai/models/toolmessage.py +1 -1
- mistralai/models/toolreferencechunk.py +2 -1
- mistralai/models/tooltypes.py +1 -1
- mistralai/models/transcriptionsegmentchunk.py +1 -1
- mistralai/models/transcriptionstreamdone.py +1 -1
- mistralai/models/transcriptionstreamlanguage.py +1 -1
- mistralai/models/transcriptionstreamsegmentdelta.py +1 -1
- mistralai/models/transcriptionstreamtextdelta.py +1 -1
- mistralai/models/unarchiveftmodelout.py +1 -1
- mistralai/models/uploadfileout.py +3 -5
- mistralai/models/usermessage.py +1 -1
- mistralai/models/wandbintegration.py +1 -1
- mistralai/models/wandbintegrationout.py +1 -1
- mistralai/models/websearchpremiumtool.py +1 -1
- mistralai/models/websearchtool.py +1 -1
- mistralai/models_.py +24 -12
- mistralai/ocr.py +38 -10
- mistralai/sdk.py +2 -2
- mistralai/transcriptions.py +28 -12
- mistralai/types/basemodel.py +41 -3
- mistralai/utils/__init__.py +0 -3
- mistralai/utils/annotations.py +32 -8
- mistralai/utils/enums.py +60 -0
- mistralai/utils/forms.py +21 -10
- mistralai/utils/queryparams.py +14 -2
- mistralai/utils/requestbodies.py +3 -3
- mistralai/utils/retries.py +69 -5
- mistralai/utils/serializers.py +0 -20
- mistralai/utils/unmarshal_json_response.py +15 -1
- {mistralai-1.10.1.dist-info → mistralai-1.11.1.dist-info}/METADATA +24 -31
- {mistralai-1.10.1.dist-info → mistralai-1.11.1.dist-info}/RECORD +233 -230
- mistralai_azure/_version.py +3 -3
- mistralai_azure/basesdk.py +6 -0
- mistralai_azure/chat.py +27 -15
- mistralai_azure/httpclient.py +0 -1
- mistralai_azure/models/__init__.py +16 -1
- mistralai_azure/models/assistantmessage.py +1 -1
- mistralai_azure/models/chatcompletionchoice.py +10 -7
- mistralai_azure/models/chatcompletionrequest.py +8 -6
- mistralai_azure/models/chatcompletionstreamrequest.py +8 -6
- mistralai_azure/models/completionresponsestreamchoice.py +11 -7
- mistralai_azure/models/documenturlchunk.py +1 -1
- mistralai_azure/models/httpvalidationerror.py +4 -2
- mistralai_azure/models/imageurlchunk.py +1 -1
- mistralai_azure/models/mistralazureerror.py +11 -7
- mistralai_azure/models/mistralpromptmode.py +1 -1
- mistralai_azure/models/no_response_error.py +5 -1
- mistralai_azure/models/ocrpageobject.py +32 -5
- mistralai_azure/models/ocrrequest.py +20 -1
- mistralai_azure/models/ocrtableobject.py +34 -0
- mistralai_azure/models/referencechunk.py +1 -1
- mistralai_azure/models/responseformats.py +5 -1
- mistralai_azure/models/responsevalidationerror.py +2 -0
- mistralai_azure/models/sdkerror.py +2 -0
- mistralai_azure/models/systemmessage.py +1 -1
- mistralai_azure/models/textchunk.py +1 -1
- mistralai_azure/models/thinkchunk.py +1 -1
- mistralai_azure/models/tool.py +2 -6
- mistralai_azure/models/toolcall.py +2 -6
- mistralai_azure/models/toolchoice.py +2 -6
- mistralai_azure/models/toolchoiceenum.py +6 -1
- mistralai_azure/models/toolmessage.py +1 -1
- mistralai_azure/models/tooltypes.py +1 -1
- mistralai_azure/models/usermessage.py +1 -1
- mistralai_azure/ocr.py +26 -6
- mistralai_azure/types/basemodel.py +41 -3
- mistralai_azure/utils/__init__.py +0 -3
- mistralai_azure/utils/annotations.py +32 -8
- mistralai_azure/utils/enums.py +60 -0
- mistralai_azure/utils/forms.py +21 -10
- mistralai_azure/utils/queryparams.py +14 -2
- mistralai_azure/utils/requestbodies.py +3 -3
- mistralai_azure/utils/retries.py +69 -5
- mistralai_azure/utils/serializers.py +0 -20
- mistralai_azure/utils/unmarshal_json_response.py +15 -1
- mistralai_gcp/_version.py +3 -3
- mistralai_gcp/basesdk.py +6 -0
- mistralai_gcp/chat.py +27 -15
- mistralai_gcp/fim.py +27 -15
- mistralai_gcp/httpclient.py +0 -1
- mistralai_gcp/models/assistantmessage.py +1 -1
- mistralai_gcp/models/chatcompletionchoice.py +10 -7
- mistralai_gcp/models/chatcompletionrequest.py +8 -6
- mistralai_gcp/models/chatcompletionstreamrequest.py +8 -6
- mistralai_gcp/models/completionresponsestreamchoice.py +11 -7
- mistralai_gcp/models/fimcompletionrequest.py +6 -1
- mistralai_gcp/models/fimcompletionstreamrequest.py +6 -1
- mistralai_gcp/models/httpvalidationerror.py +4 -2
- mistralai_gcp/models/imageurlchunk.py +1 -1
- mistralai_gcp/models/mistralgcperror.py +11 -7
- mistralai_gcp/models/mistralpromptmode.py +1 -1
- mistralai_gcp/models/no_response_error.py +5 -1
- mistralai_gcp/models/referencechunk.py +1 -1
- mistralai_gcp/models/responseformats.py +5 -1
- mistralai_gcp/models/responsevalidationerror.py +2 -0
- mistralai_gcp/models/sdkerror.py +2 -0
- mistralai_gcp/models/systemmessage.py +1 -1
- mistralai_gcp/models/textchunk.py +1 -1
- mistralai_gcp/models/thinkchunk.py +1 -1
- mistralai_gcp/models/tool.py +2 -6
- mistralai_gcp/models/toolcall.py +2 -6
- mistralai_gcp/models/toolchoice.py +2 -6
- mistralai_gcp/models/toolchoiceenum.py +6 -1
- mistralai_gcp/models/toolmessage.py +1 -1
- mistralai_gcp/models/tooltypes.py +1 -1
- mistralai_gcp/models/usermessage.py +1 -1
- mistralai_gcp/types/basemodel.py +41 -3
- mistralai_gcp/utils/__init__.py +0 -3
- mistralai_gcp/utils/annotations.py +32 -8
- mistralai_gcp/utils/enums.py +60 -0
- mistralai_gcp/utils/forms.py +21 -10
- mistralai_gcp/utils/queryparams.py +14 -2
- mistralai_gcp/utils/requestbodies.py +3 -3
- mistralai_gcp/utils/retries.py +69 -5
- mistralai_gcp/utils/serializers.py +0 -20
- mistralai_gcp/utils/unmarshal_json_response.py +15 -1
- {mistralai-1.10.1.dist-info → mistralai-1.11.1.dist-info}/WHEEL +0 -0
- {mistralai-1.10.1.dist-info → mistralai-1.11.1.dist-info}/licenses/LICENSE +0 -0
mistralai/mistral_agents.py
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
from .basesdk import BaseSDK
|
|
4
4
|
from mistralai import models, utils
|
|
5
5
|
from mistralai._hooks import HookContext
|
|
6
|
+
from mistralai.models import (
|
|
7
|
+
agentcreationrequest as models_agentcreationrequest,
|
|
8
|
+
agentupdaterequest as models_agentupdaterequest,
|
|
9
|
+
completionargs as models_completionargs,
|
|
10
|
+
requestsource as models_requestsource,
|
|
11
|
+
)
|
|
6
12
|
from mistralai.types import OptionalNullable, UNSET
|
|
7
13
|
from mistralai.utils import get_security_from_env
|
|
8
14
|
from mistralai.utils.unmarshal_json_response import unmarshal_json_response
|
|
@@ -20,12 +26,15 @@ class MistralAgents(BaseSDK):
|
|
|
20
26
|
instructions: OptionalNullable[str] = UNSET,
|
|
21
27
|
tools: Optional[
|
|
22
28
|
Union[
|
|
23
|
-
List[
|
|
24
|
-
List[
|
|
29
|
+
List[models_agentcreationrequest.AgentCreationRequestTools],
|
|
30
|
+
List[models_agentcreationrequest.AgentCreationRequestToolsTypedDict],
|
|
25
31
|
]
|
|
26
32
|
] = None,
|
|
27
33
|
completion_args: Optional[
|
|
28
|
-
Union[
|
|
34
|
+
Union[
|
|
35
|
+
models_completionargs.CompletionArgs,
|
|
36
|
+
models_completionargs.CompletionArgsTypedDict,
|
|
37
|
+
]
|
|
29
38
|
] = None,
|
|
30
39
|
description: OptionalNullable[str] = UNSET,
|
|
31
40
|
handoffs: OptionalNullable[List[str]] = UNSET,
|
|
@@ -93,6 +102,7 @@ class MistralAgents(BaseSDK):
|
|
|
93
102
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
94
103
|
request, False, False, "json", models.AgentCreationRequest
|
|
95
104
|
),
|
|
105
|
+
allow_empty_value=None,
|
|
96
106
|
timeout_ms=timeout_ms,
|
|
97
107
|
)
|
|
98
108
|
|
|
@@ -109,7 +119,7 @@ class MistralAgents(BaseSDK):
|
|
|
109
119
|
config=self.sdk_configuration,
|
|
110
120
|
base_url=base_url or "",
|
|
111
121
|
operation_id="agents_api_v1_agents_create",
|
|
112
|
-
oauth2_scopes=
|
|
122
|
+
oauth2_scopes=None,
|
|
113
123
|
security_source=get_security_from_env(
|
|
114
124
|
self.sdk_configuration.security, models.Security
|
|
115
125
|
),
|
|
@@ -144,12 +154,15 @@ class MistralAgents(BaseSDK):
|
|
|
144
154
|
instructions: OptionalNullable[str] = UNSET,
|
|
145
155
|
tools: Optional[
|
|
146
156
|
Union[
|
|
147
|
-
List[
|
|
148
|
-
List[
|
|
157
|
+
List[models_agentcreationrequest.AgentCreationRequestTools],
|
|
158
|
+
List[models_agentcreationrequest.AgentCreationRequestToolsTypedDict],
|
|
149
159
|
]
|
|
150
160
|
] = None,
|
|
151
161
|
completion_args: Optional[
|
|
152
|
-
Union[
|
|
162
|
+
Union[
|
|
163
|
+
models_completionargs.CompletionArgs,
|
|
164
|
+
models_completionargs.CompletionArgsTypedDict,
|
|
165
|
+
]
|
|
153
166
|
] = None,
|
|
154
167
|
description: OptionalNullable[str] = UNSET,
|
|
155
168
|
handoffs: OptionalNullable[List[str]] = UNSET,
|
|
@@ -217,6 +230,7 @@ class MistralAgents(BaseSDK):
|
|
|
217
230
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
218
231
|
request, False, False, "json", models.AgentCreationRequest
|
|
219
232
|
),
|
|
233
|
+
allow_empty_value=None,
|
|
220
234
|
timeout_ms=timeout_ms,
|
|
221
235
|
)
|
|
222
236
|
|
|
@@ -233,7 +247,7 @@ class MistralAgents(BaseSDK):
|
|
|
233
247
|
config=self.sdk_configuration,
|
|
234
248
|
base_url=base_url or "",
|
|
235
249
|
operation_id="agents_api_v1_agents_create",
|
|
236
|
-
oauth2_scopes=
|
|
250
|
+
oauth2_scopes=None,
|
|
237
251
|
security_source=get_security_from_env(
|
|
238
252
|
self.sdk_configuration.security, models.Security
|
|
239
253
|
),
|
|
@@ -266,7 +280,7 @@ class MistralAgents(BaseSDK):
|
|
|
266
280
|
page: Optional[int] = 0,
|
|
267
281
|
page_size: Optional[int] = 20,
|
|
268
282
|
deployment_chat: OptionalNullable[bool] = UNSET,
|
|
269
|
-
sources: OptionalNullable[List[
|
|
283
|
+
sources: OptionalNullable[List[models_requestsource.RequestSource]] = UNSET,
|
|
270
284
|
name: OptionalNullable[str] = UNSET,
|
|
271
285
|
id: OptionalNullable[str] = UNSET,
|
|
272
286
|
metadata: OptionalNullable[Dict[str, Any]] = UNSET,
|
|
@@ -279,8 +293,8 @@ class MistralAgents(BaseSDK):
|
|
|
279
293
|
|
|
280
294
|
Retrieve a list of agent entities sorted by creation time.
|
|
281
295
|
|
|
282
|
-
:param page:
|
|
283
|
-
:param page_size:
|
|
296
|
+
:param page: Page number (0-indexed)
|
|
297
|
+
:param page_size: Number of agents per page
|
|
284
298
|
:param deployment_chat:
|
|
285
299
|
:param sources:
|
|
286
300
|
:param name:
|
|
@@ -324,6 +338,7 @@ class MistralAgents(BaseSDK):
|
|
|
324
338
|
accept_header_value="application/json",
|
|
325
339
|
http_headers=http_headers,
|
|
326
340
|
security=self.sdk_configuration.security,
|
|
341
|
+
allow_empty_value=None,
|
|
327
342
|
timeout_ms=timeout_ms,
|
|
328
343
|
)
|
|
329
344
|
|
|
@@ -340,7 +355,7 @@ class MistralAgents(BaseSDK):
|
|
|
340
355
|
config=self.sdk_configuration,
|
|
341
356
|
base_url=base_url or "",
|
|
342
357
|
operation_id="agents_api_v1_agents_list",
|
|
343
|
-
oauth2_scopes=
|
|
358
|
+
oauth2_scopes=None,
|
|
344
359
|
security_source=get_security_from_env(
|
|
345
360
|
self.sdk_configuration.security, models.Security
|
|
346
361
|
),
|
|
@@ -373,7 +388,7 @@ class MistralAgents(BaseSDK):
|
|
|
373
388
|
page: Optional[int] = 0,
|
|
374
389
|
page_size: Optional[int] = 20,
|
|
375
390
|
deployment_chat: OptionalNullable[bool] = UNSET,
|
|
376
|
-
sources: OptionalNullable[List[
|
|
391
|
+
sources: OptionalNullable[List[models_requestsource.RequestSource]] = UNSET,
|
|
377
392
|
name: OptionalNullable[str] = UNSET,
|
|
378
393
|
id: OptionalNullable[str] = UNSET,
|
|
379
394
|
metadata: OptionalNullable[Dict[str, Any]] = UNSET,
|
|
@@ -386,8 +401,8 @@ class MistralAgents(BaseSDK):
|
|
|
386
401
|
|
|
387
402
|
Retrieve a list of agent entities sorted by creation time.
|
|
388
403
|
|
|
389
|
-
:param page:
|
|
390
|
-
:param page_size:
|
|
404
|
+
:param page: Page number (0-indexed)
|
|
405
|
+
:param page_size: Number of agents per page
|
|
391
406
|
:param deployment_chat:
|
|
392
407
|
:param sources:
|
|
393
408
|
:param name:
|
|
@@ -431,6 +446,7 @@ class MistralAgents(BaseSDK):
|
|
|
431
446
|
accept_header_value="application/json",
|
|
432
447
|
http_headers=http_headers,
|
|
433
448
|
security=self.sdk_configuration.security,
|
|
449
|
+
allow_empty_value=None,
|
|
434
450
|
timeout_ms=timeout_ms,
|
|
435
451
|
)
|
|
436
452
|
|
|
@@ -447,7 +463,7 @@ class MistralAgents(BaseSDK):
|
|
|
447
463
|
config=self.sdk_configuration,
|
|
448
464
|
base_url=base_url or "",
|
|
449
465
|
operation_id="agents_api_v1_agents_list",
|
|
450
|
-
oauth2_scopes=
|
|
466
|
+
oauth2_scopes=None,
|
|
451
467
|
security_source=get_security_from_env(
|
|
452
468
|
self.sdk_configuration.security, models.Security
|
|
453
469
|
),
|
|
@@ -523,6 +539,7 @@ class MistralAgents(BaseSDK):
|
|
|
523
539
|
accept_header_value="application/json",
|
|
524
540
|
http_headers=http_headers,
|
|
525
541
|
security=self.sdk_configuration.security,
|
|
542
|
+
allow_empty_value=None,
|
|
526
543
|
timeout_ms=timeout_ms,
|
|
527
544
|
)
|
|
528
545
|
|
|
@@ -539,7 +556,7 @@ class MistralAgents(BaseSDK):
|
|
|
539
556
|
config=self.sdk_configuration,
|
|
540
557
|
base_url=base_url or "",
|
|
541
558
|
operation_id="agents_api_v1_agents_get",
|
|
542
|
-
oauth2_scopes=
|
|
559
|
+
oauth2_scopes=None,
|
|
543
560
|
security_source=get_security_from_env(
|
|
544
561
|
self.sdk_configuration.security, models.Security
|
|
545
562
|
),
|
|
@@ -615,6 +632,7 @@ class MistralAgents(BaseSDK):
|
|
|
615
632
|
accept_header_value="application/json",
|
|
616
633
|
http_headers=http_headers,
|
|
617
634
|
security=self.sdk_configuration.security,
|
|
635
|
+
allow_empty_value=None,
|
|
618
636
|
timeout_ms=timeout_ms,
|
|
619
637
|
)
|
|
620
638
|
|
|
@@ -631,7 +649,7 @@ class MistralAgents(BaseSDK):
|
|
|
631
649
|
config=self.sdk_configuration,
|
|
632
650
|
base_url=base_url or "",
|
|
633
651
|
operation_id="agents_api_v1_agents_get",
|
|
634
|
-
oauth2_scopes=
|
|
652
|
+
oauth2_scopes=None,
|
|
635
653
|
security_source=get_security_from_env(
|
|
636
654
|
self.sdk_configuration.security, models.Security
|
|
637
655
|
),
|
|
@@ -665,12 +683,15 @@ class MistralAgents(BaseSDK):
|
|
|
665
683
|
instructions: OptionalNullable[str] = UNSET,
|
|
666
684
|
tools: Optional[
|
|
667
685
|
Union[
|
|
668
|
-
List[
|
|
669
|
-
List[
|
|
686
|
+
List[models_agentupdaterequest.AgentUpdateRequestTools],
|
|
687
|
+
List[models_agentupdaterequest.AgentUpdateRequestToolsTypedDict],
|
|
670
688
|
]
|
|
671
689
|
] = None,
|
|
672
690
|
completion_args: Optional[
|
|
673
|
-
Union[
|
|
691
|
+
Union[
|
|
692
|
+
models_completionargs.CompletionArgs,
|
|
693
|
+
models_completionargs.CompletionArgsTypedDict,
|
|
694
|
+
]
|
|
674
695
|
] = None,
|
|
675
696
|
model: OptionalNullable[str] = UNSET,
|
|
676
697
|
name: OptionalNullable[str] = UNSET,
|
|
@@ -751,6 +772,7 @@ class MistralAgents(BaseSDK):
|
|
|
751
772
|
"json",
|
|
752
773
|
models.AgentUpdateRequest,
|
|
753
774
|
),
|
|
775
|
+
allow_empty_value=None,
|
|
754
776
|
timeout_ms=timeout_ms,
|
|
755
777
|
)
|
|
756
778
|
|
|
@@ -767,7 +789,7 @@ class MistralAgents(BaseSDK):
|
|
|
767
789
|
config=self.sdk_configuration,
|
|
768
790
|
base_url=base_url or "",
|
|
769
791
|
operation_id="agents_api_v1_agents_update",
|
|
770
|
-
oauth2_scopes=
|
|
792
|
+
oauth2_scopes=None,
|
|
771
793
|
security_source=get_security_from_env(
|
|
772
794
|
self.sdk_configuration.security, models.Security
|
|
773
795
|
),
|
|
@@ -801,12 +823,15 @@ class MistralAgents(BaseSDK):
|
|
|
801
823
|
instructions: OptionalNullable[str] = UNSET,
|
|
802
824
|
tools: Optional[
|
|
803
825
|
Union[
|
|
804
|
-
List[
|
|
805
|
-
List[
|
|
826
|
+
List[models_agentupdaterequest.AgentUpdateRequestTools],
|
|
827
|
+
List[models_agentupdaterequest.AgentUpdateRequestToolsTypedDict],
|
|
806
828
|
]
|
|
807
829
|
] = None,
|
|
808
830
|
completion_args: Optional[
|
|
809
|
-
Union[
|
|
831
|
+
Union[
|
|
832
|
+
models_completionargs.CompletionArgs,
|
|
833
|
+
models_completionargs.CompletionArgsTypedDict,
|
|
834
|
+
]
|
|
810
835
|
] = None,
|
|
811
836
|
model: OptionalNullable[str] = UNSET,
|
|
812
837
|
name: OptionalNullable[str] = UNSET,
|
|
@@ -887,6 +912,7 @@ class MistralAgents(BaseSDK):
|
|
|
887
912
|
"json",
|
|
888
913
|
models.AgentUpdateRequest,
|
|
889
914
|
),
|
|
915
|
+
allow_empty_value=None,
|
|
890
916
|
timeout_ms=timeout_ms,
|
|
891
917
|
)
|
|
892
918
|
|
|
@@ -903,7 +929,7 @@ class MistralAgents(BaseSDK):
|
|
|
903
929
|
config=self.sdk_configuration,
|
|
904
930
|
base_url=base_url or "",
|
|
905
931
|
operation_id="agents_api_v1_agents_update",
|
|
906
|
-
oauth2_scopes=
|
|
932
|
+
oauth2_scopes=None,
|
|
907
933
|
security_source=get_security_from_env(
|
|
908
934
|
self.sdk_configuration.security, models.Security
|
|
909
935
|
),
|
|
@@ -974,6 +1000,7 @@ class MistralAgents(BaseSDK):
|
|
|
974
1000
|
accept_header_value="application/json",
|
|
975
1001
|
http_headers=http_headers,
|
|
976
1002
|
security=self.sdk_configuration.security,
|
|
1003
|
+
allow_empty_value=None,
|
|
977
1004
|
timeout_ms=timeout_ms,
|
|
978
1005
|
)
|
|
979
1006
|
|
|
@@ -990,7 +1017,7 @@ class MistralAgents(BaseSDK):
|
|
|
990
1017
|
config=self.sdk_configuration,
|
|
991
1018
|
base_url=base_url or "",
|
|
992
1019
|
operation_id="agents_api_v1_agents_delete",
|
|
993
|
-
oauth2_scopes=
|
|
1020
|
+
oauth2_scopes=None,
|
|
994
1021
|
security_source=get_security_from_env(
|
|
995
1022
|
self.sdk_configuration.security, models.Security
|
|
996
1023
|
),
|
|
@@ -1061,6 +1088,7 @@ class MistralAgents(BaseSDK):
|
|
|
1061
1088
|
accept_header_value="application/json",
|
|
1062
1089
|
http_headers=http_headers,
|
|
1063
1090
|
security=self.sdk_configuration.security,
|
|
1091
|
+
allow_empty_value=None,
|
|
1064
1092
|
timeout_ms=timeout_ms,
|
|
1065
1093
|
)
|
|
1066
1094
|
|
|
@@ -1077,7 +1105,7 @@ class MistralAgents(BaseSDK):
|
|
|
1077
1105
|
config=self.sdk_configuration,
|
|
1078
1106
|
base_url=base_url or "",
|
|
1079
1107
|
operation_id="agents_api_v1_agents_delete",
|
|
1080
|
-
oauth2_scopes=
|
|
1108
|
+
oauth2_scopes=None,
|
|
1081
1109
|
security_source=get_security_from_env(
|
|
1082
1110
|
self.sdk_configuration.security, models.Security
|
|
1083
1111
|
),
|
|
@@ -1153,6 +1181,7 @@ class MistralAgents(BaseSDK):
|
|
|
1153
1181
|
accept_header_value="application/json",
|
|
1154
1182
|
http_headers=http_headers,
|
|
1155
1183
|
security=self.sdk_configuration.security,
|
|
1184
|
+
allow_empty_value=None,
|
|
1156
1185
|
timeout_ms=timeout_ms,
|
|
1157
1186
|
)
|
|
1158
1187
|
|
|
@@ -1169,7 +1198,7 @@ class MistralAgents(BaseSDK):
|
|
|
1169
1198
|
config=self.sdk_configuration,
|
|
1170
1199
|
base_url=base_url or "",
|
|
1171
1200
|
operation_id="agents_api_v1_agents_update_version",
|
|
1172
|
-
oauth2_scopes=
|
|
1201
|
+
oauth2_scopes=None,
|
|
1173
1202
|
security_source=get_security_from_env(
|
|
1174
1203
|
self.sdk_configuration.security, models.Security
|
|
1175
1204
|
),
|
|
@@ -1245,6 +1274,7 @@ class MistralAgents(BaseSDK):
|
|
|
1245
1274
|
accept_header_value="application/json",
|
|
1246
1275
|
http_headers=http_headers,
|
|
1247
1276
|
security=self.sdk_configuration.security,
|
|
1277
|
+
allow_empty_value=None,
|
|
1248
1278
|
timeout_ms=timeout_ms,
|
|
1249
1279
|
)
|
|
1250
1280
|
|
|
@@ -1261,7 +1291,385 @@ class MistralAgents(BaseSDK):
|
|
|
1261
1291
|
config=self.sdk_configuration,
|
|
1262
1292
|
base_url=base_url or "",
|
|
1263
1293
|
operation_id="agents_api_v1_agents_update_version",
|
|
1264
|
-
oauth2_scopes=
|
|
1294
|
+
oauth2_scopes=None,
|
|
1295
|
+
security_source=get_security_from_env(
|
|
1296
|
+
self.sdk_configuration.security, models.Security
|
|
1297
|
+
),
|
|
1298
|
+
),
|
|
1299
|
+
request=req,
|
|
1300
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
1301
|
+
retry_config=retry_config,
|
|
1302
|
+
)
|
|
1303
|
+
|
|
1304
|
+
response_data: Any = None
|
|
1305
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1306
|
+
return unmarshal_json_response(models.Agent, http_res)
|
|
1307
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
1308
|
+
response_data = unmarshal_json_response(
|
|
1309
|
+
models.HTTPValidationErrorData, http_res
|
|
1310
|
+
)
|
|
1311
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
1312
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1313
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1314
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1315
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1316
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1317
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1318
|
+
|
|
1319
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
1320
|
+
|
|
1321
|
+
def list_versions(
|
|
1322
|
+
self,
|
|
1323
|
+
*,
|
|
1324
|
+
agent_id: str,
|
|
1325
|
+
page: Optional[int] = 0,
|
|
1326
|
+
page_size: Optional[int] = 20,
|
|
1327
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1328
|
+
server_url: Optional[str] = None,
|
|
1329
|
+
timeout_ms: Optional[int] = None,
|
|
1330
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1331
|
+
) -> List[models.Agent]:
|
|
1332
|
+
r"""List all versions of an agent.
|
|
1333
|
+
|
|
1334
|
+
Retrieve all versions for a specific agent with full agent context. Supports pagination.
|
|
1335
|
+
|
|
1336
|
+
:param agent_id:
|
|
1337
|
+
:param page: Page number (0-indexed)
|
|
1338
|
+
:param page_size: Number of versions per page
|
|
1339
|
+
:param retries: Override the default retry configuration for this method
|
|
1340
|
+
:param server_url: Override the default server URL for this method
|
|
1341
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1342
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1343
|
+
"""
|
|
1344
|
+
base_url = None
|
|
1345
|
+
url_variables = None
|
|
1346
|
+
if timeout_ms is None:
|
|
1347
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1348
|
+
|
|
1349
|
+
if server_url is not None:
|
|
1350
|
+
base_url = server_url
|
|
1351
|
+
else:
|
|
1352
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1353
|
+
|
|
1354
|
+
request = models.AgentsAPIV1AgentsListVersionsRequest(
|
|
1355
|
+
agent_id=agent_id,
|
|
1356
|
+
page=page,
|
|
1357
|
+
page_size=page_size,
|
|
1358
|
+
)
|
|
1359
|
+
|
|
1360
|
+
req = self._build_request(
|
|
1361
|
+
method="GET",
|
|
1362
|
+
path="/v1/agents/{agent_id}/versions",
|
|
1363
|
+
base_url=base_url,
|
|
1364
|
+
url_variables=url_variables,
|
|
1365
|
+
request=request,
|
|
1366
|
+
request_body_required=False,
|
|
1367
|
+
request_has_path_params=True,
|
|
1368
|
+
request_has_query_params=True,
|
|
1369
|
+
user_agent_header="user-agent",
|
|
1370
|
+
accept_header_value="application/json",
|
|
1371
|
+
http_headers=http_headers,
|
|
1372
|
+
security=self.sdk_configuration.security,
|
|
1373
|
+
allow_empty_value=None,
|
|
1374
|
+
timeout_ms=timeout_ms,
|
|
1375
|
+
)
|
|
1376
|
+
|
|
1377
|
+
if retries == UNSET:
|
|
1378
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1379
|
+
retries = self.sdk_configuration.retry_config
|
|
1380
|
+
|
|
1381
|
+
retry_config = None
|
|
1382
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1383
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1384
|
+
|
|
1385
|
+
http_res = self.do_request(
|
|
1386
|
+
hook_ctx=HookContext(
|
|
1387
|
+
config=self.sdk_configuration,
|
|
1388
|
+
base_url=base_url or "",
|
|
1389
|
+
operation_id="agents_api_v1_agents_list_versions",
|
|
1390
|
+
oauth2_scopes=None,
|
|
1391
|
+
security_source=get_security_from_env(
|
|
1392
|
+
self.sdk_configuration.security, models.Security
|
|
1393
|
+
),
|
|
1394
|
+
),
|
|
1395
|
+
request=req,
|
|
1396
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
1397
|
+
retry_config=retry_config,
|
|
1398
|
+
)
|
|
1399
|
+
|
|
1400
|
+
response_data: Any = None
|
|
1401
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1402
|
+
return unmarshal_json_response(List[models.Agent], http_res)
|
|
1403
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
1404
|
+
response_data = unmarshal_json_response(
|
|
1405
|
+
models.HTTPValidationErrorData, http_res
|
|
1406
|
+
)
|
|
1407
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
1408
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1409
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1410
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1411
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1412
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1413
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1414
|
+
|
|
1415
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
1416
|
+
|
|
1417
|
+
async def list_versions_async(
|
|
1418
|
+
self,
|
|
1419
|
+
*,
|
|
1420
|
+
agent_id: str,
|
|
1421
|
+
page: Optional[int] = 0,
|
|
1422
|
+
page_size: Optional[int] = 20,
|
|
1423
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1424
|
+
server_url: Optional[str] = None,
|
|
1425
|
+
timeout_ms: Optional[int] = None,
|
|
1426
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1427
|
+
) -> List[models.Agent]:
|
|
1428
|
+
r"""List all versions of an agent.
|
|
1429
|
+
|
|
1430
|
+
Retrieve all versions for a specific agent with full agent context. Supports pagination.
|
|
1431
|
+
|
|
1432
|
+
:param agent_id:
|
|
1433
|
+
:param page: Page number (0-indexed)
|
|
1434
|
+
:param page_size: Number of versions per page
|
|
1435
|
+
:param retries: Override the default retry configuration for this method
|
|
1436
|
+
:param server_url: Override the default server URL for this method
|
|
1437
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1438
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1439
|
+
"""
|
|
1440
|
+
base_url = None
|
|
1441
|
+
url_variables = None
|
|
1442
|
+
if timeout_ms is None:
|
|
1443
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1444
|
+
|
|
1445
|
+
if server_url is not None:
|
|
1446
|
+
base_url = server_url
|
|
1447
|
+
else:
|
|
1448
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1449
|
+
|
|
1450
|
+
request = models.AgentsAPIV1AgentsListVersionsRequest(
|
|
1451
|
+
agent_id=agent_id,
|
|
1452
|
+
page=page,
|
|
1453
|
+
page_size=page_size,
|
|
1454
|
+
)
|
|
1455
|
+
|
|
1456
|
+
req = self._build_request_async(
|
|
1457
|
+
method="GET",
|
|
1458
|
+
path="/v1/agents/{agent_id}/versions",
|
|
1459
|
+
base_url=base_url,
|
|
1460
|
+
url_variables=url_variables,
|
|
1461
|
+
request=request,
|
|
1462
|
+
request_body_required=False,
|
|
1463
|
+
request_has_path_params=True,
|
|
1464
|
+
request_has_query_params=True,
|
|
1465
|
+
user_agent_header="user-agent",
|
|
1466
|
+
accept_header_value="application/json",
|
|
1467
|
+
http_headers=http_headers,
|
|
1468
|
+
security=self.sdk_configuration.security,
|
|
1469
|
+
allow_empty_value=None,
|
|
1470
|
+
timeout_ms=timeout_ms,
|
|
1471
|
+
)
|
|
1472
|
+
|
|
1473
|
+
if retries == UNSET:
|
|
1474
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1475
|
+
retries = self.sdk_configuration.retry_config
|
|
1476
|
+
|
|
1477
|
+
retry_config = None
|
|
1478
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1479
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1480
|
+
|
|
1481
|
+
http_res = await self.do_request_async(
|
|
1482
|
+
hook_ctx=HookContext(
|
|
1483
|
+
config=self.sdk_configuration,
|
|
1484
|
+
base_url=base_url or "",
|
|
1485
|
+
operation_id="agents_api_v1_agents_list_versions",
|
|
1486
|
+
oauth2_scopes=None,
|
|
1487
|
+
security_source=get_security_from_env(
|
|
1488
|
+
self.sdk_configuration.security, models.Security
|
|
1489
|
+
),
|
|
1490
|
+
),
|
|
1491
|
+
request=req,
|
|
1492
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
1493
|
+
retry_config=retry_config,
|
|
1494
|
+
)
|
|
1495
|
+
|
|
1496
|
+
response_data: Any = None
|
|
1497
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1498
|
+
return unmarshal_json_response(List[models.Agent], http_res)
|
|
1499
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
1500
|
+
response_data = unmarshal_json_response(
|
|
1501
|
+
models.HTTPValidationErrorData, http_res
|
|
1502
|
+
)
|
|
1503
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
1504
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1505
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1506
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1507
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1508
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1509
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1510
|
+
|
|
1511
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
1512
|
+
|
|
1513
|
+
def get_version(
|
|
1514
|
+
self,
|
|
1515
|
+
*,
|
|
1516
|
+
agent_id: str,
|
|
1517
|
+
version: int,
|
|
1518
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1519
|
+
server_url: Optional[str] = None,
|
|
1520
|
+
timeout_ms: Optional[int] = None,
|
|
1521
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1522
|
+
) -> models.Agent:
|
|
1523
|
+
r"""Retrieve a specific version of an agent.
|
|
1524
|
+
|
|
1525
|
+
Get a specific agent version by version number.
|
|
1526
|
+
|
|
1527
|
+
:param agent_id:
|
|
1528
|
+
:param version:
|
|
1529
|
+
:param retries: Override the default retry configuration for this method
|
|
1530
|
+
:param server_url: Override the default server URL for this method
|
|
1531
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1532
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1533
|
+
"""
|
|
1534
|
+
base_url = None
|
|
1535
|
+
url_variables = None
|
|
1536
|
+
if timeout_ms is None:
|
|
1537
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1538
|
+
|
|
1539
|
+
if server_url is not None:
|
|
1540
|
+
base_url = server_url
|
|
1541
|
+
else:
|
|
1542
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1543
|
+
|
|
1544
|
+
request = models.AgentsAPIV1AgentsGetVersionRequest(
|
|
1545
|
+
agent_id=agent_id,
|
|
1546
|
+
version=version,
|
|
1547
|
+
)
|
|
1548
|
+
|
|
1549
|
+
req = self._build_request(
|
|
1550
|
+
method="GET",
|
|
1551
|
+
path="/v1/agents/{agent_id}/version/{version}",
|
|
1552
|
+
base_url=base_url,
|
|
1553
|
+
url_variables=url_variables,
|
|
1554
|
+
request=request,
|
|
1555
|
+
request_body_required=False,
|
|
1556
|
+
request_has_path_params=True,
|
|
1557
|
+
request_has_query_params=True,
|
|
1558
|
+
user_agent_header="user-agent",
|
|
1559
|
+
accept_header_value="application/json",
|
|
1560
|
+
http_headers=http_headers,
|
|
1561
|
+
security=self.sdk_configuration.security,
|
|
1562
|
+
allow_empty_value=None,
|
|
1563
|
+
timeout_ms=timeout_ms,
|
|
1564
|
+
)
|
|
1565
|
+
|
|
1566
|
+
if retries == UNSET:
|
|
1567
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1568
|
+
retries = self.sdk_configuration.retry_config
|
|
1569
|
+
|
|
1570
|
+
retry_config = None
|
|
1571
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1572
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1573
|
+
|
|
1574
|
+
http_res = self.do_request(
|
|
1575
|
+
hook_ctx=HookContext(
|
|
1576
|
+
config=self.sdk_configuration,
|
|
1577
|
+
base_url=base_url or "",
|
|
1578
|
+
operation_id="agents_api_v1_agents_get_version",
|
|
1579
|
+
oauth2_scopes=None,
|
|
1580
|
+
security_source=get_security_from_env(
|
|
1581
|
+
self.sdk_configuration.security, models.Security
|
|
1582
|
+
),
|
|
1583
|
+
),
|
|
1584
|
+
request=req,
|
|
1585
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
1586
|
+
retry_config=retry_config,
|
|
1587
|
+
)
|
|
1588
|
+
|
|
1589
|
+
response_data: Any = None
|
|
1590
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1591
|
+
return unmarshal_json_response(models.Agent, http_res)
|
|
1592
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
1593
|
+
response_data = unmarshal_json_response(
|
|
1594
|
+
models.HTTPValidationErrorData, http_res
|
|
1595
|
+
)
|
|
1596
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
1597
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1598
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1599
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1600
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1601
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1602
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1603
|
+
|
|
1604
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
1605
|
+
|
|
1606
|
+
async def get_version_async(
|
|
1607
|
+
self,
|
|
1608
|
+
*,
|
|
1609
|
+
agent_id: str,
|
|
1610
|
+
version: int,
|
|
1611
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1612
|
+
server_url: Optional[str] = None,
|
|
1613
|
+
timeout_ms: Optional[int] = None,
|
|
1614
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1615
|
+
) -> models.Agent:
|
|
1616
|
+
r"""Retrieve a specific version of an agent.
|
|
1617
|
+
|
|
1618
|
+
Get a specific agent version by version number.
|
|
1619
|
+
|
|
1620
|
+
:param agent_id:
|
|
1621
|
+
:param version:
|
|
1622
|
+
:param retries: Override the default retry configuration for this method
|
|
1623
|
+
:param server_url: Override the default server URL for this method
|
|
1624
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1625
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1626
|
+
"""
|
|
1627
|
+
base_url = None
|
|
1628
|
+
url_variables = None
|
|
1629
|
+
if timeout_ms is None:
|
|
1630
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1631
|
+
|
|
1632
|
+
if server_url is not None:
|
|
1633
|
+
base_url = server_url
|
|
1634
|
+
else:
|
|
1635
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1636
|
+
|
|
1637
|
+
request = models.AgentsAPIV1AgentsGetVersionRequest(
|
|
1638
|
+
agent_id=agent_id,
|
|
1639
|
+
version=version,
|
|
1640
|
+
)
|
|
1641
|
+
|
|
1642
|
+
req = self._build_request_async(
|
|
1643
|
+
method="GET",
|
|
1644
|
+
path="/v1/agents/{agent_id}/version/{version}",
|
|
1645
|
+
base_url=base_url,
|
|
1646
|
+
url_variables=url_variables,
|
|
1647
|
+
request=request,
|
|
1648
|
+
request_body_required=False,
|
|
1649
|
+
request_has_path_params=True,
|
|
1650
|
+
request_has_query_params=True,
|
|
1651
|
+
user_agent_header="user-agent",
|
|
1652
|
+
accept_header_value="application/json",
|
|
1653
|
+
http_headers=http_headers,
|
|
1654
|
+
security=self.sdk_configuration.security,
|
|
1655
|
+
allow_empty_value=None,
|
|
1656
|
+
timeout_ms=timeout_ms,
|
|
1657
|
+
)
|
|
1658
|
+
|
|
1659
|
+
if retries == UNSET:
|
|
1660
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1661
|
+
retries = self.sdk_configuration.retry_config
|
|
1662
|
+
|
|
1663
|
+
retry_config = None
|
|
1664
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1665
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1666
|
+
|
|
1667
|
+
http_res = await self.do_request_async(
|
|
1668
|
+
hook_ctx=HookContext(
|
|
1669
|
+
config=self.sdk_configuration,
|
|
1670
|
+
base_url=base_url or "",
|
|
1671
|
+
operation_id="agents_api_v1_agents_get_version",
|
|
1672
|
+
oauth2_scopes=None,
|
|
1265
1673
|
security_source=get_security_from_env(
|
|
1266
1674
|
self.sdk_configuration.security, models.Security
|
|
1267
1675
|
),
|