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,24 +1,27 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
3
|
import typing
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
5
6
|
from ..core.request_options import RequestOptions
|
|
6
7
|
from ..types.get_config_response import GetConfigResponse
|
|
7
|
-
from
|
|
8
|
-
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
|
9
|
-
from ..types.http_validation_error import HttpValidationError
|
|
10
|
-
from json.decoder import JSONDecodeError
|
|
11
|
-
from ..core.api_error import ApiError
|
|
12
|
-
from ..core.jsonable_encoder import jsonable_encoder
|
|
13
|
-
from ..core.client_wrapper import AsyncClientWrapper
|
|
14
|
-
|
|
15
|
-
# this is used as the default value for optional parameters
|
|
16
|
-
OMIT = typing.cast(typing.Any, ...)
|
|
8
|
+
from .raw_client import AsyncRawConfigsClient, RawConfigsClient
|
|
17
9
|
|
|
18
10
|
|
|
19
11
|
class ConfigsClient:
|
|
20
12
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
21
|
-
self.
|
|
13
|
+
self._raw_client = RawConfigsClient(client_wrapper=client_wrapper)
|
|
14
|
+
|
|
15
|
+
@property
|
|
16
|
+
def with_raw_response(self) -> RawConfigsClient:
|
|
17
|
+
"""
|
|
18
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
19
|
+
|
|
20
|
+
Returns
|
|
21
|
+
-------
|
|
22
|
+
RawConfigsClient
|
|
23
|
+
"""
|
|
24
|
+
return self._raw_client
|
|
22
25
|
|
|
23
26
|
def get_config(
|
|
24
27
|
self,
|
|
@@ -51,127 +54,18 @@ class ConfigsClient:
|
|
|
51
54
|
|
|
52
55
|
client = AgentaApi(
|
|
53
56
|
api_key="YOUR_API_KEY",
|
|
54
|
-
base_url="https://yourhost.com/path/to/api",
|
|
55
57
|
)
|
|
56
58
|
client.configs.get_config(
|
|
57
59
|
base_id="base_id",
|
|
58
60
|
)
|
|
59
61
|
"""
|
|
60
|
-
_response = self.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
"base_id": base_id,
|
|
65
|
-
"config_name": config_name,
|
|
66
|
-
"environment_name": environment_name,
|
|
67
|
-
},
|
|
68
|
-
request_options=request_options,
|
|
69
|
-
)
|
|
70
|
-
try:
|
|
71
|
-
if 200 <= _response.status_code < 300:
|
|
72
|
-
return typing.cast(
|
|
73
|
-
GetConfigResponse,
|
|
74
|
-
parse_obj_as(
|
|
75
|
-
type_=GetConfigResponse, # type: ignore
|
|
76
|
-
object_=_response.json(),
|
|
77
|
-
),
|
|
78
|
-
)
|
|
79
|
-
if _response.status_code == 422:
|
|
80
|
-
raise UnprocessableEntityError(
|
|
81
|
-
typing.cast(
|
|
82
|
-
HttpValidationError,
|
|
83
|
-
parse_obj_as(
|
|
84
|
-
type_=HttpValidationError, # type: ignore
|
|
85
|
-
object_=_response.json(),
|
|
86
|
-
),
|
|
87
|
-
)
|
|
88
|
-
)
|
|
89
|
-
_response_json = _response.json()
|
|
90
|
-
except JSONDecodeError:
|
|
91
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
92
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
93
|
-
|
|
94
|
-
def save_config(
|
|
95
|
-
self,
|
|
96
|
-
*,
|
|
97
|
-
base_id: str,
|
|
98
|
-
config_name: str,
|
|
99
|
-
parameters: typing.Dict[str, typing.Optional[typing.Any]],
|
|
100
|
-
overwrite: bool,
|
|
101
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
102
|
-
) -> typing.Optional[typing.Any]:
|
|
103
|
-
"""
|
|
104
|
-
Parameters
|
|
105
|
-
----------
|
|
106
|
-
base_id : str
|
|
107
|
-
|
|
108
|
-
config_name : str
|
|
109
|
-
|
|
110
|
-
parameters : typing.Dict[str, typing.Optional[typing.Any]]
|
|
111
|
-
|
|
112
|
-
overwrite : bool
|
|
113
|
-
|
|
114
|
-
request_options : typing.Optional[RequestOptions]
|
|
115
|
-
Request-specific configuration.
|
|
116
|
-
|
|
117
|
-
Returns
|
|
118
|
-
-------
|
|
119
|
-
typing.Optional[typing.Any]
|
|
120
|
-
Successful Response
|
|
121
|
-
|
|
122
|
-
Examples
|
|
123
|
-
--------
|
|
124
|
-
from agenta import AgentaApi
|
|
125
|
-
|
|
126
|
-
client = AgentaApi(
|
|
127
|
-
api_key="YOUR_API_KEY",
|
|
128
|
-
base_url="https://yourhost.com/path/to/api",
|
|
129
|
-
)
|
|
130
|
-
client.configs.save_config(
|
|
131
|
-
base_id="base_id",
|
|
132
|
-
config_name="config_name",
|
|
133
|
-
parameters={"key": "value"},
|
|
134
|
-
overwrite=True,
|
|
135
|
-
)
|
|
136
|
-
"""
|
|
137
|
-
_response = self._client_wrapper.httpx_client.request(
|
|
138
|
-
"configs",
|
|
139
|
-
method="POST",
|
|
140
|
-
json={
|
|
141
|
-
"base_id": base_id,
|
|
142
|
-
"config_name": config_name,
|
|
143
|
-
"parameters": parameters,
|
|
144
|
-
"overwrite": overwrite,
|
|
145
|
-
},
|
|
146
|
-
headers={
|
|
147
|
-
"content-type": "application/json",
|
|
148
|
-
},
|
|
62
|
+
_response = self._raw_client.get_config(
|
|
63
|
+
base_id=base_id,
|
|
64
|
+
config_name=config_name,
|
|
65
|
+
environment_name=environment_name,
|
|
149
66
|
request_options=request_options,
|
|
150
|
-
omit=OMIT,
|
|
151
67
|
)
|
|
152
|
-
|
|
153
|
-
if 200 <= _response.status_code < 300:
|
|
154
|
-
return typing.cast(
|
|
155
|
-
typing.Optional[typing.Any],
|
|
156
|
-
parse_obj_as(
|
|
157
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
158
|
-
object_=_response.json(),
|
|
159
|
-
),
|
|
160
|
-
)
|
|
161
|
-
if _response.status_code == 422:
|
|
162
|
-
raise UnprocessableEntityError(
|
|
163
|
-
typing.cast(
|
|
164
|
-
HttpValidationError,
|
|
165
|
-
parse_obj_as(
|
|
166
|
-
type_=HttpValidationError, # type: ignore
|
|
167
|
-
object_=_response.json(),
|
|
168
|
-
),
|
|
169
|
-
)
|
|
170
|
-
)
|
|
171
|
-
_response_json = _response.json()
|
|
172
|
-
except JSONDecodeError:
|
|
173
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
174
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
68
|
+
return _response.data
|
|
175
69
|
|
|
176
70
|
def get_config_deployment_revision(
|
|
177
71
|
self,
|
|
@@ -198,40 +92,15 @@ class ConfigsClient:
|
|
|
198
92
|
|
|
199
93
|
client = AgentaApi(
|
|
200
94
|
api_key="YOUR_API_KEY",
|
|
201
|
-
base_url="https://yourhost.com/path/to/api",
|
|
202
95
|
)
|
|
203
96
|
client.configs.get_config_deployment_revision(
|
|
204
97
|
deployment_revision_id="deployment_revision_id",
|
|
205
98
|
)
|
|
206
99
|
"""
|
|
207
|
-
_response = self.
|
|
208
|
-
|
|
209
|
-
method="GET",
|
|
210
|
-
request_options=request_options,
|
|
100
|
+
_response = self._raw_client.get_config_deployment_revision(
|
|
101
|
+
deployment_revision_id, request_options=request_options
|
|
211
102
|
)
|
|
212
|
-
|
|
213
|
-
if 200 <= _response.status_code < 300:
|
|
214
|
-
return typing.cast(
|
|
215
|
-
typing.Optional[typing.Any],
|
|
216
|
-
parse_obj_as(
|
|
217
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
218
|
-
object_=_response.json(),
|
|
219
|
-
),
|
|
220
|
-
)
|
|
221
|
-
if _response.status_code == 422:
|
|
222
|
-
raise UnprocessableEntityError(
|
|
223
|
-
typing.cast(
|
|
224
|
-
HttpValidationError,
|
|
225
|
-
parse_obj_as(
|
|
226
|
-
type_=HttpValidationError, # type: ignore
|
|
227
|
-
object_=_response.json(),
|
|
228
|
-
),
|
|
229
|
-
)
|
|
230
|
-
)
|
|
231
|
-
_response_json = _response.json()
|
|
232
|
-
except JSONDecodeError:
|
|
233
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
234
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
103
|
+
return _response.data
|
|
235
104
|
|
|
236
105
|
def revert_deployment_revision(
|
|
237
106
|
self,
|
|
@@ -258,45 +127,31 @@ class ConfigsClient:
|
|
|
258
127
|
|
|
259
128
|
client = AgentaApi(
|
|
260
129
|
api_key="YOUR_API_KEY",
|
|
261
|
-
base_url="https://yourhost.com/path/to/api",
|
|
262
130
|
)
|
|
263
131
|
client.configs.revert_deployment_revision(
|
|
264
132
|
deployment_revision_id="deployment_revision_id",
|
|
265
133
|
)
|
|
266
134
|
"""
|
|
267
|
-
_response = self.
|
|
268
|
-
|
|
269
|
-
method="POST",
|
|
270
|
-
request_options=request_options,
|
|
135
|
+
_response = self._raw_client.revert_deployment_revision(
|
|
136
|
+
deployment_revision_id, request_options=request_options
|
|
271
137
|
)
|
|
272
|
-
|
|
273
|
-
if 200 <= _response.status_code < 300:
|
|
274
|
-
return typing.cast(
|
|
275
|
-
typing.Optional[typing.Any],
|
|
276
|
-
parse_obj_as(
|
|
277
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
278
|
-
object_=_response.json(),
|
|
279
|
-
),
|
|
280
|
-
)
|
|
281
|
-
if _response.status_code == 422:
|
|
282
|
-
raise UnprocessableEntityError(
|
|
283
|
-
typing.cast(
|
|
284
|
-
HttpValidationError,
|
|
285
|
-
parse_obj_as(
|
|
286
|
-
type_=HttpValidationError, # type: ignore
|
|
287
|
-
object_=_response.json(),
|
|
288
|
-
),
|
|
289
|
-
)
|
|
290
|
-
)
|
|
291
|
-
_response_json = _response.json()
|
|
292
|
-
except JSONDecodeError:
|
|
293
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
294
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
138
|
+
return _response.data
|
|
295
139
|
|
|
296
140
|
|
|
297
141
|
class AsyncConfigsClient:
|
|
298
142
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
299
|
-
self.
|
|
143
|
+
self._raw_client = AsyncRawConfigsClient(client_wrapper=client_wrapper)
|
|
144
|
+
|
|
145
|
+
@property
|
|
146
|
+
def with_raw_response(self) -> AsyncRawConfigsClient:
|
|
147
|
+
"""
|
|
148
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
149
|
+
|
|
150
|
+
Returns
|
|
151
|
+
-------
|
|
152
|
+
AsyncRawConfigsClient
|
|
153
|
+
"""
|
|
154
|
+
return self._raw_client
|
|
300
155
|
|
|
301
156
|
async def get_config(
|
|
302
157
|
self,
|
|
@@ -331,7 +186,6 @@ class AsyncConfigsClient:
|
|
|
331
186
|
|
|
332
187
|
client = AsyncAgentaApi(
|
|
333
188
|
api_key="YOUR_API_KEY",
|
|
334
|
-
base_url="https://yourhost.com/path/to/api",
|
|
335
189
|
)
|
|
336
190
|
|
|
337
191
|
|
|
@@ -343,129 +197,13 @@ class AsyncConfigsClient:
|
|
|
343
197
|
|
|
344
198
|
asyncio.run(main())
|
|
345
199
|
"""
|
|
346
|
-
_response = await self.
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
"base_id": base_id,
|
|
351
|
-
"config_name": config_name,
|
|
352
|
-
"environment_name": environment_name,
|
|
353
|
-
},
|
|
354
|
-
request_options=request_options,
|
|
355
|
-
)
|
|
356
|
-
try:
|
|
357
|
-
if 200 <= _response.status_code < 300:
|
|
358
|
-
return typing.cast(
|
|
359
|
-
GetConfigResponse,
|
|
360
|
-
parse_obj_as(
|
|
361
|
-
type_=GetConfigResponse, # type: ignore
|
|
362
|
-
object_=_response.json(),
|
|
363
|
-
),
|
|
364
|
-
)
|
|
365
|
-
if _response.status_code == 422:
|
|
366
|
-
raise UnprocessableEntityError(
|
|
367
|
-
typing.cast(
|
|
368
|
-
HttpValidationError,
|
|
369
|
-
parse_obj_as(
|
|
370
|
-
type_=HttpValidationError, # type: ignore
|
|
371
|
-
object_=_response.json(),
|
|
372
|
-
),
|
|
373
|
-
)
|
|
374
|
-
)
|
|
375
|
-
_response_json = _response.json()
|
|
376
|
-
except JSONDecodeError:
|
|
377
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
378
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
379
|
-
|
|
380
|
-
async def save_config(
|
|
381
|
-
self,
|
|
382
|
-
*,
|
|
383
|
-
base_id: str,
|
|
384
|
-
config_name: str,
|
|
385
|
-
parameters: typing.Dict[str, typing.Optional[typing.Any]],
|
|
386
|
-
overwrite: bool,
|
|
387
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
388
|
-
) -> typing.Optional[typing.Any]:
|
|
389
|
-
"""
|
|
390
|
-
Parameters
|
|
391
|
-
----------
|
|
392
|
-
base_id : str
|
|
393
|
-
|
|
394
|
-
config_name : str
|
|
395
|
-
|
|
396
|
-
parameters : typing.Dict[str, typing.Optional[typing.Any]]
|
|
397
|
-
|
|
398
|
-
overwrite : bool
|
|
399
|
-
|
|
400
|
-
request_options : typing.Optional[RequestOptions]
|
|
401
|
-
Request-specific configuration.
|
|
402
|
-
|
|
403
|
-
Returns
|
|
404
|
-
-------
|
|
405
|
-
typing.Optional[typing.Any]
|
|
406
|
-
Successful Response
|
|
407
|
-
|
|
408
|
-
Examples
|
|
409
|
-
--------
|
|
410
|
-
import asyncio
|
|
411
|
-
|
|
412
|
-
from agenta import AsyncAgentaApi
|
|
413
|
-
|
|
414
|
-
client = AsyncAgentaApi(
|
|
415
|
-
api_key="YOUR_API_KEY",
|
|
416
|
-
base_url="https://yourhost.com/path/to/api",
|
|
417
|
-
)
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
async def main() -> None:
|
|
421
|
-
await client.configs.save_config(
|
|
422
|
-
base_id="base_id",
|
|
423
|
-
config_name="config_name",
|
|
424
|
-
parameters={"key": "value"},
|
|
425
|
-
overwrite=True,
|
|
426
|
-
)
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
asyncio.run(main())
|
|
430
|
-
"""
|
|
431
|
-
_response = await self._client_wrapper.httpx_client.request(
|
|
432
|
-
"configs",
|
|
433
|
-
method="POST",
|
|
434
|
-
json={
|
|
435
|
-
"base_id": base_id,
|
|
436
|
-
"config_name": config_name,
|
|
437
|
-
"parameters": parameters,
|
|
438
|
-
"overwrite": overwrite,
|
|
439
|
-
},
|
|
440
|
-
headers={
|
|
441
|
-
"content-type": "application/json",
|
|
442
|
-
},
|
|
200
|
+
_response = await self._raw_client.get_config(
|
|
201
|
+
base_id=base_id,
|
|
202
|
+
config_name=config_name,
|
|
203
|
+
environment_name=environment_name,
|
|
443
204
|
request_options=request_options,
|
|
444
|
-
omit=OMIT,
|
|
445
205
|
)
|
|
446
|
-
|
|
447
|
-
if 200 <= _response.status_code < 300:
|
|
448
|
-
return typing.cast(
|
|
449
|
-
typing.Optional[typing.Any],
|
|
450
|
-
parse_obj_as(
|
|
451
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
452
|
-
object_=_response.json(),
|
|
453
|
-
),
|
|
454
|
-
)
|
|
455
|
-
if _response.status_code == 422:
|
|
456
|
-
raise UnprocessableEntityError(
|
|
457
|
-
typing.cast(
|
|
458
|
-
HttpValidationError,
|
|
459
|
-
parse_obj_as(
|
|
460
|
-
type_=HttpValidationError, # type: ignore
|
|
461
|
-
object_=_response.json(),
|
|
462
|
-
),
|
|
463
|
-
)
|
|
464
|
-
)
|
|
465
|
-
_response_json = _response.json()
|
|
466
|
-
except JSONDecodeError:
|
|
467
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
468
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
206
|
+
return _response.data
|
|
469
207
|
|
|
470
208
|
async def get_config_deployment_revision(
|
|
471
209
|
self,
|
|
@@ -494,7 +232,6 @@ class AsyncConfigsClient:
|
|
|
494
232
|
|
|
495
233
|
client = AsyncAgentaApi(
|
|
496
234
|
api_key="YOUR_API_KEY",
|
|
497
|
-
base_url="https://yourhost.com/path/to/api",
|
|
498
235
|
)
|
|
499
236
|
|
|
500
237
|
|
|
@@ -506,34 +243,10 @@ class AsyncConfigsClient:
|
|
|
506
243
|
|
|
507
244
|
asyncio.run(main())
|
|
508
245
|
"""
|
|
509
|
-
_response = await self.
|
|
510
|
-
|
|
511
|
-
method="GET",
|
|
512
|
-
request_options=request_options,
|
|
246
|
+
_response = await self._raw_client.get_config_deployment_revision(
|
|
247
|
+
deployment_revision_id, request_options=request_options
|
|
513
248
|
)
|
|
514
|
-
|
|
515
|
-
if 200 <= _response.status_code < 300:
|
|
516
|
-
return typing.cast(
|
|
517
|
-
typing.Optional[typing.Any],
|
|
518
|
-
parse_obj_as(
|
|
519
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
520
|
-
object_=_response.json(),
|
|
521
|
-
),
|
|
522
|
-
)
|
|
523
|
-
if _response.status_code == 422:
|
|
524
|
-
raise UnprocessableEntityError(
|
|
525
|
-
typing.cast(
|
|
526
|
-
HttpValidationError,
|
|
527
|
-
parse_obj_as(
|
|
528
|
-
type_=HttpValidationError, # type: ignore
|
|
529
|
-
object_=_response.json(),
|
|
530
|
-
),
|
|
531
|
-
)
|
|
532
|
-
)
|
|
533
|
-
_response_json = _response.json()
|
|
534
|
-
except JSONDecodeError:
|
|
535
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
536
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
249
|
+
return _response.data
|
|
537
250
|
|
|
538
251
|
async def revert_deployment_revision(
|
|
539
252
|
self,
|
|
@@ -562,7 +275,6 @@ class AsyncConfigsClient:
|
|
|
562
275
|
|
|
563
276
|
client = AsyncAgentaApi(
|
|
564
277
|
api_key="YOUR_API_KEY",
|
|
565
|
-
base_url="https://yourhost.com/path/to/api",
|
|
566
278
|
)
|
|
567
279
|
|
|
568
280
|
|
|
@@ -574,31 +286,7 @@ class AsyncConfigsClient:
|
|
|
574
286
|
|
|
575
287
|
asyncio.run(main())
|
|
576
288
|
"""
|
|
577
|
-
_response = await self.
|
|
578
|
-
|
|
579
|
-
method="POST",
|
|
580
|
-
request_options=request_options,
|
|
289
|
+
_response = await self._raw_client.revert_deployment_revision(
|
|
290
|
+
deployment_revision_id, request_options=request_options
|
|
581
291
|
)
|
|
582
|
-
|
|
583
|
-
if 200 <= _response.status_code < 300:
|
|
584
|
-
return typing.cast(
|
|
585
|
-
typing.Optional[typing.Any],
|
|
586
|
-
parse_obj_as(
|
|
587
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
588
|
-
object_=_response.json(),
|
|
589
|
-
),
|
|
590
|
-
)
|
|
591
|
-
if _response.status_code == 422:
|
|
592
|
-
raise UnprocessableEntityError(
|
|
593
|
-
typing.cast(
|
|
594
|
-
HttpValidationError,
|
|
595
|
-
parse_obj_as(
|
|
596
|
-
type_=HttpValidationError, # type: ignore
|
|
597
|
-
object_=_response.json(),
|
|
598
|
-
),
|
|
599
|
-
)
|
|
600
|
-
)
|
|
601
|
-
_response_json = _response.json()
|
|
602
|
-
except JSONDecodeError:
|
|
603
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
604
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
292
|
+
return _response.data
|