agenta 0.48.8__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.
- 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/decorators/tracing.py +2 -4
- agenta/sdk/tracing/processors.py +26 -39
- agenta/sdk/types.py +28 -1
- {agenta-0.48.8.dist-info → agenta-0.48.10.dist-info}/METADATA +1 -1
- agenta-0.48.10.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.8.dist-info/RECORD +0 -255
- {agenta-0.48.8.dist-info → agenta-0.48.10.dist-info}/WHEEL +0 -0
|
@@ -1,19 +1,14 @@
|
|
|
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
|
-
from ..types.
|
|
7
|
-
from ..core.pydantic_utilities import parse_obj_as
|
|
8
|
-
from json.decoder import JSONDecodeError
|
|
9
|
-
from ..core.api_error import ApiError
|
|
7
|
+
from ..types.evaluator_config import EvaluatorConfig
|
|
10
8
|
from ..types.evaluator_mapping_output_interface import EvaluatorMappingOutputInterface
|
|
11
|
-
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
|
12
|
-
from ..types.http_validation_error import HttpValidationError
|
|
13
9
|
from ..types.evaluator_output_interface import EvaluatorOutputInterface
|
|
14
|
-
from ..
|
|
15
|
-
from
|
|
16
|
-
from ..core.client_wrapper import AsyncClientWrapper
|
|
10
|
+
from ..types.legacy_evaluator import LegacyEvaluator
|
|
11
|
+
from .raw_client import AsyncRawEvaluatorsClient, RawEvaluatorsClient
|
|
17
12
|
|
|
18
13
|
# this is used as the default value for optional parameters
|
|
19
14
|
OMIT = typing.cast(typing.Any, ...)
|
|
@@ -21,11 +16,22 @@ OMIT = typing.cast(typing.Any, ...)
|
|
|
21
16
|
|
|
22
17
|
class EvaluatorsClient:
|
|
23
18
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
24
|
-
self.
|
|
19
|
+
self._raw_client = RawEvaluatorsClient(client_wrapper=client_wrapper)
|
|
20
|
+
|
|
21
|
+
@property
|
|
22
|
+
def with_raw_response(self) -> RawEvaluatorsClient:
|
|
23
|
+
"""
|
|
24
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
25
|
+
|
|
26
|
+
Returns
|
|
27
|
+
-------
|
|
28
|
+
RawEvaluatorsClient
|
|
29
|
+
"""
|
|
30
|
+
return self._raw_client
|
|
25
31
|
|
|
26
32
|
def get_evaluators_endpoint(
|
|
27
33
|
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
28
|
-
) -> typing.List[
|
|
34
|
+
) -> typing.List[LegacyEvaluator]:
|
|
29
35
|
"""
|
|
30
36
|
Endpoint to fetch a list of evaluators.
|
|
31
37
|
|
|
@@ -39,7 +45,7 @@ class EvaluatorsClient:
|
|
|
39
45
|
|
|
40
46
|
Returns
|
|
41
47
|
-------
|
|
42
|
-
typing.List[
|
|
48
|
+
typing.List[LegacyEvaluator]
|
|
43
49
|
Successful Response
|
|
44
50
|
|
|
45
51
|
Examples
|
|
@@ -48,28 +54,13 @@ class EvaluatorsClient:
|
|
|
48
54
|
|
|
49
55
|
client = AgentaApi(
|
|
50
56
|
api_key="YOUR_API_KEY",
|
|
51
|
-
base_url="https://yourhost.com/path/to/api",
|
|
52
57
|
)
|
|
53
58
|
client.evaluators.get_evaluators_endpoint()
|
|
54
59
|
"""
|
|
55
|
-
_response = self.
|
|
56
|
-
|
|
57
|
-
method="GET",
|
|
58
|
-
request_options=request_options,
|
|
60
|
+
_response = self._raw_client.get_evaluators_endpoint(
|
|
61
|
+
request_options=request_options
|
|
59
62
|
)
|
|
60
|
-
|
|
61
|
-
if 200 <= _response.status_code < 300:
|
|
62
|
-
return typing.cast(
|
|
63
|
-
typing.List[Evaluator],
|
|
64
|
-
parse_obj_as(
|
|
65
|
-
type_=typing.List[Evaluator], # type: ignore
|
|
66
|
-
object_=_response.json(),
|
|
67
|
-
),
|
|
68
|
-
)
|
|
69
|
-
_response_json = _response.json()
|
|
70
|
-
except JSONDecodeError:
|
|
71
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
72
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
63
|
+
return _response.data
|
|
73
64
|
|
|
74
65
|
def evaluator_data_map(
|
|
75
66
|
self,
|
|
@@ -108,49 +99,16 @@ class EvaluatorsClient:
|
|
|
108
99
|
|
|
109
100
|
client = AgentaApi(
|
|
110
101
|
api_key="YOUR_API_KEY",
|
|
111
|
-
base_url="https://yourhost.com/path/to/api",
|
|
112
102
|
)
|
|
113
103
|
client.evaluators.evaluator_data_map(
|
|
114
104
|
inputs={"key": "value"},
|
|
115
105
|
mapping={"key": "value"},
|
|
116
106
|
)
|
|
117
107
|
"""
|
|
118
|
-
_response = self.
|
|
119
|
-
|
|
120
|
-
method="POST",
|
|
121
|
-
json={
|
|
122
|
-
"inputs": inputs,
|
|
123
|
-
"mapping": mapping,
|
|
124
|
-
},
|
|
125
|
-
headers={
|
|
126
|
-
"content-type": "application/json",
|
|
127
|
-
},
|
|
128
|
-
request_options=request_options,
|
|
129
|
-
omit=OMIT,
|
|
108
|
+
_response = self._raw_client.evaluator_data_map(
|
|
109
|
+
inputs=inputs, mapping=mapping, request_options=request_options
|
|
130
110
|
)
|
|
131
|
-
|
|
132
|
-
if 200 <= _response.status_code < 300:
|
|
133
|
-
return typing.cast(
|
|
134
|
-
EvaluatorMappingOutputInterface,
|
|
135
|
-
parse_obj_as(
|
|
136
|
-
type_=EvaluatorMappingOutputInterface, # type: ignore
|
|
137
|
-
object_=_response.json(),
|
|
138
|
-
),
|
|
139
|
-
)
|
|
140
|
-
if _response.status_code == 422:
|
|
141
|
-
raise UnprocessableEntityError(
|
|
142
|
-
typing.cast(
|
|
143
|
-
HttpValidationError,
|
|
144
|
-
parse_obj_as(
|
|
145
|
-
type_=HttpValidationError, # type: ignore
|
|
146
|
-
object_=_response.json(),
|
|
147
|
-
),
|
|
148
|
-
)
|
|
149
|
-
)
|
|
150
|
-
_response_json = _response.json()
|
|
151
|
-
except JSONDecodeError:
|
|
152
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
153
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
111
|
+
return _response.data
|
|
154
112
|
|
|
155
113
|
def evaluator_run(
|
|
156
114
|
self,
|
|
@@ -198,49 +156,19 @@ class EvaluatorsClient:
|
|
|
198
156
|
|
|
199
157
|
client = AgentaApi(
|
|
200
158
|
api_key="YOUR_API_KEY",
|
|
201
|
-
base_url="https://yourhost.com/path/to/api",
|
|
202
159
|
)
|
|
203
160
|
client.evaluators.evaluator_run(
|
|
204
161
|
evaluator_key="evaluator_key",
|
|
205
162
|
)
|
|
206
163
|
"""
|
|
207
|
-
_response = self.
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
"settings": settings,
|
|
213
|
-
"credentials": credentials,
|
|
214
|
-
},
|
|
215
|
-
headers={
|
|
216
|
-
"content-type": "application/json",
|
|
217
|
-
},
|
|
164
|
+
_response = self._raw_client.evaluator_run(
|
|
165
|
+
evaluator_key,
|
|
166
|
+
inputs=inputs,
|
|
167
|
+
settings=settings,
|
|
168
|
+
credentials=credentials,
|
|
218
169
|
request_options=request_options,
|
|
219
|
-
omit=OMIT,
|
|
220
170
|
)
|
|
221
|
-
|
|
222
|
-
if 200 <= _response.status_code < 300:
|
|
223
|
-
return typing.cast(
|
|
224
|
-
EvaluatorOutputInterface,
|
|
225
|
-
parse_obj_as(
|
|
226
|
-
type_=EvaluatorOutputInterface, # type: ignore
|
|
227
|
-
object_=_response.json(),
|
|
228
|
-
),
|
|
229
|
-
)
|
|
230
|
-
if _response.status_code == 422:
|
|
231
|
-
raise UnprocessableEntityError(
|
|
232
|
-
typing.cast(
|
|
233
|
-
HttpValidationError,
|
|
234
|
-
parse_obj_as(
|
|
235
|
-
type_=HttpValidationError, # type: ignore
|
|
236
|
-
object_=_response.json(),
|
|
237
|
-
),
|
|
238
|
-
)
|
|
239
|
-
)
|
|
240
|
-
_response_json = _response.json()
|
|
241
|
-
except JSONDecodeError:
|
|
242
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
243
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
171
|
+
return _response.data
|
|
244
172
|
|
|
245
173
|
def get_evaluator_configs(
|
|
246
174
|
self, *, app_id: str, request_options: typing.Optional[RequestOptions] = None
|
|
@@ -272,43 +200,15 @@ class EvaluatorsClient:
|
|
|
272
200
|
|
|
273
201
|
client = AgentaApi(
|
|
274
202
|
api_key="YOUR_API_KEY",
|
|
275
|
-
base_url="https://yourhost.com/path/to/api",
|
|
276
203
|
)
|
|
277
204
|
client.evaluators.get_evaluator_configs(
|
|
278
205
|
app_id="app_id",
|
|
279
206
|
)
|
|
280
207
|
"""
|
|
281
|
-
_response = self.
|
|
282
|
-
|
|
283
|
-
method="GET",
|
|
284
|
-
params={
|
|
285
|
-
"app_id": app_id,
|
|
286
|
-
},
|
|
287
|
-
request_options=request_options,
|
|
208
|
+
_response = self._raw_client.get_evaluator_configs(
|
|
209
|
+
app_id=app_id, request_options=request_options
|
|
288
210
|
)
|
|
289
|
-
|
|
290
|
-
if 200 <= _response.status_code < 300:
|
|
291
|
-
return typing.cast(
|
|
292
|
-
typing.List[EvaluatorConfig],
|
|
293
|
-
parse_obj_as(
|
|
294
|
-
type_=typing.List[EvaluatorConfig], # type: ignore
|
|
295
|
-
object_=_response.json(),
|
|
296
|
-
),
|
|
297
|
-
)
|
|
298
|
-
if _response.status_code == 422:
|
|
299
|
-
raise UnprocessableEntityError(
|
|
300
|
-
typing.cast(
|
|
301
|
-
HttpValidationError,
|
|
302
|
-
parse_obj_as(
|
|
303
|
-
type_=HttpValidationError, # type: ignore
|
|
304
|
-
object_=_response.json(),
|
|
305
|
-
),
|
|
306
|
-
)
|
|
307
|
-
)
|
|
308
|
-
_response_json = _response.json()
|
|
309
|
-
except JSONDecodeError:
|
|
310
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
311
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
211
|
+
return _response.data
|
|
312
212
|
|
|
313
213
|
def create_new_evaluator_config(
|
|
314
214
|
self,
|
|
@@ -352,7 +252,6 @@ class EvaluatorsClient:
|
|
|
352
252
|
|
|
353
253
|
client = AgentaApi(
|
|
354
254
|
api_key="YOUR_API_KEY",
|
|
355
|
-
base_url="https://yourhost.com/path/to/api",
|
|
356
255
|
)
|
|
357
256
|
client.evaluators.create_new_evaluator_config(
|
|
358
257
|
app_id="app_id",
|
|
@@ -361,44 +260,14 @@ class EvaluatorsClient:
|
|
|
361
260
|
settings_values={"key": "value"},
|
|
362
261
|
)
|
|
363
262
|
"""
|
|
364
|
-
_response = self.
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
"name": name,
|
|
370
|
-
"evaluator_key": evaluator_key,
|
|
371
|
-
"settings_values": settings_values,
|
|
372
|
-
},
|
|
373
|
-
headers={
|
|
374
|
-
"content-type": "application/json",
|
|
375
|
-
},
|
|
263
|
+
_response = self._raw_client.create_new_evaluator_config(
|
|
264
|
+
app_id=app_id,
|
|
265
|
+
name=name,
|
|
266
|
+
evaluator_key=evaluator_key,
|
|
267
|
+
settings_values=settings_values,
|
|
376
268
|
request_options=request_options,
|
|
377
|
-
omit=OMIT,
|
|
378
269
|
)
|
|
379
|
-
|
|
380
|
-
if 200 <= _response.status_code < 300:
|
|
381
|
-
return typing.cast(
|
|
382
|
-
EvaluatorConfig,
|
|
383
|
-
parse_obj_as(
|
|
384
|
-
type_=EvaluatorConfig, # type: ignore
|
|
385
|
-
object_=_response.json(),
|
|
386
|
-
),
|
|
387
|
-
)
|
|
388
|
-
if _response.status_code == 422:
|
|
389
|
-
raise UnprocessableEntityError(
|
|
390
|
-
typing.cast(
|
|
391
|
-
HttpValidationError,
|
|
392
|
-
parse_obj_as(
|
|
393
|
-
type_=HttpValidationError, # type: ignore
|
|
394
|
-
object_=_response.json(),
|
|
395
|
-
),
|
|
396
|
-
)
|
|
397
|
-
)
|
|
398
|
-
_response_json = _response.json()
|
|
399
|
-
except JSONDecodeError:
|
|
400
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
401
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
270
|
+
return _response.data
|
|
402
271
|
|
|
403
272
|
def get_evaluator_config(
|
|
404
273
|
self,
|
|
@@ -430,40 +299,15 @@ class EvaluatorsClient:
|
|
|
430
299
|
|
|
431
300
|
client = AgentaApi(
|
|
432
301
|
api_key="YOUR_API_KEY",
|
|
433
|
-
base_url="https://yourhost.com/path/to/api",
|
|
434
302
|
)
|
|
435
303
|
client.evaluators.get_evaluator_config(
|
|
436
304
|
evaluator_config_id="evaluator_config_id",
|
|
437
305
|
)
|
|
438
306
|
"""
|
|
439
|
-
_response = self.
|
|
440
|
-
|
|
441
|
-
method="GET",
|
|
442
|
-
request_options=request_options,
|
|
307
|
+
_response = self._raw_client.get_evaluator_config(
|
|
308
|
+
evaluator_config_id, request_options=request_options
|
|
443
309
|
)
|
|
444
|
-
|
|
445
|
-
if 200 <= _response.status_code < 300:
|
|
446
|
-
return typing.cast(
|
|
447
|
-
EvaluatorConfig,
|
|
448
|
-
parse_obj_as(
|
|
449
|
-
type_=EvaluatorConfig, # type: ignore
|
|
450
|
-
object_=_response.json(),
|
|
451
|
-
),
|
|
452
|
-
)
|
|
453
|
-
if _response.status_code == 422:
|
|
454
|
-
raise UnprocessableEntityError(
|
|
455
|
-
typing.cast(
|
|
456
|
-
HttpValidationError,
|
|
457
|
-
parse_obj_as(
|
|
458
|
-
type_=HttpValidationError, # type: ignore
|
|
459
|
-
object_=_response.json(),
|
|
460
|
-
),
|
|
461
|
-
)
|
|
462
|
-
)
|
|
463
|
-
_response_json = _response.json()
|
|
464
|
-
except JSONDecodeError:
|
|
465
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
466
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
310
|
+
return _response.data
|
|
467
311
|
|
|
468
312
|
def update_evaluator_config(
|
|
469
313
|
self,
|
|
@@ -506,49 +350,19 @@ class EvaluatorsClient:
|
|
|
506
350
|
|
|
507
351
|
client = AgentaApi(
|
|
508
352
|
api_key="YOUR_API_KEY",
|
|
509
|
-
base_url="https://yourhost.com/path/to/api",
|
|
510
353
|
)
|
|
511
354
|
client.evaluators.update_evaluator_config(
|
|
512
355
|
evaluator_config_id="evaluator_config_id",
|
|
513
356
|
)
|
|
514
357
|
"""
|
|
515
|
-
_response = self.
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
"evaluator_key": evaluator_key,
|
|
521
|
-
"settings_values": settings_values,
|
|
522
|
-
},
|
|
523
|
-
headers={
|
|
524
|
-
"content-type": "application/json",
|
|
525
|
-
},
|
|
358
|
+
_response = self._raw_client.update_evaluator_config(
|
|
359
|
+
evaluator_config_id,
|
|
360
|
+
name=name,
|
|
361
|
+
evaluator_key=evaluator_key,
|
|
362
|
+
settings_values=settings_values,
|
|
526
363
|
request_options=request_options,
|
|
527
|
-
omit=OMIT,
|
|
528
364
|
)
|
|
529
|
-
|
|
530
|
-
if 200 <= _response.status_code < 300:
|
|
531
|
-
return typing.cast(
|
|
532
|
-
EvaluatorConfig,
|
|
533
|
-
parse_obj_as(
|
|
534
|
-
type_=EvaluatorConfig, # type: ignore
|
|
535
|
-
object_=_response.json(),
|
|
536
|
-
),
|
|
537
|
-
)
|
|
538
|
-
if _response.status_code == 422:
|
|
539
|
-
raise UnprocessableEntityError(
|
|
540
|
-
typing.cast(
|
|
541
|
-
HttpValidationError,
|
|
542
|
-
parse_obj_as(
|
|
543
|
-
type_=HttpValidationError, # type: ignore
|
|
544
|
-
object_=_response.json(),
|
|
545
|
-
),
|
|
546
|
-
)
|
|
547
|
-
)
|
|
548
|
-
_response_json = _response.json()
|
|
549
|
-
except JSONDecodeError:
|
|
550
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
551
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
365
|
+
return _response.data
|
|
552
366
|
|
|
553
367
|
def delete_evaluator_config(
|
|
554
368
|
self,
|
|
@@ -583,49 +397,35 @@ class EvaluatorsClient:
|
|
|
583
397
|
|
|
584
398
|
client = AgentaApi(
|
|
585
399
|
api_key="YOUR_API_KEY",
|
|
586
|
-
base_url="https://yourhost.com/path/to/api",
|
|
587
400
|
)
|
|
588
401
|
client.evaluators.delete_evaluator_config(
|
|
589
402
|
evaluator_config_id="evaluator_config_id",
|
|
590
403
|
)
|
|
591
404
|
"""
|
|
592
|
-
_response = self.
|
|
593
|
-
|
|
594
|
-
method="DELETE",
|
|
595
|
-
request_options=request_options,
|
|
405
|
+
_response = self._raw_client.delete_evaluator_config(
|
|
406
|
+
evaluator_config_id, request_options=request_options
|
|
596
407
|
)
|
|
597
|
-
|
|
598
|
-
if 200 <= _response.status_code < 300:
|
|
599
|
-
return typing.cast(
|
|
600
|
-
bool,
|
|
601
|
-
parse_obj_as(
|
|
602
|
-
type_=bool, # type: ignore
|
|
603
|
-
object_=_response.json(),
|
|
604
|
-
),
|
|
605
|
-
)
|
|
606
|
-
if _response.status_code == 422:
|
|
607
|
-
raise UnprocessableEntityError(
|
|
608
|
-
typing.cast(
|
|
609
|
-
HttpValidationError,
|
|
610
|
-
parse_obj_as(
|
|
611
|
-
type_=HttpValidationError, # type: ignore
|
|
612
|
-
object_=_response.json(),
|
|
613
|
-
),
|
|
614
|
-
)
|
|
615
|
-
)
|
|
616
|
-
_response_json = _response.json()
|
|
617
|
-
except JSONDecodeError:
|
|
618
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
619
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
408
|
+
return _response.data
|
|
620
409
|
|
|
621
410
|
|
|
622
411
|
class AsyncEvaluatorsClient:
|
|
623
412
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
624
|
-
self.
|
|
413
|
+
self._raw_client = AsyncRawEvaluatorsClient(client_wrapper=client_wrapper)
|
|
414
|
+
|
|
415
|
+
@property
|
|
416
|
+
def with_raw_response(self) -> AsyncRawEvaluatorsClient:
|
|
417
|
+
"""
|
|
418
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
419
|
+
|
|
420
|
+
Returns
|
|
421
|
+
-------
|
|
422
|
+
AsyncRawEvaluatorsClient
|
|
423
|
+
"""
|
|
424
|
+
return self._raw_client
|
|
625
425
|
|
|
626
426
|
async def get_evaluators_endpoint(
|
|
627
427
|
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
628
|
-
) -> typing.List[
|
|
428
|
+
) -> typing.List[LegacyEvaluator]:
|
|
629
429
|
"""
|
|
630
430
|
Endpoint to fetch a list of evaluators.
|
|
631
431
|
|
|
@@ -639,7 +439,7 @@ class AsyncEvaluatorsClient:
|
|
|
639
439
|
|
|
640
440
|
Returns
|
|
641
441
|
-------
|
|
642
|
-
typing.List[
|
|
442
|
+
typing.List[LegacyEvaluator]
|
|
643
443
|
Successful Response
|
|
644
444
|
|
|
645
445
|
Examples
|
|
@@ -650,7 +450,6 @@ class AsyncEvaluatorsClient:
|
|
|
650
450
|
|
|
651
451
|
client = AsyncAgentaApi(
|
|
652
452
|
api_key="YOUR_API_KEY",
|
|
653
|
-
base_url="https://yourhost.com/path/to/api",
|
|
654
453
|
)
|
|
655
454
|
|
|
656
455
|
|
|
@@ -660,24 +459,10 @@ class AsyncEvaluatorsClient:
|
|
|
660
459
|
|
|
661
460
|
asyncio.run(main())
|
|
662
461
|
"""
|
|
663
|
-
_response = await self.
|
|
664
|
-
|
|
665
|
-
method="GET",
|
|
666
|
-
request_options=request_options,
|
|
462
|
+
_response = await self._raw_client.get_evaluators_endpoint(
|
|
463
|
+
request_options=request_options
|
|
667
464
|
)
|
|
668
|
-
|
|
669
|
-
if 200 <= _response.status_code < 300:
|
|
670
|
-
return typing.cast(
|
|
671
|
-
typing.List[Evaluator],
|
|
672
|
-
parse_obj_as(
|
|
673
|
-
type_=typing.List[Evaluator], # type: ignore
|
|
674
|
-
object_=_response.json(),
|
|
675
|
-
),
|
|
676
|
-
)
|
|
677
|
-
_response_json = _response.json()
|
|
678
|
-
except JSONDecodeError:
|
|
679
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
680
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
465
|
+
return _response.data
|
|
681
466
|
|
|
682
467
|
async def evaluator_data_map(
|
|
683
468
|
self,
|
|
@@ -718,7 +503,6 @@ class AsyncEvaluatorsClient:
|
|
|
718
503
|
|
|
719
504
|
client = AsyncAgentaApi(
|
|
720
505
|
api_key="YOUR_API_KEY",
|
|
721
|
-
base_url="https://yourhost.com/path/to/api",
|
|
722
506
|
)
|
|
723
507
|
|
|
724
508
|
|
|
@@ -731,42 +515,10 @@ class AsyncEvaluatorsClient:
|
|
|
731
515
|
|
|
732
516
|
asyncio.run(main())
|
|
733
517
|
"""
|
|
734
|
-
_response = await self.
|
|
735
|
-
|
|
736
|
-
method="POST",
|
|
737
|
-
json={
|
|
738
|
-
"inputs": inputs,
|
|
739
|
-
"mapping": mapping,
|
|
740
|
-
},
|
|
741
|
-
headers={
|
|
742
|
-
"content-type": "application/json",
|
|
743
|
-
},
|
|
744
|
-
request_options=request_options,
|
|
745
|
-
omit=OMIT,
|
|
518
|
+
_response = await self._raw_client.evaluator_data_map(
|
|
519
|
+
inputs=inputs, mapping=mapping, request_options=request_options
|
|
746
520
|
)
|
|
747
|
-
|
|
748
|
-
if 200 <= _response.status_code < 300:
|
|
749
|
-
return typing.cast(
|
|
750
|
-
EvaluatorMappingOutputInterface,
|
|
751
|
-
parse_obj_as(
|
|
752
|
-
type_=EvaluatorMappingOutputInterface, # type: ignore
|
|
753
|
-
object_=_response.json(),
|
|
754
|
-
),
|
|
755
|
-
)
|
|
756
|
-
if _response.status_code == 422:
|
|
757
|
-
raise UnprocessableEntityError(
|
|
758
|
-
typing.cast(
|
|
759
|
-
HttpValidationError,
|
|
760
|
-
parse_obj_as(
|
|
761
|
-
type_=HttpValidationError, # type: ignore
|
|
762
|
-
object_=_response.json(),
|
|
763
|
-
),
|
|
764
|
-
)
|
|
765
|
-
)
|
|
766
|
-
_response_json = _response.json()
|
|
767
|
-
except JSONDecodeError:
|
|
768
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
769
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
521
|
+
return _response.data
|
|
770
522
|
|
|
771
523
|
async def evaluator_run(
|
|
772
524
|
self,
|
|
@@ -816,7 +568,6 @@ class AsyncEvaluatorsClient:
|
|
|
816
568
|
|
|
817
569
|
client = AsyncAgentaApi(
|
|
818
570
|
api_key="YOUR_API_KEY",
|
|
819
|
-
base_url="https://yourhost.com/path/to/api",
|
|
820
571
|
)
|
|
821
572
|
|
|
822
573
|
|
|
@@ -828,43 +579,14 @@ class AsyncEvaluatorsClient:
|
|
|
828
579
|
|
|
829
580
|
asyncio.run(main())
|
|
830
581
|
"""
|
|
831
|
-
_response = await self.
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
"settings": settings,
|
|
837
|
-
"credentials": credentials,
|
|
838
|
-
},
|
|
839
|
-
headers={
|
|
840
|
-
"content-type": "application/json",
|
|
841
|
-
},
|
|
582
|
+
_response = await self._raw_client.evaluator_run(
|
|
583
|
+
evaluator_key,
|
|
584
|
+
inputs=inputs,
|
|
585
|
+
settings=settings,
|
|
586
|
+
credentials=credentials,
|
|
842
587
|
request_options=request_options,
|
|
843
|
-
omit=OMIT,
|
|
844
588
|
)
|
|
845
|
-
|
|
846
|
-
if 200 <= _response.status_code < 300:
|
|
847
|
-
return typing.cast(
|
|
848
|
-
EvaluatorOutputInterface,
|
|
849
|
-
parse_obj_as(
|
|
850
|
-
type_=EvaluatorOutputInterface, # type: ignore
|
|
851
|
-
object_=_response.json(),
|
|
852
|
-
),
|
|
853
|
-
)
|
|
854
|
-
if _response.status_code == 422:
|
|
855
|
-
raise UnprocessableEntityError(
|
|
856
|
-
typing.cast(
|
|
857
|
-
HttpValidationError,
|
|
858
|
-
parse_obj_as(
|
|
859
|
-
type_=HttpValidationError, # type: ignore
|
|
860
|
-
object_=_response.json(),
|
|
861
|
-
),
|
|
862
|
-
)
|
|
863
|
-
)
|
|
864
|
-
_response_json = _response.json()
|
|
865
|
-
except JSONDecodeError:
|
|
866
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
867
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
589
|
+
return _response.data
|
|
868
590
|
|
|
869
591
|
async def get_evaluator_configs(
|
|
870
592
|
self, *, app_id: str, request_options: typing.Optional[RequestOptions] = None
|
|
@@ -898,7 +620,6 @@ class AsyncEvaluatorsClient:
|
|
|
898
620
|
|
|
899
621
|
client = AsyncAgentaApi(
|
|
900
622
|
api_key="YOUR_API_KEY",
|
|
901
|
-
base_url="https://yourhost.com/path/to/api",
|
|
902
623
|
)
|
|
903
624
|
|
|
904
625
|
|
|
@@ -910,37 +631,10 @@ class AsyncEvaluatorsClient:
|
|
|
910
631
|
|
|
911
632
|
asyncio.run(main())
|
|
912
633
|
"""
|
|
913
|
-
_response = await self.
|
|
914
|
-
|
|
915
|
-
method="GET",
|
|
916
|
-
params={
|
|
917
|
-
"app_id": app_id,
|
|
918
|
-
},
|
|
919
|
-
request_options=request_options,
|
|
634
|
+
_response = await self._raw_client.get_evaluator_configs(
|
|
635
|
+
app_id=app_id, request_options=request_options
|
|
920
636
|
)
|
|
921
|
-
|
|
922
|
-
if 200 <= _response.status_code < 300:
|
|
923
|
-
return typing.cast(
|
|
924
|
-
typing.List[EvaluatorConfig],
|
|
925
|
-
parse_obj_as(
|
|
926
|
-
type_=typing.List[EvaluatorConfig], # type: ignore
|
|
927
|
-
object_=_response.json(),
|
|
928
|
-
),
|
|
929
|
-
)
|
|
930
|
-
if _response.status_code == 422:
|
|
931
|
-
raise UnprocessableEntityError(
|
|
932
|
-
typing.cast(
|
|
933
|
-
HttpValidationError,
|
|
934
|
-
parse_obj_as(
|
|
935
|
-
type_=HttpValidationError, # type: ignore
|
|
936
|
-
object_=_response.json(),
|
|
937
|
-
),
|
|
938
|
-
)
|
|
939
|
-
)
|
|
940
|
-
_response_json = _response.json()
|
|
941
|
-
except JSONDecodeError:
|
|
942
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
943
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
637
|
+
return _response.data
|
|
944
638
|
|
|
945
639
|
async def create_new_evaluator_config(
|
|
946
640
|
self,
|
|
@@ -986,7 +680,6 @@ class AsyncEvaluatorsClient:
|
|
|
986
680
|
|
|
987
681
|
client = AsyncAgentaApi(
|
|
988
682
|
api_key="YOUR_API_KEY",
|
|
989
|
-
base_url="https://yourhost.com/path/to/api",
|
|
990
683
|
)
|
|
991
684
|
|
|
992
685
|
|
|
@@ -1001,44 +694,14 @@ class AsyncEvaluatorsClient:
|
|
|
1001
694
|
|
|
1002
695
|
asyncio.run(main())
|
|
1003
696
|
"""
|
|
1004
|
-
_response = await self.
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
"name": name,
|
|
1010
|
-
"evaluator_key": evaluator_key,
|
|
1011
|
-
"settings_values": settings_values,
|
|
1012
|
-
},
|
|
1013
|
-
headers={
|
|
1014
|
-
"content-type": "application/json",
|
|
1015
|
-
},
|
|
697
|
+
_response = await self._raw_client.create_new_evaluator_config(
|
|
698
|
+
app_id=app_id,
|
|
699
|
+
name=name,
|
|
700
|
+
evaluator_key=evaluator_key,
|
|
701
|
+
settings_values=settings_values,
|
|
1016
702
|
request_options=request_options,
|
|
1017
|
-
omit=OMIT,
|
|
1018
703
|
)
|
|
1019
|
-
|
|
1020
|
-
if 200 <= _response.status_code < 300:
|
|
1021
|
-
return typing.cast(
|
|
1022
|
-
EvaluatorConfig,
|
|
1023
|
-
parse_obj_as(
|
|
1024
|
-
type_=EvaluatorConfig, # type: ignore
|
|
1025
|
-
object_=_response.json(),
|
|
1026
|
-
),
|
|
1027
|
-
)
|
|
1028
|
-
if _response.status_code == 422:
|
|
1029
|
-
raise UnprocessableEntityError(
|
|
1030
|
-
typing.cast(
|
|
1031
|
-
HttpValidationError,
|
|
1032
|
-
parse_obj_as(
|
|
1033
|
-
type_=HttpValidationError, # type: ignore
|
|
1034
|
-
object_=_response.json(),
|
|
1035
|
-
),
|
|
1036
|
-
)
|
|
1037
|
-
)
|
|
1038
|
-
_response_json = _response.json()
|
|
1039
|
-
except JSONDecodeError:
|
|
1040
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1041
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
704
|
+
return _response.data
|
|
1042
705
|
|
|
1043
706
|
async def get_evaluator_config(
|
|
1044
707
|
self,
|
|
@@ -1072,7 +735,6 @@ class AsyncEvaluatorsClient:
|
|
|
1072
735
|
|
|
1073
736
|
client = AsyncAgentaApi(
|
|
1074
737
|
api_key="YOUR_API_KEY",
|
|
1075
|
-
base_url="https://yourhost.com/path/to/api",
|
|
1076
738
|
)
|
|
1077
739
|
|
|
1078
740
|
|
|
@@ -1084,34 +746,10 @@ class AsyncEvaluatorsClient:
|
|
|
1084
746
|
|
|
1085
747
|
asyncio.run(main())
|
|
1086
748
|
"""
|
|
1087
|
-
_response = await self.
|
|
1088
|
-
|
|
1089
|
-
method="GET",
|
|
1090
|
-
request_options=request_options,
|
|
749
|
+
_response = await self._raw_client.get_evaluator_config(
|
|
750
|
+
evaluator_config_id, request_options=request_options
|
|
1091
751
|
)
|
|
1092
|
-
|
|
1093
|
-
if 200 <= _response.status_code < 300:
|
|
1094
|
-
return typing.cast(
|
|
1095
|
-
EvaluatorConfig,
|
|
1096
|
-
parse_obj_as(
|
|
1097
|
-
type_=EvaluatorConfig, # type: ignore
|
|
1098
|
-
object_=_response.json(),
|
|
1099
|
-
),
|
|
1100
|
-
)
|
|
1101
|
-
if _response.status_code == 422:
|
|
1102
|
-
raise UnprocessableEntityError(
|
|
1103
|
-
typing.cast(
|
|
1104
|
-
HttpValidationError,
|
|
1105
|
-
parse_obj_as(
|
|
1106
|
-
type_=HttpValidationError, # type: ignore
|
|
1107
|
-
object_=_response.json(),
|
|
1108
|
-
),
|
|
1109
|
-
)
|
|
1110
|
-
)
|
|
1111
|
-
_response_json = _response.json()
|
|
1112
|
-
except JSONDecodeError:
|
|
1113
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1114
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
752
|
+
return _response.data
|
|
1115
753
|
|
|
1116
754
|
async def update_evaluator_config(
|
|
1117
755
|
self,
|
|
@@ -1156,7 +794,6 @@ class AsyncEvaluatorsClient:
|
|
|
1156
794
|
|
|
1157
795
|
client = AsyncAgentaApi(
|
|
1158
796
|
api_key="YOUR_API_KEY",
|
|
1159
|
-
base_url="https://yourhost.com/path/to/api",
|
|
1160
797
|
)
|
|
1161
798
|
|
|
1162
799
|
|
|
@@ -1168,43 +805,14 @@ class AsyncEvaluatorsClient:
|
|
|
1168
805
|
|
|
1169
806
|
asyncio.run(main())
|
|
1170
807
|
"""
|
|
1171
|
-
_response = await self.
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
"evaluator_key": evaluator_key,
|
|
1177
|
-
"settings_values": settings_values,
|
|
1178
|
-
},
|
|
1179
|
-
headers={
|
|
1180
|
-
"content-type": "application/json",
|
|
1181
|
-
},
|
|
808
|
+
_response = await self._raw_client.update_evaluator_config(
|
|
809
|
+
evaluator_config_id,
|
|
810
|
+
name=name,
|
|
811
|
+
evaluator_key=evaluator_key,
|
|
812
|
+
settings_values=settings_values,
|
|
1182
813
|
request_options=request_options,
|
|
1183
|
-
omit=OMIT,
|
|
1184
814
|
)
|
|
1185
|
-
|
|
1186
|
-
if 200 <= _response.status_code < 300:
|
|
1187
|
-
return typing.cast(
|
|
1188
|
-
EvaluatorConfig,
|
|
1189
|
-
parse_obj_as(
|
|
1190
|
-
type_=EvaluatorConfig, # type: ignore
|
|
1191
|
-
object_=_response.json(),
|
|
1192
|
-
),
|
|
1193
|
-
)
|
|
1194
|
-
if _response.status_code == 422:
|
|
1195
|
-
raise UnprocessableEntityError(
|
|
1196
|
-
typing.cast(
|
|
1197
|
-
HttpValidationError,
|
|
1198
|
-
parse_obj_as(
|
|
1199
|
-
type_=HttpValidationError, # type: ignore
|
|
1200
|
-
object_=_response.json(),
|
|
1201
|
-
),
|
|
1202
|
-
)
|
|
1203
|
-
)
|
|
1204
|
-
_response_json = _response.json()
|
|
1205
|
-
except JSONDecodeError:
|
|
1206
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1207
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
815
|
+
return _response.data
|
|
1208
816
|
|
|
1209
817
|
async def delete_evaluator_config(
|
|
1210
818
|
self,
|
|
@@ -1241,7 +849,6 @@ class AsyncEvaluatorsClient:
|
|
|
1241
849
|
|
|
1242
850
|
client = AsyncAgentaApi(
|
|
1243
851
|
api_key="YOUR_API_KEY",
|
|
1244
|
-
base_url="https://yourhost.com/path/to/api",
|
|
1245
852
|
)
|
|
1246
853
|
|
|
1247
854
|
|
|
@@ -1253,31 +860,7 @@ class AsyncEvaluatorsClient:
|
|
|
1253
860
|
|
|
1254
861
|
asyncio.run(main())
|
|
1255
862
|
"""
|
|
1256
|
-
_response = await self.
|
|
1257
|
-
|
|
1258
|
-
method="DELETE",
|
|
1259
|
-
request_options=request_options,
|
|
863
|
+
_response = await self._raw_client.delete_evaluator_config(
|
|
864
|
+
evaluator_config_id, request_options=request_options
|
|
1260
865
|
)
|
|
1261
|
-
|
|
1262
|
-
if 200 <= _response.status_code < 300:
|
|
1263
|
-
return typing.cast(
|
|
1264
|
-
bool,
|
|
1265
|
-
parse_obj_as(
|
|
1266
|
-
type_=bool, # type: ignore
|
|
1267
|
-
object_=_response.json(),
|
|
1268
|
-
),
|
|
1269
|
-
)
|
|
1270
|
-
if _response.status_code == 422:
|
|
1271
|
-
raise UnprocessableEntityError(
|
|
1272
|
-
typing.cast(
|
|
1273
|
-
HttpValidationError,
|
|
1274
|
-
parse_obj_as(
|
|
1275
|
-
type_=HttpValidationError, # type: ignore
|
|
1276
|
-
object_=_response.json(),
|
|
1277
|
-
),
|
|
1278
|
-
)
|
|
1279
|
-
)
|
|
1280
|
-
_response_json = _response.json()
|
|
1281
|
-
except JSONDecodeError:
|
|
1282
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1283
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
866
|
+
return _response.data
|