agenta 0.13.0__py3-none-any.whl → 0.13.0a0__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.
Potentially problematic release.
This version of agenta might be problematic. Click here for more details.
- agenta/__init__.py +0 -1
- agenta/client/backend/client.py +50 -169
- agenta/client/backend/core/api_error.py +1 -3
- agenta/client/backend/core/datetime_utils.py +1 -3
- agenta/client/backend/core/jsonable_encoder.py +3 -9
- agenta/client/backend/resources/__init__.py +1 -12
- agenta/client/backend/resources/apps/__init__.py +1 -0
- agenta/client/backend/resources/apps/client.py +26 -88
- agenta/client/backend/resources/bases/__init__.py +1 -0
- agenta/client/backend/resources/bases/client.py +2 -8
- agenta/client/backend/resources/configs/__init__.py +1 -0
- agenta/client/backend/resources/configs/client.py +14 -58
- agenta/client/backend/resources/containers/client.py +14 -46
- agenta/client/backend/resources/environments/__init__.py +1 -0
- agenta/client/backend/resources/environments/client.py +6 -18
- agenta/client/backend/resources/evaluations/__init__.py +1 -0
- agenta/client/backend/resources/evaluations/client.py +26 -86
- agenta/client/backend/resources/evaluators/__init__.py +1 -0
- agenta/client/backend/resources/evaluators/client.py +17 -57
- agenta/client/backend/resources/observability/__init__.py +1 -0
- agenta/client/backend/resources/observability/client.py +30 -100
- agenta/client/backend/resources/testsets/__init__.py +1 -0
- agenta/client/backend/resources/testsets/client.py +16 -56
- agenta/client/backend/resources/variants/client.py +26 -92
- agenta/client/backend/resources/variants/types/__init__.py +1 -3
- agenta/client/backend/types/aggregated_result.py +2 -10
- agenta/client/backend/types/aggregated_result_evaluator_config.py +1 -3
- agenta/client/backend/types/app.py +2 -10
- agenta/client/backend/types/app_variant_response.py +2 -10
- agenta/client/backend/types/app_variant_revision.py +2 -10
- agenta/client/backend/types/base_output.py +2 -10
- agenta/client/backend/types/body_import_testset.py +2 -10
- agenta/client/backend/types/config_db.py +2 -10
- agenta/client/backend/types/create_app_output.py +2 -10
- agenta/client/backend/types/create_span.py +2 -11
- agenta/client/backend/types/create_trace_response.py +2 -10
- agenta/client/backend/types/docker_env_vars.py +2 -10
- agenta/client/backend/types/environment_output.py +2 -10
- agenta/client/backend/types/environment_output_extended.py +2 -10
- agenta/client/backend/types/environment_revision.py +2 -10
- agenta/client/backend/types/error.py +2 -10
- agenta/client/backend/types/evaluation.py +2 -10
- agenta/client/backend/types/evaluation_scenario.py +2 -10
- agenta/client/backend/types/evaluation_scenario_input.py +2 -10
- agenta/client/backend/types/evaluation_scenario_output.py +2 -10
- agenta/client/backend/types/evaluation_scenario_result.py +2 -10
- agenta/client/backend/types/evaluation_scenario_score_update.py +2 -10
- agenta/client/backend/types/evaluation_type.py +1 -3
- agenta/client/backend/types/evaluation_webhook.py +2 -10
- agenta/client/backend/types/evaluator.py +2 -10
- agenta/client/backend/types/evaluator_config.py +2 -10
- agenta/client/backend/types/feedback.py +2 -10
- agenta/client/backend/types/get_config_response.py +3 -10
- agenta/client/backend/types/http_validation_error.py +2 -10
- agenta/client/backend/types/human_evaluation.py +2 -10
- agenta/client/backend/types/human_evaluation_scenario.py +2 -10
- agenta/client/backend/types/human_evaluation_scenario_input.py +2 -10
- agenta/client/backend/types/human_evaluation_scenario_output.py +2 -10
- agenta/client/backend/types/human_evaluation_scenario_update.py +2 -10
- agenta/client/backend/types/human_evaluation_update.py +2 -10
- agenta/client/backend/types/image.py +2 -10
- agenta/client/backend/types/invite_request.py +2 -10
- agenta/client/backend/types/list_api_keys_response.py +2 -10
- agenta/client/backend/types/llm_run_rate_limit.py +2 -10
- agenta/client/backend/types/llm_tokens.py +2 -10
- agenta/client/backend/types/new_human_evaluation.py +2 -10
- agenta/client/backend/types/new_testset.py +2 -10
- agenta/client/backend/types/organization.py +2 -10
- agenta/client/backend/types/organization_output.py +2 -10
- agenta/client/backend/types/result.py +2 -10
- agenta/client/backend/types/simple_evaluation_output.py +2 -10
- agenta/client/backend/types/span.py +2 -10
- agenta/client/backend/types/span_detail.py +2 -10
- agenta/client/backend/types/span_variant.py +2 -10
- agenta/client/backend/types/template.py +2 -10
- agenta/client/backend/types/template_image_info.py +2 -10
- agenta/client/backend/types/test_set_output_response.py +2 -10
- agenta/client/backend/types/test_set_simple_response.py +2 -10
- agenta/client/backend/types/trace_detail.py +2 -10
- agenta/client/backend/types/uri.py +2 -10
- agenta/client/backend/types/validation_error.py +2 -10
- agenta/client/backend/types/variant_action.py +2 -10
- agenta/client/backend/types/variant_action_enum.py +1 -3
- agenta/client/backend/types/with_pagination.py +2 -10
- agenta/client/backend/types/workspace_member_response.py +2 -10
- agenta/client/backend/types/workspace_permission.py +2 -10
- agenta/client/backend/types/workspace_response.py +2 -10
- agenta/client/backend/types/workspace_role_response.py +2 -10
- agenta/sdk/__init__.py +0 -1
- agenta/sdk/agenta_decorator.py +3 -11
- agenta/sdk/agenta_init.py +1 -3
- agenta/sdk/tracing/llm_tracing.py +18 -35
- agenta/sdk/types.py +0 -38
- {agenta-0.13.0.dist-info → agenta-0.13.0a0.dist-info}/METADATA +96 -46
- agenta-0.13.0a0.dist-info/RECORD +161 -0
- agenta-0.13.0.dist-info/RECORD +0 -161
- {agenta-0.13.0.dist-info → agenta-0.13.0a0.dist-info}/WHEEL +0 -0
- {agenta-0.13.0.dist-info → agenta-0.13.0a0.dist-info}/entry_points.txt +0 -0
|
@@ -55,9 +55,7 @@ class AppsClient:
|
|
|
55
55
|
"""
|
|
56
56
|
_response = self._client_wrapper.httpx_client.request(
|
|
57
57
|
"GET",
|
|
58
|
-
urllib.parse.urljoin(
|
|
59
|
-
f"{self._client_wrapper.get_base_url()}/", f"apps/{app_id}/variants"
|
|
60
|
-
),
|
|
58
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"apps/{app_id}/variants"),
|
|
61
59
|
headers=self._client_wrapper.get_headers(),
|
|
62
60
|
timeout=60,
|
|
63
61
|
)
|
|
@@ -71,9 +69,7 @@ class AppsClient:
|
|
|
71
69
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
72
70
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
73
71
|
|
|
74
|
-
def get_variant_by_env(
|
|
75
|
-
self, *, app_id: str, environment: str
|
|
76
|
-
) -> AppVariantResponse:
|
|
72
|
+
def get_variant_by_env(self, *, app_id: str, environment: str) -> AppVariantResponse:
|
|
77
73
|
"""
|
|
78
74
|
Retrieve the app variant based on the provided app_id and environment.
|
|
79
75
|
|
|
@@ -106,12 +102,8 @@ class AppsClient:
|
|
|
106
102
|
"""
|
|
107
103
|
_response = self._client_wrapper.httpx_client.request(
|
|
108
104
|
"GET",
|
|
109
|
-
urllib.parse.urljoin(
|
|
110
|
-
|
|
111
|
-
),
|
|
112
|
-
params=remove_none_from_dict(
|
|
113
|
-
{"app_id": app_id, "environment": environment}
|
|
114
|
-
),
|
|
105
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "apps/get_variant_by_env"),
|
|
106
|
+
params=remove_none_from_dict({"app_id": app_id, "environment": environment}),
|
|
115
107
|
headers=self._client_wrapper.get_headers(),
|
|
116
108
|
timeout=60,
|
|
117
109
|
)
|
|
@@ -164,9 +156,7 @@ class AppsClient:
|
|
|
164
156
|
_response = self._client_wrapper.httpx_client.request(
|
|
165
157
|
"GET",
|
|
166
158
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "apps"),
|
|
167
|
-
params=remove_none_from_dict(
|
|
168
|
-
{"app_name": app_name, "org_id": org_id, "workspace_id": workspace_id}
|
|
169
|
-
),
|
|
159
|
+
params=remove_none_from_dict({"app_name": app_name, "org_id": org_id, "workspace_id": workspace_id}),
|
|
170
160
|
headers=self._client_wrapper.get_headers(),
|
|
171
161
|
timeout=60,
|
|
172
162
|
)
|
|
@@ -181,11 +171,7 @@ class AppsClient:
|
|
|
181
171
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
182
172
|
|
|
183
173
|
def create_app(
|
|
184
|
-
self,
|
|
185
|
-
*,
|
|
186
|
-
app_name: str,
|
|
187
|
-
organization_id: typing.Optional[str] = OMIT,
|
|
188
|
-
workspace_id: typing.Optional[str] = OMIT,
|
|
174
|
+
self, *, app_name: str, organization_id: typing.Optional[str] = OMIT, workspace_id: typing.Optional[str] = OMIT
|
|
189
175
|
) -> CreateAppOutput:
|
|
190
176
|
"""
|
|
191
177
|
Create a new app for a user or organization.
|
|
@@ -289,21 +275,14 @@ class AppsClient:
|
|
|
289
275
|
tags="tags",
|
|
290
276
|
)
|
|
291
277
|
"""
|
|
292
|
-
_request: typing.Dict[str, typing.Any] = {
|
|
293
|
-
"variant_name": variant_name,
|
|
294
|
-
"docker_id": docker_id,
|
|
295
|
-
"tags": tags,
|
|
296
|
-
}
|
|
278
|
+
_request: typing.Dict[str, typing.Any] = {"variant_name": variant_name, "docker_id": docker_id, "tags": tags}
|
|
297
279
|
if base_name is not OMIT:
|
|
298
280
|
_request["base_name"] = base_name
|
|
299
281
|
if config_name is not OMIT:
|
|
300
282
|
_request["config_name"] = config_name
|
|
301
283
|
_response = self._client_wrapper.httpx_client.request(
|
|
302
284
|
"POST",
|
|
303
|
-
urllib.parse.urljoin(
|
|
304
|
-
f"{self._client_wrapper.get_base_url()}/",
|
|
305
|
-
f"apps/{app_id}/variant/from-image",
|
|
306
|
-
),
|
|
285
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"apps/{app_id}/variant/from-image"),
|
|
307
286
|
json=jsonable_encoder(_request),
|
|
308
287
|
headers=self._client_wrapper.get_headers(),
|
|
309
288
|
timeout=60,
|
|
@@ -340,9 +319,7 @@ class AppsClient:
|
|
|
340
319
|
"""
|
|
341
320
|
_response = self._client_wrapper.httpx_client.request(
|
|
342
321
|
"DELETE",
|
|
343
|
-
urllib.parse.urljoin(
|
|
344
|
-
f"{self._client_wrapper.get_base_url()}/", f"apps/{app_id}"
|
|
345
|
-
),
|
|
322
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"apps/{app_id}"),
|
|
346
323
|
headers=self._client_wrapper.get_headers(),
|
|
347
324
|
timeout=60,
|
|
348
325
|
)
|
|
@@ -412,10 +389,7 @@ class AppsClient:
|
|
|
412
389
|
_request["workspace_id"] = workspace_id
|
|
413
390
|
_response = self._client_wrapper.httpx_client.request(
|
|
414
391
|
"POST",
|
|
415
|
-
urllib.parse.urljoin(
|
|
416
|
-
f"{self._client_wrapper.get_base_url()}/",
|
|
417
|
-
"apps/app_and_variant_from_template",
|
|
418
|
-
),
|
|
392
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "apps/app_and_variant_from_template"),
|
|
419
393
|
json=jsonable_encoder(_request),
|
|
420
394
|
headers=self._client_wrapper.get_headers(),
|
|
421
395
|
timeout=60,
|
|
@@ -456,9 +430,7 @@ class AppsClient:
|
|
|
456
430
|
"""
|
|
457
431
|
_response = self._client_wrapper.httpx_client.request(
|
|
458
432
|
"GET",
|
|
459
|
-
urllib.parse.urljoin(
|
|
460
|
-
f"{self._client_wrapper.get_base_url()}/", f"apps/{app_id}/environments"
|
|
461
|
-
),
|
|
433
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"apps/{app_id}/environments"),
|
|
462
434
|
headers=self._client_wrapper.get_headers(),
|
|
463
435
|
timeout=60,
|
|
464
436
|
)
|
|
@@ -472,9 +444,7 @@ class AppsClient:
|
|
|
472
444
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
473
445
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
474
446
|
|
|
475
|
-
def environment_revisions(
|
|
476
|
-
self, app_id: str, environment_name: typing.Any
|
|
477
|
-
) -> EnvironmentOutputExtended:
|
|
447
|
+
def environment_revisions(self, app_id: str, environment_name: typing.Any) -> EnvironmentOutputExtended:
|
|
478
448
|
"""
|
|
479
449
|
Parameters:
|
|
480
450
|
- app_id: str.
|
|
@@ -484,8 +454,7 @@ class AppsClient:
|
|
|
484
454
|
_response = self._client_wrapper.httpx_client.request(
|
|
485
455
|
"GET",
|
|
486
456
|
urllib.parse.urljoin(
|
|
487
|
-
f"{self._client_wrapper.get_base_url()}/",
|
|
488
|
-
f"apps/{app_id}/revisions/{environment_name}",
|
|
457
|
+
f"{self._client_wrapper.get_base_url()}/", f"apps/{app_id}/revisions/{environment_name}"
|
|
489
458
|
),
|
|
490
459
|
headers=self._client_wrapper.get_headers(),
|
|
491
460
|
timeout=60,
|
|
@@ -531,9 +500,7 @@ class AsyncAppsClient:
|
|
|
531
500
|
"""
|
|
532
501
|
_response = await self._client_wrapper.httpx_client.request(
|
|
533
502
|
"GET",
|
|
534
|
-
urllib.parse.urljoin(
|
|
535
|
-
f"{self._client_wrapper.get_base_url()}/", f"apps/{app_id}/variants"
|
|
536
|
-
),
|
|
503
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"apps/{app_id}/variants"),
|
|
537
504
|
headers=self._client_wrapper.get_headers(),
|
|
538
505
|
timeout=60,
|
|
539
506
|
)
|
|
@@ -547,9 +514,7 @@ class AsyncAppsClient:
|
|
|
547
514
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
548
515
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
549
516
|
|
|
550
|
-
async def get_variant_by_env(
|
|
551
|
-
self, *, app_id: str, environment: str
|
|
552
|
-
) -> AppVariantResponse:
|
|
517
|
+
async def get_variant_by_env(self, *, app_id: str, environment: str) -> AppVariantResponse:
|
|
553
518
|
"""
|
|
554
519
|
Retrieve the app variant based on the provided app_id and environment.
|
|
555
520
|
|
|
@@ -582,12 +547,8 @@ class AsyncAppsClient:
|
|
|
582
547
|
"""
|
|
583
548
|
_response = await self._client_wrapper.httpx_client.request(
|
|
584
549
|
"GET",
|
|
585
|
-
urllib.parse.urljoin(
|
|
586
|
-
|
|
587
|
-
),
|
|
588
|
-
params=remove_none_from_dict(
|
|
589
|
-
{"app_id": app_id, "environment": environment}
|
|
590
|
-
),
|
|
550
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "apps/get_variant_by_env"),
|
|
551
|
+
params=remove_none_from_dict({"app_id": app_id, "environment": environment}),
|
|
591
552
|
headers=self._client_wrapper.get_headers(),
|
|
592
553
|
timeout=60,
|
|
593
554
|
)
|
|
@@ -640,9 +601,7 @@ class AsyncAppsClient:
|
|
|
640
601
|
_response = await self._client_wrapper.httpx_client.request(
|
|
641
602
|
"GET",
|
|
642
603
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "apps"),
|
|
643
|
-
params=remove_none_from_dict(
|
|
644
|
-
{"app_name": app_name, "org_id": org_id, "workspace_id": workspace_id}
|
|
645
|
-
),
|
|
604
|
+
params=remove_none_from_dict({"app_name": app_name, "org_id": org_id, "workspace_id": workspace_id}),
|
|
646
605
|
headers=self._client_wrapper.get_headers(),
|
|
647
606
|
timeout=60,
|
|
648
607
|
)
|
|
@@ -657,11 +616,7 @@ class AsyncAppsClient:
|
|
|
657
616
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
658
617
|
|
|
659
618
|
async def create_app(
|
|
660
|
-
self,
|
|
661
|
-
*,
|
|
662
|
-
app_name: str,
|
|
663
|
-
organization_id: typing.Optional[str] = OMIT,
|
|
664
|
-
workspace_id: typing.Optional[str] = OMIT,
|
|
619
|
+
self, *, app_name: str, organization_id: typing.Optional[str] = OMIT, workspace_id: typing.Optional[str] = OMIT
|
|
665
620
|
) -> CreateAppOutput:
|
|
666
621
|
"""
|
|
667
622
|
Create a new app for a user or organization.
|
|
@@ -765,21 +720,14 @@ class AsyncAppsClient:
|
|
|
765
720
|
tags="tags",
|
|
766
721
|
)
|
|
767
722
|
"""
|
|
768
|
-
_request: typing.Dict[str, typing.Any] = {
|
|
769
|
-
"variant_name": variant_name,
|
|
770
|
-
"docker_id": docker_id,
|
|
771
|
-
"tags": tags,
|
|
772
|
-
}
|
|
723
|
+
_request: typing.Dict[str, typing.Any] = {"variant_name": variant_name, "docker_id": docker_id, "tags": tags}
|
|
773
724
|
if base_name is not OMIT:
|
|
774
725
|
_request["base_name"] = base_name
|
|
775
726
|
if config_name is not OMIT:
|
|
776
727
|
_request["config_name"] = config_name
|
|
777
728
|
_response = await self._client_wrapper.httpx_client.request(
|
|
778
729
|
"POST",
|
|
779
|
-
urllib.parse.urljoin(
|
|
780
|
-
f"{self._client_wrapper.get_base_url()}/",
|
|
781
|
-
f"apps/{app_id}/variant/from-image",
|
|
782
|
-
),
|
|
730
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"apps/{app_id}/variant/from-image"),
|
|
783
731
|
json=jsonable_encoder(_request),
|
|
784
732
|
headers=self._client_wrapper.get_headers(),
|
|
785
733
|
timeout=60,
|
|
@@ -816,9 +764,7 @@ class AsyncAppsClient:
|
|
|
816
764
|
"""
|
|
817
765
|
_response = await self._client_wrapper.httpx_client.request(
|
|
818
766
|
"DELETE",
|
|
819
|
-
urllib.parse.urljoin(
|
|
820
|
-
f"{self._client_wrapper.get_base_url()}/", f"apps/{app_id}"
|
|
821
|
-
),
|
|
767
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"apps/{app_id}"),
|
|
822
768
|
headers=self._client_wrapper.get_headers(),
|
|
823
769
|
timeout=60,
|
|
824
770
|
)
|
|
@@ -888,10 +834,7 @@ class AsyncAppsClient:
|
|
|
888
834
|
_request["workspace_id"] = workspace_id
|
|
889
835
|
_response = await self._client_wrapper.httpx_client.request(
|
|
890
836
|
"POST",
|
|
891
|
-
urllib.parse.urljoin(
|
|
892
|
-
f"{self._client_wrapper.get_base_url()}/",
|
|
893
|
-
"apps/app_and_variant_from_template",
|
|
894
|
-
),
|
|
837
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "apps/app_and_variant_from_template"),
|
|
895
838
|
json=jsonable_encoder(_request),
|
|
896
839
|
headers=self._client_wrapper.get_headers(),
|
|
897
840
|
timeout=60,
|
|
@@ -932,9 +875,7 @@ class AsyncAppsClient:
|
|
|
932
875
|
"""
|
|
933
876
|
_response = await self._client_wrapper.httpx_client.request(
|
|
934
877
|
"GET",
|
|
935
|
-
urllib.parse.urljoin(
|
|
936
|
-
f"{self._client_wrapper.get_base_url()}/", f"apps/{app_id}/environments"
|
|
937
|
-
),
|
|
878
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"apps/{app_id}/environments"),
|
|
938
879
|
headers=self._client_wrapper.get_headers(),
|
|
939
880
|
timeout=60,
|
|
940
881
|
)
|
|
@@ -948,9 +889,7 @@ class AsyncAppsClient:
|
|
|
948
889
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
949
890
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
950
891
|
|
|
951
|
-
async def environment_revisions(
|
|
952
|
-
self, app_id: str, environment_name: typing.Any
|
|
953
|
-
) -> EnvironmentOutputExtended:
|
|
892
|
+
async def environment_revisions(self, app_id: str, environment_name: typing.Any) -> EnvironmentOutputExtended:
|
|
954
893
|
"""
|
|
955
894
|
Parameters:
|
|
956
895
|
- app_id: str.
|
|
@@ -960,8 +899,7 @@ class AsyncAppsClient:
|
|
|
960
899
|
_response = await self._client_wrapper.httpx_client.request(
|
|
961
900
|
"GET",
|
|
962
901
|
urllib.parse.urljoin(
|
|
963
|
-
f"{self._client_wrapper.get_base_url()}/",
|
|
964
|
-
f"apps/{app_id}/revisions/{environment_name}",
|
|
902
|
+
f"{self._client_wrapper.get_base_url()}/", f"apps/{app_id}/revisions/{environment_name}"
|
|
965
903
|
),
|
|
966
904
|
headers=self._client_wrapper.get_headers(),
|
|
967
905
|
timeout=60,
|
|
@@ -22,10 +22,7 @@ class BasesClient:
|
|
|
22
22
|
self._client_wrapper = client_wrapper
|
|
23
23
|
|
|
24
24
|
def list_bases(
|
|
25
|
-
self,
|
|
26
|
-
*,
|
|
27
|
-
app_id: typing.Optional[str] = None,
|
|
28
|
-
base_name: typing.Optional[str] = None,
|
|
25
|
+
self, *, app_id: typing.Optional[str] = None, base_name: typing.Optional[str] = None
|
|
29
26
|
) -> typing.List[BaseOutput]:
|
|
30
27
|
"""
|
|
31
28
|
Retrieve a list of bases filtered by app_id and base_name.
|
|
@@ -77,10 +74,7 @@ class AsyncBasesClient:
|
|
|
77
74
|
self._client_wrapper = client_wrapper
|
|
78
75
|
|
|
79
76
|
async def list_bases(
|
|
80
|
-
self,
|
|
81
|
-
*,
|
|
82
|
-
app_id: typing.Optional[str] = None,
|
|
83
|
-
base_name: typing.Optional[str] = None,
|
|
77
|
+
self, *, app_id: typing.Optional[str] = None, base_name: typing.Optional[str] = None
|
|
84
78
|
) -> typing.List[BaseOutput]:
|
|
85
79
|
"""
|
|
86
80
|
Retrieve a list of bases filtered by app_id and base_name.
|
|
@@ -26,11 +26,7 @@ class ConfigsClient:
|
|
|
26
26
|
self._client_wrapper = client_wrapper
|
|
27
27
|
|
|
28
28
|
def get_config(
|
|
29
|
-
self,
|
|
30
|
-
*,
|
|
31
|
-
base_id: str,
|
|
32
|
-
config_name: typing.Optional[str] = None,
|
|
33
|
-
environment_name: typing.Optional[str] = None,
|
|
29
|
+
self, *, base_id: str, config_name: typing.Optional[str] = None, environment_name: typing.Optional[str] = None
|
|
34
30
|
) -> GetConfigResponse:
|
|
35
31
|
"""
|
|
36
32
|
Parameters:
|
|
@@ -54,11 +50,7 @@ class ConfigsClient:
|
|
|
54
50
|
"GET",
|
|
55
51
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "configs"),
|
|
56
52
|
params=remove_none_from_dict(
|
|
57
|
-
{
|
|
58
|
-
"base_id": base_id,
|
|
59
|
-
"config_name": config_name,
|
|
60
|
-
"environment_name": environment_name,
|
|
61
|
-
}
|
|
53
|
+
{"base_id": base_id, "config_name": config_name, "environment_name": environment_name}
|
|
62
54
|
),
|
|
63
55
|
headers=self._client_wrapper.get_headers(),
|
|
64
56
|
timeout=60,
|
|
@@ -74,12 +66,7 @@ class ConfigsClient:
|
|
|
74
66
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
75
67
|
|
|
76
68
|
def save_config(
|
|
77
|
-
self,
|
|
78
|
-
*,
|
|
79
|
-
base_id: str,
|
|
80
|
-
config_name: str,
|
|
81
|
-
parameters: typing.Dict[str, typing.Any],
|
|
82
|
-
overwrite: bool,
|
|
69
|
+
self, *, base_id: str, config_name: str, parameters: typing.Dict[str, typing.Any], overwrite: bool
|
|
83
70
|
) -> typing.Any:
|
|
84
71
|
"""
|
|
85
72
|
Parameters:
|
|
@@ -108,12 +95,7 @@ class ConfigsClient:
|
|
|
108
95
|
"POST",
|
|
109
96
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "configs"),
|
|
110
97
|
json=jsonable_encoder(
|
|
111
|
-
{
|
|
112
|
-
"base_id": base_id,
|
|
113
|
-
"config_name": config_name,
|
|
114
|
-
"parameters": parameters,
|
|
115
|
-
"overwrite": overwrite,
|
|
116
|
-
}
|
|
98
|
+
{"base_id": base_id, "config_name": config_name, "parameters": parameters, "overwrite": overwrite}
|
|
117
99
|
),
|
|
118
100
|
headers=self._client_wrapper.get_headers(),
|
|
119
101
|
timeout=60,
|
|
@@ -146,8 +128,7 @@ class ConfigsClient:
|
|
|
146
128
|
_response = self._client_wrapper.httpx_client.request(
|
|
147
129
|
"GET",
|
|
148
130
|
urllib.parse.urljoin(
|
|
149
|
-
f"{self._client_wrapper.get_base_url()}/",
|
|
150
|
-
f"configs/deployment/{deployment_revision_id}",
|
|
131
|
+
f"{self._client_wrapper.get_base_url()}/", f"configs/deployment/{deployment_revision_id}"
|
|
151
132
|
),
|
|
152
133
|
headers=self._client_wrapper.get_headers(),
|
|
153
134
|
timeout=60,
|
|
@@ -180,8 +161,7 @@ class ConfigsClient:
|
|
|
180
161
|
_response = self._client_wrapper.httpx_client.request(
|
|
181
162
|
"POST",
|
|
182
163
|
urllib.parse.urljoin(
|
|
183
|
-
f"{self._client_wrapper.get_base_url()}/",
|
|
184
|
-
f"configs/deployment/{deployment_revision_id}/revert",
|
|
164
|
+
f"{self._client_wrapper.get_base_url()}/", f"configs/deployment/{deployment_revision_id}/revert"
|
|
185
165
|
),
|
|
186
166
|
headers=self._client_wrapper.get_headers(),
|
|
187
167
|
timeout=60,
|
|
@@ -202,11 +182,7 @@ class AsyncConfigsClient:
|
|
|
202
182
|
self._client_wrapper = client_wrapper
|
|
203
183
|
|
|
204
184
|
async def get_config(
|
|
205
|
-
self,
|
|
206
|
-
*,
|
|
207
|
-
base_id: str,
|
|
208
|
-
config_name: typing.Optional[str] = None,
|
|
209
|
-
environment_name: typing.Optional[str] = None,
|
|
185
|
+
self, *, base_id: str, config_name: typing.Optional[str] = None, environment_name: typing.Optional[str] = None
|
|
210
186
|
) -> GetConfigResponse:
|
|
211
187
|
"""
|
|
212
188
|
Parameters:
|
|
@@ -230,11 +206,7 @@ class AsyncConfigsClient:
|
|
|
230
206
|
"GET",
|
|
231
207
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "configs"),
|
|
232
208
|
params=remove_none_from_dict(
|
|
233
|
-
{
|
|
234
|
-
"base_id": base_id,
|
|
235
|
-
"config_name": config_name,
|
|
236
|
-
"environment_name": environment_name,
|
|
237
|
-
}
|
|
209
|
+
{"base_id": base_id, "config_name": config_name, "environment_name": environment_name}
|
|
238
210
|
),
|
|
239
211
|
headers=self._client_wrapper.get_headers(),
|
|
240
212
|
timeout=60,
|
|
@@ -250,12 +222,7 @@ class AsyncConfigsClient:
|
|
|
250
222
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
251
223
|
|
|
252
224
|
async def save_config(
|
|
253
|
-
self,
|
|
254
|
-
*,
|
|
255
|
-
base_id: str,
|
|
256
|
-
config_name: str,
|
|
257
|
-
parameters: typing.Dict[str, typing.Any],
|
|
258
|
-
overwrite: bool,
|
|
225
|
+
self, *, base_id: str, config_name: str, parameters: typing.Dict[str, typing.Any], overwrite: bool
|
|
259
226
|
) -> typing.Any:
|
|
260
227
|
"""
|
|
261
228
|
Parameters:
|
|
@@ -284,12 +251,7 @@ class AsyncConfigsClient:
|
|
|
284
251
|
"POST",
|
|
285
252
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "configs"),
|
|
286
253
|
json=jsonable_encoder(
|
|
287
|
-
{
|
|
288
|
-
"base_id": base_id,
|
|
289
|
-
"config_name": config_name,
|
|
290
|
-
"parameters": parameters,
|
|
291
|
-
"overwrite": overwrite,
|
|
292
|
-
}
|
|
254
|
+
{"base_id": base_id, "config_name": config_name, "parameters": parameters, "overwrite": overwrite}
|
|
293
255
|
),
|
|
294
256
|
headers=self._client_wrapper.get_headers(),
|
|
295
257
|
timeout=60,
|
|
@@ -304,9 +266,7 @@ class AsyncConfigsClient:
|
|
|
304
266
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
305
267
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
306
268
|
|
|
307
|
-
async def get_config_deployment_revision(
|
|
308
|
-
self, deployment_revision_id: str
|
|
309
|
-
) -> typing.Any:
|
|
269
|
+
async def get_config_deployment_revision(self, deployment_revision_id: str) -> typing.Any:
|
|
310
270
|
"""
|
|
311
271
|
Parameters:
|
|
312
272
|
- deployment_revision_id: str.
|
|
@@ -324,8 +284,7 @@ class AsyncConfigsClient:
|
|
|
324
284
|
_response = await self._client_wrapper.httpx_client.request(
|
|
325
285
|
"GET",
|
|
326
286
|
urllib.parse.urljoin(
|
|
327
|
-
f"{self._client_wrapper.get_base_url()}/",
|
|
328
|
-
f"configs/deployment/{deployment_revision_id}",
|
|
287
|
+
f"{self._client_wrapper.get_base_url()}/", f"configs/deployment/{deployment_revision_id}"
|
|
329
288
|
),
|
|
330
289
|
headers=self._client_wrapper.get_headers(),
|
|
331
290
|
timeout=60,
|
|
@@ -340,9 +299,7 @@ class AsyncConfigsClient:
|
|
|
340
299
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
341
300
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
342
301
|
|
|
343
|
-
async def revert_deployment_revision(
|
|
344
|
-
self, deployment_revision_id: str
|
|
345
|
-
) -> typing.Any:
|
|
302
|
+
async def revert_deployment_revision(self, deployment_revision_id: str) -> typing.Any:
|
|
346
303
|
"""
|
|
347
304
|
Parameters:
|
|
348
305
|
- deployment_revision_id: str.
|
|
@@ -360,8 +317,7 @@ class AsyncConfigsClient:
|
|
|
360
317
|
_response = await self._client_wrapper.httpx_client.request(
|
|
361
318
|
"POST",
|
|
362
319
|
urllib.parse.urljoin(
|
|
363
|
-
f"{self._client_wrapper.get_base_url()}/",
|
|
364
|
-
f"configs/deployment/{deployment_revision_id}/revert",
|
|
320
|
+
f"{self._client_wrapper.get_base_url()}/", f"configs/deployment/{deployment_revision_id}/revert"
|
|
365
321
|
),
|
|
366
322
|
headers=self._client_wrapper.get_headers(),
|
|
367
323
|
timeout=60,
|
|
@@ -60,9 +60,7 @@ class ContainersClient:
|
|
|
60
60
|
"""
|
|
61
61
|
_response = self._client_wrapper.httpx_client.request(
|
|
62
62
|
"POST",
|
|
63
|
-
urllib.parse.urljoin(
|
|
64
|
-
f"{self._client_wrapper.get_base_url()}/", "containers/build_image"
|
|
65
|
-
),
|
|
63
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "containers/build_image"),
|
|
66
64
|
params=remove_none_from_dict({"app_id": app_id, "base_name": base_name}),
|
|
67
65
|
data=jsonable_encoder({}),
|
|
68
66
|
files={"tar_file": tar_file},
|
|
@@ -101,10 +99,7 @@ class ContainersClient:
|
|
|
101
99
|
"""
|
|
102
100
|
_response = self._client_wrapper.httpx_client.request(
|
|
103
101
|
"POST",
|
|
104
|
-
urllib.parse.urljoin(
|
|
105
|
-
f"{self._client_wrapper.get_base_url()}/",
|
|
106
|
-
"containers/restart_container",
|
|
107
|
-
),
|
|
102
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "containers/restart_container"),
|
|
108
103
|
json=jsonable_encoder({"variant_id": variant_id}),
|
|
109
104
|
headers=self._client_wrapper.get_headers(),
|
|
110
105
|
timeout=60,
|
|
@@ -132,9 +127,7 @@ class ContainersClient:
|
|
|
132
127
|
"""
|
|
133
128
|
_response = self._client_wrapper.httpx_client.request(
|
|
134
129
|
"GET",
|
|
135
|
-
urllib.parse.urljoin(
|
|
136
|
-
f"{self._client_wrapper.get_base_url()}/", "containers/templates"
|
|
137
|
-
),
|
|
130
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "containers/templates"),
|
|
138
131
|
headers=self._client_wrapper.get_headers(),
|
|
139
132
|
timeout=60,
|
|
140
133
|
)
|
|
@@ -147,10 +140,7 @@ class ContainersClient:
|
|
|
147
140
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
148
141
|
|
|
149
142
|
def construct_app_container_url(
|
|
150
|
-
self,
|
|
151
|
-
*,
|
|
152
|
-
base_id: typing.Optional[str] = None,
|
|
153
|
-
variant_id: typing.Optional[str] = None,
|
|
143
|
+
self, *, base_id: typing.Optional[str] = None, variant_id: typing.Optional[str] = None
|
|
154
144
|
) -> Uri:
|
|
155
145
|
"""
|
|
156
146
|
Constructs the URL for an app container based on the provided base_id or variant_id.
|
|
@@ -181,12 +171,8 @@ class ContainersClient:
|
|
|
181
171
|
"""
|
|
182
172
|
_response = self._client_wrapper.httpx_client.request(
|
|
183
173
|
"GET",
|
|
184
|
-
urllib.parse.urljoin(
|
|
185
|
-
|
|
186
|
-
),
|
|
187
|
-
params=remove_none_from_dict(
|
|
188
|
-
{"base_id": base_id, "variant_id": variant_id}
|
|
189
|
-
),
|
|
174
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "containers/container_url"),
|
|
175
|
+
params=remove_none_from_dict({"base_id": base_id, "variant_id": variant_id}),
|
|
190
176
|
headers=self._client_wrapper.get_headers(),
|
|
191
177
|
timeout=60,
|
|
192
178
|
)
|
|
@@ -205,9 +191,7 @@ class AsyncContainersClient:
|
|
|
205
191
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
206
192
|
self._client_wrapper = client_wrapper
|
|
207
193
|
|
|
208
|
-
async def build_image(
|
|
209
|
-
self, *, app_id: str, base_name: str, tar_file: typing.IO
|
|
210
|
-
) -> Image:
|
|
194
|
+
async def build_image(self, *, app_id: str, base_name: str, tar_file: typing.IO) -> Image:
|
|
211
195
|
"""
|
|
212
196
|
Builds a Docker image from a tar file containing the application code.
|
|
213
197
|
|
|
@@ -240,9 +224,7 @@ class AsyncContainersClient:
|
|
|
240
224
|
"""
|
|
241
225
|
_response = await self._client_wrapper.httpx_client.request(
|
|
242
226
|
"POST",
|
|
243
|
-
urllib.parse.urljoin(
|
|
244
|
-
f"{self._client_wrapper.get_base_url()}/", "containers/build_image"
|
|
245
|
-
),
|
|
227
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "containers/build_image"),
|
|
246
228
|
params=remove_none_from_dict({"app_id": app_id, "base_name": base_name}),
|
|
247
229
|
data=jsonable_encoder({}),
|
|
248
230
|
files={"tar_file": tar_file},
|
|
@@ -259,9 +241,7 @@ class AsyncContainersClient:
|
|
|
259
241
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
260
242
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
261
243
|
|
|
262
|
-
async def restart_container(
|
|
263
|
-
self, *, variant_id: str
|
|
264
|
-
) -> typing.Dict[str, typing.Any]:
|
|
244
|
+
async def restart_container(self, *, variant_id: str) -> typing.Dict[str, typing.Any]:
|
|
265
245
|
"""
|
|
266
246
|
Restart docker container.
|
|
267
247
|
|
|
@@ -283,10 +263,7 @@ class AsyncContainersClient:
|
|
|
283
263
|
"""
|
|
284
264
|
_response = await self._client_wrapper.httpx_client.request(
|
|
285
265
|
"POST",
|
|
286
|
-
urllib.parse.urljoin(
|
|
287
|
-
f"{self._client_wrapper.get_base_url()}/",
|
|
288
|
-
"containers/restart_container",
|
|
289
|
-
),
|
|
266
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "containers/restart_container"),
|
|
290
267
|
json=jsonable_encoder({"variant_id": variant_id}),
|
|
291
268
|
headers=self._client_wrapper.get_headers(),
|
|
292
269
|
timeout=60,
|
|
@@ -314,9 +291,7 @@ class AsyncContainersClient:
|
|
|
314
291
|
"""
|
|
315
292
|
_response = await self._client_wrapper.httpx_client.request(
|
|
316
293
|
"GET",
|
|
317
|
-
urllib.parse.urljoin(
|
|
318
|
-
f"{self._client_wrapper.get_base_url()}/", "containers/templates"
|
|
319
|
-
),
|
|
294
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "containers/templates"),
|
|
320
295
|
headers=self._client_wrapper.get_headers(),
|
|
321
296
|
timeout=60,
|
|
322
297
|
)
|
|
@@ -329,10 +304,7 @@ class AsyncContainersClient:
|
|
|
329
304
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
330
305
|
|
|
331
306
|
async def construct_app_container_url(
|
|
332
|
-
self,
|
|
333
|
-
*,
|
|
334
|
-
base_id: typing.Optional[str] = None,
|
|
335
|
-
variant_id: typing.Optional[str] = None,
|
|
307
|
+
self, *, base_id: typing.Optional[str] = None, variant_id: typing.Optional[str] = None
|
|
336
308
|
) -> Uri:
|
|
337
309
|
"""
|
|
338
310
|
Constructs the URL for an app container based on the provided base_id or variant_id.
|
|
@@ -363,12 +335,8 @@ class AsyncContainersClient:
|
|
|
363
335
|
"""
|
|
364
336
|
_response = await self._client_wrapper.httpx_client.request(
|
|
365
337
|
"GET",
|
|
366
|
-
urllib.parse.urljoin(
|
|
367
|
-
|
|
368
|
-
),
|
|
369
|
-
params=remove_none_from_dict(
|
|
370
|
-
{"base_id": base_id, "variant_id": variant_id}
|
|
371
|
-
),
|
|
338
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "containers/container_url"),
|
|
339
|
+
params=remove_none_from_dict({"base_id": base_id, "variant_id": variant_id}),
|
|
372
340
|
headers=self._client_wrapper.get_headers(),
|
|
373
341
|
timeout=60,
|
|
374
342
|
)
|
|
@@ -23,9 +23,7 @@ class EnvironmentsClient:
|
|
|
23
23
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
24
24
|
self._client_wrapper = client_wrapper
|
|
25
25
|
|
|
26
|
-
def deploy_to_environment(
|
|
27
|
-
self, *, environment_name: str, variant_id: str
|
|
28
|
-
) -> typing.Any:
|
|
26
|
+
def deploy_to_environment(self, *, environment_name: str, variant_id: str) -> typing.Any:
|
|
29
27
|
"""
|
|
30
28
|
Deploys a given variant to an environment
|
|
31
29
|
|
|
@@ -55,12 +53,8 @@ class EnvironmentsClient:
|
|
|
55
53
|
"""
|
|
56
54
|
_response = self._client_wrapper.httpx_client.request(
|
|
57
55
|
"POST",
|
|
58
|
-
urllib.parse.urljoin(
|
|
59
|
-
|
|
60
|
-
),
|
|
61
|
-
json=jsonable_encoder(
|
|
62
|
-
{"environment_name": environment_name, "variant_id": variant_id}
|
|
63
|
-
),
|
|
56
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "environments/deploy"),
|
|
57
|
+
json=jsonable_encoder({"environment_name": environment_name, "variant_id": variant_id}),
|
|
64
58
|
headers=self._client_wrapper.get_headers(),
|
|
65
59
|
timeout=60,
|
|
66
60
|
)
|
|
@@ -79,9 +73,7 @@ class AsyncEnvironmentsClient:
|
|
|
79
73
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
80
74
|
self._client_wrapper = client_wrapper
|
|
81
75
|
|
|
82
|
-
async def deploy_to_environment(
|
|
83
|
-
self, *, environment_name: str, variant_id: str
|
|
84
|
-
) -> typing.Any:
|
|
76
|
+
async def deploy_to_environment(self, *, environment_name: str, variant_id: str) -> typing.Any:
|
|
85
77
|
"""
|
|
86
78
|
Deploys a given variant to an environment
|
|
87
79
|
|
|
@@ -111,12 +103,8 @@ class AsyncEnvironmentsClient:
|
|
|
111
103
|
"""
|
|
112
104
|
_response = await self._client_wrapper.httpx_client.request(
|
|
113
105
|
"POST",
|
|
114
|
-
urllib.parse.urljoin(
|
|
115
|
-
|
|
116
|
-
),
|
|
117
|
-
json=jsonable_encoder(
|
|
118
|
-
{"environment_name": environment_name, "variant_id": variant_id}
|
|
119
|
-
),
|
|
106
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "environments/deploy"),
|
|
107
|
+
json=jsonable_encoder({"environment_name": environment_name, "variant_id": variant_id}),
|
|
120
108
|
headers=self._client_wrapper.get_headers(),
|
|
121
109
|
timeout=60,
|
|
122
110
|
)
|