agenta 0.48.9__py3-none-any.whl → 0.49.0__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 +3 -2
- agenta/client/Readme.md +258 -80
- agenta/client/__init__.py +205 -29
- agenta/client/backend/__init__.py +461 -0
- agenta/client/backend/access_control/__init__.py +2 -0
- agenta/client/backend/access_control/client.py +53 -73
- agenta/client/backend/access_control/raw_client.py +180 -0
- agenta/client/backend/admin/__init__.py +2 -0
- agenta/client/backend/admin/client.py +473 -268
- agenta/client/backend/admin/raw_client.py +1017 -0
- agenta/client/backend/api_keys/__init__.py +2 -0
- agenta/client/backend/api_keys/client.py +43 -276
- agenta/client/backend/api_keys/raw_client.py +364 -0
- agenta/client/backend/apps/__init__.py +2 -0
- agenta/client/backend/apps/client.py +132 -895
- agenta/client/backend/apps/raw_client.py +1516 -0
- agenta/client/backend/bases/__init__.py +2 -0
- agenta/client/backend/bases/client.py +33 -73
- agenta/client/backend/bases/raw_client.py +179 -0
- agenta/client/backend/billing/__init__.py +3 -0
- agenta/client/backend/billing/client.py +564 -0
- agenta/client/backend/billing/raw_client.py +805 -0
- agenta/client/backend/client.py +1268 -0
- agenta/client/backend/configs/__init__.py +2 -0
- agenta/client/backend/configs/client.py +49 -361
- agenta/client/backend/configs/raw_client.py +402 -0
- agenta/client/backend/containers/__init__.py +1 -3
- agenta/client/backend/containers/client.py +25 -548
- agenta/client/backend/containers/raw_client.py +112 -0
- agenta/client/backend/core/__init__.py +5 -0
- agenta/client/backend/core/api_error.py +12 -6
- agenta/client/backend/core/client_wrapper.py +4 -4
- agenta/client/backend/core/file.py +1 -3
- agenta/client/backend/core/force_multipart.py +16 -0
- agenta/client/backend/core/http_client.py +78 -34
- agenta/client/backend/core/http_response.py +55 -0
- agenta/client/backend/core/jsonable_encoder.py +0 -1
- agenta/client/backend/core/pydantic_utilities.py +88 -113
- agenta/client/backend/core/serialization.py +9 -3
- agenta/client/backend/environment.py +7 -0
- agenta/client/backend/environments/__init__.py +2 -0
- agenta/client/backend/environments/client.py +43 -79
- agenta/client/backend/environments/raw_client.py +193 -0
- agenta/client/backend/errors/__init__.py +2 -0
- agenta/client/backend/errors/unprocessable_entity_error.py +8 -2
- agenta/client/backend/evals/__init__.py +3 -0
- agenta/client/backend/evals/client.py +1042 -0
- agenta/client/backend/evals/raw_client.py +1549 -0
- agenta/client/backend/evaluations/__init__.py +2 -0
- agenta/client/backend/evaluations/client.py +106 -590
- agenta/client/backend/evaluations/raw_client.py +1344 -0
- agenta/client/backend/evaluators/__init__.py +2 -0
- agenta/client/backend/evaluators/client.py +99 -516
- agenta/client/backend/evaluators/raw_client.py +1182 -0
- agenta/client/backend/human_evaluations/__init__.py +2 -0
- agenta/client/backend/human_evaluations/client.py +120 -680
- agenta/client/backend/human_evaluations/raw_client.py +1577 -0
- agenta/client/backend/observability/__init__.py +14 -2
- agenta/client/backend/observability/client.py +185 -341
- agenta/client/backend/observability/raw_client.py +943 -0
- agenta/client/backend/observability/types/__init__.py +10 -2
- agenta/client/backend/observability/types/{format.py → fetch_trace_by_id_request_trace_id.py} +1 -1
- agenta/client/backend/observability/types/fetch_trace_by_id_response.py +15 -0
- agenta/client/backend/observability/types/query_analytics_response.py +2 -1
- agenta/client/backend/observability/types/query_traces_response.py +7 -3
- agenta/client/backend/organization/__init__.py +2 -0
- agenta/client/backend/organization/client.py +105 -361
- agenta/client/backend/organization/raw_client.py +774 -0
- agenta/client/backend/raw_client.py +1432 -0
- agenta/client/backend/scopes/__init__.py +2 -0
- agenta/client/backend/scopes/client.py +31 -45
- agenta/client/backend/scopes/raw_client.py +105 -0
- agenta/client/backend/testsets/__init__.py +14 -0
- agenta/client/backend/testsets/client.py +1098 -653
- agenta/client/backend/testsets/raw_client.py +2348 -0
- agenta/client/backend/testsets/types/__init__.py +17 -0
- agenta/client/backend/testsets/types/create_testset_from_file_request_file_type.py +7 -0
- agenta/client/backend/testsets/types/fetch_testset_to_file_request_file_type.py +7 -0
- agenta/client/backend/testsets/types/update_testset_from_file_request_file_type.py +7 -0
- agenta/client/backend/tracing/__init__.py +7 -0
- agenta/client/backend/tracing/client.py +782 -0
- agenta/client/backend/tracing/raw_client.py +1223 -0
- agenta/client/backend/tracing/types/__init__.py +8 -0
- agenta/client/backend/{types/variant_action_enum.py → tracing/types/fetch_trace_request_trace_id.py} +1 -1
- agenta/client/backend/tracing/types/remove_trace_request_trace_id.py +5 -0
- agenta/client/backend/types/__init__.py +153 -26
- agenta/client/backend/types/account_request.py +24 -0
- agenta/client/backend/types/account_response.py +5 -7
- agenta/client/backend/types/agenta_node_dto.py +13 -13
- agenta/client/backend/types/agenta_node_dto_nodes_value.py +1 -0
- agenta/client/backend/types/agenta_nodes_response.py +14 -8
- agenta/client/backend/types/agenta_root_dto.py +16 -8
- agenta/client/backend/types/agenta_roots_response.py +16 -8
- agenta/client/backend/types/agenta_tree_dto.py +16 -8
- agenta/client/backend/types/agenta_trees_response.py +16 -8
- agenta/client/backend/types/aggregated_result.py +5 -7
- agenta/client/backend/types/aggregated_result_evaluator_config.py +1 -0
- agenta/client/backend/types/analytics_response.py +4 -6
- agenta/client/backend/types/annotation.py +50 -0
- agenta/client/backend/types/annotation_create.py +39 -0
- agenta/client/backend/types/annotation_edit.py +31 -0
- agenta/client/backend/types/annotation_kind.py +5 -0
- agenta/client/backend/types/{uri.py → annotation_link.py} +6 -7
- agenta/client/backend/types/{provider_key_dto.py → annotation_link_response.py} +6 -7
- agenta/client/backend/types/annotation_query.py +40 -0
- agenta/client/backend/types/annotation_query_request.py +20 -0
- agenta/client/backend/types/annotation_reference.py +21 -0
- agenta/client/backend/types/annotation_references.py +22 -0
- agenta/client/backend/types/{docker_env_vars.py → annotation_response.py} +6 -7
- agenta/client/backend/types/annotation_source.py +5 -0
- agenta/client/backend/types/annotations_response.py +24 -0
- agenta/client/backend/types/app.py +3 -5
- agenta/client/backend/types/app_variant_response.py +3 -6
- agenta/client/backend/types/app_variant_revision.py +5 -6
- agenta/client/backend/types/artifact.py +44 -0
- agenta/client/backend/types/base_output.py +3 -5
- agenta/client/backend/types/body_fetch_workflow_revision.py +21 -0
- agenta/client/backend/types/body_import_testset.py +3 -5
- agenta/client/backend/types/bucket_dto.py +4 -6
- agenta/client/backend/types/collect_status_response.py +3 -5
- agenta/client/backend/types/config_db.py +3 -5
- agenta/client/backend/types/config_dto.py +5 -7
- agenta/client/backend/types/config_response_model.py +5 -7
- agenta/client/backend/types/correct_answer.py +3 -5
- agenta/client/backend/types/create_app_output.py +3 -5
- agenta/client/backend/types/custom_model_settings_dto.py +3 -5
- agenta/client/backend/types/custom_provider_dto.py +6 -9
- agenta/client/backend/types/custom_provider_kind.py +5 -5
- agenta/client/backend/types/custom_provider_settings_dto.py +3 -5
- agenta/client/backend/types/data.py +2 -1
- agenta/client/backend/types/delete_evaluation.py +3 -5
- agenta/client/backend/types/environment_output.py +3 -5
- agenta/client/backend/types/environment_output_extended.py +4 -6
- agenta/client/backend/types/environment_revision.py +5 -5
- agenta/client/backend/types/error.py +3 -5
- agenta/client/backend/types/evaluation.py +6 -8
- agenta/client/backend/types/evaluation_scenario.py +5 -7
- agenta/client/backend/types/evaluation_scenario_input.py +3 -5
- agenta/client/backend/types/evaluation_scenario_output.py +4 -6
- agenta/client/backend/types/evaluation_scenario_result.py +4 -6
- agenta/client/backend/types/evaluator.py +31 -12
- agenta/client/backend/types/evaluator_config.py +3 -5
- agenta/client/backend/types/evaluator_flags.py +21 -0
- agenta/client/backend/types/evaluator_mapping_output_interface.py +3 -5
- agenta/client/backend/types/evaluator_output_interface.py +3 -5
- agenta/client/backend/types/evaluator_query.py +32 -0
- agenta/client/backend/types/evaluator_query_request.py +30 -0
- agenta/client/backend/types/evaluator_request.py +20 -0
- agenta/client/backend/types/evaluator_response.py +21 -0
- agenta/client/backend/types/evaluators_response.py +21 -0
- agenta/client/backend/types/exception_dto.py +3 -5
- agenta/client/backend/types/{o_tel_spans_response.py → extended_o_tel_tracing_response.py} +5 -7
- agenta/client/backend/types/focus.py +5 -0
- agenta/client/backend/types/format.py +5 -0
- agenta/client/backend/types/full_json_input.py +34 -0
- agenta/client/backend/types/full_json_output.py +29 -0
- agenta/client/backend/types/get_config_response.py +3 -5
- agenta/client/backend/types/{header_dto.py → header.py} +4 -6
- agenta/client/backend/types/http_validation_error.py +4 -6
- agenta/client/backend/types/human_evaluation.py +3 -5
- agenta/client/backend/types/human_evaluation_scenario.py +4 -6
- agenta/client/backend/types/human_evaluation_scenario_input.py +3 -5
- agenta/client/backend/types/human_evaluation_scenario_output.py +3 -5
- agenta/client/backend/types/invite_request.py +4 -6
- agenta/client/backend/types/legacy_analytics_response.py +4 -6
- agenta/client/backend/types/legacy_data_point.py +3 -5
- agenta/client/backend/types/legacy_evaluator.py +26 -0
- agenta/client/backend/types/legacy_scope_request.py +4 -6
- agenta/client/backend/types/legacy_scopes_response.py +3 -5
- agenta/client/backend/types/legacy_subscription_request.py +19 -0
- agenta/client/backend/types/legacy_user_request.py +5 -7
- agenta/client/backend/types/legacy_user_response.py +3 -5
- agenta/client/backend/types/lifecycle_dto.py +3 -5
- agenta/client/backend/types/link_dto.py +4 -6
- agenta/client/backend/types/list_api_keys_response.py +3 -5
- agenta/client/backend/types/llm_run_rate_limit.py +3 -5
- agenta/client/backend/types/meta_request.py +30 -0
- agenta/client/backend/types/metrics_dto.py +3 -5
- agenta/client/backend/types/new_testset.py +3 -5
- agenta/client/backend/types/node_dto.py +4 -6
- agenta/client/backend/types/o_tel_context_dto.py +3 -5
- agenta/client/backend/types/o_tel_event.py +35 -0
- agenta/client/backend/types/o_tel_event_dto.py +3 -5
- agenta/client/backend/types/o_tel_extra_dto.py +4 -6
- agenta/client/backend/types/o_tel_flat_span.py +56 -0
- agenta/client/backend/types/o_tel_flat_span_input_end_time.py +6 -0
- agenta/client/backend/types/o_tel_flat_span_input_start_time.py +6 -0
- agenta/client/backend/types/o_tel_flat_span_output_end_time.py +6 -0
- agenta/client/backend/types/o_tel_flat_span_output_start_time.py +6 -0
- agenta/client/backend/types/o_tel_link.py +34 -0
- agenta/client/backend/types/o_tel_link_dto.py +4 -6
- agenta/client/backend/types/o_tel_links_response.py +22 -0
- agenta/client/backend/types/o_tel_span.py +58 -0
- agenta/client/backend/types/o_tel_span_dto.py +8 -10
- agenta/client/backend/types/o_tel_span_input_end_time.py +6 -0
- agenta/client/backend/types/o_tel_span_input_spans_value.py +7 -0
- agenta/client/backend/types/o_tel_span_input_start_time.py +6 -0
- agenta/client/backend/types/o_tel_span_output_end_time.py +6 -0
- agenta/client/backend/types/o_tel_span_output_spans_value.py +30 -0
- agenta/client/backend/types/o_tel_span_output_start_time.py +6 -0
- agenta/client/backend/types/o_tel_spans_tree.py +22 -0
- agenta/client/backend/types/o_tel_spans_tree_input_spans_value.py +7 -0
- agenta/client/backend/types/o_tel_spans_tree_output_spans_value.py +5 -0
- agenta/client/backend/types/o_tel_status_code.py +1 -1
- agenta/client/backend/types/o_tel_tracing_data_response.py +22 -0
- agenta/client/backend/types/o_tel_tracing_request.py +22 -0
- agenta/client/backend/types/o_tel_tracing_response.py +27 -0
- agenta/client/backend/types/organization.py +3 -5
- agenta/client/backend/types/organization_details.py +3 -5
- agenta/client/backend/types/organization_membership_request.py +5 -7
- agenta/client/backend/types/organization_output.py +3 -5
- agenta/client/backend/types/organization_request.py +3 -5
- agenta/client/backend/types/parent_dto.py +3 -5
- agenta/client/backend/types/permission.py +11 -0
- agenta/client/backend/types/plan.py +14 -0
- agenta/client/backend/types/project_membership_request.py +5 -7
- agenta/client/backend/types/project_request.py +4 -6
- agenta/client/backend/types/project_scope.py +5 -7
- agenta/client/backend/types/projects_response.py +3 -5
- agenta/client/backend/types/recursive_types.py +23 -0
- agenta/client/backend/types/reference.py +18 -5
- agenta/client/backend/types/reference_dto.py +4 -5
- agenta/client/backend/types/reference_request_model.py +4 -5
- agenta/client/backend/types/result.py +4 -6
- agenta/client/backend/types/root_dto.py +3 -5
- agenta/client/backend/types/scopes_response_model.py +4 -6
- agenta/client/backend/types/secret_dto.py +5 -7
- agenta/client/backend/types/secret_response_dto.py +11 -11
- agenta/client/backend/types/simple_evaluation_output.py +4 -6
- agenta/client/backend/types/span_dto.py +18 -14
- agenta/client/backend/types/span_dto_nodes_value.py +1 -1
- agenta/client/backend/types/standard_provider_dto.py +5 -7
- agenta/client/backend/types/standard_provider_settings_dto.py +3 -5
- agenta/client/backend/types/status_dto.py +4 -6
- agenta/client/backend/types/tags_request.py +30 -0
- agenta/client/backend/types/test_set_output_response.py +5 -7
- agenta/client/backend/types/test_set_simple_response.py +3 -5
- agenta/client/backend/types/testcase_response.py +33 -0
- agenta/client/backend/types/testset.py +46 -0
- agenta/client/backend/types/testset_request.py +20 -0
- agenta/client/backend/types/testset_response.py +21 -0
- agenta/client/backend/types/testsets_response.py +21 -0
- agenta/client/backend/types/time_dto.py +3 -5
- agenta/client/backend/types/timestamp.py +6 -0
- agenta/client/backend/types/tree_dto.py +4 -6
- agenta/client/backend/types/update_app_output.py +3 -5
- agenta/client/backend/types/user_request.py +3 -5
- agenta/client/backend/types/validation_error.py +4 -6
- agenta/client/backend/types/workflow_artifact.py +45 -0
- agenta/client/backend/types/workflow_data.py +20 -0
- agenta/client/backend/types/workflow_flags.py +21 -0
- agenta/client/backend/types/workflow_request.py +20 -0
- agenta/client/backend/types/workflow_response.py +21 -0
- agenta/client/backend/types/workflow_revision.py +57 -0
- agenta/client/backend/types/workflow_revision_request.py +20 -0
- agenta/client/backend/types/workflow_revision_response.py +21 -0
- agenta/client/backend/types/workflow_revisions_response.py +21 -0
- agenta/client/backend/types/workflow_variant.py +48 -0
- agenta/client/backend/types/workflow_variant_request.py +20 -0
- agenta/client/backend/types/workflow_variant_response.py +21 -0
- agenta/client/backend/types/workflow_variants_response.py +21 -0
- agenta/client/backend/types/workflows_response.py +21 -0
- agenta/client/backend/types/workspace.py +3 -5
- agenta/client/backend/types/workspace_member_response.py +4 -6
- agenta/client/backend/types/workspace_membership_request.py +5 -7
- agenta/client/backend/types/workspace_permission.py +5 -7
- agenta/client/backend/types/workspace_request.py +4 -6
- agenta/client/backend/types/workspace_response.py +4 -6
- agenta/client/backend/variants/__init__.py +2 -0
- agenta/client/backend/variants/client.py +306 -1651
- agenta/client/backend/variants/raw_client.py +2482 -0
- agenta/client/backend/variants/types/__init__.py +2 -0
- agenta/client/backend/variants/types/add_variant_from_base_and_config_response.py +1 -0
- agenta/client/backend/vault/__init__.py +2 -0
- agenta/client/backend/vault/client.py +69 -323
- agenta/client/backend/vault/raw_client.py +616 -0
- agenta/client/backend/workflows/__init__.py +3 -0
- agenta/client/backend/workflows/client.py +2398 -0
- agenta/client/backend/workflows/raw_client.py +3639 -0
- agenta/client/backend/workspace/__init__.py +2 -0
- agenta/client/backend/workspace/client.py +46 -147
- agenta/client/backend/workspace/raw_client.py +376 -0
- agenta/client/types.py +4 -0
- agenta/sdk/litellm/mocks/__init__.py +144 -0
- agenta/sdk/middleware/auth.py +26 -25
- agenta/sdk/types.py +28 -1
- {agenta-0.48.9.dist-info → agenta-0.49.0.dist-info}/METADATA +1 -1
- agenta-0.49.0.dist-info/RECORD +362 -0
- agenta/client/backend/containers/types/__init__.py +0 -5
- agenta/client/backend/containers/types/container_templates_response.py +0 -6
- agenta/client/backend/types/image.py +0 -25
- agenta/client/backend/types/provider_kind.py +0 -21
- agenta/client/backend/types/template.py +0 -23
- agenta/client/backend/types/template_image_info.py +0 -29
- agenta/client/backend/types/variant_action.py +0 -22
- agenta-0.48.9.dist-info/RECORD +0 -255
- {agenta-0.48.9.dist-info → agenta-0.49.0.dist-info}/WHEEL +0 -0
|
@@ -1,26 +1,21 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
3
|
import typing
|
|
4
|
-
|
|
5
|
-
from ..
|
|
6
|
-
from ..
|
|
7
|
-
from ..types.
|
|
8
|
-
from ..types.
|
|
4
|
+
|
|
5
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
|
+
from ..core.request_options import RequestOptions
|
|
7
|
+
from ..types.account_request import AccountRequest
|
|
8
|
+
from ..types.account_response import AccountResponse
|
|
9
9
|
from ..types.organization_membership_request import OrganizationMembershipRequest
|
|
10
|
-
from ..types.
|
|
10
|
+
from ..types.organization_request import OrganizationRequest
|
|
11
|
+
from ..types.plan import Plan
|
|
11
12
|
from ..types.project_membership_request import ProjectMembershipRequest
|
|
12
|
-
from ..
|
|
13
|
+
from ..types.project_request import ProjectRequest
|
|
13
14
|
from ..types.scopes_response_model import ScopesResponseModel
|
|
14
|
-
from ..
|
|
15
|
-
from ..
|
|
16
|
-
from ..
|
|
17
|
-
from
|
|
18
|
-
from json.decoder import JSONDecodeError
|
|
19
|
-
from ..core.api_error import ApiError
|
|
20
|
-
from ..types.legacy_user_request import LegacyUserRequest
|
|
21
|
-
from ..types.legacy_scope_request import LegacyScopeRequest
|
|
22
|
-
from ..types.account_response import AccountResponse
|
|
23
|
-
from ..core.client_wrapper import AsyncClientWrapper
|
|
15
|
+
from ..types.user_request import UserRequest
|
|
16
|
+
from ..types.workspace_membership_request import WorkspaceMembershipRequest
|
|
17
|
+
from ..types.workspace_request import WorkspaceRequest
|
|
18
|
+
from .raw_client import AsyncRawAdminClient, RawAdminClient
|
|
24
19
|
|
|
25
20
|
# this is used as the default value for optional parameters
|
|
26
21
|
OMIT = typing.cast(typing.Any, ...)
|
|
@@ -28,7 +23,18 @@ OMIT = typing.cast(typing.Any, ...)
|
|
|
28
23
|
|
|
29
24
|
class AdminClient:
|
|
30
25
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
31
|
-
self.
|
|
26
|
+
self._raw_client = RawAdminClient(client_wrapper=client_wrapper)
|
|
27
|
+
|
|
28
|
+
@property
|
|
29
|
+
def with_raw_response(self) -> RawAdminClient:
|
|
30
|
+
"""
|
|
31
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
32
|
+
|
|
33
|
+
Returns
|
|
34
|
+
-------
|
|
35
|
+
RawAdminClient
|
|
36
|
+
"""
|
|
37
|
+
return self._raw_client
|
|
32
38
|
|
|
33
39
|
def create_accounts(
|
|
34
40
|
self,
|
|
@@ -83,7 +89,6 @@ class AdminClient:
|
|
|
83
89
|
|
|
84
90
|
client = AgentaApi(
|
|
85
91
|
api_key="YOUR_API_KEY",
|
|
86
|
-
base_url="https://yourhost.com/path/to/api",
|
|
87
92
|
)
|
|
88
93
|
client.admin.create_accounts(
|
|
89
94
|
users={
|
|
@@ -142,89 +147,28 @@ class AdminClient:
|
|
|
142
147
|
},
|
|
143
148
|
)
|
|
144
149
|
"""
|
|
145
|
-
_response = self.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
),
|
|
154
|
-
"organizations": convert_and_respect_annotation_metadata(
|
|
155
|
-
object_=organizations,
|
|
156
|
-
annotation=typing.Dict[str, OrganizationRequest],
|
|
157
|
-
direction="write",
|
|
158
|
-
),
|
|
159
|
-
"workspaces": convert_and_respect_annotation_metadata(
|
|
160
|
-
object_=workspaces,
|
|
161
|
-
annotation=typing.Dict[str, WorkspaceRequest],
|
|
162
|
-
direction="write",
|
|
163
|
-
),
|
|
164
|
-
"projects": convert_and_respect_annotation_metadata(
|
|
165
|
-
object_=projects,
|
|
166
|
-
annotation=typing.Dict[str, ProjectRequest],
|
|
167
|
-
direction="write",
|
|
168
|
-
),
|
|
169
|
-
"organization_memberships": convert_and_respect_annotation_metadata(
|
|
170
|
-
object_=organization_memberships,
|
|
171
|
-
annotation=typing.Dict[str, OrganizationMembershipRequest],
|
|
172
|
-
direction="write",
|
|
173
|
-
),
|
|
174
|
-
"workspace_memberships": convert_and_respect_annotation_metadata(
|
|
175
|
-
object_=workspace_memberships,
|
|
176
|
-
annotation=typing.Dict[str, WorkspaceMembershipRequest],
|
|
177
|
-
direction="write",
|
|
178
|
-
),
|
|
179
|
-
"project_memberships": convert_and_respect_annotation_metadata(
|
|
180
|
-
object_=project_memberships,
|
|
181
|
-
annotation=typing.Dict[str, ProjectMembershipRequest],
|
|
182
|
-
direction="write",
|
|
183
|
-
),
|
|
184
|
-
},
|
|
185
|
-
headers={
|
|
186
|
-
"content-type": "application/json",
|
|
187
|
-
},
|
|
150
|
+
_response = self._raw_client.create_accounts(
|
|
151
|
+
users=users,
|
|
152
|
+
organizations=organizations,
|
|
153
|
+
workspaces=workspaces,
|
|
154
|
+
projects=projects,
|
|
155
|
+
organization_memberships=organization_memberships,
|
|
156
|
+
workspace_memberships=workspace_memberships,
|
|
157
|
+
project_memberships=project_memberships,
|
|
188
158
|
request_options=request_options,
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
try:
|
|
192
|
-
if 200 <= _response.status_code < 300:
|
|
193
|
-
return typing.cast(
|
|
194
|
-
ScopesResponseModel,
|
|
195
|
-
parse_obj_as(
|
|
196
|
-
type_=ScopesResponseModel, # type: ignore
|
|
197
|
-
object_=_response.json(),
|
|
198
|
-
),
|
|
199
|
-
)
|
|
200
|
-
if _response.status_code == 422:
|
|
201
|
-
raise UnprocessableEntityError(
|
|
202
|
-
typing.cast(
|
|
203
|
-
HttpValidationError,
|
|
204
|
-
parse_obj_as(
|
|
205
|
-
type_=HttpValidationError, # type: ignore
|
|
206
|
-
object_=_response.json(),
|
|
207
|
-
),
|
|
208
|
-
)
|
|
209
|
-
)
|
|
210
|
-
_response_json = _response.json()
|
|
211
|
-
except JSONDecodeError:
|
|
212
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
213
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
159
|
+
)
|
|
160
|
+
return _response.data
|
|
214
161
|
|
|
215
162
|
def create_account(
|
|
216
163
|
self,
|
|
217
164
|
*,
|
|
218
|
-
|
|
219
|
-
scope: LegacyScopeRequest,
|
|
165
|
+
request: typing.Optional[AccountRequest] = None,
|
|
220
166
|
request_options: typing.Optional[RequestOptions] = None,
|
|
221
167
|
) -> AccountResponse:
|
|
222
168
|
"""
|
|
223
169
|
Parameters
|
|
224
170
|
----------
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
scope : LegacyScopeRequest
|
|
171
|
+
request : typing.Optional[AccountRequest]
|
|
228
172
|
|
|
229
173
|
request_options : typing.Optional[RequestOptions]
|
|
230
174
|
Request-specific configuration.
|
|
@@ -236,67 +180,214 @@ class AdminClient:
|
|
|
236
180
|
|
|
237
181
|
Examples
|
|
238
182
|
--------
|
|
239
|
-
from agenta import AgentaApi
|
|
183
|
+
from agenta import AgentaApi
|
|
240
184
|
|
|
241
185
|
client = AgentaApi(
|
|
242
186
|
api_key="YOUR_API_KEY",
|
|
243
|
-
|
|
244
|
-
)
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
187
|
+
)
|
|
188
|
+
client.admin.create_account()
|
|
189
|
+
"""
|
|
190
|
+
_response = self._raw_client.create_account(
|
|
191
|
+
request=request, request_options=request_options
|
|
192
|
+
)
|
|
193
|
+
return _response.data
|
|
194
|
+
|
|
195
|
+
def create_portal(
|
|
196
|
+
self,
|
|
197
|
+
*,
|
|
198
|
+
organization_id: str,
|
|
199
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
200
|
+
) -> typing.Optional[typing.Any]:
|
|
201
|
+
"""
|
|
202
|
+
Parameters
|
|
203
|
+
----------
|
|
204
|
+
organization_id : str
|
|
205
|
+
|
|
206
|
+
request_options : typing.Optional[RequestOptions]
|
|
207
|
+
Request-specific configuration.
|
|
208
|
+
|
|
209
|
+
Returns
|
|
210
|
+
-------
|
|
211
|
+
typing.Optional[typing.Any]
|
|
212
|
+
Successful Response
|
|
213
|
+
|
|
214
|
+
Examples
|
|
215
|
+
--------
|
|
216
|
+
from agenta import AgentaApi
|
|
217
|
+
|
|
218
|
+
client = AgentaApi(
|
|
219
|
+
api_key="YOUR_API_KEY",
|
|
220
|
+
)
|
|
221
|
+
client.admin.create_portal(
|
|
222
|
+
organization_id="organization_id",
|
|
223
|
+
)
|
|
224
|
+
"""
|
|
225
|
+
_response = self._raw_client.create_portal(
|
|
226
|
+
organization_id=organization_id, request_options=request_options
|
|
227
|
+
)
|
|
228
|
+
return _response.data
|
|
229
|
+
|
|
230
|
+
def create_checkout(
|
|
231
|
+
self,
|
|
232
|
+
*,
|
|
233
|
+
organization_id: str,
|
|
234
|
+
plan: Plan,
|
|
235
|
+
success_url: str,
|
|
236
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
237
|
+
) -> typing.Optional[typing.Any]:
|
|
238
|
+
"""
|
|
239
|
+
Parameters
|
|
240
|
+
----------
|
|
241
|
+
organization_id : str
|
|
242
|
+
|
|
243
|
+
plan : Plan
|
|
244
|
+
|
|
245
|
+
success_url : str
|
|
246
|
+
|
|
247
|
+
request_options : typing.Optional[RequestOptions]
|
|
248
|
+
Request-specific configuration.
|
|
249
|
+
|
|
250
|
+
Returns
|
|
251
|
+
-------
|
|
252
|
+
typing.Optional[typing.Any]
|
|
253
|
+
Successful Response
|
|
254
|
+
|
|
255
|
+
Examples
|
|
256
|
+
--------
|
|
257
|
+
from agenta import AgentaApi
|
|
258
|
+
|
|
259
|
+
client = AgentaApi(
|
|
260
|
+
api_key="YOUR_API_KEY",
|
|
261
|
+
)
|
|
262
|
+
client.admin.create_checkout(
|
|
263
|
+
organization_id="organization_id",
|
|
264
|
+
plan="cloud_v0_hobby",
|
|
265
|
+
success_url="success_url",
|
|
266
|
+
)
|
|
267
|
+
"""
|
|
268
|
+
_response = self._raw_client.create_checkout(
|
|
269
|
+
organization_id=organization_id,
|
|
270
|
+
plan=plan,
|
|
271
|
+
success_url=success_url,
|
|
269
272
|
request_options=request_options,
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
273
|
+
)
|
|
274
|
+
return _response.data
|
|
275
|
+
|
|
276
|
+
def switch_plans(
|
|
277
|
+
self,
|
|
278
|
+
*,
|
|
279
|
+
organization_id: str,
|
|
280
|
+
plan: Plan,
|
|
281
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
282
|
+
) -> typing.Optional[typing.Any]:
|
|
283
|
+
"""
|
|
284
|
+
Parameters
|
|
285
|
+
----------
|
|
286
|
+
organization_id : str
|
|
287
|
+
|
|
288
|
+
plan : Plan
|
|
289
|
+
|
|
290
|
+
request_options : typing.Optional[RequestOptions]
|
|
291
|
+
Request-specific configuration.
|
|
292
|
+
|
|
293
|
+
Returns
|
|
294
|
+
-------
|
|
295
|
+
typing.Optional[typing.Any]
|
|
296
|
+
Successful Response
|
|
297
|
+
|
|
298
|
+
Examples
|
|
299
|
+
--------
|
|
300
|
+
from agenta import AgentaApi
|
|
301
|
+
|
|
302
|
+
client = AgentaApi(
|
|
303
|
+
api_key="YOUR_API_KEY",
|
|
304
|
+
)
|
|
305
|
+
client.admin.switch_plans(
|
|
306
|
+
organization_id="organization_id",
|
|
307
|
+
plan="cloud_v0_hobby",
|
|
308
|
+
)
|
|
309
|
+
"""
|
|
310
|
+
_response = self._raw_client.switch_plans(
|
|
311
|
+
organization_id=organization_id, plan=plan, request_options=request_options
|
|
312
|
+
)
|
|
313
|
+
return _response.data
|
|
314
|
+
|
|
315
|
+
def cancel_subscription(
|
|
316
|
+
self,
|
|
317
|
+
*,
|
|
318
|
+
organization_id: str,
|
|
319
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
320
|
+
) -> typing.Optional[typing.Any]:
|
|
321
|
+
"""
|
|
322
|
+
Parameters
|
|
323
|
+
----------
|
|
324
|
+
organization_id : str
|
|
325
|
+
|
|
326
|
+
request_options : typing.Optional[RequestOptions]
|
|
327
|
+
Request-specific configuration.
|
|
328
|
+
|
|
329
|
+
Returns
|
|
330
|
+
-------
|
|
331
|
+
typing.Optional[typing.Any]
|
|
332
|
+
Successful Response
|
|
333
|
+
|
|
334
|
+
Examples
|
|
335
|
+
--------
|
|
336
|
+
from agenta import AgentaApi
|
|
337
|
+
|
|
338
|
+
client = AgentaApi(
|
|
339
|
+
api_key="YOUR_API_KEY",
|
|
340
|
+
)
|
|
341
|
+
client.admin.cancel_subscription(
|
|
342
|
+
organization_id="organization_id",
|
|
343
|
+
)
|
|
344
|
+
"""
|
|
345
|
+
_response = self._raw_client.cancel_subscription(
|
|
346
|
+
organization_id=organization_id, request_options=request_options
|
|
347
|
+
)
|
|
348
|
+
return _response.data
|
|
349
|
+
|
|
350
|
+
def report_usage(
|
|
351
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
352
|
+
) -> typing.Optional[typing.Any]:
|
|
353
|
+
"""
|
|
354
|
+
Parameters
|
|
355
|
+
----------
|
|
356
|
+
request_options : typing.Optional[RequestOptions]
|
|
357
|
+
Request-specific configuration.
|
|
358
|
+
|
|
359
|
+
Returns
|
|
360
|
+
-------
|
|
361
|
+
typing.Optional[typing.Any]
|
|
362
|
+
Successful Response
|
|
363
|
+
|
|
364
|
+
Examples
|
|
365
|
+
--------
|
|
366
|
+
from agenta import AgentaApi
|
|
367
|
+
|
|
368
|
+
client = AgentaApi(
|
|
369
|
+
api_key="YOUR_API_KEY",
|
|
370
|
+
)
|
|
371
|
+
client.admin.report_usage()
|
|
372
|
+
"""
|
|
373
|
+
_response = self._raw_client.report_usage(request_options=request_options)
|
|
374
|
+
return _response.data
|
|
295
375
|
|
|
296
376
|
|
|
297
377
|
class AsyncAdminClient:
|
|
298
378
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
299
|
-
self.
|
|
379
|
+
self._raw_client = AsyncRawAdminClient(client_wrapper=client_wrapper)
|
|
380
|
+
|
|
381
|
+
@property
|
|
382
|
+
def with_raw_response(self) -> AsyncRawAdminClient:
|
|
383
|
+
"""
|
|
384
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
385
|
+
|
|
386
|
+
Returns
|
|
387
|
+
-------
|
|
388
|
+
AsyncRawAdminClient
|
|
389
|
+
"""
|
|
390
|
+
return self._raw_client
|
|
300
391
|
|
|
301
392
|
async def create_accounts(
|
|
302
393
|
self,
|
|
@@ -353,7 +444,6 @@ class AsyncAdminClient:
|
|
|
353
444
|
|
|
354
445
|
client = AsyncAgentaApi(
|
|
355
446
|
api_key="YOUR_API_KEY",
|
|
356
|
-
base_url="https://yourhost.com/path/to/api",
|
|
357
447
|
)
|
|
358
448
|
|
|
359
449
|
|
|
@@ -418,89 +508,28 @@ class AsyncAdminClient:
|
|
|
418
508
|
|
|
419
509
|
asyncio.run(main())
|
|
420
510
|
"""
|
|
421
|
-
_response = await self.
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
),
|
|
430
|
-
"organizations": convert_and_respect_annotation_metadata(
|
|
431
|
-
object_=organizations,
|
|
432
|
-
annotation=typing.Dict[str, OrganizationRequest],
|
|
433
|
-
direction="write",
|
|
434
|
-
),
|
|
435
|
-
"workspaces": convert_and_respect_annotation_metadata(
|
|
436
|
-
object_=workspaces,
|
|
437
|
-
annotation=typing.Dict[str, WorkspaceRequest],
|
|
438
|
-
direction="write",
|
|
439
|
-
),
|
|
440
|
-
"projects": convert_and_respect_annotation_metadata(
|
|
441
|
-
object_=projects,
|
|
442
|
-
annotation=typing.Dict[str, ProjectRequest],
|
|
443
|
-
direction="write",
|
|
444
|
-
),
|
|
445
|
-
"organization_memberships": convert_and_respect_annotation_metadata(
|
|
446
|
-
object_=organization_memberships,
|
|
447
|
-
annotation=typing.Dict[str, OrganizationMembershipRequest],
|
|
448
|
-
direction="write",
|
|
449
|
-
),
|
|
450
|
-
"workspace_memberships": convert_and_respect_annotation_metadata(
|
|
451
|
-
object_=workspace_memberships,
|
|
452
|
-
annotation=typing.Dict[str, WorkspaceMembershipRequest],
|
|
453
|
-
direction="write",
|
|
454
|
-
),
|
|
455
|
-
"project_memberships": convert_and_respect_annotation_metadata(
|
|
456
|
-
object_=project_memberships,
|
|
457
|
-
annotation=typing.Dict[str, ProjectMembershipRequest],
|
|
458
|
-
direction="write",
|
|
459
|
-
),
|
|
460
|
-
},
|
|
461
|
-
headers={
|
|
462
|
-
"content-type": "application/json",
|
|
463
|
-
},
|
|
511
|
+
_response = await self._raw_client.create_accounts(
|
|
512
|
+
users=users,
|
|
513
|
+
organizations=organizations,
|
|
514
|
+
workspaces=workspaces,
|
|
515
|
+
projects=projects,
|
|
516
|
+
organization_memberships=organization_memberships,
|
|
517
|
+
workspace_memberships=workspace_memberships,
|
|
518
|
+
project_memberships=project_memberships,
|
|
464
519
|
request_options=request_options,
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
try:
|
|
468
|
-
if 200 <= _response.status_code < 300:
|
|
469
|
-
return typing.cast(
|
|
470
|
-
ScopesResponseModel,
|
|
471
|
-
parse_obj_as(
|
|
472
|
-
type_=ScopesResponseModel, # type: ignore
|
|
473
|
-
object_=_response.json(),
|
|
474
|
-
),
|
|
475
|
-
)
|
|
476
|
-
if _response.status_code == 422:
|
|
477
|
-
raise UnprocessableEntityError(
|
|
478
|
-
typing.cast(
|
|
479
|
-
HttpValidationError,
|
|
480
|
-
parse_obj_as(
|
|
481
|
-
type_=HttpValidationError, # type: ignore
|
|
482
|
-
object_=_response.json(),
|
|
483
|
-
),
|
|
484
|
-
)
|
|
485
|
-
)
|
|
486
|
-
_response_json = _response.json()
|
|
487
|
-
except JSONDecodeError:
|
|
488
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
489
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
520
|
+
)
|
|
521
|
+
return _response.data
|
|
490
522
|
|
|
491
523
|
async def create_account(
|
|
492
524
|
self,
|
|
493
525
|
*,
|
|
494
|
-
|
|
495
|
-
scope: LegacyScopeRequest,
|
|
526
|
+
request: typing.Optional[AccountRequest] = None,
|
|
496
527
|
request_options: typing.Optional[RequestOptions] = None,
|
|
497
528
|
) -> AccountResponse:
|
|
498
529
|
"""
|
|
499
530
|
Parameters
|
|
500
531
|
----------
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
scope : LegacyScopeRequest
|
|
532
|
+
request : typing.Optional[AccountRequest]
|
|
504
533
|
|
|
505
534
|
request_options : typing.Optional[RequestOptions]
|
|
506
535
|
Request-specific configuration.
|
|
@@ -514,65 +543,241 @@ class AsyncAdminClient:
|
|
|
514
543
|
--------
|
|
515
544
|
import asyncio
|
|
516
545
|
|
|
517
|
-
from agenta import AsyncAgentaApi
|
|
546
|
+
from agenta import AsyncAgentaApi
|
|
518
547
|
|
|
519
548
|
client = AsyncAgentaApi(
|
|
520
549
|
api_key="YOUR_API_KEY",
|
|
521
|
-
base_url="https://yourhost.com/path/to/api",
|
|
522
550
|
)
|
|
523
551
|
|
|
524
552
|
|
|
525
553
|
async def main() -> None:
|
|
526
|
-
await client.admin.create_account(
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
554
|
+
await client.admin.create_account()
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+
asyncio.run(main())
|
|
558
|
+
"""
|
|
559
|
+
_response = await self._raw_client.create_account(
|
|
560
|
+
request=request, request_options=request_options
|
|
561
|
+
)
|
|
562
|
+
return _response.data
|
|
563
|
+
|
|
564
|
+
async def create_portal(
|
|
565
|
+
self,
|
|
566
|
+
*,
|
|
567
|
+
organization_id: str,
|
|
568
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
569
|
+
) -> typing.Optional[typing.Any]:
|
|
570
|
+
"""
|
|
571
|
+
Parameters
|
|
572
|
+
----------
|
|
573
|
+
organization_id : str
|
|
574
|
+
|
|
575
|
+
request_options : typing.Optional[RequestOptions]
|
|
576
|
+
Request-specific configuration.
|
|
577
|
+
|
|
578
|
+
Returns
|
|
579
|
+
-------
|
|
580
|
+
typing.Optional[typing.Any]
|
|
581
|
+
Successful Response
|
|
582
|
+
|
|
583
|
+
Examples
|
|
584
|
+
--------
|
|
585
|
+
import asyncio
|
|
586
|
+
|
|
587
|
+
from agenta import AsyncAgentaApi
|
|
588
|
+
|
|
589
|
+
client = AsyncAgentaApi(
|
|
590
|
+
api_key="YOUR_API_KEY",
|
|
591
|
+
)
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
async def main() -> None:
|
|
595
|
+
await client.admin.create_portal(
|
|
596
|
+
organization_id="organization_id",
|
|
534
597
|
)
|
|
535
598
|
|
|
536
599
|
|
|
537
600
|
asyncio.run(main())
|
|
538
601
|
"""
|
|
539
|
-
_response = await self.
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
602
|
+
_response = await self._raw_client.create_portal(
|
|
603
|
+
organization_id=organization_id, request_options=request_options
|
|
604
|
+
)
|
|
605
|
+
return _response.data
|
|
606
|
+
|
|
607
|
+
async def create_checkout(
|
|
608
|
+
self,
|
|
609
|
+
*,
|
|
610
|
+
organization_id: str,
|
|
611
|
+
plan: Plan,
|
|
612
|
+
success_url: str,
|
|
613
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
614
|
+
) -> typing.Optional[typing.Any]:
|
|
615
|
+
"""
|
|
616
|
+
Parameters
|
|
617
|
+
----------
|
|
618
|
+
organization_id : str
|
|
619
|
+
|
|
620
|
+
plan : Plan
|
|
621
|
+
|
|
622
|
+
success_url : str
|
|
623
|
+
|
|
624
|
+
request_options : typing.Optional[RequestOptions]
|
|
625
|
+
Request-specific configuration.
|
|
626
|
+
|
|
627
|
+
Returns
|
|
628
|
+
-------
|
|
629
|
+
typing.Optional[typing.Any]
|
|
630
|
+
Successful Response
|
|
631
|
+
|
|
632
|
+
Examples
|
|
633
|
+
--------
|
|
634
|
+
import asyncio
|
|
635
|
+
|
|
636
|
+
from agenta import AsyncAgentaApi
|
|
637
|
+
|
|
638
|
+
client = AsyncAgentaApi(
|
|
639
|
+
api_key="YOUR_API_KEY",
|
|
640
|
+
)
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
async def main() -> None:
|
|
644
|
+
await client.admin.create_checkout(
|
|
645
|
+
organization_id="organization_id",
|
|
646
|
+
plan="cloud_v0_hobby",
|
|
647
|
+
success_url="success_url",
|
|
648
|
+
)
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
asyncio.run(main())
|
|
652
|
+
"""
|
|
653
|
+
_response = await self._raw_client.create_checkout(
|
|
654
|
+
organization_id=organization_id,
|
|
655
|
+
plan=plan,
|
|
656
|
+
success_url=success_url,
|
|
553
657
|
request_options=request_options,
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
658
|
+
)
|
|
659
|
+
return _response.data
|
|
660
|
+
|
|
661
|
+
async def switch_plans(
|
|
662
|
+
self,
|
|
663
|
+
*,
|
|
664
|
+
organization_id: str,
|
|
665
|
+
plan: Plan,
|
|
666
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
667
|
+
) -> typing.Optional[typing.Any]:
|
|
668
|
+
"""
|
|
669
|
+
Parameters
|
|
670
|
+
----------
|
|
671
|
+
organization_id : str
|
|
672
|
+
|
|
673
|
+
plan : Plan
|
|
674
|
+
|
|
675
|
+
request_options : typing.Optional[RequestOptions]
|
|
676
|
+
Request-specific configuration.
|
|
677
|
+
|
|
678
|
+
Returns
|
|
679
|
+
-------
|
|
680
|
+
typing.Optional[typing.Any]
|
|
681
|
+
Successful Response
|
|
682
|
+
|
|
683
|
+
Examples
|
|
684
|
+
--------
|
|
685
|
+
import asyncio
|
|
686
|
+
|
|
687
|
+
from agenta import AsyncAgentaApi
|
|
688
|
+
|
|
689
|
+
client = AsyncAgentaApi(
|
|
690
|
+
api_key="YOUR_API_KEY",
|
|
691
|
+
)
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
async def main() -> None:
|
|
695
|
+
await client.admin.switch_plans(
|
|
696
|
+
organization_id="organization_id",
|
|
697
|
+
plan="cloud_v0_hobby",
|
|
698
|
+
)
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
asyncio.run(main())
|
|
702
|
+
"""
|
|
703
|
+
_response = await self._raw_client.switch_plans(
|
|
704
|
+
organization_id=organization_id, plan=plan, request_options=request_options
|
|
705
|
+
)
|
|
706
|
+
return _response.data
|
|
707
|
+
|
|
708
|
+
async def cancel_subscription(
|
|
709
|
+
self,
|
|
710
|
+
*,
|
|
711
|
+
organization_id: str,
|
|
712
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
713
|
+
) -> typing.Optional[typing.Any]:
|
|
714
|
+
"""
|
|
715
|
+
Parameters
|
|
716
|
+
----------
|
|
717
|
+
organization_id : str
|
|
718
|
+
|
|
719
|
+
request_options : typing.Optional[RequestOptions]
|
|
720
|
+
Request-specific configuration.
|
|
721
|
+
|
|
722
|
+
Returns
|
|
723
|
+
-------
|
|
724
|
+
typing.Optional[typing.Any]
|
|
725
|
+
Successful Response
|
|
726
|
+
|
|
727
|
+
Examples
|
|
728
|
+
--------
|
|
729
|
+
import asyncio
|
|
730
|
+
|
|
731
|
+
from agenta import AsyncAgentaApi
|
|
732
|
+
|
|
733
|
+
client = AsyncAgentaApi(
|
|
734
|
+
api_key="YOUR_API_KEY",
|
|
735
|
+
)
|
|
736
|
+
|
|
737
|
+
|
|
738
|
+
async def main() -> None:
|
|
739
|
+
await client.admin.cancel_subscription(
|
|
740
|
+
organization_id="organization_id",
|
|
741
|
+
)
|
|
742
|
+
|
|
743
|
+
|
|
744
|
+
asyncio.run(main())
|
|
745
|
+
"""
|
|
746
|
+
_response = await self._raw_client.cancel_subscription(
|
|
747
|
+
organization_id=organization_id, request_options=request_options
|
|
748
|
+
)
|
|
749
|
+
return _response.data
|
|
750
|
+
|
|
751
|
+
async def report_usage(
|
|
752
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
753
|
+
) -> typing.Optional[typing.Any]:
|
|
754
|
+
"""
|
|
755
|
+
Parameters
|
|
756
|
+
----------
|
|
757
|
+
request_options : typing.Optional[RequestOptions]
|
|
758
|
+
Request-specific configuration.
|
|
759
|
+
|
|
760
|
+
Returns
|
|
761
|
+
-------
|
|
762
|
+
typing.Optional[typing.Any]
|
|
763
|
+
Successful Response
|
|
764
|
+
|
|
765
|
+
Examples
|
|
766
|
+
--------
|
|
767
|
+
import asyncio
|
|
768
|
+
|
|
769
|
+
from agenta import AsyncAgentaApi
|
|
770
|
+
|
|
771
|
+
client = AsyncAgentaApi(
|
|
772
|
+
api_key="YOUR_API_KEY",
|
|
773
|
+
)
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
async def main() -> None:
|
|
777
|
+
await client.admin.report_usage()
|
|
778
|
+
|
|
779
|
+
|
|
780
|
+
asyncio.run(main())
|
|
781
|
+
"""
|
|
782
|
+
_response = await self._raw_client.report_usage(request_options=request_options)
|
|
783
|
+
return _response.data
|