agenta 0.48.9__py3-none-any.whl → 0.48.10__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 (295) hide show
  1. agenta/__init__.py +3 -2
  2. agenta/client/Readme.md +258 -80
  3. agenta/client/__init__.py +205 -29
  4. agenta/client/backend/__init__.py +461 -0
  5. agenta/client/backend/access_control/__init__.py +2 -0
  6. agenta/client/backend/access_control/client.py +53 -73
  7. agenta/client/backend/access_control/raw_client.py +180 -0
  8. agenta/client/backend/admin/__init__.py +2 -0
  9. agenta/client/backend/admin/client.py +473 -268
  10. agenta/client/backend/admin/raw_client.py +1017 -0
  11. agenta/client/backend/api_keys/__init__.py +2 -0
  12. agenta/client/backend/api_keys/client.py +43 -276
  13. agenta/client/backend/api_keys/raw_client.py +364 -0
  14. agenta/client/backend/apps/__init__.py +2 -0
  15. agenta/client/backend/apps/client.py +132 -895
  16. agenta/client/backend/apps/raw_client.py +1516 -0
  17. agenta/client/backend/bases/__init__.py +2 -0
  18. agenta/client/backend/bases/client.py +33 -73
  19. agenta/client/backend/bases/raw_client.py +179 -0
  20. agenta/client/backend/billing/__init__.py +3 -0
  21. agenta/client/backend/billing/client.py +564 -0
  22. agenta/client/backend/billing/raw_client.py +805 -0
  23. agenta/client/backend/client.py +1268 -0
  24. agenta/client/backend/configs/__init__.py +2 -0
  25. agenta/client/backend/configs/client.py +49 -361
  26. agenta/client/backend/configs/raw_client.py +402 -0
  27. agenta/client/backend/containers/__init__.py +1 -3
  28. agenta/client/backend/containers/client.py +25 -548
  29. agenta/client/backend/containers/raw_client.py +112 -0
  30. agenta/client/backend/core/__init__.py +5 -0
  31. agenta/client/backend/core/api_error.py +12 -6
  32. agenta/client/backend/core/client_wrapper.py +4 -4
  33. agenta/client/backend/core/file.py +1 -3
  34. agenta/client/backend/core/force_multipart.py +16 -0
  35. agenta/client/backend/core/http_client.py +78 -34
  36. agenta/client/backend/core/http_response.py +55 -0
  37. agenta/client/backend/core/jsonable_encoder.py +0 -1
  38. agenta/client/backend/core/pydantic_utilities.py +88 -113
  39. agenta/client/backend/core/serialization.py +9 -3
  40. agenta/client/backend/environment.py +7 -0
  41. agenta/client/backend/environments/__init__.py +2 -0
  42. agenta/client/backend/environments/client.py +43 -79
  43. agenta/client/backend/environments/raw_client.py +193 -0
  44. agenta/client/backend/errors/__init__.py +2 -0
  45. agenta/client/backend/errors/unprocessable_entity_error.py +8 -2
  46. agenta/client/backend/evals/__init__.py +3 -0
  47. agenta/client/backend/evals/client.py +1042 -0
  48. agenta/client/backend/evals/raw_client.py +1549 -0
  49. agenta/client/backend/evaluations/__init__.py +2 -0
  50. agenta/client/backend/evaluations/client.py +106 -590
  51. agenta/client/backend/evaluations/raw_client.py +1344 -0
  52. agenta/client/backend/evaluators/__init__.py +2 -0
  53. agenta/client/backend/evaluators/client.py +99 -516
  54. agenta/client/backend/evaluators/raw_client.py +1182 -0
  55. agenta/client/backend/human_evaluations/__init__.py +2 -0
  56. agenta/client/backend/human_evaluations/client.py +120 -680
  57. agenta/client/backend/human_evaluations/raw_client.py +1577 -0
  58. agenta/client/backend/observability/__init__.py +14 -2
  59. agenta/client/backend/observability/client.py +185 -341
  60. agenta/client/backend/observability/raw_client.py +943 -0
  61. agenta/client/backend/observability/types/__init__.py +10 -2
  62. agenta/client/backend/observability/types/{format.py → fetch_trace_by_id_request_trace_id.py} +1 -1
  63. agenta/client/backend/observability/types/fetch_trace_by_id_response.py +15 -0
  64. agenta/client/backend/observability/types/query_analytics_response.py +2 -1
  65. agenta/client/backend/observability/types/query_traces_response.py +7 -3
  66. agenta/client/backend/organization/__init__.py +2 -0
  67. agenta/client/backend/organization/client.py +105 -361
  68. agenta/client/backend/organization/raw_client.py +774 -0
  69. agenta/client/backend/raw_client.py +1432 -0
  70. agenta/client/backend/scopes/__init__.py +2 -0
  71. agenta/client/backend/scopes/client.py +31 -45
  72. agenta/client/backend/scopes/raw_client.py +105 -0
  73. agenta/client/backend/testsets/__init__.py +14 -0
  74. agenta/client/backend/testsets/client.py +1098 -653
  75. agenta/client/backend/testsets/raw_client.py +2348 -0
  76. agenta/client/backend/testsets/types/__init__.py +17 -0
  77. agenta/client/backend/testsets/types/create_testset_from_file_request_file_type.py +7 -0
  78. agenta/client/backend/testsets/types/fetch_testset_to_file_request_file_type.py +7 -0
  79. agenta/client/backend/testsets/types/update_testset_from_file_request_file_type.py +7 -0
  80. agenta/client/backend/tracing/__init__.py +7 -0
  81. agenta/client/backend/tracing/client.py +782 -0
  82. agenta/client/backend/tracing/raw_client.py +1223 -0
  83. agenta/client/backend/tracing/types/__init__.py +8 -0
  84. agenta/client/backend/{types/variant_action_enum.py → tracing/types/fetch_trace_request_trace_id.py} +1 -1
  85. agenta/client/backend/tracing/types/remove_trace_request_trace_id.py +5 -0
  86. agenta/client/backend/types/__init__.py +153 -26
  87. agenta/client/backend/types/account_request.py +24 -0
  88. agenta/client/backend/types/account_response.py +5 -7
  89. agenta/client/backend/types/agenta_node_dto.py +13 -13
  90. agenta/client/backend/types/agenta_node_dto_nodes_value.py +1 -0
  91. agenta/client/backend/types/agenta_nodes_response.py +14 -8
  92. agenta/client/backend/types/agenta_root_dto.py +16 -8
  93. agenta/client/backend/types/agenta_roots_response.py +16 -8
  94. agenta/client/backend/types/agenta_tree_dto.py +16 -8
  95. agenta/client/backend/types/agenta_trees_response.py +16 -8
  96. agenta/client/backend/types/aggregated_result.py +5 -7
  97. agenta/client/backend/types/aggregated_result_evaluator_config.py +1 -0
  98. agenta/client/backend/types/analytics_response.py +4 -6
  99. agenta/client/backend/types/annotation.py +50 -0
  100. agenta/client/backend/types/annotation_create.py +39 -0
  101. agenta/client/backend/types/annotation_edit.py +31 -0
  102. agenta/client/backend/types/annotation_kind.py +5 -0
  103. agenta/client/backend/types/{uri.py → annotation_link.py} +6 -7
  104. agenta/client/backend/types/{provider_key_dto.py → annotation_link_response.py} +6 -7
  105. agenta/client/backend/types/annotation_query.py +40 -0
  106. agenta/client/backend/types/annotation_query_request.py +20 -0
  107. agenta/client/backend/types/annotation_reference.py +21 -0
  108. agenta/client/backend/types/annotation_references.py +22 -0
  109. agenta/client/backend/types/{docker_env_vars.py → annotation_response.py} +6 -7
  110. agenta/client/backend/types/annotation_source.py +5 -0
  111. agenta/client/backend/types/annotations_response.py +24 -0
  112. agenta/client/backend/types/app.py +3 -5
  113. agenta/client/backend/types/app_variant_response.py +3 -6
  114. agenta/client/backend/types/app_variant_revision.py +5 -6
  115. agenta/client/backend/types/artifact.py +44 -0
  116. agenta/client/backend/types/base_output.py +3 -5
  117. agenta/client/backend/types/body_fetch_workflow_revision.py +21 -0
  118. agenta/client/backend/types/body_import_testset.py +3 -5
  119. agenta/client/backend/types/bucket_dto.py +4 -6
  120. agenta/client/backend/types/collect_status_response.py +3 -5
  121. agenta/client/backend/types/config_db.py +3 -5
  122. agenta/client/backend/types/config_dto.py +5 -7
  123. agenta/client/backend/types/config_response_model.py +5 -7
  124. agenta/client/backend/types/correct_answer.py +3 -5
  125. agenta/client/backend/types/create_app_output.py +3 -5
  126. agenta/client/backend/types/custom_model_settings_dto.py +3 -5
  127. agenta/client/backend/types/custom_provider_dto.py +6 -9
  128. agenta/client/backend/types/custom_provider_kind.py +5 -5
  129. agenta/client/backend/types/custom_provider_settings_dto.py +3 -5
  130. agenta/client/backend/types/data.py +2 -1
  131. agenta/client/backend/types/delete_evaluation.py +3 -5
  132. agenta/client/backend/types/environment_output.py +3 -5
  133. agenta/client/backend/types/environment_output_extended.py +4 -6
  134. agenta/client/backend/types/environment_revision.py +5 -5
  135. agenta/client/backend/types/error.py +3 -5
  136. agenta/client/backend/types/evaluation.py +6 -8
  137. agenta/client/backend/types/evaluation_scenario.py +5 -7
  138. agenta/client/backend/types/evaluation_scenario_input.py +3 -5
  139. agenta/client/backend/types/evaluation_scenario_output.py +4 -6
  140. agenta/client/backend/types/evaluation_scenario_result.py +4 -6
  141. agenta/client/backend/types/evaluator.py +31 -12
  142. agenta/client/backend/types/evaluator_config.py +3 -5
  143. agenta/client/backend/types/evaluator_flags.py +21 -0
  144. agenta/client/backend/types/evaluator_mapping_output_interface.py +3 -5
  145. agenta/client/backend/types/evaluator_output_interface.py +3 -5
  146. agenta/client/backend/types/evaluator_query.py +32 -0
  147. agenta/client/backend/types/evaluator_query_request.py +30 -0
  148. agenta/client/backend/types/evaluator_request.py +20 -0
  149. agenta/client/backend/types/evaluator_response.py +21 -0
  150. agenta/client/backend/types/evaluators_response.py +21 -0
  151. agenta/client/backend/types/exception_dto.py +3 -5
  152. agenta/client/backend/types/{o_tel_spans_response.py → extended_o_tel_tracing_response.py} +5 -7
  153. agenta/client/backend/types/focus.py +5 -0
  154. agenta/client/backend/types/format.py +5 -0
  155. agenta/client/backend/types/full_json_input.py +34 -0
  156. agenta/client/backend/types/full_json_output.py +29 -0
  157. agenta/client/backend/types/get_config_response.py +3 -5
  158. agenta/client/backend/types/{header_dto.py → header.py} +4 -6
  159. agenta/client/backend/types/http_validation_error.py +4 -6
  160. agenta/client/backend/types/human_evaluation.py +3 -5
  161. agenta/client/backend/types/human_evaluation_scenario.py +4 -6
  162. agenta/client/backend/types/human_evaluation_scenario_input.py +3 -5
  163. agenta/client/backend/types/human_evaluation_scenario_output.py +3 -5
  164. agenta/client/backend/types/invite_request.py +4 -6
  165. agenta/client/backend/types/legacy_analytics_response.py +4 -6
  166. agenta/client/backend/types/legacy_data_point.py +3 -5
  167. agenta/client/backend/types/legacy_evaluator.py +26 -0
  168. agenta/client/backend/types/legacy_scope_request.py +4 -6
  169. agenta/client/backend/types/legacy_scopes_response.py +3 -5
  170. agenta/client/backend/types/legacy_subscription_request.py +19 -0
  171. agenta/client/backend/types/legacy_user_request.py +5 -7
  172. agenta/client/backend/types/legacy_user_response.py +3 -5
  173. agenta/client/backend/types/lifecycle_dto.py +3 -5
  174. agenta/client/backend/types/link_dto.py +4 -6
  175. agenta/client/backend/types/list_api_keys_response.py +3 -5
  176. agenta/client/backend/types/llm_run_rate_limit.py +3 -5
  177. agenta/client/backend/types/meta_request.py +30 -0
  178. agenta/client/backend/types/metrics_dto.py +3 -5
  179. agenta/client/backend/types/new_testset.py +3 -5
  180. agenta/client/backend/types/node_dto.py +4 -6
  181. agenta/client/backend/types/o_tel_context_dto.py +3 -5
  182. agenta/client/backend/types/o_tel_event.py +35 -0
  183. agenta/client/backend/types/o_tel_event_dto.py +3 -5
  184. agenta/client/backend/types/o_tel_extra_dto.py +4 -6
  185. agenta/client/backend/types/o_tel_flat_span.py +56 -0
  186. agenta/client/backend/types/o_tel_flat_span_input_end_time.py +6 -0
  187. agenta/client/backend/types/o_tel_flat_span_input_start_time.py +6 -0
  188. agenta/client/backend/types/o_tel_flat_span_output_end_time.py +6 -0
  189. agenta/client/backend/types/o_tel_flat_span_output_start_time.py +6 -0
  190. agenta/client/backend/types/o_tel_link.py +34 -0
  191. agenta/client/backend/types/o_tel_link_dto.py +4 -6
  192. agenta/client/backend/types/o_tel_links_response.py +22 -0
  193. agenta/client/backend/types/o_tel_span.py +58 -0
  194. agenta/client/backend/types/o_tel_span_dto.py +8 -10
  195. agenta/client/backend/types/o_tel_span_input_end_time.py +6 -0
  196. agenta/client/backend/types/o_tel_span_input_spans_value.py +7 -0
  197. agenta/client/backend/types/o_tel_span_input_start_time.py +6 -0
  198. agenta/client/backend/types/o_tel_span_output_end_time.py +6 -0
  199. agenta/client/backend/types/o_tel_span_output_spans_value.py +30 -0
  200. agenta/client/backend/types/o_tel_span_output_start_time.py +6 -0
  201. agenta/client/backend/types/o_tel_spans_tree.py +22 -0
  202. agenta/client/backend/types/o_tel_spans_tree_input_spans_value.py +7 -0
  203. agenta/client/backend/types/o_tel_spans_tree_output_spans_value.py +5 -0
  204. agenta/client/backend/types/o_tel_status_code.py +1 -1
  205. agenta/client/backend/types/o_tel_tracing_data_response.py +22 -0
  206. agenta/client/backend/types/o_tel_tracing_request.py +22 -0
  207. agenta/client/backend/types/o_tel_tracing_response.py +27 -0
  208. agenta/client/backend/types/organization.py +3 -5
  209. agenta/client/backend/types/organization_details.py +3 -5
  210. agenta/client/backend/types/organization_membership_request.py +5 -7
  211. agenta/client/backend/types/organization_output.py +3 -5
  212. agenta/client/backend/types/organization_request.py +3 -5
  213. agenta/client/backend/types/parent_dto.py +3 -5
  214. agenta/client/backend/types/permission.py +11 -0
  215. agenta/client/backend/types/plan.py +14 -0
  216. agenta/client/backend/types/project_membership_request.py +5 -7
  217. agenta/client/backend/types/project_request.py +4 -6
  218. agenta/client/backend/types/project_scope.py +5 -7
  219. agenta/client/backend/types/projects_response.py +3 -5
  220. agenta/client/backend/types/recursive_types.py +23 -0
  221. agenta/client/backend/types/reference.py +18 -5
  222. agenta/client/backend/types/reference_dto.py +4 -5
  223. agenta/client/backend/types/reference_request_model.py +4 -5
  224. agenta/client/backend/types/result.py +4 -6
  225. agenta/client/backend/types/root_dto.py +3 -5
  226. agenta/client/backend/types/scopes_response_model.py +4 -6
  227. agenta/client/backend/types/secret_dto.py +5 -7
  228. agenta/client/backend/types/secret_response_dto.py +11 -11
  229. agenta/client/backend/types/simple_evaluation_output.py +4 -6
  230. agenta/client/backend/types/span_dto.py +18 -14
  231. agenta/client/backend/types/span_dto_nodes_value.py +1 -1
  232. agenta/client/backend/types/standard_provider_dto.py +5 -7
  233. agenta/client/backend/types/standard_provider_settings_dto.py +3 -5
  234. agenta/client/backend/types/status_dto.py +4 -6
  235. agenta/client/backend/types/tags_request.py +30 -0
  236. agenta/client/backend/types/test_set_output_response.py +5 -7
  237. agenta/client/backend/types/test_set_simple_response.py +3 -5
  238. agenta/client/backend/types/testcase_response.py +33 -0
  239. agenta/client/backend/types/testset.py +46 -0
  240. agenta/client/backend/types/testset_request.py +20 -0
  241. agenta/client/backend/types/testset_response.py +21 -0
  242. agenta/client/backend/types/testsets_response.py +21 -0
  243. agenta/client/backend/types/time_dto.py +3 -5
  244. agenta/client/backend/types/timestamp.py +6 -0
  245. agenta/client/backend/types/tree_dto.py +4 -6
  246. agenta/client/backend/types/update_app_output.py +3 -5
  247. agenta/client/backend/types/user_request.py +3 -5
  248. agenta/client/backend/types/validation_error.py +4 -6
  249. agenta/client/backend/types/workflow_artifact.py +45 -0
  250. agenta/client/backend/types/workflow_data.py +20 -0
  251. agenta/client/backend/types/workflow_flags.py +21 -0
  252. agenta/client/backend/types/workflow_request.py +20 -0
  253. agenta/client/backend/types/workflow_response.py +21 -0
  254. agenta/client/backend/types/workflow_revision.py +57 -0
  255. agenta/client/backend/types/workflow_revision_request.py +20 -0
  256. agenta/client/backend/types/workflow_revision_response.py +21 -0
  257. agenta/client/backend/types/workflow_revisions_response.py +21 -0
  258. agenta/client/backend/types/workflow_variant.py +48 -0
  259. agenta/client/backend/types/workflow_variant_request.py +20 -0
  260. agenta/client/backend/types/workflow_variant_response.py +21 -0
  261. agenta/client/backend/types/workflow_variants_response.py +21 -0
  262. agenta/client/backend/types/workflows_response.py +21 -0
  263. agenta/client/backend/types/workspace.py +3 -5
  264. agenta/client/backend/types/workspace_member_response.py +4 -6
  265. agenta/client/backend/types/workspace_membership_request.py +5 -7
  266. agenta/client/backend/types/workspace_permission.py +5 -7
  267. agenta/client/backend/types/workspace_request.py +4 -6
  268. agenta/client/backend/types/workspace_response.py +4 -6
  269. agenta/client/backend/variants/__init__.py +2 -0
  270. agenta/client/backend/variants/client.py +306 -1651
  271. agenta/client/backend/variants/raw_client.py +2482 -0
  272. agenta/client/backend/variants/types/__init__.py +2 -0
  273. agenta/client/backend/variants/types/add_variant_from_base_and_config_response.py +1 -0
  274. agenta/client/backend/vault/__init__.py +2 -0
  275. agenta/client/backend/vault/client.py +69 -323
  276. agenta/client/backend/vault/raw_client.py +616 -0
  277. agenta/client/backend/workflows/__init__.py +3 -0
  278. agenta/client/backend/workflows/client.py +2398 -0
  279. agenta/client/backend/workflows/raw_client.py +3639 -0
  280. agenta/client/backend/workspace/__init__.py +2 -0
  281. agenta/client/backend/workspace/client.py +46 -147
  282. agenta/client/backend/workspace/raw_client.py +376 -0
  283. agenta/client/types.py +4 -0
  284. agenta/sdk/types.py +28 -1
  285. {agenta-0.48.9.dist-info → agenta-0.48.10.dist-info}/METADATA +1 -1
  286. agenta-0.48.10.dist-info/RECORD +362 -0
  287. agenta/client/backend/containers/types/__init__.py +0 -5
  288. agenta/client/backend/containers/types/container_templates_response.py +0 -6
  289. agenta/client/backend/types/image.py +0 -25
  290. agenta/client/backend/types/provider_kind.py +0 -21
  291. agenta/client/backend/types/template.py +0 -23
  292. agenta/client/backend/types/template_image_info.py +0 -29
  293. agenta/client/backend/types/variant_action.py +0 -22
  294. agenta-0.48.9.dist-info/RECORD +0 -255
  295. {agenta-0.48.9.dist-info → agenta-0.48.10.dist-info}/WHEEL +0 -0
@@ -0,0 +1,1268 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ import httpx
7
+ from .access_control.client import AccessControlClient, AsyncAccessControlClient
8
+ from .admin.client import AdminClient, AsyncAdminClient
9
+ from .api_keys.client import ApiKeysClient, AsyncApiKeysClient
10
+ from .apps.client import AppsClient, AsyncAppsClient
11
+ from .bases.client import AsyncBasesClient, BasesClient
12
+ from .billing.client import AsyncBillingClient, BillingClient
13
+ from .configs.client import AsyncConfigsClient, ConfigsClient
14
+ from .containers.client import AsyncContainersClient, ContainersClient
15
+ from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
16
+ from .core.request_options import RequestOptions
17
+ from .environment import AgentaApiEnvironment
18
+ from .environments.client import AsyncEnvironmentsClient, EnvironmentsClient
19
+ from .evals.client import AsyncEvalsClient, EvalsClient
20
+ from .evaluations.client import AsyncEvaluationsClient, EvaluationsClient
21
+ from .evaluators.client import AsyncEvaluatorsClient, EvaluatorsClient
22
+ from .human_evaluations.client import (
23
+ AsyncHumanEvaluationsClient,
24
+ HumanEvaluationsClient,
25
+ )
26
+ from .observability.client import AsyncObservabilityClient, ObservabilityClient
27
+ from .organization.client import AsyncOrganizationClient, OrganizationClient
28
+ from .raw_client import AsyncRawAgentaApi, RawAgentaApi
29
+ from .scopes.client import AsyncScopesClient, ScopesClient
30
+ from .testsets.client import AsyncTestsetsClient, TestsetsClient
31
+ from .tracing.client import AsyncTracingClient, TracingClient
32
+ from .types.organization_output import OrganizationOutput
33
+ from .types.permission import Permission
34
+ from .types.workspace_response import WorkspaceResponse
35
+ from .variants.client import AsyncVariantsClient, VariantsClient
36
+ from .vault.client import AsyncVaultClient, VaultClient
37
+ from .workflows.client import AsyncWorkflowsClient, WorkflowsClient
38
+ from .workspace.client import AsyncWorkspaceClient, WorkspaceClient
39
+
40
+ # this is used as the default value for optional parameters
41
+ OMIT = typing.cast(typing.Any, ...)
42
+
43
+
44
+ class AgentaApi:
45
+ """
46
+ Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.
47
+
48
+ Parameters
49
+ ----------
50
+ base_url : typing.Optional[str]
51
+ The base url to use for requests from the client.
52
+
53
+ environment : AgentaApiEnvironment
54
+ The environment to use for requests from the client. from .environment import AgentaApiEnvironment
55
+
56
+
57
+
58
+ Defaults to AgentaApiEnvironment.DEFAULT
59
+
60
+
61
+
62
+ api_key : str
63
+ timeout : typing.Optional[float]
64
+ The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
65
+
66
+ follow_redirects : typing.Optional[bool]
67
+ Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
68
+
69
+ httpx_client : typing.Optional[httpx.Client]
70
+ The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
71
+
72
+ Examples
73
+ --------
74
+ from agenta import AgentaApi
75
+
76
+ client = AgentaApi(
77
+ api_key="YOUR_API_KEY",
78
+ )
79
+ """
80
+
81
+ def __init__(
82
+ self,
83
+ *,
84
+ base_url: typing.Optional[str] = None,
85
+ environment: AgentaApiEnvironment = AgentaApiEnvironment.DEFAULT,
86
+ api_key: str,
87
+ timeout: typing.Optional[float] = None,
88
+ follow_redirects: typing.Optional[bool] = True,
89
+ httpx_client: typing.Optional[httpx.Client] = None,
90
+ ):
91
+ _defaulted_timeout = (
92
+ timeout
93
+ if timeout is not None
94
+ else 60
95
+ if httpx_client is None
96
+ else httpx_client.timeout.read
97
+ )
98
+ self._client_wrapper = SyncClientWrapper(
99
+ base_url=_get_base_url(base_url=base_url, environment=environment),
100
+ api_key=api_key,
101
+ httpx_client=httpx_client
102
+ if httpx_client is not None
103
+ else httpx.Client(
104
+ timeout=_defaulted_timeout, follow_redirects=follow_redirects
105
+ )
106
+ if follow_redirects is not None
107
+ else httpx.Client(timeout=_defaulted_timeout),
108
+ timeout=_defaulted_timeout,
109
+ )
110
+ self._raw_client = RawAgentaApi(client_wrapper=self._client_wrapper)
111
+ self.admin = AdminClient(client_wrapper=self._client_wrapper)
112
+ self.organization = OrganizationClient(client_wrapper=self._client_wrapper)
113
+ self.evaluations = EvaluationsClient(client_wrapper=self._client_wrapper)
114
+ self.human_evaluations = HumanEvaluationsClient(
115
+ client_wrapper=self._client_wrapper
116
+ )
117
+ self.billing = BillingClient(client_wrapper=self._client_wrapper)
118
+ self.access_control = AccessControlClient(client_wrapper=self._client_wrapper)
119
+ self.scopes = ScopesClient(client_wrapper=self._client_wrapper)
120
+ self.apps = AppsClient(client_wrapper=self._client_wrapper)
121
+ self.variants = VariantsClient(client_wrapper=self._client_wrapper)
122
+ self.containers = ContainersClient(client_wrapper=self._client_wrapper)
123
+ self.evaluators = EvaluatorsClient(client_wrapper=self._client_wrapper)
124
+ self.testsets = TestsetsClient(client_wrapper=self._client_wrapper)
125
+ self.environments = EnvironmentsClient(client_wrapper=self._client_wrapper)
126
+ self.bases = BasesClient(client_wrapper=self._client_wrapper)
127
+ self.configs = ConfigsClient(client_wrapper=self._client_wrapper)
128
+ self.api_keys = ApiKeysClient(client_wrapper=self._client_wrapper)
129
+ self.workspace = WorkspaceClient(client_wrapper=self._client_wrapper)
130
+ self.tracing = TracingClient(client_wrapper=self._client_wrapper)
131
+ self.evals = EvalsClient(client_wrapper=self._client_wrapper)
132
+ self.workflows = WorkflowsClient(client_wrapper=self._client_wrapper)
133
+ self.observability = ObservabilityClient(client_wrapper=self._client_wrapper)
134
+ self.vault = VaultClient(client_wrapper=self._client_wrapper)
135
+
136
+ @property
137
+ def with_raw_response(self) -> RawAgentaApi:
138
+ """
139
+ Retrieves a raw implementation of this client that returns raw responses.
140
+
141
+ Returns
142
+ -------
143
+ RawAgentaApi
144
+ """
145
+ return self._raw_client
146
+
147
+ def get_own_org(
148
+ self, *, request_options: typing.Optional[RequestOptions] = None
149
+ ) -> OrganizationOutput:
150
+ """
151
+ Parameters
152
+ ----------
153
+ request_options : typing.Optional[RequestOptions]
154
+ Request-specific configuration.
155
+
156
+ Returns
157
+ -------
158
+ OrganizationOutput
159
+ Successful Response
160
+
161
+ Examples
162
+ --------
163
+ from agenta import AgentaApi
164
+
165
+ client = AgentaApi(
166
+ api_key="YOUR_API_KEY",
167
+ )
168
+ client.get_own_org()
169
+ """
170
+ _response = self._raw_client.get_own_org(request_options=request_options)
171
+ return _response.data
172
+
173
+ def update_organization(
174
+ self,
175
+ org_id: str,
176
+ *,
177
+ name: typing.Optional[str] = OMIT,
178
+ description: typing.Optional[str] = OMIT,
179
+ updated_at: typing.Optional[str] = OMIT,
180
+ request_options: typing.Optional[RequestOptions] = None,
181
+ ) -> typing.Optional[typing.Any]:
182
+ """
183
+ Parameters
184
+ ----------
185
+ org_id : str
186
+
187
+ name : typing.Optional[str]
188
+
189
+ description : typing.Optional[str]
190
+
191
+ updated_at : typing.Optional[str]
192
+
193
+ request_options : typing.Optional[RequestOptions]
194
+ Request-specific configuration.
195
+
196
+ Returns
197
+ -------
198
+ typing.Optional[typing.Any]
199
+ Successful Response
200
+
201
+ Examples
202
+ --------
203
+ from agenta import AgentaApi
204
+
205
+ client = AgentaApi(
206
+ api_key="YOUR_API_KEY",
207
+ )
208
+ client.update_organization(
209
+ org_id="org_id",
210
+ )
211
+ """
212
+ _response = self._raw_client.update_organization(
213
+ org_id,
214
+ name=name,
215
+ description=description,
216
+ updated_at=updated_at,
217
+ request_options=request_options,
218
+ )
219
+ return _response.data
220
+
221
+ def create_workspace(
222
+ self,
223
+ org_id: str,
224
+ *,
225
+ name: str,
226
+ description: typing.Optional[str] = OMIT,
227
+ type: typing.Optional[str] = OMIT,
228
+ request_options: typing.Optional[RequestOptions] = None,
229
+ ) -> WorkspaceResponse:
230
+ """
231
+ Parameters
232
+ ----------
233
+ org_id : str
234
+
235
+ name : str
236
+
237
+ description : typing.Optional[str]
238
+
239
+ type : typing.Optional[str]
240
+
241
+ request_options : typing.Optional[RequestOptions]
242
+ Request-specific configuration.
243
+
244
+ Returns
245
+ -------
246
+ WorkspaceResponse
247
+ Successful Response
248
+
249
+ Examples
250
+ --------
251
+ from agenta import AgentaApi
252
+
253
+ client = AgentaApi(
254
+ api_key="YOUR_API_KEY",
255
+ )
256
+ client.create_workspace(
257
+ org_id="org_id",
258
+ name="name",
259
+ )
260
+ """
261
+ _response = self._raw_client.create_workspace(
262
+ org_id,
263
+ name=name,
264
+ description=description,
265
+ type=type,
266
+ request_options=request_options,
267
+ )
268
+ return _response.data
269
+
270
+ def update_workspace(
271
+ self,
272
+ org_id: str,
273
+ workspace_id: str,
274
+ *,
275
+ name: typing.Optional[str] = OMIT,
276
+ description: typing.Optional[str] = OMIT,
277
+ updated_at: typing.Optional[dt.datetime] = OMIT,
278
+ request_options: typing.Optional[RequestOptions] = None,
279
+ ) -> WorkspaceResponse:
280
+ """
281
+ Parameters
282
+ ----------
283
+ org_id : str
284
+
285
+ workspace_id : str
286
+
287
+ name : typing.Optional[str]
288
+
289
+ description : typing.Optional[str]
290
+
291
+ updated_at : typing.Optional[dt.datetime]
292
+
293
+ request_options : typing.Optional[RequestOptions]
294
+ Request-specific configuration.
295
+
296
+ Returns
297
+ -------
298
+ WorkspaceResponse
299
+ Successful Response
300
+
301
+ Examples
302
+ --------
303
+ from agenta import AgentaApi
304
+
305
+ client = AgentaApi(
306
+ api_key="YOUR_API_KEY",
307
+ )
308
+ client.update_workspace(
309
+ org_id="org_id",
310
+ workspace_id="workspace_id",
311
+ )
312
+ """
313
+ _response = self._raw_client.update_workspace(
314
+ org_id,
315
+ workspace_id,
316
+ name=name,
317
+ description=description,
318
+ updated_at=updated_at,
319
+ request_options=request_options,
320
+ )
321
+ return _response.data
322
+
323
+ def get_all_workspace_permissions(
324
+ self, *, request_options: typing.Optional[RequestOptions] = None
325
+ ) -> typing.List[Permission]:
326
+ """
327
+ Get all workspace permissions.
328
+
329
+ Returns a list of all available workspace permissions.
330
+
331
+ Returns:
332
+ List[Permission]: A list of Permission objects representing the available workspace permissions.
333
+
334
+ Raises:
335
+ HTTPException: If there is an error retrieving the workspace permissions.
336
+
337
+ Parameters
338
+ ----------
339
+ request_options : typing.Optional[RequestOptions]
340
+ Request-specific configuration.
341
+
342
+ Returns
343
+ -------
344
+ typing.List[Permission]
345
+ Successful Response
346
+
347
+ Examples
348
+ --------
349
+ from agenta import AgentaApi
350
+
351
+ client = AgentaApi(
352
+ api_key="YOUR_API_KEY",
353
+ )
354
+ client.get_all_workspace_permissions()
355
+ """
356
+ _response = self._raw_client.get_all_workspace_permissions(
357
+ request_options=request_options
358
+ )
359
+ return _response.data
360
+
361
+ def assign_role_to_user(
362
+ self,
363
+ workspace_id: str,
364
+ *,
365
+ email: str,
366
+ organization_id: str,
367
+ role: typing.Optional[str] = OMIT,
368
+ request_options: typing.Optional[RequestOptions] = None,
369
+ ) -> typing.Optional[typing.Any]:
370
+ """
371
+ Assigns a role to a user in a workspace.
372
+
373
+ Args:
374
+ payload (UserRole): The payload containing the organization id, user email, and role to assign.
375
+ workspace_id (str): The ID of the workspace.
376
+ request (Request): The FastAPI request object.
377
+
378
+ Returns:
379
+ bool: True if the role was successfully assigned, False otherwise.
380
+
381
+ Raises:
382
+ HTTPException: If the user does not have permission to perform this action.
383
+ HTTPException: If there is an error assigning the role to the user.
384
+
385
+ Parameters
386
+ ----------
387
+ workspace_id : str
388
+
389
+ email : str
390
+
391
+ organization_id : str
392
+
393
+ role : typing.Optional[str]
394
+
395
+ request_options : typing.Optional[RequestOptions]
396
+ Request-specific configuration.
397
+
398
+ Returns
399
+ -------
400
+ typing.Optional[typing.Any]
401
+ Successful Response
402
+
403
+ Examples
404
+ --------
405
+ from agenta import AgentaApi
406
+
407
+ client = AgentaApi(
408
+ api_key="YOUR_API_KEY",
409
+ )
410
+ client.assign_role_to_user(
411
+ workspace_id="workspace_id",
412
+ email="email",
413
+ organization_id="organization_id",
414
+ )
415
+ """
416
+ _response = self._raw_client.assign_role_to_user(
417
+ workspace_id,
418
+ email=email,
419
+ organization_id=organization_id,
420
+ role=role,
421
+ request_options=request_options,
422
+ )
423
+ return _response.data
424
+
425
+ def unassign_role_from_user(
426
+ self,
427
+ workspace_id: str,
428
+ *,
429
+ email: str,
430
+ org_id: str,
431
+ role: str,
432
+ request_options: typing.Optional[RequestOptions] = None,
433
+ ) -> typing.Optional[typing.Any]:
434
+ """
435
+ Delete a role assignment from a user in a workspace.
436
+
437
+ Args:
438
+ workspace_id (str): The ID of the workspace.
439
+ email (str): The email of the user to remove the role from.
440
+ org_id (str): The ID of the organization.
441
+ role (str): The role to remove from the user.
442
+ request (Request): The FastAPI request object.
443
+
444
+ Returns:
445
+ bool: True if the role assignment was successfully deleted.
446
+
447
+ Raises:
448
+ HTTPException: If there is an error in the request or the user does not have permission to perform the action.
449
+ HTTPException: If there is an error in updating the user's roles.
450
+
451
+ Parameters
452
+ ----------
453
+ workspace_id : str
454
+
455
+ email : str
456
+
457
+ org_id : str
458
+
459
+ role : str
460
+
461
+ request_options : typing.Optional[RequestOptions]
462
+ Request-specific configuration.
463
+
464
+ Returns
465
+ -------
466
+ typing.Optional[typing.Any]
467
+ Successful Response
468
+
469
+ Examples
470
+ --------
471
+ from agenta import AgentaApi
472
+
473
+ client = AgentaApi(
474
+ api_key="YOUR_API_KEY",
475
+ )
476
+ client.unassign_role_from_user(
477
+ workspace_id="workspace_id",
478
+ email="email",
479
+ org_id="org_id",
480
+ role="role",
481
+ )
482
+ """
483
+ _response = self._raw_client.unassign_role_from_user(
484
+ workspace_id,
485
+ email=email,
486
+ org_id=org_id,
487
+ role=role,
488
+ request_options=request_options,
489
+ )
490
+ return _response.data
491
+
492
+ def delete_accounts(
493
+ self, *, request_options: typing.Optional[RequestOptions] = None
494
+ ) -> typing.Optional[typing.Any]:
495
+ """
496
+ Parameters
497
+ ----------
498
+ request_options : typing.Optional[RequestOptions]
499
+ Request-specific configuration.
500
+
501
+ Returns
502
+ -------
503
+ typing.Optional[typing.Any]
504
+ Successful Response
505
+
506
+ Examples
507
+ --------
508
+ from agenta import AgentaApi
509
+
510
+ client = AgentaApi(
511
+ api_key="YOUR_API_KEY",
512
+ )
513
+ client.delete_accounts()
514
+ """
515
+ _response = self._raw_client.delete_accounts(request_options=request_options)
516
+ return _response.data
517
+
518
+ def health_check(
519
+ self, *, request_options: typing.Optional[RequestOptions] = None
520
+ ) -> typing.Optional[typing.Any]:
521
+ """
522
+ Parameters
523
+ ----------
524
+ request_options : typing.Optional[RequestOptions]
525
+ Request-specific configuration.
526
+
527
+ Returns
528
+ -------
529
+ typing.Optional[typing.Any]
530
+ Successful Response
531
+
532
+ Examples
533
+ --------
534
+ from agenta import AgentaApi
535
+
536
+ client = AgentaApi(
537
+ api_key="YOUR_API_KEY",
538
+ )
539
+ client.health_check()
540
+ """
541
+ _response = self._raw_client.health_check(request_options=request_options)
542
+ return _response.data
543
+
544
+ def fetch_user_profile(
545
+ self, *, request_options: typing.Optional[RequestOptions] = None
546
+ ) -> typing.Optional[typing.Any]:
547
+ """
548
+ Parameters
549
+ ----------
550
+ request_options : typing.Optional[RequestOptions]
551
+ Request-specific configuration.
552
+
553
+ Returns
554
+ -------
555
+ typing.Optional[typing.Any]
556
+ Successful Response
557
+
558
+ Examples
559
+ --------
560
+ from agenta import AgentaApi
561
+
562
+ client = AgentaApi(
563
+ api_key="YOUR_API_KEY",
564
+ )
565
+ client.fetch_user_profile()
566
+ """
567
+ _response = self._raw_client.fetch_user_profile(request_options=request_options)
568
+ return _response.data
569
+
570
+ def reset_user_password(
571
+ self, *, user_id: str, request_options: typing.Optional[RequestOptions] = None
572
+ ) -> typing.Optional[typing.Any]:
573
+ """
574
+ Parameters
575
+ ----------
576
+ user_id : str
577
+
578
+ request_options : typing.Optional[RequestOptions]
579
+ Request-specific configuration.
580
+
581
+ Returns
582
+ -------
583
+ typing.Optional[typing.Any]
584
+ Successful Response
585
+
586
+ Examples
587
+ --------
588
+ from agenta import AgentaApi
589
+
590
+ client = AgentaApi(
591
+ api_key="YOUR_API_KEY",
592
+ )
593
+ client.reset_user_password(
594
+ user_id="user_id",
595
+ )
596
+ """
597
+ _response = self._raw_client.reset_user_password(
598
+ user_id=user_id, request_options=request_options
599
+ )
600
+ return _response.data
601
+
602
+
603
+ class AsyncAgentaApi:
604
+ """
605
+ Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.
606
+
607
+ Parameters
608
+ ----------
609
+ base_url : typing.Optional[str]
610
+ The base url to use for requests from the client.
611
+
612
+ environment : AgentaApiEnvironment
613
+ The environment to use for requests from the client. from .environment import AgentaApiEnvironment
614
+
615
+
616
+
617
+ Defaults to AgentaApiEnvironment.DEFAULT
618
+
619
+
620
+
621
+ api_key : str
622
+ timeout : typing.Optional[float]
623
+ The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
624
+
625
+ follow_redirects : typing.Optional[bool]
626
+ Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
627
+
628
+ httpx_client : typing.Optional[httpx.AsyncClient]
629
+ The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
630
+
631
+ Examples
632
+ --------
633
+ from agenta import AsyncAgentaApi
634
+
635
+ client = AsyncAgentaApi(
636
+ api_key="YOUR_API_KEY",
637
+ )
638
+ """
639
+
640
+ def __init__(
641
+ self,
642
+ *,
643
+ base_url: typing.Optional[str] = None,
644
+ environment: AgentaApiEnvironment = AgentaApiEnvironment.DEFAULT,
645
+ api_key: str,
646
+ timeout: typing.Optional[float] = None,
647
+ follow_redirects: typing.Optional[bool] = True,
648
+ httpx_client: typing.Optional[httpx.AsyncClient] = None,
649
+ ):
650
+ _defaulted_timeout = (
651
+ timeout
652
+ if timeout is not None
653
+ else 60
654
+ if httpx_client is None
655
+ else httpx_client.timeout.read
656
+ )
657
+ self._client_wrapper = AsyncClientWrapper(
658
+ base_url=_get_base_url(base_url=base_url, environment=environment),
659
+ api_key=api_key,
660
+ httpx_client=httpx_client
661
+ if httpx_client is not None
662
+ else httpx.AsyncClient(
663
+ timeout=_defaulted_timeout, follow_redirects=follow_redirects
664
+ )
665
+ if follow_redirects is not None
666
+ else httpx.AsyncClient(timeout=_defaulted_timeout),
667
+ timeout=_defaulted_timeout,
668
+ )
669
+ self._raw_client = AsyncRawAgentaApi(client_wrapper=self._client_wrapper)
670
+ self.admin = AsyncAdminClient(client_wrapper=self._client_wrapper)
671
+ self.organization = AsyncOrganizationClient(client_wrapper=self._client_wrapper)
672
+ self.evaluations = AsyncEvaluationsClient(client_wrapper=self._client_wrapper)
673
+ self.human_evaluations = AsyncHumanEvaluationsClient(
674
+ client_wrapper=self._client_wrapper
675
+ )
676
+ self.billing = AsyncBillingClient(client_wrapper=self._client_wrapper)
677
+ self.access_control = AsyncAccessControlClient(
678
+ client_wrapper=self._client_wrapper
679
+ )
680
+ self.scopes = AsyncScopesClient(client_wrapper=self._client_wrapper)
681
+ self.apps = AsyncAppsClient(client_wrapper=self._client_wrapper)
682
+ self.variants = AsyncVariantsClient(client_wrapper=self._client_wrapper)
683
+ self.containers = AsyncContainersClient(client_wrapper=self._client_wrapper)
684
+ self.evaluators = AsyncEvaluatorsClient(client_wrapper=self._client_wrapper)
685
+ self.testsets = AsyncTestsetsClient(client_wrapper=self._client_wrapper)
686
+ self.environments = AsyncEnvironmentsClient(client_wrapper=self._client_wrapper)
687
+ self.bases = AsyncBasesClient(client_wrapper=self._client_wrapper)
688
+ self.configs = AsyncConfigsClient(client_wrapper=self._client_wrapper)
689
+ self.api_keys = AsyncApiKeysClient(client_wrapper=self._client_wrapper)
690
+ self.workspace = AsyncWorkspaceClient(client_wrapper=self._client_wrapper)
691
+ self.tracing = AsyncTracingClient(client_wrapper=self._client_wrapper)
692
+ self.evals = AsyncEvalsClient(client_wrapper=self._client_wrapper)
693
+ self.workflows = AsyncWorkflowsClient(client_wrapper=self._client_wrapper)
694
+ self.observability = AsyncObservabilityClient(
695
+ client_wrapper=self._client_wrapper
696
+ )
697
+ self.vault = AsyncVaultClient(client_wrapper=self._client_wrapper)
698
+
699
+ @property
700
+ def with_raw_response(self) -> AsyncRawAgentaApi:
701
+ """
702
+ Retrieves a raw implementation of this client that returns raw responses.
703
+
704
+ Returns
705
+ -------
706
+ AsyncRawAgentaApi
707
+ """
708
+ return self._raw_client
709
+
710
+ async def get_own_org(
711
+ self, *, request_options: typing.Optional[RequestOptions] = None
712
+ ) -> OrganizationOutput:
713
+ """
714
+ Parameters
715
+ ----------
716
+ request_options : typing.Optional[RequestOptions]
717
+ Request-specific configuration.
718
+
719
+ Returns
720
+ -------
721
+ OrganizationOutput
722
+ Successful Response
723
+
724
+ Examples
725
+ --------
726
+ import asyncio
727
+
728
+ from agenta import AsyncAgentaApi
729
+
730
+ client = AsyncAgentaApi(
731
+ api_key="YOUR_API_KEY",
732
+ )
733
+
734
+
735
+ async def main() -> None:
736
+ await client.get_own_org()
737
+
738
+
739
+ asyncio.run(main())
740
+ """
741
+ _response = await self._raw_client.get_own_org(request_options=request_options)
742
+ return _response.data
743
+
744
+ async def update_organization(
745
+ self,
746
+ org_id: str,
747
+ *,
748
+ name: typing.Optional[str] = OMIT,
749
+ description: typing.Optional[str] = OMIT,
750
+ updated_at: typing.Optional[str] = OMIT,
751
+ request_options: typing.Optional[RequestOptions] = None,
752
+ ) -> typing.Optional[typing.Any]:
753
+ """
754
+ Parameters
755
+ ----------
756
+ org_id : str
757
+
758
+ name : typing.Optional[str]
759
+
760
+ description : typing.Optional[str]
761
+
762
+ updated_at : typing.Optional[str]
763
+
764
+ request_options : typing.Optional[RequestOptions]
765
+ Request-specific configuration.
766
+
767
+ Returns
768
+ -------
769
+ typing.Optional[typing.Any]
770
+ Successful Response
771
+
772
+ Examples
773
+ --------
774
+ import asyncio
775
+
776
+ from agenta import AsyncAgentaApi
777
+
778
+ client = AsyncAgentaApi(
779
+ api_key="YOUR_API_KEY",
780
+ )
781
+
782
+
783
+ async def main() -> None:
784
+ await client.update_organization(
785
+ org_id="org_id",
786
+ )
787
+
788
+
789
+ asyncio.run(main())
790
+ """
791
+ _response = await self._raw_client.update_organization(
792
+ org_id,
793
+ name=name,
794
+ description=description,
795
+ updated_at=updated_at,
796
+ request_options=request_options,
797
+ )
798
+ return _response.data
799
+
800
+ async def create_workspace(
801
+ self,
802
+ org_id: str,
803
+ *,
804
+ name: str,
805
+ description: typing.Optional[str] = OMIT,
806
+ type: typing.Optional[str] = OMIT,
807
+ request_options: typing.Optional[RequestOptions] = None,
808
+ ) -> WorkspaceResponse:
809
+ """
810
+ Parameters
811
+ ----------
812
+ org_id : str
813
+
814
+ name : str
815
+
816
+ description : typing.Optional[str]
817
+
818
+ type : typing.Optional[str]
819
+
820
+ request_options : typing.Optional[RequestOptions]
821
+ Request-specific configuration.
822
+
823
+ Returns
824
+ -------
825
+ WorkspaceResponse
826
+ Successful Response
827
+
828
+ Examples
829
+ --------
830
+ import asyncio
831
+
832
+ from agenta import AsyncAgentaApi
833
+
834
+ client = AsyncAgentaApi(
835
+ api_key="YOUR_API_KEY",
836
+ )
837
+
838
+
839
+ async def main() -> None:
840
+ await client.create_workspace(
841
+ org_id="org_id",
842
+ name="name",
843
+ )
844
+
845
+
846
+ asyncio.run(main())
847
+ """
848
+ _response = await self._raw_client.create_workspace(
849
+ org_id,
850
+ name=name,
851
+ description=description,
852
+ type=type,
853
+ request_options=request_options,
854
+ )
855
+ return _response.data
856
+
857
+ async def update_workspace(
858
+ self,
859
+ org_id: str,
860
+ workspace_id: str,
861
+ *,
862
+ name: typing.Optional[str] = OMIT,
863
+ description: typing.Optional[str] = OMIT,
864
+ updated_at: typing.Optional[dt.datetime] = OMIT,
865
+ request_options: typing.Optional[RequestOptions] = None,
866
+ ) -> WorkspaceResponse:
867
+ """
868
+ Parameters
869
+ ----------
870
+ org_id : str
871
+
872
+ workspace_id : str
873
+
874
+ name : typing.Optional[str]
875
+
876
+ description : typing.Optional[str]
877
+
878
+ updated_at : typing.Optional[dt.datetime]
879
+
880
+ request_options : typing.Optional[RequestOptions]
881
+ Request-specific configuration.
882
+
883
+ Returns
884
+ -------
885
+ WorkspaceResponse
886
+ Successful Response
887
+
888
+ Examples
889
+ --------
890
+ import asyncio
891
+
892
+ from agenta import AsyncAgentaApi
893
+
894
+ client = AsyncAgentaApi(
895
+ api_key="YOUR_API_KEY",
896
+ )
897
+
898
+
899
+ async def main() -> None:
900
+ await client.update_workspace(
901
+ org_id="org_id",
902
+ workspace_id="workspace_id",
903
+ )
904
+
905
+
906
+ asyncio.run(main())
907
+ """
908
+ _response = await self._raw_client.update_workspace(
909
+ org_id,
910
+ workspace_id,
911
+ name=name,
912
+ description=description,
913
+ updated_at=updated_at,
914
+ request_options=request_options,
915
+ )
916
+ return _response.data
917
+
918
+ async def get_all_workspace_permissions(
919
+ self, *, request_options: typing.Optional[RequestOptions] = None
920
+ ) -> typing.List[Permission]:
921
+ """
922
+ Get all workspace permissions.
923
+
924
+ Returns a list of all available workspace permissions.
925
+
926
+ Returns:
927
+ List[Permission]: A list of Permission objects representing the available workspace permissions.
928
+
929
+ Raises:
930
+ HTTPException: If there is an error retrieving the workspace permissions.
931
+
932
+ Parameters
933
+ ----------
934
+ request_options : typing.Optional[RequestOptions]
935
+ Request-specific configuration.
936
+
937
+ Returns
938
+ -------
939
+ typing.List[Permission]
940
+ Successful Response
941
+
942
+ Examples
943
+ --------
944
+ import asyncio
945
+
946
+ from agenta import AsyncAgentaApi
947
+
948
+ client = AsyncAgentaApi(
949
+ api_key="YOUR_API_KEY",
950
+ )
951
+
952
+
953
+ async def main() -> None:
954
+ await client.get_all_workspace_permissions()
955
+
956
+
957
+ asyncio.run(main())
958
+ """
959
+ _response = await self._raw_client.get_all_workspace_permissions(
960
+ request_options=request_options
961
+ )
962
+ return _response.data
963
+
964
+ async def assign_role_to_user(
965
+ self,
966
+ workspace_id: str,
967
+ *,
968
+ email: str,
969
+ organization_id: str,
970
+ role: typing.Optional[str] = OMIT,
971
+ request_options: typing.Optional[RequestOptions] = None,
972
+ ) -> typing.Optional[typing.Any]:
973
+ """
974
+ Assigns a role to a user in a workspace.
975
+
976
+ Args:
977
+ payload (UserRole): The payload containing the organization id, user email, and role to assign.
978
+ workspace_id (str): The ID of the workspace.
979
+ request (Request): The FastAPI request object.
980
+
981
+ Returns:
982
+ bool: True if the role was successfully assigned, False otherwise.
983
+
984
+ Raises:
985
+ HTTPException: If the user does not have permission to perform this action.
986
+ HTTPException: If there is an error assigning the role to the user.
987
+
988
+ Parameters
989
+ ----------
990
+ workspace_id : str
991
+
992
+ email : str
993
+
994
+ organization_id : str
995
+
996
+ role : typing.Optional[str]
997
+
998
+ request_options : typing.Optional[RequestOptions]
999
+ Request-specific configuration.
1000
+
1001
+ Returns
1002
+ -------
1003
+ typing.Optional[typing.Any]
1004
+ Successful Response
1005
+
1006
+ Examples
1007
+ --------
1008
+ import asyncio
1009
+
1010
+ from agenta import AsyncAgentaApi
1011
+
1012
+ client = AsyncAgentaApi(
1013
+ api_key="YOUR_API_KEY",
1014
+ )
1015
+
1016
+
1017
+ async def main() -> None:
1018
+ await client.assign_role_to_user(
1019
+ workspace_id="workspace_id",
1020
+ email="email",
1021
+ organization_id="organization_id",
1022
+ )
1023
+
1024
+
1025
+ asyncio.run(main())
1026
+ """
1027
+ _response = await self._raw_client.assign_role_to_user(
1028
+ workspace_id,
1029
+ email=email,
1030
+ organization_id=organization_id,
1031
+ role=role,
1032
+ request_options=request_options,
1033
+ )
1034
+ return _response.data
1035
+
1036
+ async def unassign_role_from_user(
1037
+ self,
1038
+ workspace_id: str,
1039
+ *,
1040
+ email: str,
1041
+ org_id: str,
1042
+ role: str,
1043
+ request_options: typing.Optional[RequestOptions] = None,
1044
+ ) -> typing.Optional[typing.Any]:
1045
+ """
1046
+ Delete a role assignment from a user in a workspace.
1047
+
1048
+ Args:
1049
+ workspace_id (str): The ID of the workspace.
1050
+ email (str): The email of the user to remove the role from.
1051
+ org_id (str): The ID of the organization.
1052
+ role (str): The role to remove from the user.
1053
+ request (Request): The FastAPI request object.
1054
+
1055
+ Returns:
1056
+ bool: True if the role assignment was successfully deleted.
1057
+
1058
+ Raises:
1059
+ HTTPException: If there is an error in the request or the user does not have permission to perform the action.
1060
+ HTTPException: If there is an error in updating the user's roles.
1061
+
1062
+ Parameters
1063
+ ----------
1064
+ workspace_id : str
1065
+
1066
+ email : str
1067
+
1068
+ org_id : str
1069
+
1070
+ role : str
1071
+
1072
+ request_options : typing.Optional[RequestOptions]
1073
+ Request-specific configuration.
1074
+
1075
+ Returns
1076
+ -------
1077
+ typing.Optional[typing.Any]
1078
+ Successful Response
1079
+
1080
+ Examples
1081
+ --------
1082
+ import asyncio
1083
+
1084
+ from agenta import AsyncAgentaApi
1085
+
1086
+ client = AsyncAgentaApi(
1087
+ api_key="YOUR_API_KEY",
1088
+ )
1089
+
1090
+
1091
+ async def main() -> None:
1092
+ await client.unassign_role_from_user(
1093
+ workspace_id="workspace_id",
1094
+ email="email",
1095
+ org_id="org_id",
1096
+ role="role",
1097
+ )
1098
+
1099
+
1100
+ asyncio.run(main())
1101
+ """
1102
+ _response = await self._raw_client.unassign_role_from_user(
1103
+ workspace_id,
1104
+ email=email,
1105
+ org_id=org_id,
1106
+ role=role,
1107
+ request_options=request_options,
1108
+ )
1109
+ return _response.data
1110
+
1111
+ async def delete_accounts(
1112
+ self, *, request_options: typing.Optional[RequestOptions] = None
1113
+ ) -> typing.Optional[typing.Any]:
1114
+ """
1115
+ Parameters
1116
+ ----------
1117
+ request_options : typing.Optional[RequestOptions]
1118
+ Request-specific configuration.
1119
+
1120
+ Returns
1121
+ -------
1122
+ typing.Optional[typing.Any]
1123
+ Successful Response
1124
+
1125
+ Examples
1126
+ --------
1127
+ import asyncio
1128
+
1129
+ from agenta import AsyncAgentaApi
1130
+
1131
+ client = AsyncAgentaApi(
1132
+ api_key="YOUR_API_KEY",
1133
+ )
1134
+
1135
+
1136
+ async def main() -> None:
1137
+ await client.delete_accounts()
1138
+
1139
+
1140
+ asyncio.run(main())
1141
+ """
1142
+ _response = await self._raw_client.delete_accounts(
1143
+ request_options=request_options
1144
+ )
1145
+ return _response.data
1146
+
1147
+ async def health_check(
1148
+ self, *, request_options: typing.Optional[RequestOptions] = None
1149
+ ) -> typing.Optional[typing.Any]:
1150
+ """
1151
+ Parameters
1152
+ ----------
1153
+ request_options : typing.Optional[RequestOptions]
1154
+ Request-specific configuration.
1155
+
1156
+ Returns
1157
+ -------
1158
+ typing.Optional[typing.Any]
1159
+ Successful Response
1160
+
1161
+ Examples
1162
+ --------
1163
+ import asyncio
1164
+
1165
+ from agenta import AsyncAgentaApi
1166
+
1167
+ client = AsyncAgentaApi(
1168
+ api_key="YOUR_API_KEY",
1169
+ )
1170
+
1171
+
1172
+ async def main() -> None:
1173
+ await client.health_check()
1174
+
1175
+
1176
+ asyncio.run(main())
1177
+ """
1178
+ _response = await self._raw_client.health_check(request_options=request_options)
1179
+ return _response.data
1180
+
1181
+ async def fetch_user_profile(
1182
+ self, *, request_options: typing.Optional[RequestOptions] = None
1183
+ ) -> typing.Optional[typing.Any]:
1184
+ """
1185
+ Parameters
1186
+ ----------
1187
+ request_options : typing.Optional[RequestOptions]
1188
+ Request-specific configuration.
1189
+
1190
+ Returns
1191
+ -------
1192
+ typing.Optional[typing.Any]
1193
+ Successful Response
1194
+
1195
+ Examples
1196
+ --------
1197
+ import asyncio
1198
+
1199
+ from agenta import AsyncAgentaApi
1200
+
1201
+ client = AsyncAgentaApi(
1202
+ api_key="YOUR_API_KEY",
1203
+ )
1204
+
1205
+
1206
+ async def main() -> None:
1207
+ await client.fetch_user_profile()
1208
+
1209
+
1210
+ asyncio.run(main())
1211
+ """
1212
+ _response = await self._raw_client.fetch_user_profile(
1213
+ request_options=request_options
1214
+ )
1215
+ return _response.data
1216
+
1217
+ async def reset_user_password(
1218
+ self, *, user_id: str, request_options: typing.Optional[RequestOptions] = None
1219
+ ) -> typing.Optional[typing.Any]:
1220
+ """
1221
+ Parameters
1222
+ ----------
1223
+ user_id : str
1224
+
1225
+ request_options : typing.Optional[RequestOptions]
1226
+ Request-specific configuration.
1227
+
1228
+ Returns
1229
+ -------
1230
+ typing.Optional[typing.Any]
1231
+ Successful Response
1232
+
1233
+ Examples
1234
+ --------
1235
+ import asyncio
1236
+
1237
+ from agenta import AsyncAgentaApi
1238
+
1239
+ client = AsyncAgentaApi(
1240
+ api_key="YOUR_API_KEY",
1241
+ )
1242
+
1243
+
1244
+ async def main() -> None:
1245
+ await client.reset_user_password(
1246
+ user_id="user_id",
1247
+ )
1248
+
1249
+
1250
+ asyncio.run(main())
1251
+ """
1252
+ _response = await self._raw_client.reset_user_password(
1253
+ user_id=user_id, request_options=request_options
1254
+ )
1255
+ return _response.data
1256
+
1257
+
1258
+ def _get_base_url(
1259
+ *, base_url: typing.Optional[str] = None, environment: AgentaApiEnvironment
1260
+ ) -> str:
1261
+ if base_url is not None:
1262
+ return base_url
1263
+ elif environment is not None:
1264
+ return environment.value
1265
+ else:
1266
+ raise Exception(
1267
+ "Please pass in either base_url or environment to construct the client"
1268
+ )