aeri-python 4.0.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.
- aeri/__init__.py +72 -0
- aeri/_client/_validation.py +204 -0
- aeri/_client/attributes.py +188 -0
- aeri/_client/client.py +3761 -0
- aeri/_client/constants.py +65 -0
- aeri/_client/datasets.py +302 -0
- aeri/_client/environment_variables.py +158 -0
- aeri/_client/get_client.py +149 -0
- aeri/_client/observe.py +661 -0
- aeri/_client/propagation.py +475 -0
- aeri/_client/resource_manager.py +510 -0
- aeri/_client/span.py +1519 -0
- aeri/_client/span_filter.py +76 -0
- aeri/_client/span_processor.py +206 -0
- aeri/_client/utils.py +132 -0
- aeri/_task_manager/media_manager.py +331 -0
- aeri/_task_manager/media_upload_consumer.py +44 -0
- aeri/_task_manager/media_upload_queue.py +12 -0
- aeri/_task_manager/score_ingestion_consumer.py +208 -0
- aeri/_task_manager/task_manager.py +475 -0
- aeri/_utils/__init__.py +19 -0
- aeri/_utils/environment.py +34 -0
- aeri/_utils/error_logging.py +47 -0
- aeri/_utils/parse_error.py +99 -0
- aeri/_utils/prompt_cache.py +188 -0
- aeri/_utils/request.py +137 -0
- aeri/_utils/serializer.py +205 -0
- aeri/api/.fern/metadata.json +14 -0
- aeri/api/__init__.py +836 -0
- aeri/api/annotation_queues/__init__.py +82 -0
- aeri/api/annotation_queues/client.py +1111 -0
- aeri/api/annotation_queues/raw_client.py +2288 -0
- aeri/api/annotation_queues/types/__init__.py +84 -0
- aeri/api/annotation_queues/types/annotation_queue.py +28 -0
- aeri/api/annotation_queues/types/annotation_queue_assignment_request.py +16 -0
- aeri/api/annotation_queues/types/annotation_queue_item.py +34 -0
- aeri/api/annotation_queues/types/annotation_queue_object_type.py +26 -0
- aeri/api/annotation_queues/types/annotation_queue_status.py +22 -0
- aeri/api/annotation_queues/types/create_annotation_queue_assignment_response.py +18 -0
- aeri/api/annotation_queues/types/create_annotation_queue_item_request.py +25 -0
- aeri/api/annotation_queues/types/create_annotation_queue_request.py +20 -0
- aeri/api/annotation_queues/types/delete_annotation_queue_assignment_response.py +14 -0
- aeri/api/annotation_queues/types/delete_annotation_queue_item_response.py +15 -0
- aeri/api/annotation_queues/types/paginated_annotation_queue_items.py +17 -0
- aeri/api/annotation_queues/types/paginated_annotation_queues.py +17 -0
- aeri/api/annotation_queues/types/update_annotation_queue_item_request.py +15 -0
- aeri/api/blob_storage_integrations/__init__.py +73 -0
- aeri/api/blob_storage_integrations/client.py +550 -0
- aeri/api/blob_storage_integrations/raw_client.py +976 -0
- aeri/api/blob_storage_integrations/types/__init__.py +77 -0
- aeri/api/blob_storage_integrations/types/blob_storage_export_frequency.py +26 -0
- aeri/api/blob_storage_integrations/types/blob_storage_export_mode.py +26 -0
- aeri/api/blob_storage_integrations/types/blob_storage_integration_deletion_response.py +14 -0
- aeri/api/blob_storage_integrations/types/blob_storage_integration_file_type.py +26 -0
- aeri/api/blob_storage_integrations/types/blob_storage_integration_response.py +64 -0
- aeri/api/blob_storage_integrations/types/blob_storage_integration_status_response.py +50 -0
- aeri/api/blob_storage_integrations/types/blob_storage_integration_type.py +26 -0
- aeri/api/blob_storage_integrations/types/blob_storage_integrations_response.py +15 -0
- aeri/api/blob_storage_integrations/types/blob_storage_sync_status.py +47 -0
- aeri/api/blob_storage_integrations/types/create_blob_storage_integration_request.py +91 -0
- aeri/api/client.py +679 -0
- aeri/api/comments/__init__.py +44 -0
- aeri/api/comments/client.py +407 -0
- aeri/api/comments/raw_client.py +750 -0
- aeri/api/comments/types/__init__.py +46 -0
- aeri/api/comments/types/create_comment_request.py +47 -0
- aeri/api/comments/types/create_comment_response.py +17 -0
- aeri/api/comments/types/get_comments_response.py +17 -0
- aeri/api/commons/__init__.py +210 -0
- aeri/api/commons/errors/__init__.py +56 -0
- aeri/api/commons/errors/access_denied_error.py +12 -0
- aeri/api/commons/errors/error.py +12 -0
- aeri/api/commons/errors/method_not_allowed_error.py +12 -0
- aeri/api/commons/errors/not_found_error.py +12 -0
- aeri/api/commons/errors/unauthorized_error.py +12 -0
- aeri/api/commons/types/__init__.py +190 -0
- aeri/api/commons/types/base_score.py +90 -0
- aeri/api/commons/types/base_score_v1.py +70 -0
- aeri/api/commons/types/boolean_score.py +26 -0
- aeri/api/commons/types/boolean_score_v1.py +26 -0
- aeri/api/commons/types/categorical_score.py +26 -0
- aeri/api/commons/types/categorical_score_v1.py +26 -0
- aeri/api/commons/types/comment.py +36 -0
- aeri/api/commons/types/comment_object_type.py +30 -0
- aeri/api/commons/types/config_category.py +15 -0
- aeri/api/commons/types/correction_score.py +26 -0
- aeri/api/commons/types/create_score_value.py +5 -0
- aeri/api/commons/types/dataset.py +49 -0
- aeri/api/commons/types/dataset_item.py +58 -0
- aeri/api/commons/types/dataset_run.py +63 -0
- aeri/api/commons/types/dataset_run_item.py +40 -0
- aeri/api/commons/types/dataset_run_with_items.py +19 -0
- aeri/api/commons/types/dataset_status.py +22 -0
- aeri/api/commons/types/map_value.py +11 -0
- aeri/api/commons/types/model.py +125 -0
- aeri/api/commons/types/model_price.py +14 -0
- aeri/api/commons/types/model_usage_unit.py +42 -0
- aeri/api/commons/types/numeric_score.py +17 -0
- aeri/api/commons/types/numeric_score_v1.py +17 -0
- aeri/api/commons/types/observation.py +142 -0
- aeri/api/commons/types/observation_level.py +30 -0
- aeri/api/commons/types/observation_v2.py +235 -0
- aeri/api/commons/types/observations_view.py +89 -0
- aeri/api/commons/types/pricing_tier.py +91 -0
- aeri/api/commons/types/pricing_tier_condition.py +68 -0
- aeri/api/commons/types/pricing_tier_input.py +76 -0
- aeri/api/commons/types/pricing_tier_operator.py +42 -0
- aeri/api/commons/types/score.py +201 -0
- aeri/api/commons/types/score_config.py +66 -0
- aeri/api/commons/types/score_config_data_type.py +26 -0
- aeri/api/commons/types/score_data_type.py +30 -0
- aeri/api/commons/types/score_source.py +26 -0
- aeri/api/commons/types/score_v1.py +131 -0
- aeri/api/commons/types/session.py +25 -0
- aeri/api/commons/types/session_with_traces.py +15 -0
- aeri/api/commons/types/trace.py +84 -0
- aeri/api/commons/types/trace_with_details.py +43 -0
- aeri/api/commons/types/trace_with_full_details.py +45 -0
- aeri/api/commons/types/usage.py +59 -0
- aeri/api/core/__init__.py +111 -0
- aeri/api/core/api_error.py +23 -0
- aeri/api/core/client_wrapper.py +141 -0
- aeri/api/core/datetime_utils.py +30 -0
- aeri/api/core/enum.py +20 -0
- aeri/api/core/file.py +70 -0
- aeri/api/core/force_multipart.py +18 -0
- aeri/api/core/http_client.py +711 -0
- aeri/api/core/http_response.py +55 -0
- aeri/api/core/http_sse/__init__.py +48 -0
- aeri/api/core/http_sse/_api.py +114 -0
- aeri/api/core/http_sse/_decoders.py +66 -0
- aeri/api/core/http_sse/_exceptions.py +7 -0
- aeri/api/core/http_sse/_models.py +17 -0
- aeri/api/core/jsonable_encoder.py +102 -0
- aeri/api/core/pydantic_utilities.py +310 -0
- aeri/api/core/query_encoder.py +60 -0
- aeri/api/core/remove_none_from_dict.py +11 -0
- aeri/api/core/request_options.py +35 -0
- aeri/api/core/serialization.py +282 -0
- aeri/api/dataset_items/__init__.py +52 -0
- aeri/api/dataset_items/client.py +499 -0
- aeri/api/dataset_items/raw_client.py +973 -0
- aeri/api/dataset_items/types/__init__.py +50 -0
- aeri/api/dataset_items/types/create_dataset_item_request.py +37 -0
- aeri/api/dataset_items/types/delete_dataset_item_response.py +17 -0
- aeri/api/dataset_items/types/paginated_dataset_items.py +17 -0
- aeri/api/dataset_run_items/__init__.py +43 -0
- aeri/api/dataset_run_items/client.py +323 -0
- aeri/api/dataset_run_items/raw_client.py +547 -0
- aeri/api/dataset_run_items/types/__init__.py +44 -0
- aeri/api/dataset_run_items/types/create_dataset_run_item_request.py +51 -0
- aeri/api/dataset_run_items/types/paginated_dataset_run_items.py +17 -0
- aeri/api/datasets/__init__.py +55 -0
- aeri/api/datasets/client.py +661 -0
- aeri/api/datasets/raw_client.py +1368 -0
- aeri/api/datasets/types/__init__.py +53 -0
- aeri/api/datasets/types/create_dataset_request.py +31 -0
- aeri/api/datasets/types/delete_dataset_run_response.py +14 -0
- aeri/api/datasets/types/paginated_dataset_runs.py +17 -0
- aeri/api/datasets/types/paginated_datasets.py +17 -0
- aeri/api/health/__init__.py +44 -0
- aeri/api/health/client.py +112 -0
- aeri/api/health/errors/__init__.py +42 -0
- aeri/api/health/errors/service_unavailable_error.py +13 -0
- aeri/api/health/raw_client.py +227 -0
- aeri/api/health/types/__init__.py +40 -0
- aeri/api/health/types/health_response.py +30 -0
- aeri/api/ingestion/__init__.py +169 -0
- aeri/api/ingestion/client.py +221 -0
- aeri/api/ingestion/raw_client.py +293 -0
- aeri/api/ingestion/types/__init__.py +169 -0
- aeri/api/ingestion/types/base_event.py +27 -0
- aeri/api/ingestion/types/create_event_body.py +14 -0
- aeri/api/ingestion/types/create_event_event.py +15 -0
- aeri/api/ingestion/types/create_generation_body.py +40 -0
- aeri/api/ingestion/types/create_generation_event.py +15 -0
- aeri/api/ingestion/types/create_observation_event.py +15 -0
- aeri/api/ingestion/types/create_span_body.py +19 -0
- aeri/api/ingestion/types/create_span_event.py +15 -0
- aeri/api/ingestion/types/ingestion_error.py +17 -0
- aeri/api/ingestion/types/ingestion_event.py +155 -0
- aeri/api/ingestion/types/ingestion_response.py +17 -0
- aeri/api/ingestion/types/ingestion_success.py +15 -0
- aeri/api/ingestion/types/ingestion_usage.py +8 -0
- aeri/api/ingestion/types/observation_body.py +53 -0
- aeri/api/ingestion/types/observation_type.py +54 -0
- aeri/api/ingestion/types/open_ai_completion_usage_schema.py +26 -0
- aeri/api/ingestion/types/open_ai_response_usage_schema.py +24 -0
- aeri/api/ingestion/types/open_ai_usage.py +28 -0
- aeri/api/ingestion/types/optional_observation_body.py +36 -0
- aeri/api/ingestion/types/score_body.py +75 -0
- aeri/api/ingestion/types/score_event.py +15 -0
- aeri/api/ingestion/types/sdk_log_body.py +14 -0
- aeri/api/ingestion/types/sdk_log_event.py +15 -0
- aeri/api/ingestion/types/trace_body.py +36 -0
- aeri/api/ingestion/types/trace_event.py +15 -0
- aeri/api/ingestion/types/update_event_body.py +14 -0
- aeri/api/ingestion/types/update_generation_body.py +40 -0
- aeri/api/ingestion/types/update_generation_event.py +15 -0
- aeri/api/ingestion/types/update_observation_event.py +15 -0
- aeri/api/ingestion/types/update_span_body.py +19 -0
- aeri/api/ingestion/types/update_span_event.py +15 -0
- aeri/api/ingestion/types/usage_details.py +10 -0
- aeri/api/legacy/__init__.py +61 -0
- aeri/api/legacy/client.py +105 -0
- aeri/api/legacy/metrics_v1/__init__.py +40 -0
- aeri/api/legacy/metrics_v1/client.py +214 -0
- aeri/api/legacy/metrics_v1/raw_client.py +322 -0
- aeri/api/legacy/metrics_v1/types/__init__.py +40 -0
- aeri/api/legacy/metrics_v1/types/metrics_response.py +19 -0
- aeri/api/legacy/observations_v1/__init__.py +43 -0
- aeri/api/legacy/observations_v1/client.py +523 -0
- aeri/api/legacy/observations_v1/raw_client.py +759 -0
- aeri/api/legacy/observations_v1/types/__init__.py +44 -0
- aeri/api/legacy/observations_v1/types/observations.py +17 -0
- aeri/api/legacy/observations_v1/types/observations_views.py +17 -0
- aeri/api/legacy/raw_client.py +13 -0
- aeri/api/legacy/score_v1/__init__.py +43 -0
- aeri/api/legacy/score_v1/client.py +329 -0
- aeri/api/legacy/score_v1/raw_client.py +545 -0
- aeri/api/legacy/score_v1/types/__init__.py +44 -0
- aeri/api/legacy/score_v1/types/create_score_request.py +75 -0
- aeri/api/legacy/score_v1/types/create_score_response.py +17 -0
- aeri/api/llm_connections/__init__.py +55 -0
- aeri/api/llm_connections/client.py +311 -0
- aeri/api/llm_connections/raw_client.py +541 -0
- aeri/api/llm_connections/types/__init__.py +53 -0
- aeri/api/llm_connections/types/llm_adapter.py +38 -0
- aeri/api/llm_connections/types/llm_connection.py +77 -0
- aeri/api/llm_connections/types/paginated_llm_connections.py +17 -0
- aeri/api/llm_connections/types/upsert_llm_connection_request.py +69 -0
- aeri/api/media/__init__.py +58 -0
- aeri/api/media/client.py +427 -0
- aeri/api/media/raw_client.py +739 -0
- aeri/api/media/types/__init__.py +56 -0
- aeri/api/media/types/get_media_response.py +55 -0
- aeri/api/media/types/get_media_upload_url_request.py +51 -0
- aeri/api/media/types/get_media_upload_url_response.py +28 -0
- aeri/api/media/types/media_content_type.py +232 -0
- aeri/api/media/types/patch_media_body.py +43 -0
- aeri/api/metrics/__init__.py +40 -0
- aeri/api/metrics/client.py +422 -0
- aeri/api/metrics/raw_client.py +530 -0
- aeri/api/metrics/types/__init__.py +40 -0
- aeri/api/metrics/types/metrics_v2response.py +19 -0
- aeri/api/models/__init__.py +43 -0
- aeri/api/models/client.py +523 -0
- aeri/api/models/raw_client.py +993 -0
- aeri/api/models/types/__init__.py +44 -0
- aeri/api/models/types/create_model_request.py +103 -0
- aeri/api/models/types/paginated_models.py +17 -0
- aeri/api/observations/__init__.py +43 -0
- aeri/api/observations/client.py +522 -0
- aeri/api/observations/raw_client.py +641 -0
- aeri/api/observations/types/__init__.py +44 -0
- aeri/api/observations/types/observations_v2meta.py +21 -0
- aeri/api/observations/types/observations_v2response.py +28 -0
- aeri/api/opentelemetry/__init__.py +67 -0
- aeri/api/opentelemetry/client.py +276 -0
- aeri/api/opentelemetry/raw_client.py +291 -0
- aeri/api/opentelemetry/types/__init__.py +65 -0
- aeri/api/opentelemetry/types/otel_attribute.py +27 -0
- aeri/api/opentelemetry/types/otel_attribute_value.py +46 -0
- aeri/api/opentelemetry/types/otel_resource.py +24 -0
- aeri/api/opentelemetry/types/otel_resource_span.py +32 -0
- aeri/api/opentelemetry/types/otel_scope.py +34 -0
- aeri/api/opentelemetry/types/otel_scope_span.py +28 -0
- aeri/api/opentelemetry/types/otel_span.py +76 -0
- aeri/api/opentelemetry/types/otel_trace_response.py +16 -0
- aeri/api/organizations/__init__.py +73 -0
- aeri/api/organizations/client.py +756 -0
- aeri/api/organizations/raw_client.py +1707 -0
- aeri/api/organizations/types/__init__.py +71 -0
- aeri/api/organizations/types/delete_membership_request.py +16 -0
- aeri/api/organizations/types/membership_deletion_response.py +17 -0
- aeri/api/organizations/types/membership_request.py +18 -0
- aeri/api/organizations/types/membership_response.py +20 -0
- aeri/api/organizations/types/membership_role.py +30 -0
- aeri/api/organizations/types/memberships_response.py +15 -0
- aeri/api/organizations/types/organization_api_key.py +31 -0
- aeri/api/organizations/types/organization_api_keys_response.py +19 -0
- aeri/api/organizations/types/organization_project.py +25 -0
- aeri/api/organizations/types/organization_projects_response.py +15 -0
- aeri/api/projects/__init__.py +67 -0
- aeri/api/projects/client.py +760 -0
- aeri/api/projects/raw_client.py +1577 -0
- aeri/api/projects/types/__init__.py +65 -0
- aeri/api/projects/types/api_key_deletion_response.py +18 -0
- aeri/api/projects/types/api_key_list.py +23 -0
- aeri/api/projects/types/api_key_response.py +30 -0
- aeri/api/projects/types/api_key_summary.py +35 -0
- aeri/api/projects/types/organization.py +22 -0
- aeri/api/projects/types/project.py +34 -0
- aeri/api/projects/types/project_deletion_response.py +15 -0
- aeri/api/projects/types/projects.py +15 -0
- aeri/api/prompt_version/__init__.py +4 -0
- aeri/api/prompt_version/client.py +157 -0
- aeri/api/prompt_version/raw_client.py +264 -0
- aeri/api/prompts/__init__.py +100 -0
- aeri/api/prompts/client.py +550 -0
- aeri/api/prompts/raw_client.py +987 -0
- aeri/api/prompts/types/__init__.py +96 -0
- aeri/api/prompts/types/base_prompt.py +42 -0
- aeri/api/prompts/types/chat_message.py +17 -0
- aeri/api/prompts/types/chat_message_type.py +15 -0
- aeri/api/prompts/types/chat_message_with_placeholders.py +8 -0
- aeri/api/prompts/types/chat_prompt.py +15 -0
- aeri/api/prompts/types/create_chat_prompt_request.py +37 -0
- aeri/api/prompts/types/create_chat_prompt_type.py +15 -0
- aeri/api/prompts/types/create_prompt_request.py +8 -0
- aeri/api/prompts/types/create_text_prompt_request.py +36 -0
- aeri/api/prompts/types/create_text_prompt_type.py +15 -0
- aeri/api/prompts/types/placeholder_message.py +16 -0
- aeri/api/prompts/types/placeholder_message_type.py +15 -0
- aeri/api/prompts/types/prompt.py +58 -0
- aeri/api/prompts/types/prompt_meta.py +35 -0
- aeri/api/prompts/types/prompt_meta_list_response.py +17 -0
- aeri/api/prompts/types/prompt_type.py +20 -0
- aeri/api/prompts/types/text_prompt.py +14 -0
- aeri/api/scim/__init__.py +94 -0
- aeri/api/scim/client.py +686 -0
- aeri/api/scim/raw_client.py +1528 -0
- aeri/api/scim/types/__init__.py +92 -0
- aeri/api/scim/types/authentication_scheme.py +20 -0
- aeri/api/scim/types/bulk_config.py +22 -0
- aeri/api/scim/types/empty_response.py +16 -0
- aeri/api/scim/types/filter_config.py +17 -0
- aeri/api/scim/types/resource_meta.py +17 -0
- aeri/api/scim/types/resource_type.py +27 -0
- aeri/api/scim/types/resource_types_response.py +21 -0
- aeri/api/scim/types/schema_extension.py +17 -0
- aeri/api/scim/types/schema_resource.py +19 -0
- aeri/api/scim/types/schemas_response.py +21 -0
- aeri/api/scim/types/scim_email.py +16 -0
- aeri/api/scim/types/scim_feature_support.py +14 -0
- aeri/api/scim/types/scim_name.py +14 -0
- aeri/api/scim/types/scim_user.py +24 -0
- aeri/api/scim/types/scim_users_list_response.py +25 -0
- aeri/api/scim/types/service_provider_config.py +36 -0
- aeri/api/scim/types/user_meta.py +20 -0
- aeri/api/score_configs/__init__.py +44 -0
- aeri/api/score_configs/client.py +526 -0
- aeri/api/score_configs/raw_client.py +1012 -0
- aeri/api/score_configs/types/__init__.py +46 -0
- aeri/api/score_configs/types/create_score_config_request.py +46 -0
- aeri/api/score_configs/types/score_configs.py +17 -0
- aeri/api/score_configs/types/update_score_config_request.py +53 -0
- aeri/api/scores/__init__.py +76 -0
- aeri/api/scores/client.py +420 -0
- aeri/api/scores/raw_client.py +656 -0
- aeri/api/scores/types/__init__.py +76 -0
- aeri/api/scores/types/get_scores_response.py +17 -0
- aeri/api/scores/types/get_scores_response_data.py +211 -0
- aeri/api/scores/types/get_scores_response_data_boolean.py +15 -0
- aeri/api/scores/types/get_scores_response_data_categorical.py +15 -0
- aeri/api/scores/types/get_scores_response_data_correction.py +15 -0
- aeri/api/scores/types/get_scores_response_data_numeric.py +15 -0
- aeri/api/scores/types/get_scores_response_trace_data.py +38 -0
- aeri/api/sessions/__init__.py +40 -0
- aeri/api/sessions/client.py +262 -0
- aeri/api/sessions/raw_client.py +500 -0
- aeri/api/sessions/types/__init__.py +40 -0
- aeri/api/sessions/types/paginated_sessions.py +17 -0
- aeri/api/trace/__init__.py +44 -0
- aeri/api/trace/client.py +728 -0
- aeri/api/trace/raw_client.py +1208 -0
- aeri/api/trace/types/__init__.py +46 -0
- aeri/api/trace/types/delete_trace_response.py +14 -0
- aeri/api/trace/types/sort.py +14 -0
- aeri/api/trace/types/traces.py +17 -0
- aeri/api/utils/__init__.py +44 -0
- aeri/api/utils/pagination/__init__.py +40 -0
- aeri/api/utils/pagination/types/__init__.py +40 -0
- aeri/api/utils/pagination/types/meta_response.py +38 -0
- aeri/batch_evaluation.py +1643 -0
- aeri/experiment.py +1044 -0
- aeri/langchain/CallbackHandler.py +1377 -0
- aeri/langchain/__init__.py +5 -0
- aeri/langchain/utils.py +212 -0
- aeri/logger.py +28 -0
- aeri/media.py +352 -0
- aeri/model.py +477 -0
- aeri/openai.py +1124 -0
- aeri/py.typed +0 -0
- aeri/span_filter.py +17 -0
- aeri/types.py +79 -0
- aeri/version.py +3 -0
- aeri_python-4.0.0.dist-info/METADATA +51 -0
- aeri_python-4.0.0.dist-info/RECORD +391 -0
- aeri_python-4.0.0.dist-info/WHEEL +4 -0
- aeri_python-4.0.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
from importlib import import_module
|
|
7
|
+
|
|
8
|
+
if typing.TYPE_CHECKING:
|
|
9
|
+
from .create_score_config_request import CreateScoreConfigRequest
|
|
10
|
+
from .score_configs import ScoreConfigs
|
|
11
|
+
from .update_score_config_request import UpdateScoreConfigRequest
|
|
12
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
13
|
+
"CreateScoreConfigRequest": ".create_score_config_request",
|
|
14
|
+
"ScoreConfigs": ".score_configs",
|
|
15
|
+
"UpdateScoreConfigRequest": ".update_score_config_request",
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
20
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
21
|
+
if module_name is None:
|
|
22
|
+
raise AttributeError(
|
|
23
|
+
f"No {attr_name} found in _dynamic_imports for module name -> {__name__}"
|
|
24
|
+
)
|
|
25
|
+
try:
|
|
26
|
+
module = import_module(module_name, __package__)
|
|
27
|
+
if module_name == f".{attr_name}":
|
|
28
|
+
return module
|
|
29
|
+
else:
|
|
30
|
+
return getattr(module, attr_name)
|
|
31
|
+
except ImportError as e:
|
|
32
|
+
raise ImportError(
|
|
33
|
+
f"Failed to import {attr_name} from {module_name}: {e}"
|
|
34
|
+
) from e
|
|
35
|
+
except AttributeError as e:
|
|
36
|
+
raise AttributeError(
|
|
37
|
+
f"Failed to get {attr_name} from {module_name}: {e}"
|
|
38
|
+
) from e
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def __dir__():
|
|
42
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
43
|
+
return sorted(lazy_attrs)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
__all__ = ["CreateScoreConfigRequest", "ScoreConfigs", "UpdateScoreConfigRequest"]
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
import typing_extensions
|
|
7
|
+
from ...commons.types.config_category import ConfigCategory
|
|
8
|
+
from ...commons.types.score_config_data_type import ScoreConfigDataType
|
|
9
|
+
from ...core.pydantic_utilities import UniversalBaseModel
|
|
10
|
+
from ...core.serialization import FieldMetadata
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class CreateScoreConfigRequest(UniversalBaseModel):
|
|
14
|
+
name: str
|
|
15
|
+
data_type: typing_extensions.Annotated[
|
|
16
|
+
ScoreConfigDataType, FieldMetadata(alias="dataType")
|
|
17
|
+
]
|
|
18
|
+
categories: typing.Optional[typing.List[ConfigCategory]] = pydantic.Field(
|
|
19
|
+
default=None
|
|
20
|
+
)
|
|
21
|
+
"""
|
|
22
|
+
Configure custom categories for categorical scores. Pass a list of objects with `label` and `value` properties. Categories are autogenerated for boolean configs and cannot be passed
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
min_value: typing_extensions.Annotated[
|
|
26
|
+
typing.Optional[float], FieldMetadata(alias="minValue")
|
|
27
|
+
] = pydantic.Field(default=None)
|
|
28
|
+
"""
|
|
29
|
+
Configure a minimum value for numerical scores. If not set, the minimum value defaults to -∞
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
max_value: typing_extensions.Annotated[
|
|
33
|
+
typing.Optional[float], FieldMetadata(alias="maxValue")
|
|
34
|
+
] = pydantic.Field(default=None)
|
|
35
|
+
"""
|
|
36
|
+
Configure a maximum value for numerical scores. If not set, the maximum value defaults to +∞
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
description: typing.Optional[str] = pydantic.Field(default=None)
|
|
40
|
+
"""
|
|
41
|
+
Description is shown across the Aeri UI and can be used to e.g. explain the config categories in detail, why a numeric range was set, or provide additional context on config name or usage
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
45
|
+
extra="allow", frozen=True
|
|
46
|
+
)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
from ...commons.types.score_config import ScoreConfig
|
|
7
|
+
from ...core.pydantic_utilities import UniversalBaseModel
|
|
8
|
+
from ...utils.pagination.types.meta_response import MetaResponse
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ScoreConfigs(UniversalBaseModel):
|
|
12
|
+
data: typing.List[ScoreConfig]
|
|
13
|
+
meta: MetaResponse
|
|
14
|
+
|
|
15
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
16
|
+
extra="allow", frozen=True
|
|
17
|
+
)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
import typing_extensions
|
|
7
|
+
from ...commons.types.config_category import ConfigCategory
|
|
8
|
+
from ...core.pydantic_utilities import UniversalBaseModel
|
|
9
|
+
from ...core.serialization import FieldMetadata
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class UpdateScoreConfigRequest(UniversalBaseModel):
|
|
13
|
+
is_archived: typing_extensions.Annotated[
|
|
14
|
+
typing.Optional[bool], FieldMetadata(alias="isArchived")
|
|
15
|
+
] = pydantic.Field(default=None)
|
|
16
|
+
"""
|
|
17
|
+
The status of the score config showing if it is archived or not
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
name: typing.Optional[str] = pydantic.Field(default=None)
|
|
21
|
+
"""
|
|
22
|
+
The name of the score config
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
categories: typing.Optional[typing.List[ConfigCategory]] = pydantic.Field(
|
|
26
|
+
default=None
|
|
27
|
+
)
|
|
28
|
+
"""
|
|
29
|
+
Configure custom categories for categorical scores. Pass a list of objects with `label` and `value` properties. Categories are autogenerated for boolean configs and cannot be passed
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
min_value: typing_extensions.Annotated[
|
|
33
|
+
typing.Optional[float], FieldMetadata(alias="minValue")
|
|
34
|
+
] = pydantic.Field(default=None)
|
|
35
|
+
"""
|
|
36
|
+
Configure a minimum value for numerical scores. If not set, the minimum value defaults to -∞
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
max_value: typing_extensions.Annotated[
|
|
40
|
+
typing.Optional[float], FieldMetadata(alias="maxValue")
|
|
41
|
+
] = pydantic.Field(default=None)
|
|
42
|
+
"""
|
|
43
|
+
Configure a maximum value for numerical scores. If not set, the maximum value defaults to +∞
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
description: typing.Optional[str] = pydantic.Field(default=None)
|
|
47
|
+
"""
|
|
48
|
+
Description is shown across the Aeri UI and can be used to e.g. explain the config categories in detail, why a numeric range was set, or provide additional context on config name or usage
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
52
|
+
extra="allow", frozen=True
|
|
53
|
+
)
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
from importlib import import_module
|
|
7
|
+
|
|
8
|
+
if typing.TYPE_CHECKING:
|
|
9
|
+
from .types import (
|
|
10
|
+
GetScoresResponse,
|
|
11
|
+
GetScoresResponseData,
|
|
12
|
+
GetScoresResponseDataBoolean,
|
|
13
|
+
GetScoresResponseDataCategorical,
|
|
14
|
+
GetScoresResponseDataCorrection,
|
|
15
|
+
GetScoresResponseDataNumeric,
|
|
16
|
+
GetScoresResponseData_Boolean,
|
|
17
|
+
GetScoresResponseData_Categorical,
|
|
18
|
+
GetScoresResponseData_Correction,
|
|
19
|
+
GetScoresResponseData_Numeric,
|
|
20
|
+
GetScoresResponseTraceData,
|
|
21
|
+
)
|
|
22
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
23
|
+
"GetScoresResponse": ".types",
|
|
24
|
+
"GetScoresResponseData": ".types",
|
|
25
|
+
"GetScoresResponseDataBoolean": ".types",
|
|
26
|
+
"GetScoresResponseDataCategorical": ".types",
|
|
27
|
+
"GetScoresResponseDataCorrection": ".types",
|
|
28
|
+
"GetScoresResponseDataNumeric": ".types",
|
|
29
|
+
"GetScoresResponseData_Boolean": ".types",
|
|
30
|
+
"GetScoresResponseData_Categorical": ".types",
|
|
31
|
+
"GetScoresResponseData_Correction": ".types",
|
|
32
|
+
"GetScoresResponseData_Numeric": ".types",
|
|
33
|
+
"GetScoresResponseTraceData": ".types",
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
38
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
39
|
+
if module_name is None:
|
|
40
|
+
raise AttributeError(
|
|
41
|
+
f"No {attr_name} found in _dynamic_imports for module name -> {__name__}"
|
|
42
|
+
)
|
|
43
|
+
try:
|
|
44
|
+
module = import_module(module_name, __package__)
|
|
45
|
+
if module_name == f".{attr_name}":
|
|
46
|
+
return module
|
|
47
|
+
else:
|
|
48
|
+
return getattr(module, attr_name)
|
|
49
|
+
except ImportError as e:
|
|
50
|
+
raise ImportError(
|
|
51
|
+
f"Failed to import {attr_name} from {module_name}: {e}"
|
|
52
|
+
) from e
|
|
53
|
+
except AttributeError as e:
|
|
54
|
+
raise AttributeError(
|
|
55
|
+
f"Failed to get {attr_name} from {module_name}: {e}"
|
|
56
|
+
) from e
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def __dir__():
|
|
60
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
61
|
+
return sorted(lazy_attrs)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
__all__ = [
|
|
65
|
+
"GetScoresResponse",
|
|
66
|
+
"GetScoresResponseData",
|
|
67
|
+
"GetScoresResponseDataBoolean",
|
|
68
|
+
"GetScoresResponseDataCategorical",
|
|
69
|
+
"GetScoresResponseDataCorrection",
|
|
70
|
+
"GetScoresResponseDataNumeric",
|
|
71
|
+
"GetScoresResponseData_Boolean",
|
|
72
|
+
"GetScoresResponseData_Categorical",
|
|
73
|
+
"GetScoresResponseData_Correction",
|
|
74
|
+
"GetScoresResponseData_Numeric",
|
|
75
|
+
"GetScoresResponseTraceData",
|
|
76
|
+
]
|
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
from ..commons.types.score import Score
|
|
7
|
+
from ..commons.types.score_data_type import ScoreDataType
|
|
8
|
+
from ..commons.types.score_source import ScoreSource
|
|
9
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
10
|
+
from ..core.request_options import RequestOptions
|
|
11
|
+
from .raw_client import AsyncRawScoresClient, RawScoresClient
|
|
12
|
+
from .types.get_scores_response import GetScoresResponse
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class ScoresClient:
|
|
16
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
17
|
+
self._raw_client = RawScoresClient(client_wrapper=client_wrapper)
|
|
18
|
+
|
|
19
|
+
@property
|
|
20
|
+
def with_raw_response(self) -> RawScoresClient:
|
|
21
|
+
"""
|
|
22
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
23
|
+
|
|
24
|
+
Returns
|
|
25
|
+
-------
|
|
26
|
+
RawScoresClient
|
|
27
|
+
"""
|
|
28
|
+
return self._raw_client
|
|
29
|
+
|
|
30
|
+
def get_many(
|
|
31
|
+
self,
|
|
32
|
+
*,
|
|
33
|
+
page: typing.Optional[int] = None,
|
|
34
|
+
limit: typing.Optional[int] = None,
|
|
35
|
+
user_id: typing.Optional[str] = None,
|
|
36
|
+
name: typing.Optional[str] = None,
|
|
37
|
+
from_timestamp: typing.Optional[dt.datetime] = None,
|
|
38
|
+
to_timestamp: typing.Optional[dt.datetime] = None,
|
|
39
|
+
environment: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
40
|
+
source: typing.Optional[ScoreSource] = None,
|
|
41
|
+
operator: typing.Optional[str] = None,
|
|
42
|
+
value: typing.Optional[float] = None,
|
|
43
|
+
score_ids: typing.Optional[str] = None,
|
|
44
|
+
config_id: typing.Optional[str] = None,
|
|
45
|
+
session_id: typing.Optional[str] = None,
|
|
46
|
+
dataset_run_id: typing.Optional[str] = None,
|
|
47
|
+
trace_id: typing.Optional[str] = None,
|
|
48
|
+
observation_id: typing.Optional[str] = None,
|
|
49
|
+
queue_id: typing.Optional[str] = None,
|
|
50
|
+
data_type: typing.Optional[ScoreDataType] = None,
|
|
51
|
+
trace_tags: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
52
|
+
fields: typing.Optional[str] = None,
|
|
53
|
+
filter: typing.Optional[str] = None,
|
|
54
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
55
|
+
) -> GetScoresResponse:
|
|
56
|
+
"""
|
|
57
|
+
Get a list of scores (supports both trace and session scores)
|
|
58
|
+
|
|
59
|
+
Parameters
|
|
60
|
+
----------
|
|
61
|
+
page : typing.Optional[int]
|
|
62
|
+
Page number, starts at 1.
|
|
63
|
+
|
|
64
|
+
limit : typing.Optional[int]
|
|
65
|
+
Limit of items per page. If you encounter api issues due to too large page sizes, try to reduce the limit.
|
|
66
|
+
|
|
67
|
+
user_id : typing.Optional[str]
|
|
68
|
+
Retrieve only scores with this userId associated to the trace.
|
|
69
|
+
|
|
70
|
+
name : typing.Optional[str]
|
|
71
|
+
Retrieve only scores with this name.
|
|
72
|
+
|
|
73
|
+
from_timestamp : typing.Optional[dt.datetime]
|
|
74
|
+
Optional filter to only include scores created on or after a certain datetime (ISO 8601)
|
|
75
|
+
|
|
76
|
+
to_timestamp : typing.Optional[dt.datetime]
|
|
77
|
+
Optional filter to only include scores created before a certain datetime (ISO 8601)
|
|
78
|
+
|
|
79
|
+
environment : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
80
|
+
Optional filter for scores where the environment is one of the provided values.
|
|
81
|
+
|
|
82
|
+
source : typing.Optional[ScoreSource]
|
|
83
|
+
Retrieve only scores from a specific source.
|
|
84
|
+
|
|
85
|
+
operator : typing.Optional[str]
|
|
86
|
+
Retrieve only scores with <operator> value.
|
|
87
|
+
|
|
88
|
+
value : typing.Optional[float]
|
|
89
|
+
Retrieve only scores with <operator> value.
|
|
90
|
+
|
|
91
|
+
score_ids : typing.Optional[str]
|
|
92
|
+
Comma-separated list of score IDs to limit the results to.
|
|
93
|
+
|
|
94
|
+
config_id : typing.Optional[str]
|
|
95
|
+
Retrieve only scores with a specific configId.
|
|
96
|
+
|
|
97
|
+
session_id : typing.Optional[str]
|
|
98
|
+
Retrieve only scores with a specific sessionId.
|
|
99
|
+
|
|
100
|
+
dataset_run_id : typing.Optional[str]
|
|
101
|
+
Retrieve only scores with a specific datasetRunId.
|
|
102
|
+
|
|
103
|
+
trace_id : typing.Optional[str]
|
|
104
|
+
Retrieve only scores with a specific traceId.
|
|
105
|
+
|
|
106
|
+
observation_id : typing.Optional[str]
|
|
107
|
+
Comma-separated list of observation IDs to filter scores by.
|
|
108
|
+
|
|
109
|
+
queue_id : typing.Optional[str]
|
|
110
|
+
Retrieve only scores with a specific annotation queueId.
|
|
111
|
+
|
|
112
|
+
data_type : typing.Optional[ScoreDataType]
|
|
113
|
+
Retrieve only scores with a specific dataType.
|
|
114
|
+
|
|
115
|
+
trace_tags : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
116
|
+
Only scores linked to traces that include all of these tags will be returned.
|
|
117
|
+
|
|
118
|
+
fields : typing.Optional[str]
|
|
119
|
+
Comma-separated list of field groups to include in the response. Available field groups: 'score' (core score fields), 'trace' (trace properties: userId, tags, environment, sessionId). If not specified, both 'score' and 'trace' are returned by default. Example: 'score' to exclude trace data, 'score,trace' to include both. Note: When filtering by trace properties (using userId or traceTags parameters), the 'trace' field group must be included, otherwise a 400 error will be returned.
|
|
120
|
+
|
|
121
|
+
filter : typing.Optional[str]
|
|
122
|
+
A JSON stringified array of filter objects. Each object requires type, column, operator, and value. Supports filtering by score metadata using the stringObject type. Example: [{"type":"stringObject","column":"metadata","key":"user_id","operator":"=","value":"abc123"}]. Supported types: stringObject (metadata key-value filtering), string, number, datetime, stringOptions, arrayOptions. Supported operators for stringObject: =, contains, does not contain, starts with, ends with.
|
|
123
|
+
|
|
124
|
+
request_options : typing.Optional[RequestOptions]
|
|
125
|
+
Request-specific configuration.
|
|
126
|
+
|
|
127
|
+
Returns
|
|
128
|
+
-------
|
|
129
|
+
GetScoresResponse
|
|
130
|
+
|
|
131
|
+
Examples
|
|
132
|
+
--------
|
|
133
|
+
from aeri import AeriAPI
|
|
134
|
+
|
|
135
|
+
client = AeriAPI(
|
|
136
|
+
x_aeri_sdk_name="YOUR_X_AERI_SDK_NAME",
|
|
137
|
+
x_aeri_sdk_version="YOUR_X_AERI_SDK_VERSION",
|
|
138
|
+
x_aeri_public_key="YOUR_X_AERI_PUBLIC_KEY",
|
|
139
|
+
username="YOUR_USERNAME",
|
|
140
|
+
password="YOUR_PASSWORD",
|
|
141
|
+
base_url="https://yourhost.com/path/to/api",
|
|
142
|
+
)
|
|
143
|
+
client.scores.get_many()
|
|
144
|
+
"""
|
|
145
|
+
_response = self._raw_client.get_many(
|
|
146
|
+
page=page,
|
|
147
|
+
limit=limit,
|
|
148
|
+
user_id=user_id,
|
|
149
|
+
name=name,
|
|
150
|
+
from_timestamp=from_timestamp,
|
|
151
|
+
to_timestamp=to_timestamp,
|
|
152
|
+
environment=environment,
|
|
153
|
+
source=source,
|
|
154
|
+
operator=operator,
|
|
155
|
+
value=value,
|
|
156
|
+
score_ids=score_ids,
|
|
157
|
+
config_id=config_id,
|
|
158
|
+
session_id=session_id,
|
|
159
|
+
dataset_run_id=dataset_run_id,
|
|
160
|
+
trace_id=trace_id,
|
|
161
|
+
observation_id=observation_id,
|
|
162
|
+
queue_id=queue_id,
|
|
163
|
+
data_type=data_type,
|
|
164
|
+
trace_tags=trace_tags,
|
|
165
|
+
fields=fields,
|
|
166
|
+
filter=filter,
|
|
167
|
+
request_options=request_options,
|
|
168
|
+
)
|
|
169
|
+
return _response.data
|
|
170
|
+
|
|
171
|
+
def get_by_id(
|
|
172
|
+
self, score_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
173
|
+
) -> Score:
|
|
174
|
+
"""
|
|
175
|
+
Get a score (supports both trace and session scores)
|
|
176
|
+
|
|
177
|
+
Parameters
|
|
178
|
+
----------
|
|
179
|
+
score_id : str
|
|
180
|
+
The unique aeri identifier of a score
|
|
181
|
+
|
|
182
|
+
request_options : typing.Optional[RequestOptions]
|
|
183
|
+
Request-specific configuration.
|
|
184
|
+
|
|
185
|
+
Returns
|
|
186
|
+
-------
|
|
187
|
+
Score
|
|
188
|
+
|
|
189
|
+
Examples
|
|
190
|
+
--------
|
|
191
|
+
from aeri import AeriAPI
|
|
192
|
+
|
|
193
|
+
client = AeriAPI(
|
|
194
|
+
x_aeri_sdk_name="YOUR_X_AERI_SDK_NAME",
|
|
195
|
+
x_aeri_sdk_version="YOUR_X_AERI_SDK_VERSION",
|
|
196
|
+
x_aeri_public_key="YOUR_X_AERI_PUBLIC_KEY",
|
|
197
|
+
username="YOUR_USERNAME",
|
|
198
|
+
password="YOUR_PASSWORD",
|
|
199
|
+
base_url="https://yourhost.com/path/to/api",
|
|
200
|
+
)
|
|
201
|
+
client.scores.get_by_id(
|
|
202
|
+
score_id="scoreId",
|
|
203
|
+
)
|
|
204
|
+
"""
|
|
205
|
+
_response = self._raw_client.get_by_id(
|
|
206
|
+
score_id, request_options=request_options
|
|
207
|
+
)
|
|
208
|
+
return _response.data
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
class AsyncScoresClient:
|
|
212
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
213
|
+
self._raw_client = AsyncRawScoresClient(client_wrapper=client_wrapper)
|
|
214
|
+
|
|
215
|
+
@property
|
|
216
|
+
def with_raw_response(self) -> AsyncRawScoresClient:
|
|
217
|
+
"""
|
|
218
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
219
|
+
|
|
220
|
+
Returns
|
|
221
|
+
-------
|
|
222
|
+
AsyncRawScoresClient
|
|
223
|
+
"""
|
|
224
|
+
return self._raw_client
|
|
225
|
+
|
|
226
|
+
async def get_many(
|
|
227
|
+
self,
|
|
228
|
+
*,
|
|
229
|
+
page: typing.Optional[int] = None,
|
|
230
|
+
limit: typing.Optional[int] = None,
|
|
231
|
+
user_id: typing.Optional[str] = None,
|
|
232
|
+
name: typing.Optional[str] = None,
|
|
233
|
+
from_timestamp: typing.Optional[dt.datetime] = None,
|
|
234
|
+
to_timestamp: typing.Optional[dt.datetime] = None,
|
|
235
|
+
environment: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
236
|
+
source: typing.Optional[ScoreSource] = None,
|
|
237
|
+
operator: typing.Optional[str] = None,
|
|
238
|
+
value: typing.Optional[float] = None,
|
|
239
|
+
score_ids: typing.Optional[str] = None,
|
|
240
|
+
config_id: typing.Optional[str] = None,
|
|
241
|
+
session_id: typing.Optional[str] = None,
|
|
242
|
+
dataset_run_id: typing.Optional[str] = None,
|
|
243
|
+
trace_id: typing.Optional[str] = None,
|
|
244
|
+
observation_id: typing.Optional[str] = None,
|
|
245
|
+
queue_id: typing.Optional[str] = None,
|
|
246
|
+
data_type: typing.Optional[ScoreDataType] = None,
|
|
247
|
+
trace_tags: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
248
|
+
fields: typing.Optional[str] = None,
|
|
249
|
+
filter: typing.Optional[str] = None,
|
|
250
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
251
|
+
) -> GetScoresResponse:
|
|
252
|
+
"""
|
|
253
|
+
Get a list of scores (supports both trace and session scores)
|
|
254
|
+
|
|
255
|
+
Parameters
|
|
256
|
+
----------
|
|
257
|
+
page : typing.Optional[int]
|
|
258
|
+
Page number, starts at 1.
|
|
259
|
+
|
|
260
|
+
limit : typing.Optional[int]
|
|
261
|
+
Limit of items per page. If you encounter api issues due to too large page sizes, try to reduce the limit.
|
|
262
|
+
|
|
263
|
+
user_id : typing.Optional[str]
|
|
264
|
+
Retrieve only scores with this userId associated to the trace.
|
|
265
|
+
|
|
266
|
+
name : typing.Optional[str]
|
|
267
|
+
Retrieve only scores with this name.
|
|
268
|
+
|
|
269
|
+
from_timestamp : typing.Optional[dt.datetime]
|
|
270
|
+
Optional filter to only include scores created on or after a certain datetime (ISO 8601)
|
|
271
|
+
|
|
272
|
+
to_timestamp : typing.Optional[dt.datetime]
|
|
273
|
+
Optional filter to only include scores created before a certain datetime (ISO 8601)
|
|
274
|
+
|
|
275
|
+
environment : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
276
|
+
Optional filter for scores where the environment is one of the provided values.
|
|
277
|
+
|
|
278
|
+
source : typing.Optional[ScoreSource]
|
|
279
|
+
Retrieve only scores from a specific source.
|
|
280
|
+
|
|
281
|
+
operator : typing.Optional[str]
|
|
282
|
+
Retrieve only scores with <operator> value.
|
|
283
|
+
|
|
284
|
+
value : typing.Optional[float]
|
|
285
|
+
Retrieve only scores with <operator> value.
|
|
286
|
+
|
|
287
|
+
score_ids : typing.Optional[str]
|
|
288
|
+
Comma-separated list of score IDs to limit the results to.
|
|
289
|
+
|
|
290
|
+
config_id : typing.Optional[str]
|
|
291
|
+
Retrieve only scores with a specific configId.
|
|
292
|
+
|
|
293
|
+
session_id : typing.Optional[str]
|
|
294
|
+
Retrieve only scores with a specific sessionId.
|
|
295
|
+
|
|
296
|
+
dataset_run_id : typing.Optional[str]
|
|
297
|
+
Retrieve only scores with a specific datasetRunId.
|
|
298
|
+
|
|
299
|
+
trace_id : typing.Optional[str]
|
|
300
|
+
Retrieve only scores with a specific traceId.
|
|
301
|
+
|
|
302
|
+
observation_id : typing.Optional[str]
|
|
303
|
+
Comma-separated list of observation IDs to filter scores by.
|
|
304
|
+
|
|
305
|
+
queue_id : typing.Optional[str]
|
|
306
|
+
Retrieve only scores with a specific annotation queueId.
|
|
307
|
+
|
|
308
|
+
data_type : typing.Optional[ScoreDataType]
|
|
309
|
+
Retrieve only scores with a specific dataType.
|
|
310
|
+
|
|
311
|
+
trace_tags : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
312
|
+
Only scores linked to traces that include all of these tags will be returned.
|
|
313
|
+
|
|
314
|
+
fields : typing.Optional[str]
|
|
315
|
+
Comma-separated list of field groups to include in the response. Available field groups: 'score' (core score fields), 'trace' (trace properties: userId, tags, environment, sessionId). If not specified, both 'score' and 'trace' are returned by default. Example: 'score' to exclude trace data, 'score,trace' to include both. Note: When filtering by trace properties (using userId or traceTags parameters), the 'trace' field group must be included, otherwise a 400 error will be returned.
|
|
316
|
+
|
|
317
|
+
filter : typing.Optional[str]
|
|
318
|
+
A JSON stringified array of filter objects. Each object requires type, column, operator, and value. Supports filtering by score metadata using the stringObject type. Example: [{"type":"stringObject","column":"metadata","key":"user_id","operator":"=","value":"abc123"}]. Supported types: stringObject (metadata key-value filtering), string, number, datetime, stringOptions, arrayOptions. Supported operators for stringObject: =, contains, does not contain, starts with, ends with.
|
|
319
|
+
|
|
320
|
+
request_options : typing.Optional[RequestOptions]
|
|
321
|
+
Request-specific configuration.
|
|
322
|
+
|
|
323
|
+
Returns
|
|
324
|
+
-------
|
|
325
|
+
GetScoresResponse
|
|
326
|
+
|
|
327
|
+
Examples
|
|
328
|
+
--------
|
|
329
|
+
import asyncio
|
|
330
|
+
|
|
331
|
+
from aeri import AsyncAeriAPI
|
|
332
|
+
|
|
333
|
+
client = AsyncAeriAPI(
|
|
334
|
+
x_aeri_sdk_name="YOUR_X_AERI_SDK_NAME",
|
|
335
|
+
x_aeri_sdk_version="YOUR_X_AERI_SDK_VERSION",
|
|
336
|
+
x_aeri_public_key="YOUR_X_AERI_PUBLIC_KEY",
|
|
337
|
+
username="YOUR_USERNAME",
|
|
338
|
+
password="YOUR_PASSWORD",
|
|
339
|
+
base_url="https://yourhost.com/path/to/api",
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
async def main() -> None:
|
|
344
|
+
await client.scores.get_many()
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
asyncio.run(main())
|
|
348
|
+
"""
|
|
349
|
+
_response = await self._raw_client.get_many(
|
|
350
|
+
page=page,
|
|
351
|
+
limit=limit,
|
|
352
|
+
user_id=user_id,
|
|
353
|
+
name=name,
|
|
354
|
+
from_timestamp=from_timestamp,
|
|
355
|
+
to_timestamp=to_timestamp,
|
|
356
|
+
environment=environment,
|
|
357
|
+
source=source,
|
|
358
|
+
operator=operator,
|
|
359
|
+
value=value,
|
|
360
|
+
score_ids=score_ids,
|
|
361
|
+
config_id=config_id,
|
|
362
|
+
session_id=session_id,
|
|
363
|
+
dataset_run_id=dataset_run_id,
|
|
364
|
+
trace_id=trace_id,
|
|
365
|
+
observation_id=observation_id,
|
|
366
|
+
queue_id=queue_id,
|
|
367
|
+
data_type=data_type,
|
|
368
|
+
trace_tags=trace_tags,
|
|
369
|
+
fields=fields,
|
|
370
|
+
filter=filter,
|
|
371
|
+
request_options=request_options,
|
|
372
|
+
)
|
|
373
|
+
return _response.data
|
|
374
|
+
|
|
375
|
+
async def get_by_id(
|
|
376
|
+
self, score_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
377
|
+
) -> Score:
|
|
378
|
+
"""
|
|
379
|
+
Get a score (supports both trace and session scores)
|
|
380
|
+
|
|
381
|
+
Parameters
|
|
382
|
+
----------
|
|
383
|
+
score_id : str
|
|
384
|
+
The unique aeri identifier of a score
|
|
385
|
+
|
|
386
|
+
request_options : typing.Optional[RequestOptions]
|
|
387
|
+
Request-specific configuration.
|
|
388
|
+
|
|
389
|
+
Returns
|
|
390
|
+
-------
|
|
391
|
+
Score
|
|
392
|
+
|
|
393
|
+
Examples
|
|
394
|
+
--------
|
|
395
|
+
import asyncio
|
|
396
|
+
|
|
397
|
+
from aeri import AsyncAeriAPI
|
|
398
|
+
|
|
399
|
+
client = AsyncAeriAPI(
|
|
400
|
+
x_aeri_sdk_name="YOUR_X_AERI_SDK_NAME",
|
|
401
|
+
x_aeri_sdk_version="YOUR_X_AERI_SDK_VERSION",
|
|
402
|
+
x_aeri_public_key="YOUR_X_AERI_PUBLIC_KEY",
|
|
403
|
+
username="YOUR_USERNAME",
|
|
404
|
+
password="YOUR_PASSWORD",
|
|
405
|
+
base_url="https://yourhost.com/path/to/api",
|
|
406
|
+
)
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
async def main() -> None:
|
|
410
|
+
await client.scores.get_by_id(
|
|
411
|
+
score_id="scoreId",
|
|
412
|
+
)
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
asyncio.run(main())
|
|
416
|
+
"""
|
|
417
|
+
_response = await self._raw_client.get_by_id(
|
|
418
|
+
score_id, request_options=request_options
|
|
419
|
+
)
|
|
420
|
+
return _response.data
|