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.

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