agenta 0.13.0a0__py3-none-any.whl → 0.13.0a2__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 +1 -0
- agenta/client/backend/client.py +169 -50
- agenta/client/backend/core/api_error.py +3 -1
- agenta/client/backend/core/datetime_utils.py +3 -1
- agenta/client/backend/core/jsonable_encoder.py +9 -3
- agenta/client/backend/resources/__init__.py +12 -1
- agenta/client/backend/resources/apps/__init__.py +0 -1
- agenta/client/backend/resources/apps/client.py +88 -26
- agenta/client/backend/resources/bases/__init__.py +0 -1
- agenta/client/backend/resources/bases/client.py +8 -2
- agenta/client/backend/resources/configs/__init__.py +0 -1
- agenta/client/backend/resources/configs/client.py +58 -14
- agenta/client/backend/resources/containers/client.py +46 -14
- agenta/client/backend/resources/environments/__init__.py +0 -1
- agenta/client/backend/resources/environments/client.py +18 -6
- agenta/client/backend/resources/evaluations/__init__.py +0 -1
- agenta/client/backend/resources/evaluations/client.py +86 -26
- agenta/client/backend/resources/evaluators/__init__.py +0 -1
- agenta/client/backend/resources/evaluators/client.py +57 -17
- agenta/client/backend/resources/observability/__init__.py +0 -1
- agenta/client/backend/resources/observability/client.py +100 -30
- agenta/client/backend/resources/testsets/__init__.py +0 -1
- agenta/client/backend/resources/testsets/client.py +56 -16
- agenta/client/backend/resources/variants/client.py +92 -26
- agenta/client/backend/resources/variants/types/__init__.py +3 -1
- agenta/client/backend/types/aggregated_result.py +10 -2
- agenta/client/backend/types/aggregated_result_evaluator_config.py +3 -1
- agenta/client/backend/types/app.py +10 -2
- agenta/client/backend/types/app_variant_response.py +10 -2
- agenta/client/backend/types/app_variant_revision.py +10 -2
- agenta/client/backend/types/base_output.py +10 -2
- agenta/client/backend/types/body_import_testset.py +10 -2
- agenta/client/backend/types/config_db.py +10 -2
- agenta/client/backend/types/create_app_output.py +10 -2
- agenta/client/backend/types/create_span.py +11 -2
- agenta/client/backend/types/create_trace_response.py +10 -2
- agenta/client/backend/types/docker_env_vars.py +10 -2
- agenta/client/backend/types/environment_output.py +10 -2
- agenta/client/backend/types/environment_output_extended.py +10 -2
- agenta/client/backend/types/environment_revision.py +10 -2
- agenta/client/backend/types/error.py +10 -2
- agenta/client/backend/types/evaluation.py +10 -2
- agenta/client/backend/types/evaluation_scenario.py +10 -2
- agenta/client/backend/types/evaluation_scenario_input.py +10 -2
- agenta/client/backend/types/evaluation_scenario_output.py +10 -2
- agenta/client/backend/types/evaluation_scenario_result.py +10 -2
- agenta/client/backend/types/evaluation_scenario_score_update.py +10 -2
- agenta/client/backend/types/evaluation_type.py +3 -1
- agenta/client/backend/types/evaluation_webhook.py +10 -2
- agenta/client/backend/types/evaluator.py +10 -2
- agenta/client/backend/types/evaluator_config.py +10 -2
- agenta/client/backend/types/feedback.py +10 -2
- agenta/client/backend/types/get_config_response.py +10 -3
- agenta/client/backend/types/http_validation_error.py +10 -2
- agenta/client/backend/types/human_evaluation.py +10 -2
- agenta/client/backend/types/human_evaluation_scenario.py +10 -2
- agenta/client/backend/types/human_evaluation_scenario_input.py +10 -2
- agenta/client/backend/types/human_evaluation_scenario_output.py +10 -2
- agenta/client/backend/types/human_evaluation_scenario_update.py +10 -2
- agenta/client/backend/types/human_evaluation_update.py +10 -2
- agenta/client/backend/types/image.py +10 -2
- agenta/client/backend/types/invite_request.py +10 -2
- agenta/client/backend/types/list_api_keys_response.py +10 -2
- agenta/client/backend/types/llm_run_rate_limit.py +10 -2
- agenta/client/backend/types/llm_tokens.py +10 -2
- agenta/client/backend/types/new_human_evaluation.py +10 -2
- agenta/client/backend/types/new_testset.py +10 -2
- agenta/client/backend/types/organization.py +10 -2
- agenta/client/backend/types/organization_output.py +10 -2
- agenta/client/backend/types/result.py +10 -2
- agenta/client/backend/types/simple_evaluation_output.py +10 -2
- agenta/client/backend/types/span.py +10 -2
- agenta/client/backend/types/span_detail.py +10 -2
- agenta/client/backend/types/span_variant.py +10 -2
- agenta/client/backend/types/template.py +10 -2
- agenta/client/backend/types/template_image_info.py +10 -2
- agenta/client/backend/types/test_set_output_response.py +10 -2
- agenta/client/backend/types/test_set_simple_response.py +10 -2
- agenta/client/backend/types/trace_detail.py +10 -2
- agenta/client/backend/types/uri.py +10 -2
- agenta/client/backend/types/validation_error.py +10 -2
- agenta/client/backend/types/variant_action.py +10 -2
- agenta/client/backend/types/variant_action_enum.py +3 -1
- agenta/client/backend/types/with_pagination.py +10 -2
- agenta/client/backend/types/workspace_member_response.py +10 -2
- agenta/client/backend/types/workspace_permission.py +10 -2
- agenta/client/backend/types/workspace_response.py +10 -2
- agenta/client/backend/types/workspace_role_response.py +10 -2
- agenta/sdk/__init__.py +1 -0
- agenta/sdk/agenta_decorator.py +11 -3
- agenta/sdk/agenta_init.py +3 -1
- agenta/sdk/tracing/llm_tracing.py +35 -18
- agenta/sdk/types.py +38 -0
- {agenta-0.13.0a0.dist-info → agenta-0.13.0a2.dist-info}/METADATA +46 -96
- agenta-0.13.0a2.dist-info/RECORD +161 -0
- agenta-0.13.0a0.dist-info/RECORD +0 -161
- {agenta-0.13.0a0.dist-info → agenta-0.13.0a2.dist-info}/WHEEL +0 -0
- {agenta-0.13.0a0.dist-info → agenta-0.13.0a2.dist-info}/entry_points.txt +0 -0
agenta/__init__.py
CHANGED
agenta/client/backend/client.py
CHANGED
|
@@ -19,7 +19,10 @@ from .resources.containers.client import AsyncContainersClient, ContainersClient
|
|
|
19
19
|
from .resources.environments.client import AsyncEnvironmentsClient, EnvironmentsClient
|
|
20
20
|
from .resources.evaluations.client import AsyncEvaluationsClient, EvaluationsClient
|
|
21
21
|
from .resources.evaluators.client import AsyncEvaluatorsClient, EvaluatorsClient
|
|
22
|
-
from .resources.observability.client import
|
|
22
|
+
from .resources.observability.client import (
|
|
23
|
+
AsyncObservabilityClient,
|
|
24
|
+
ObservabilityClient,
|
|
25
|
+
)
|
|
23
26
|
from .resources.testsets.client import AsyncTestsetsClient, TestsetsClient
|
|
24
27
|
from .resources.variants.client import AsyncVariantsClient, VariantsClient
|
|
25
28
|
from .types.http_validation_error import HttpValidationError
|
|
@@ -53,7 +56,9 @@ class AgentaApi:
|
|
|
53
56
|
self._client_wrapper = SyncClientWrapper(
|
|
54
57
|
base_url=base_url,
|
|
55
58
|
api_key=api_key,
|
|
56
|
-
httpx_client=httpx.Client(timeout=timeout)
|
|
59
|
+
httpx_client=httpx.Client(timeout=timeout)
|
|
60
|
+
if httpx_client is None
|
|
61
|
+
else httpx_client,
|
|
57
62
|
)
|
|
58
63
|
self.observability = ObservabilityClient(client_wrapper=self._client_wrapper)
|
|
59
64
|
self.apps = AppsClient(client_wrapper=self._client_wrapper)
|
|
@@ -168,7 +173,9 @@ class AgentaApi:
|
|
|
168
173
|
"""
|
|
169
174
|
_response = self._client_wrapper.httpx_client.request(
|
|
170
175
|
"DELETE",
|
|
171
|
-
urllib.parse.urljoin(
|
|
176
|
+
urllib.parse.urljoin(
|
|
177
|
+
f"{self._client_wrapper.get_base_url()}/", f"keys/{key_prefix}"
|
|
178
|
+
),
|
|
172
179
|
headers=self._client_wrapper.get_headers(),
|
|
173
180
|
timeout=60,
|
|
174
181
|
)
|
|
@@ -203,7 +210,9 @@ class AgentaApi:
|
|
|
203
210
|
"""
|
|
204
211
|
_response = self._client_wrapper.httpx_client.request(
|
|
205
212
|
"GET",
|
|
206
|
-
urllib.parse.urljoin(
|
|
213
|
+
urllib.parse.urljoin(
|
|
214
|
+
f"{self._client_wrapper.get_base_url()}/", f"keys/{key_prefix}/validate"
|
|
215
|
+
),
|
|
207
216
|
headers=self._client_wrapper.get_headers(),
|
|
208
217
|
timeout=60,
|
|
209
218
|
)
|
|
@@ -241,7 +250,9 @@ class AgentaApi:
|
|
|
241
250
|
"""
|
|
242
251
|
_response = self._client_wrapper.httpx_client.request(
|
|
243
252
|
"GET",
|
|
244
|
-
urllib.parse.urljoin(
|
|
253
|
+
urllib.parse.urljoin(
|
|
254
|
+
f"{self._client_wrapper.get_base_url()}/", "organizations"
|
|
255
|
+
),
|
|
245
256
|
headers=self._client_wrapper.get_headers(),
|
|
246
257
|
timeout=60,
|
|
247
258
|
)
|
|
@@ -290,7 +301,9 @@ class AgentaApi:
|
|
|
290
301
|
_request["owner"] = owner
|
|
291
302
|
_response = self._client_wrapper.httpx_client.request(
|
|
292
303
|
"POST",
|
|
293
|
-
urllib.parse.urljoin(
|
|
304
|
+
urllib.parse.urljoin(
|
|
305
|
+
f"{self._client_wrapper.get_base_url()}/", "organizations"
|
|
306
|
+
),
|
|
294
307
|
json=jsonable_encoder(_request),
|
|
295
308
|
headers=self._client_wrapper.get_headers(),
|
|
296
309
|
timeout=60,
|
|
@@ -317,7 +330,9 @@ class AgentaApi:
|
|
|
317
330
|
"""
|
|
318
331
|
_response = self._client_wrapper.httpx_client.request(
|
|
319
332
|
"GET",
|
|
320
|
-
urllib.parse.urljoin(
|
|
333
|
+
urllib.parse.urljoin(
|
|
334
|
+
f"{self._client_wrapper.get_base_url()}/", "organizations/own"
|
|
335
|
+
),
|
|
321
336
|
headers=self._client_wrapper.get_headers(),
|
|
322
337
|
timeout=60,
|
|
323
338
|
)
|
|
@@ -355,7 +370,9 @@ class AgentaApi:
|
|
|
355
370
|
"""
|
|
356
371
|
_response = self._client_wrapper.httpx_client.request(
|
|
357
372
|
"GET",
|
|
358
|
-
urllib.parse.urljoin(
|
|
373
|
+
urllib.parse.urljoin(
|
|
374
|
+
f"{self._client_wrapper.get_base_url()}/", f"organizations/{org_id}"
|
|
375
|
+
),
|
|
359
376
|
headers=self._client_wrapper.get_headers(),
|
|
360
377
|
timeout=60,
|
|
361
378
|
)
|
|
@@ -406,7 +423,9 @@ class AgentaApi:
|
|
|
406
423
|
_request["updated_at"] = updated_at
|
|
407
424
|
_response = self._client_wrapper.httpx_client.request(
|
|
408
425
|
"PUT",
|
|
409
|
-
urllib.parse.urljoin(
|
|
426
|
+
urllib.parse.urljoin(
|
|
427
|
+
f"{self._client_wrapper.get_base_url()}/", f"organizations/{org_id}"
|
|
428
|
+
),
|
|
410
429
|
json=jsonable_encoder(_request),
|
|
411
430
|
headers=self._client_wrapper.get_headers(),
|
|
412
431
|
timeout=60,
|
|
@@ -453,7 +472,8 @@ class AgentaApi:
|
|
|
453
472
|
_response = self._client_wrapper.httpx_client.request(
|
|
454
473
|
"POST",
|
|
455
474
|
urllib.parse.urljoin(
|
|
456
|
-
f"{self._client_wrapper.get_base_url()}/",
|
|
475
|
+
f"{self._client_wrapper.get_base_url()}/",
|
|
476
|
+
f"organizations/{org_id}/workspaces/{workspace_id}/invite",
|
|
457
477
|
),
|
|
458
478
|
json=jsonable_encoder(request),
|
|
459
479
|
headers=self._client_wrapper.get_headers(),
|
|
@@ -469,7 +489,9 @@ class AgentaApi:
|
|
|
469
489
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
470
490
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
471
491
|
|
|
472
|
-
def resend_invitation(
|
|
492
|
+
def resend_invitation(
|
|
493
|
+
self, org_id: str, workspace_id: str, *, email: str
|
|
494
|
+
) -> typing.Any:
|
|
473
495
|
"""
|
|
474
496
|
Resend an invitation to a user to an Organization.
|
|
475
497
|
|
|
@@ -520,7 +542,9 @@ class AgentaApi:
|
|
|
520
542
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
521
543
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
522
544
|
|
|
523
|
-
def accept_invitation(
|
|
545
|
+
def accept_invitation(
|
|
546
|
+
self, org_id: str, workspace_id: str, *, token: str
|
|
547
|
+
) -> typing.Any:
|
|
524
548
|
"""
|
|
525
549
|
Accept an invitation to a workspace.
|
|
526
550
|
|
|
@@ -572,7 +596,12 @@ class AgentaApi:
|
|
|
572
596
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
573
597
|
|
|
574
598
|
def create_workspace(
|
|
575
|
-
self,
|
|
599
|
+
self,
|
|
600
|
+
org_id: str,
|
|
601
|
+
*,
|
|
602
|
+
name: str,
|
|
603
|
+
description: typing.Optional[str] = OMIT,
|
|
604
|
+
type: typing.Optional[str] = OMIT,
|
|
576
605
|
) -> WorkspaceResponse:
|
|
577
606
|
"""
|
|
578
607
|
Parameters:
|
|
@@ -602,7 +631,10 @@ class AgentaApi:
|
|
|
602
631
|
_request["type"] = type
|
|
603
632
|
_response = self._client_wrapper.httpx_client.request(
|
|
604
633
|
"POST",
|
|
605
|
-
urllib.parse.urljoin(
|
|
634
|
+
urllib.parse.urljoin(
|
|
635
|
+
f"{self._client_wrapper.get_base_url()}/",
|
|
636
|
+
f"organizations/{org_id}/workspaces",
|
|
637
|
+
),
|
|
606
638
|
json=jsonable_encoder(_request),
|
|
607
639
|
headers=self._client_wrapper.get_headers(),
|
|
608
640
|
timeout=60,
|
|
@@ -659,7 +691,8 @@ class AgentaApi:
|
|
|
659
691
|
_response = self._client_wrapper.httpx_client.request(
|
|
660
692
|
"PUT",
|
|
661
693
|
urllib.parse.urljoin(
|
|
662
|
-
f"{self._client_wrapper.get_base_url()}/",
|
|
694
|
+
f"{self._client_wrapper.get_base_url()}/",
|
|
695
|
+
f"organizations/{org_id}/workspaces/{workspace_id}",
|
|
663
696
|
),
|
|
664
697
|
json=jsonable_encoder(_request),
|
|
665
698
|
headers=self._client_wrapper.get_headers(),
|
|
@@ -698,7 +731,9 @@ class AgentaApi:
|
|
|
698
731
|
"""
|
|
699
732
|
_response = self._client_wrapper.httpx_client.request(
|
|
700
733
|
"GET",
|
|
701
|
-
urllib.parse.urljoin(
|
|
734
|
+
urllib.parse.urljoin(
|
|
735
|
+
f"{self._client_wrapper.get_base_url()}/", "workspaces/roles"
|
|
736
|
+
),
|
|
702
737
|
headers=self._client_wrapper.get_headers(),
|
|
703
738
|
timeout=60,
|
|
704
739
|
)
|
|
@@ -733,7 +768,9 @@ class AgentaApi:
|
|
|
733
768
|
"""
|
|
734
769
|
_response = self._client_wrapper.httpx_client.request(
|
|
735
770
|
"GET",
|
|
736
|
-
urllib.parse.urljoin(
|
|
771
|
+
urllib.parse.urljoin(
|
|
772
|
+
f"{self._client_wrapper.get_base_url()}/", "workspaces/permissions"
|
|
773
|
+
),
|
|
737
774
|
headers=self._client_wrapper.get_headers(),
|
|
738
775
|
timeout=60,
|
|
739
776
|
)
|
|
@@ -746,7 +783,12 @@ class AgentaApi:
|
|
|
746
783
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
747
784
|
|
|
748
785
|
def assign_role_to_user(
|
|
749
|
-
self,
|
|
786
|
+
self,
|
|
787
|
+
workspace_id: str,
|
|
788
|
+
*,
|
|
789
|
+
email: str,
|
|
790
|
+
organization_id: str,
|
|
791
|
+
role: typing.Optional[WorkspaceRole] = OMIT,
|
|
750
792
|
) -> bool:
|
|
751
793
|
"""
|
|
752
794
|
Assigns a role to a user in a workspace.
|
|
@@ -784,12 +826,18 @@ class AgentaApi:
|
|
|
784
826
|
organization_id="organization_id",
|
|
785
827
|
)
|
|
786
828
|
"""
|
|
787
|
-
_request: typing.Dict[str, typing.Any] = {
|
|
829
|
+
_request: typing.Dict[str, typing.Any] = {
|
|
830
|
+
"email": email,
|
|
831
|
+
"organization_id": organization_id,
|
|
832
|
+
}
|
|
788
833
|
if role is not OMIT:
|
|
789
834
|
_request["role"] = role.value
|
|
790
835
|
_response = self._client_wrapper.httpx_client.request(
|
|
791
836
|
"POST",
|
|
792
|
-
urllib.parse.urljoin(
|
|
837
|
+
urllib.parse.urljoin(
|
|
838
|
+
f"{self._client_wrapper.get_base_url()}/",
|
|
839
|
+
f"workspaces/{workspace_id}/roles",
|
|
840
|
+
),
|
|
793
841
|
json=jsonable_encoder(_request),
|
|
794
842
|
headers=self._client_wrapper.get_headers(),
|
|
795
843
|
timeout=60,
|
|
@@ -804,7 +852,9 @@ class AgentaApi:
|
|
|
804
852
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
805
853
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
806
854
|
|
|
807
|
-
def unassign_role_from_user(
|
|
855
|
+
def unassign_role_from_user(
|
|
856
|
+
self, workspace_id: str, *, email: str, org_id: str, role: str
|
|
857
|
+
) -> typing.Any:
|
|
808
858
|
"""
|
|
809
859
|
Delete a role assignment from a user in a workspace.
|
|
810
860
|
|
|
@@ -846,8 +896,13 @@ class AgentaApi:
|
|
|
846
896
|
"""
|
|
847
897
|
_response = self._client_wrapper.httpx_client.request(
|
|
848
898
|
"DELETE",
|
|
849
|
-
urllib.parse.urljoin(
|
|
850
|
-
|
|
899
|
+
urllib.parse.urljoin(
|
|
900
|
+
f"{self._client_wrapper.get_base_url()}/",
|
|
901
|
+
f"workspaces/{workspace_id}/roles",
|
|
902
|
+
),
|
|
903
|
+
params=remove_none_from_dict(
|
|
904
|
+
{"email": email, "org_id": org_id, "role": role}
|
|
905
|
+
),
|
|
851
906
|
headers=self._client_wrapper.get_headers(),
|
|
852
907
|
timeout=60,
|
|
853
908
|
)
|
|
@@ -861,7 +916,9 @@ class AgentaApi:
|
|
|
861
916
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
862
917
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
863
918
|
|
|
864
|
-
def remove_user_from_workspace(
|
|
919
|
+
def remove_user_from_workspace(
|
|
920
|
+
self, workspace_id: str, *, org_id: str, email: str
|
|
921
|
+
) -> WorkspaceResponse:
|
|
865
922
|
"""
|
|
866
923
|
Remove a user from a workspace.
|
|
867
924
|
|
|
@@ -901,7 +958,10 @@ class AgentaApi:
|
|
|
901
958
|
"""
|
|
902
959
|
_response = self._client_wrapper.httpx_client.request(
|
|
903
960
|
"DELETE",
|
|
904
|
-
urllib.parse.urljoin(
|
|
961
|
+
urllib.parse.urljoin(
|
|
962
|
+
f"{self._client_wrapper.get_base_url()}/",
|
|
963
|
+
f"workspaces/{workspace_id}/users",
|
|
964
|
+
),
|
|
905
965
|
params=remove_none_from_dict({"org_id": org_id, "email": email}),
|
|
906
966
|
headers=self._client_wrapper.get_headers(),
|
|
907
967
|
timeout=60,
|
|
@@ -977,9 +1037,13 @@ class AsyncAgentaApi:
|
|
|
977
1037
|
self._client_wrapper = AsyncClientWrapper(
|
|
978
1038
|
base_url=base_url,
|
|
979
1039
|
api_key=api_key,
|
|
980
|
-
httpx_client=httpx.AsyncClient(timeout=timeout)
|
|
1040
|
+
httpx_client=httpx.AsyncClient(timeout=timeout)
|
|
1041
|
+
if httpx_client is None
|
|
1042
|
+
else httpx_client,
|
|
1043
|
+
)
|
|
1044
|
+
self.observability = AsyncObservabilityClient(
|
|
1045
|
+
client_wrapper=self._client_wrapper
|
|
981
1046
|
)
|
|
982
|
-
self.observability = AsyncObservabilityClient(client_wrapper=self._client_wrapper)
|
|
983
1047
|
self.apps = AsyncAppsClient(client_wrapper=self._client_wrapper)
|
|
984
1048
|
self.variants = AsyncVariantsClient(client_wrapper=self._client_wrapper)
|
|
985
1049
|
self.evaluations = AsyncEvaluationsClient(client_wrapper=self._client_wrapper)
|
|
@@ -1092,7 +1156,9 @@ class AsyncAgentaApi:
|
|
|
1092
1156
|
"""
|
|
1093
1157
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1094
1158
|
"DELETE",
|
|
1095
|
-
urllib.parse.urljoin(
|
|
1159
|
+
urllib.parse.urljoin(
|
|
1160
|
+
f"{self._client_wrapper.get_base_url()}/", f"keys/{key_prefix}"
|
|
1161
|
+
),
|
|
1096
1162
|
headers=self._client_wrapper.get_headers(),
|
|
1097
1163
|
timeout=60,
|
|
1098
1164
|
)
|
|
@@ -1127,7 +1193,9 @@ class AsyncAgentaApi:
|
|
|
1127
1193
|
"""
|
|
1128
1194
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1129
1195
|
"GET",
|
|
1130
|
-
urllib.parse.urljoin(
|
|
1196
|
+
urllib.parse.urljoin(
|
|
1197
|
+
f"{self._client_wrapper.get_base_url()}/", f"keys/{key_prefix}/validate"
|
|
1198
|
+
),
|
|
1131
1199
|
headers=self._client_wrapper.get_headers(),
|
|
1132
1200
|
timeout=60,
|
|
1133
1201
|
)
|
|
@@ -1165,7 +1233,9 @@ class AsyncAgentaApi:
|
|
|
1165
1233
|
"""
|
|
1166
1234
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1167
1235
|
"GET",
|
|
1168
|
-
urllib.parse.urljoin(
|
|
1236
|
+
urllib.parse.urljoin(
|
|
1237
|
+
f"{self._client_wrapper.get_base_url()}/", "organizations"
|
|
1238
|
+
),
|
|
1169
1239
|
headers=self._client_wrapper.get_headers(),
|
|
1170
1240
|
timeout=60,
|
|
1171
1241
|
)
|
|
@@ -1214,7 +1284,9 @@ class AsyncAgentaApi:
|
|
|
1214
1284
|
_request["owner"] = owner
|
|
1215
1285
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1216
1286
|
"POST",
|
|
1217
|
-
urllib.parse.urljoin(
|
|
1287
|
+
urllib.parse.urljoin(
|
|
1288
|
+
f"{self._client_wrapper.get_base_url()}/", "organizations"
|
|
1289
|
+
),
|
|
1218
1290
|
json=jsonable_encoder(_request),
|
|
1219
1291
|
headers=self._client_wrapper.get_headers(),
|
|
1220
1292
|
timeout=60,
|
|
@@ -1241,7 +1313,9 @@ class AsyncAgentaApi:
|
|
|
1241
1313
|
"""
|
|
1242
1314
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1243
1315
|
"GET",
|
|
1244
|
-
urllib.parse.urljoin(
|
|
1316
|
+
urllib.parse.urljoin(
|
|
1317
|
+
f"{self._client_wrapper.get_base_url()}/", "organizations/own"
|
|
1318
|
+
),
|
|
1245
1319
|
headers=self._client_wrapper.get_headers(),
|
|
1246
1320
|
timeout=60,
|
|
1247
1321
|
)
|
|
@@ -1279,7 +1353,9 @@ class AsyncAgentaApi:
|
|
|
1279
1353
|
"""
|
|
1280
1354
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1281
1355
|
"GET",
|
|
1282
|
-
urllib.parse.urljoin(
|
|
1356
|
+
urllib.parse.urljoin(
|
|
1357
|
+
f"{self._client_wrapper.get_base_url()}/", f"organizations/{org_id}"
|
|
1358
|
+
),
|
|
1283
1359
|
headers=self._client_wrapper.get_headers(),
|
|
1284
1360
|
timeout=60,
|
|
1285
1361
|
)
|
|
@@ -1330,7 +1406,9 @@ class AsyncAgentaApi:
|
|
|
1330
1406
|
_request["updated_at"] = updated_at
|
|
1331
1407
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1332
1408
|
"PUT",
|
|
1333
|
-
urllib.parse.urljoin(
|
|
1409
|
+
urllib.parse.urljoin(
|
|
1410
|
+
f"{self._client_wrapper.get_base_url()}/", f"organizations/{org_id}"
|
|
1411
|
+
),
|
|
1334
1412
|
json=jsonable_encoder(_request),
|
|
1335
1413
|
headers=self._client_wrapper.get_headers(),
|
|
1336
1414
|
timeout=60,
|
|
@@ -1377,7 +1455,8 @@ class AsyncAgentaApi:
|
|
|
1377
1455
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1378
1456
|
"POST",
|
|
1379
1457
|
urllib.parse.urljoin(
|
|
1380
|
-
f"{self._client_wrapper.get_base_url()}/",
|
|
1458
|
+
f"{self._client_wrapper.get_base_url()}/",
|
|
1459
|
+
f"organizations/{org_id}/workspaces/{workspace_id}/invite",
|
|
1381
1460
|
),
|
|
1382
1461
|
json=jsonable_encoder(request),
|
|
1383
1462
|
headers=self._client_wrapper.get_headers(),
|
|
@@ -1393,7 +1472,9 @@ class AsyncAgentaApi:
|
|
|
1393
1472
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1394
1473
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1395
1474
|
|
|
1396
|
-
async def resend_invitation(
|
|
1475
|
+
async def resend_invitation(
|
|
1476
|
+
self, org_id: str, workspace_id: str, *, email: str
|
|
1477
|
+
) -> typing.Any:
|
|
1397
1478
|
"""
|
|
1398
1479
|
Resend an invitation to a user to an Organization.
|
|
1399
1480
|
|
|
@@ -1444,7 +1525,9 @@ class AsyncAgentaApi:
|
|
|
1444
1525
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1445
1526
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1446
1527
|
|
|
1447
|
-
async def accept_invitation(
|
|
1528
|
+
async def accept_invitation(
|
|
1529
|
+
self, org_id: str, workspace_id: str, *, token: str
|
|
1530
|
+
) -> typing.Any:
|
|
1448
1531
|
"""
|
|
1449
1532
|
Accept an invitation to a workspace.
|
|
1450
1533
|
|
|
@@ -1496,7 +1579,12 @@ class AsyncAgentaApi:
|
|
|
1496
1579
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1497
1580
|
|
|
1498
1581
|
async def create_workspace(
|
|
1499
|
-
self,
|
|
1582
|
+
self,
|
|
1583
|
+
org_id: str,
|
|
1584
|
+
*,
|
|
1585
|
+
name: str,
|
|
1586
|
+
description: typing.Optional[str] = OMIT,
|
|
1587
|
+
type: typing.Optional[str] = OMIT,
|
|
1500
1588
|
) -> WorkspaceResponse:
|
|
1501
1589
|
"""
|
|
1502
1590
|
Parameters:
|
|
@@ -1526,7 +1614,10 @@ class AsyncAgentaApi:
|
|
|
1526
1614
|
_request["type"] = type
|
|
1527
1615
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1528
1616
|
"POST",
|
|
1529
|
-
urllib.parse.urljoin(
|
|
1617
|
+
urllib.parse.urljoin(
|
|
1618
|
+
f"{self._client_wrapper.get_base_url()}/",
|
|
1619
|
+
f"organizations/{org_id}/workspaces",
|
|
1620
|
+
),
|
|
1530
1621
|
json=jsonable_encoder(_request),
|
|
1531
1622
|
headers=self._client_wrapper.get_headers(),
|
|
1532
1623
|
timeout=60,
|
|
@@ -1583,7 +1674,8 @@ class AsyncAgentaApi:
|
|
|
1583
1674
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1584
1675
|
"PUT",
|
|
1585
1676
|
urllib.parse.urljoin(
|
|
1586
|
-
f"{self._client_wrapper.get_base_url()}/",
|
|
1677
|
+
f"{self._client_wrapper.get_base_url()}/",
|
|
1678
|
+
f"organizations/{org_id}/workspaces/{workspace_id}",
|
|
1587
1679
|
),
|
|
1588
1680
|
json=jsonable_encoder(_request),
|
|
1589
1681
|
headers=self._client_wrapper.get_headers(),
|
|
@@ -1622,7 +1714,9 @@ class AsyncAgentaApi:
|
|
|
1622
1714
|
"""
|
|
1623
1715
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1624
1716
|
"GET",
|
|
1625
|
-
urllib.parse.urljoin(
|
|
1717
|
+
urllib.parse.urljoin(
|
|
1718
|
+
f"{self._client_wrapper.get_base_url()}/", "workspaces/roles"
|
|
1719
|
+
),
|
|
1626
1720
|
headers=self._client_wrapper.get_headers(),
|
|
1627
1721
|
timeout=60,
|
|
1628
1722
|
)
|
|
@@ -1657,7 +1751,9 @@ class AsyncAgentaApi:
|
|
|
1657
1751
|
"""
|
|
1658
1752
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1659
1753
|
"GET",
|
|
1660
|
-
urllib.parse.urljoin(
|
|
1754
|
+
urllib.parse.urljoin(
|
|
1755
|
+
f"{self._client_wrapper.get_base_url()}/", "workspaces/permissions"
|
|
1756
|
+
),
|
|
1661
1757
|
headers=self._client_wrapper.get_headers(),
|
|
1662
1758
|
timeout=60,
|
|
1663
1759
|
)
|
|
@@ -1670,7 +1766,12 @@ class AsyncAgentaApi:
|
|
|
1670
1766
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1671
1767
|
|
|
1672
1768
|
async def assign_role_to_user(
|
|
1673
|
-
self,
|
|
1769
|
+
self,
|
|
1770
|
+
workspace_id: str,
|
|
1771
|
+
*,
|
|
1772
|
+
email: str,
|
|
1773
|
+
organization_id: str,
|
|
1774
|
+
role: typing.Optional[WorkspaceRole] = OMIT,
|
|
1674
1775
|
) -> bool:
|
|
1675
1776
|
"""
|
|
1676
1777
|
Assigns a role to a user in a workspace.
|
|
@@ -1708,12 +1809,18 @@ class AsyncAgentaApi:
|
|
|
1708
1809
|
organization_id="organization_id",
|
|
1709
1810
|
)
|
|
1710
1811
|
"""
|
|
1711
|
-
_request: typing.Dict[str, typing.Any] = {
|
|
1812
|
+
_request: typing.Dict[str, typing.Any] = {
|
|
1813
|
+
"email": email,
|
|
1814
|
+
"organization_id": organization_id,
|
|
1815
|
+
}
|
|
1712
1816
|
if role is not OMIT:
|
|
1713
1817
|
_request["role"] = role.value
|
|
1714
1818
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1715
1819
|
"POST",
|
|
1716
|
-
urllib.parse.urljoin(
|
|
1820
|
+
urllib.parse.urljoin(
|
|
1821
|
+
f"{self._client_wrapper.get_base_url()}/",
|
|
1822
|
+
f"workspaces/{workspace_id}/roles",
|
|
1823
|
+
),
|
|
1717
1824
|
json=jsonable_encoder(_request),
|
|
1718
1825
|
headers=self._client_wrapper.get_headers(),
|
|
1719
1826
|
timeout=60,
|
|
@@ -1728,7 +1835,9 @@ class AsyncAgentaApi:
|
|
|
1728
1835
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1729
1836
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1730
1837
|
|
|
1731
|
-
async def unassign_role_from_user(
|
|
1838
|
+
async def unassign_role_from_user(
|
|
1839
|
+
self, workspace_id: str, *, email: str, org_id: str, role: str
|
|
1840
|
+
) -> typing.Any:
|
|
1732
1841
|
"""
|
|
1733
1842
|
Delete a role assignment from a user in a workspace.
|
|
1734
1843
|
|
|
@@ -1770,8 +1879,13 @@ class AsyncAgentaApi:
|
|
|
1770
1879
|
"""
|
|
1771
1880
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1772
1881
|
"DELETE",
|
|
1773
|
-
urllib.parse.urljoin(
|
|
1774
|
-
|
|
1882
|
+
urllib.parse.urljoin(
|
|
1883
|
+
f"{self._client_wrapper.get_base_url()}/",
|
|
1884
|
+
f"workspaces/{workspace_id}/roles",
|
|
1885
|
+
),
|
|
1886
|
+
params=remove_none_from_dict(
|
|
1887
|
+
{"email": email, "org_id": org_id, "role": role}
|
|
1888
|
+
),
|
|
1775
1889
|
headers=self._client_wrapper.get_headers(),
|
|
1776
1890
|
timeout=60,
|
|
1777
1891
|
)
|
|
@@ -1785,7 +1899,9 @@ class AsyncAgentaApi:
|
|
|
1785
1899
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1786
1900
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1787
1901
|
|
|
1788
|
-
async def remove_user_from_workspace(
|
|
1902
|
+
async def remove_user_from_workspace(
|
|
1903
|
+
self, workspace_id: str, *, org_id: str, email: str
|
|
1904
|
+
) -> WorkspaceResponse:
|
|
1789
1905
|
"""
|
|
1790
1906
|
Remove a user from a workspace.
|
|
1791
1907
|
|
|
@@ -1825,7 +1941,10 @@ class AsyncAgentaApi:
|
|
|
1825
1941
|
"""
|
|
1826
1942
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1827
1943
|
"DELETE",
|
|
1828
|
-
urllib.parse.urljoin(
|
|
1944
|
+
urllib.parse.urljoin(
|
|
1945
|
+
f"{self._client_wrapper.get_base_url()}/",
|
|
1946
|
+
f"workspaces/{workspace_id}/users",
|
|
1947
|
+
),
|
|
1829
1948
|
params=remove_none_from_dict({"org_id": org_id, "email": email}),
|
|
1830
1949
|
headers=self._client_wrapper.get_headers(),
|
|
1831
1950
|
timeout=60,
|
|
@@ -7,7 +7,9 @@ class ApiError(Exception):
|
|
|
7
7
|
status_code: typing.Optional[int]
|
|
8
8
|
body: typing.Any
|
|
9
9
|
|
|
10
|
-
def __init__(
|
|
10
|
+
def __init__(
|
|
11
|
+
self, *, status_code: typing.Optional[int] = None, body: typing.Any = None
|
|
12
|
+
):
|
|
11
13
|
self.status_code = status_code
|
|
12
14
|
self.body = body
|
|
13
15
|
|
|
@@ -13,7 +13,9 @@ def serialize_datetime(v: dt.datetime) -> str:
|
|
|
13
13
|
"""
|
|
14
14
|
|
|
15
15
|
def _serialize_zoned_datetime(v: dt.datetime) -> str:
|
|
16
|
-
if v.tzinfo is not None and v.tzinfo.tzname(None) == dt.timezone.utc.tzname(
|
|
16
|
+
if v.tzinfo is not None and v.tzinfo.tzname(None) == dt.timezone.utc.tzname(
|
|
17
|
+
None
|
|
18
|
+
):
|
|
17
19
|
# UTC is a special case where we use "Z" at the end instead of "+00:00"
|
|
18
20
|
return v.isoformat().replace("+00:00", "Z")
|
|
19
21
|
else:
|
|
@@ -30,16 +30,22 @@ DictIntStrAny = Dict[Union[int, str], Any]
|
|
|
30
30
|
def generate_encoders_by_class_tuples(
|
|
31
31
|
type_encoder_map: Dict[Any, Callable[[Any], Any]]
|
|
32
32
|
) -> Dict[Callable[[Any], Any], Tuple[Any, ...]]:
|
|
33
|
-
encoders_by_class_tuples: Dict[Callable[[Any], Any], Tuple[Any, ...]] = defaultdict(
|
|
33
|
+
encoders_by_class_tuples: Dict[Callable[[Any], Any], Tuple[Any, ...]] = defaultdict(
|
|
34
|
+
tuple
|
|
35
|
+
)
|
|
34
36
|
for type_, encoder in type_encoder_map.items():
|
|
35
37
|
encoders_by_class_tuples[encoder] += (type_,)
|
|
36
38
|
return encoders_by_class_tuples
|
|
37
39
|
|
|
38
40
|
|
|
39
|
-
encoders_by_class_tuples = generate_encoders_by_class_tuples(
|
|
41
|
+
encoders_by_class_tuples = generate_encoders_by_class_tuples(
|
|
42
|
+
pydantic.json.ENCODERS_BY_TYPE
|
|
43
|
+
)
|
|
40
44
|
|
|
41
45
|
|
|
42
|
-
def jsonable_encoder(
|
|
46
|
+
def jsonable_encoder(
|
|
47
|
+
obj: Any, custom_encoder: Optional[Dict[Any, Callable[[Any], Any]]] = None
|
|
48
|
+
) -> Any:
|
|
43
49
|
custom_encoder = custom_encoder or {}
|
|
44
50
|
if custom_encoder:
|
|
45
51
|
if type(obj) in custom_encoder:
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from . import
|
|
3
|
+
from . import (
|
|
4
|
+
apps,
|
|
5
|
+
bases,
|
|
6
|
+
configs,
|
|
7
|
+
containers,
|
|
8
|
+
environments,
|
|
9
|
+
evaluations,
|
|
10
|
+
evaluators,
|
|
11
|
+
observability,
|
|
12
|
+
testsets,
|
|
13
|
+
variants,
|
|
14
|
+
)
|
|
4
15
|
from .containers import ContainerTemplatesResponse
|
|
5
16
|
from .variants import AddVariantFromBaseAndConfigResponse
|
|
6
17
|
|