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,547 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
from json.decoder import JSONDecodeError
|
|
6
|
+
|
|
7
|
+
from ..commons.errors.access_denied_error import AccessDeniedError
|
|
8
|
+
from ..commons.errors.error import Error
|
|
9
|
+
from ..commons.errors.method_not_allowed_error import MethodNotAllowedError
|
|
10
|
+
from ..commons.errors.not_found_error import NotFoundError
|
|
11
|
+
from ..commons.errors.unauthorized_error import UnauthorizedError
|
|
12
|
+
from ..commons.types.dataset_run_item import DatasetRunItem
|
|
13
|
+
from ..core.api_error import ApiError
|
|
14
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
15
|
+
from ..core.http_response import AsyncHttpResponse, HttpResponse
|
|
16
|
+
from ..core.pydantic_utilities import parse_obj_as
|
|
17
|
+
from ..core.request_options import RequestOptions
|
|
18
|
+
from .types.paginated_dataset_run_items import PaginatedDatasetRunItems
|
|
19
|
+
|
|
20
|
+
# this is used as the default value for optional parameters
|
|
21
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class RawDatasetRunItemsClient:
|
|
25
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
26
|
+
self._client_wrapper = client_wrapper
|
|
27
|
+
|
|
28
|
+
def create(
|
|
29
|
+
self,
|
|
30
|
+
*,
|
|
31
|
+
run_name: str,
|
|
32
|
+
dataset_item_id: str,
|
|
33
|
+
run_description: typing.Optional[str] = OMIT,
|
|
34
|
+
metadata: typing.Optional[typing.Any] = OMIT,
|
|
35
|
+
observation_id: typing.Optional[str] = OMIT,
|
|
36
|
+
trace_id: typing.Optional[str] = OMIT,
|
|
37
|
+
dataset_version: typing.Optional[dt.datetime] = OMIT,
|
|
38
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
39
|
+
) -> HttpResponse[DatasetRunItem]:
|
|
40
|
+
"""
|
|
41
|
+
Create a dataset run item
|
|
42
|
+
|
|
43
|
+
Parameters
|
|
44
|
+
----------
|
|
45
|
+
run_name : str
|
|
46
|
+
|
|
47
|
+
dataset_item_id : str
|
|
48
|
+
|
|
49
|
+
run_description : typing.Optional[str]
|
|
50
|
+
Description of the run. If run exists, description will be updated.
|
|
51
|
+
|
|
52
|
+
metadata : typing.Optional[typing.Any]
|
|
53
|
+
Metadata of the dataset run, updates run if run already exists
|
|
54
|
+
|
|
55
|
+
observation_id : typing.Optional[str]
|
|
56
|
+
|
|
57
|
+
trace_id : typing.Optional[str]
|
|
58
|
+
traceId should always be provided. For compatibility with older SDK versions it can also be inferred from the provided observationId.
|
|
59
|
+
|
|
60
|
+
dataset_version : typing.Optional[dt.datetime]
|
|
61
|
+
ISO 8601 timestamp (RFC 3339, Section 5.6) in UTC (e.g., "2026-01-21T14:35:42Z").
|
|
62
|
+
Specifies the dataset version to use for this experiment run.
|
|
63
|
+
If provided, the experiment will use dataset items as they existed at or before this timestamp.
|
|
64
|
+
If not provided, uses the latest version of dataset items.
|
|
65
|
+
|
|
66
|
+
request_options : typing.Optional[RequestOptions]
|
|
67
|
+
Request-specific configuration.
|
|
68
|
+
|
|
69
|
+
Returns
|
|
70
|
+
-------
|
|
71
|
+
HttpResponse[DatasetRunItem]
|
|
72
|
+
"""
|
|
73
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
74
|
+
"api/public/dataset-run-items",
|
|
75
|
+
method="POST",
|
|
76
|
+
json={
|
|
77
|
+
"runName": run_name,
|
|
78
|
+
"runDescription": run_description,
|
|
79
|
+
"metadata": metadata,
|
|
80
|
+
"datasetItemId": dataset_item_id,
|
|
81
|
+
"observationId": observation_id,
|
|
82
|
+
"traceId": trace_id,
|
|
83
|
+
"datasetVersion": dataset_version,
|
|
84
|
+
},
|
|
85
|
+
request_options=request_options,
|
|
86
|
+
omit=OMIT,
|
|
87
|
+
)
|
|
88
|
+
try:
|
|
89
|
+
if 200 <= _response.status_code < 300:
|
|
90
|
+
_data = typing.cast(
|
|
91
|
+
DatasetRunItem,
|
|
92
|
+
parse_obj_as(
|
|
93
|
+
type_=DatasetRunItem, # type: ignore
|
|
94
|
+
object_=_response.json(),
|
|
95
|
+
),
|
|
96
|
+
)
|
|
97
|
+
return HttpResponse(response=_response, data=_data)
|
|
98
|
+
if _response.status_code == 400:
|
|
99
|
+
raise Error(
|
|
100
|
+
headers=dict(_response.headers),
|
|
101
|
+
body=typing.cast(
|
|
102
|
+
typing.Any,
|
|
103
|
+
parse_obj_as(
|
|
104
|
+
type_=typing.Any, # type: ignore
|
|
105
|
+
object_=_response.json(),
|
|
106
|
+
),
|
|
107
|
+
),
|
|
108
|
+
)
|
|
109
|
+
if _response.status_code == 401:
|
|
110
|
+
raise UnauthorizedError(
|
|
111
|
+
headers=dict(_response.headers),
|
|
112
|
+
body=typing.cast(
|
|
113
|
+
typing.Any,
|
|
114
|
+
parse_obj_as(
|
|
115
|
+
type_=typing.Any, # type: ignore
|
|
116
|
+
object_=_response.json(),
|
|
117
|
+
),
|
|
118
|
+
),
|
|
119
|
+
)
|
|
120
|
+
if _response.status_code == 403:
|
|
121
|
+
raise AccessDeniedError(
|
|
122
|
+
headers=dict(_response.headers),
|
|
123
|
+
body=typing.cast(
|
|
124
|
+
typing.Any,
|
|
125
|
+
parse_obj_as(
|
|
126
|
+
type_=typing.Any, # type: ignore
|
|
127
|
+
object_=_response.json(),
|
|
128
|
+
),
|
|
129
|
+
),
|
|
130
|
+
)
|
|
131
|
+
if _response.status_code == 405:
|
|
132
|
+
raise MethodNotAllowedError(
|
|
133
|
+
headers=dict(_response.headers),
|
|
134
|
+
body=typing.cast(
|
|
135
|
+
typing.Any,
|
|
136
|
+
parse_obj_as(
|
|
137
|
+
type_=typing.Any, # type: ignore
|
|
138
|
+
object_=_response.json(),
|
|
139
|
+
),
|
|
140
|
+
),
|
|
141
|
+
)
|
|
142
|
+
if _response.status_code == 404:
|
|
143
|
+
raise NotFoundError(
|
|
144
|
+
headers=dict(_response.headers),
|
|
145
|
+
body=typing.cast(
|
|
146
|
+
typing.Any,
|
|
147
|
+
parse_obj_as(
|
|
148
|
+
type_=typing.Any, # type: ignore
|
|
149
|
+
object_=_response.json(),
|
|
150
|
+
),
|
|
151
|
+
),
|
|
152
|
+
)
|
|
153
|
+
_response_json = _response.json()
|
|
154
|
+
except JSONDecodeError:
|
|
155
|
+
raise ApiError(
|
|
156
|
+
status_code=_response.status_code,
|
|
157
|
+
headers=dict(_response.headers),
|
|
158
|
+
body=_response.text,
|
|
159
|
+
)
|
|
160
|
+
raise ApiError(
|
|
161
|
+
status_code=_response.status_code,
|
|
162
|
+
headers=dict(_response.headers),
|
|
163
|
+
body=_response_json,
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
def list(
|
|
167
|
+
self,
|
|
168
|
+
*,
|
|
169
|
+
dataset_id: str,
|
|
170
|
+
run_name: str,
|
|
171
|
+
page: typing.Optional[int] = None,
|
|
172
|
+
limit: typing.Optional[int] = None,
|
|
173
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
174
|
+
) -> HttpResponse[PaginatedDatasetRunItems]:
|
|
175
|
+
"""
|
|
176
|
+
List dataset run items
|
|
177
|
+
|
|
178
|
+
Parameters
|
|
179
|
+
----------
|
|
180
|
+
dataset_id : str
|
|
181
|
+
|
|
182
|
+
run_name : str
|
|
183
|
+
|
|
184
|
+
page : typing.Optional[int]
|
|
185
|
+
page number, starts at 1
|
|
186
|
+
|
|
187
|
+
limit : typing.Optional[int]
|
|
188
|
+
limit of items per page
|
|
189
|
+
|
|
190
|
+
request_options : typing.Optional[RequestOptions]
|
|
191
|
+
Request-specific configuration.
|
|
192
|
+
|
|
193
|
+
Returns
|
|
194
|
+
-------
|
|
195
|
+
HttpResponse[PaginatedDatasetRunItems]
|
|
196
|
+
"""
|
|
197
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
198
|
+
"api/public/dataset-run-items",
|
|
199
|
+
method="GET",
|
|
200
|
+
params={
|
|
201
|
+
"datasetId": dataset_id,
|
|
202
|
+
"runName": run_name,
|
|
203
|
+
"page": page,
|
|
204
|
+
"limit": limit,
|
|
205
|
+
},
|
|
206
|
+
request_options=request_options,
|
|
207
|
+
)
|
|
208
|
+
try:
|
|
209
|
+
if 200 <= _response.status_code < 300:
|
|
210
|
+
_data = typing.cast(
|
|
211
|
+
PaginatedDatasetRunItems,
|
|
212
|
+
parse_obj_as(
|
|
213
|
+
type_=PaginatedDatasetRunItems, # type: ignore
|
|
214
|
+
object_=_response.json(),
|
|
215
|
+
),
|
|
216
|
+
)
|
|
217
|
+
return HttpResponse(response=_response, data=_data)
|
|
218
|
+
if _response.status_code == 400:
|
|
219
|
+
raise Error(
|
|
220
|
+
headers=dict(_response.headers),
|
|
221
|
+
body=typing.cast(
|
|
222
|
+
typing.Any,
|
|
223
|
+
parse_obj_as(
|
|
224
|
+
type_=typing.Any, # type: ignore
|
|
225
|
+
object_=_response.json(),
|
|
226
|
+
),
|
|
227
|
+
),
|
|
228
|
+
)
|
|
229
|
+
if _response.status_code == 401:
|
|
230
|
+
raise UnauthorizedError(
|
|
231
|
+
headers=dict(_response.headers),
|
|
232
|
+
body=typing.cast(
|
|
233
|
+
typing.Any,
|
|
234
|
+
parse_obj_as(
|
|
235
|
+
type_=typing.Any, # type: ignore
|
|
236
|
+
object_=_response.json(),
|
|
237
|
+
),
|
|
238
|
+
),
|
|
239
|
+
)
|
|
240
|
+
if _response.status_code == 403:
|
|
241
|
+
raise AccessDeniedError(
|
|
242
|
+
headers=dict(_response.headers),
|
|
243
|
+
body=typing.cast(
|
|
244
|
+
typing.Any,
|
|
245
|
+
parse_obj_as(
|
|
246
|
+
type_=typing.Any, # type: ignore
|
|
247
|
+
object_=_response.json(),
|
|
248
|
+
),
|
|
249
|
+
),
|
|
250
|
+
)
|
|
251
|
+
if _response.status_code == 405:
|
|
252
|
+
raise MethodNotAllowedError(
|
|
253
|
+
headers=dict(_response.headers),
|
|
254
|
+
body=typing.cast(
|
|
255
|
+
typing.Any,
|
|
256
|
+
parse_obj_as(
|
|
257
|
+
type_=typing.Any, # type: ignore
|
|
258
|
+
object_=_response.json(),
|
|
259
|
+
),
|
|
260
|
+
),
|
|
261
|
+
)
|
|
262
|
+
if _response.status_code == 404:
|
|
263
|
+
raise NotFoundError(
|
|
264
|
+
headers=dict(_response.headers),
|
|
265
|
+
body=typing.cast(
|
|
266
|
+
typing.Any,
|
|
267
|
+
parse_obj_as(
|
|
268
|
+
type_=typing.Any, # type: ignore
|
|
269
|
+
object_=_response.json(),
|
|
270
|
+
),
|
|
271
|
+
),
|
|
272
|
+
)
|
|
273
|
+
_response_json = _response.json()
|
|
274
|
+
except JSONDecodeError:
|
|
275
|
+
raise ApiError(
|
|
276
|
+
status_code=_response.status_code,
|
|
277
|
+
headers=dict(_response.headers),
|
|
278
|
+
body=_response.text,
|
|
279
|
+
)
|
|
280
|
+
raise ApiError(
|
|
281
|
+
status_code=_response.status_code,
|
|
282
|
+
headers=dict(_response.headers),
|
|
283
|
+
body=_response_json,
|
|
284
|
+
)
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
class AsyncRawDatasetRunItemsClient:
|
|
288
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
289
|
+
self._client_wrapper = client_wrapper
|
|
290
|
+
|
|
291
|
+
async def create(
|
|
292
|
+
self,
|
|
293
|
+
*,
|
|
294
|
+
run_name: str,
|
|
295
|
+
dataset_item_id: str,
|
|
296
|
+
run_description: typing.Optional[str] = OMIT,
|
|
297
|
+
metadata: typing.Optional[typing.Any] = OMIT,
|
|
298
|
+
observation_id: typing.Optional[str] = OMIT,
|
|
299
|
+
trace_id: typing.Optional[str] = OMIT,
|
|
300
|
+
dataset_version: typing.Optional[dt.datetime] = OMIT,
|
|
301
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
302
|
+
) -> AsyncHttpResponse[DatasetRunItem]:
|
|
303
|
+
"""
|
|
304
|
+
Create a dataset run item
|
|
305
|
+
|
|
306
|
+
Parameters
|
|
307
|
+
----------
|
|
308
|
+
run_name : str
|
|
309
|
+
|
|
310
|
+
dataset_item_id : str
|
|
311
|
+
|
|
312
|
+
run_description : typing.Optional[str]
|
|
313
|
+
Description of the run. If run exists, description will be updated.
|
|
314
|
+
|
|
315
|
+
metadata : typing.Optional[typing.Any]
|
|
316
|
+
Metadata of the dataset run, updates run if run already exists
|
|
317
|
+
|
|
318
|
+
observation_id : typing.Optional[str]
|
|
319
|
+
|
|
320
|
+
trace_id : typing.Optional[str]
|
|
321
|
+
traceId should always be provided. For compatibility with older SDK versions it can also be inferred from the provided observationId.
|
|
322
|
+
|
|
323
|
+
dataset_version : typing.Optional[dt.datetime]
|
|
324
|
+
ISO 8601 timestamp (RFC 3339, Section 5.6) in UTC (e.g., "2026-01-21T14:35:42Z").
|
|
325
|
+
Specifies the dataset version to use for this experiment run.
|
|
326
|
+
If provided, the experiment will use dataset items as they existed at or before this timestamp.
|
|
327
|
+
If not provided, uses the latest version of dataset items.
|
|
328
|
+
|
|
329
|
+
request_options : typing.Optional[RequestOptions]
|
|
330
|
+
Request-specific configuration.
|
|
331
|
+
|
|
332
|
+
Returns
|
|
333
|
+
-------
|
|
334
|
+
AsyncHttpResponse[DatasetRunItem]
|
|
335
|
+
"""
|
|
336
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
337
|
+
"api/public/dataset-run-items",
|
|
338
|
+
method="POST",
|
|
339
|
+
json={
|
|
340
|
+
"runName": run_name,
|
|
341
|
+
"runDescription": run_description,
|
|
342
|
+
"metadata": metadata,
|
|
343
|
+
"datasetItemId": dataset_item_id,
|
|
344
|
+
"observationId": observation_id,
|
|
345
|
+
"traceId": trace_id,
|
|
346
|
+
"datasetVersion": dataset_version,
|
|
347
|
+
},
|
|
348
|
+
request_options=request_options,
|
|
349
|
+
omit=OMIT,
|
|
350
|
+
)
|
|
351
|
+
try:
|
|
352
|
+
if 200 <= _response.status_code < 300:
|
|
353
|
+
_data = typing.cast(
|
|
354
|
+
DatasetRunItem,
|
|
355
|
+
parse_obj_as(
|
|
356
|
+
type_=DatasetRunItem, # type: ignore
|
|
357
|
+
object_=_response.json(),
|
|
358
|
+
),
|
|
359
|
+
)
|
|
360
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
361
|
+
if _response.status_code == 400:
|
|
362
|
+
raise Error(
|
|
363
|
+
headers=dict(_response.headers),
|
|
364
|
+
body=typing.cast(
|
|
365
|
+
typing.Any,
|
|
366
|
+
parse_obj_as(
|
|
367
|
+
type_=typing.Any, # type: ignore
|
|
368
|
+
object_=_response.json(),
|
|
369
|
+
),
|
|
370
|
+
),
|
|
371
|
+
)
|
|
372
|
+
if _response.status_code == 401:
|
|
373
|
+
raise UnauthorizedError(
|
|
374
|
+
headers=dict(_response.headers),
|
|
375
|
+
body=typing.cast(
|
|
376
|
+
typing.Any,
|
|
377
|
+
parse_obj_as(
|
|
378
|
+
type_=typing.Any, # type: ignore
|
|
379
|
+
object_=_response.json(),
|
|
380
|
+
),
|
|
381
|
+
),
|
|
382
|
+
)
|
|
383
|
+
if _response.status_code == 403:
|
|
384
|
+
raise AccessDeniedError(
|
|
385
|
+
headers=dict(_response.headers),
|
|
386
|
+
body=typing.cast(
|
|
387
|
+
typing.Any,
|
|
388
|
+
parse_obj_as(
|
|
389
|
+
type_=typing.Any, # type: ignore
|
|
390
|
+
object_=_response.json(),
|
|
391
|
+
),
|
|
392
|
+
),
|
|
393
|
+
)
|
|
394
|
+
if _response.status_code == 405:
|
|
395
|
+
raise MethodNotAllowedError(
|
|
396
|
+
headers=dict(_response.headers),
|
|
397
|
+
body=typing.cast(
|
|
398
|
+
typing.Any,
|
|
399
|
+
parse_obj_as(
|
|
400
|
+
type_=typing.Any, # type: ignore
|
|
401
|
+
object_=_response.json(),
|
|
402
|
+
),
|
|
403
|
+
),
|
|
404
|
+
)
|
|
405
|
+
if _response.status_code == 404:
|
|
406
|
+
raise NotFoundError(
|
|
407
|
+
headers=dict(_response.headers),
|
|
408
|
+
body=typing.cast(
|
|
409
|
+
typing.Any,
|
|
410
|
+
parse_obj_as(
|
|
411
|
+
type_=typing.Any, # type: ignore
|
|
412
|
+
object_=_response.json(),
|
|
413
|
+
),
|
|
414
|
+
),
|
|
415
|
+
)
|
|
416
|
+
_response_json = _response.json()
|
|
417
|
+
except JSONDecodeError:
|
|
418
|
+
raise ApiError(
|
|
419
|
+
status_code=_response.status_code,
|
|
420
|
+
headers=dict(_response.headers),
|
|
421
|
+
body=_response.text,
|
|
422
|
+
)
|
|
423
|
+
raise ApiError(
|
|
424
|
+
status_code=_response.status_code,
|
|
425
|
+
headers=dict(_response.headers),
|
|
426
|
+
body=_response_json,
|
|
427
|
+
)
|
|
428
|
+
|
|
429
|
+
async def list(
|
|
430
|
+
self,
|
|
431
|
+
*,
|
|
432
|
+
dataset_id: str,
|
|
433
|
+
run_name: str,
|
|
434
|
+
page: typing.Optional[int] = None,
|
|
435
|
+
limit: typing.Optional[int] = None,
|
|
436
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
437
|
+
) -> AsyncHttpResponse[PaginatedDatasetRunItems]:
|
|
438
|
+
"""
|
|
439
|
+
List dataset run items
|
|
440
|
+
|
|
441
|
+
Parameters
|
|
442
|
+
----------
|
|
443
|
+
dataset_id : str
|
|
444
|
+
|
|
445
|
+
run_name : str
|
|
446
|
+
|
|
447
|
+
page : typing.Optional[int]
|
|
448
|
+
page number, starts at 1
|
|
449
|
+
|
|
450
|
+
limit : typing.Optional[int]
|
|
451
|
+
limit of items per page
|
|
452
|
+
|
|
453
|
+
request_options : typing.Optional[RequestOptions]
|
|
454
|
+
Request-specific configuration.
|
|
455
|
+
|
|
456
|
+
Returns
|
|
457
|
+
-------
|
|
458
|
+
AsyncHttpResponse[PaginatedDatasetRunItems]
|
|
459
|
+
"""
|
|
460
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
461
|
+
"api/public/dataset-run-items",
|
|
462
|
+
method="GET",
|
|
463
|
+
params={
|
|
464
|
+
"datasetId": dataset_id,
|
|
465
|
+
"runName": run_name,
|
|
466
|
+
"page": page,
|
|
467
|
+
"limit": limit,
|
|
468
|
+
},
|
|
469
|
+
request_options=request_options,
|
|
470
|
+
)
|
|
471
|
+
try:
|
|
472
|
+
if 200 <= _response.status_code < 300:
|
|
473
|
+
_data = typing.cast(
|
|
474
|
+
PaginatedDatasetRunItems,
|
|
475
|
+
parse_obj_as(
|
|
476
|
+
type_=PaginatedDatasetRunItems, # type: ignore
|
|
477
|
+
object_=_response.json(),
|
|
478
|
+
),
|
|
479
|
+
)
|
|
480
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
481
|
+
if _response.status_code == 400:
|
|
482
|
+
raise Error(
|
|
483
|
+
headers=dict(_response.headers),
|
|
484
|
+
body=typing.cast(
|
|
485
|
+
typing.Any,
|
|
486
|
+
parse_obj_as(
|
|
487
|
+
type_=typing.Any, # type: ignore
|
|
488
|
+
object_=_response.json(),
|
|
489
|
+
),
|
|
490
|
+
),
|
|
491
|
+
)
|
|
492
|
+
if _response.status_code == 401:
|
|
493
|
+
raise UnauthorizedError(
|
|
494
|
+
headers=dict(_response.headers),
|
|
495
|
+
body=typing.cast(
|
|
496
|
+
typing.Any,
|
|
497
|
+
parse_obj_as(
|
|
498
|
+
type_=typing.Any, # type: ignore
|
|
499
|
+
object_=_response.json(),
|
|
500
|
+
),
|
|
501
|
+
),
|
|
502
|
+
)
|
|
503
|
+
if _response.status_code == 403:
|
|
504
|
+
raise AccessDeniedError(
|
|
505
|
+
headers=dict(_response.headers),
|
|
506
|
+
body=typing.cast(
|
|
507
|
+
typing.Any,
|
|
508
|
+
parse_obj_as(
|
|
509
|
+
type_=typing.Any, # type: ignore
|
|
510
|
+
object_=_response.json(),
|
|
511
|
+
),
|
|
512
|
+
),
|
|
513
|
+
)
|
|
514
|
+
if _response.status_code == 405:
|
|
515
|
+
raise MethodNotAllowedError(
|
|
516
|
+
headers=dict(_response.headers),
|
|
517
|
+
body=typing.cast(
|
|
518
|
+
typing.Any,
|
|
519
|
+
parse_obj_as(
|
|
520
|
+
type_=typing.Any, # type: ignore
|
|
521
|
+
object_=_response.json(),
|
|
522
|
+
),
|
|
523
|
+
),
|
|
524
|
+
)
|
|
525
|
+
if _response.status_code == 404:
|
|
526
|
+
raise NotFoundError(
|
|
527
|
+
headers=dict(_response.headers),
|
|
528
|
+
body=typing.cast(
|
|
529
|
+
typing.Any,
|
|
530
|
+
parse_obj_as(
|
|
531
|
+
type_=typing.Any, # type: ignore
|
|
532
|
+
object_=_response.json(),
|
|
533
|
+
),
|
|
534
|
+
),
|
|
535
|
+
)
|
|
536
|
+
_response_json = _response.json()
|
|
537
|
+
except JSONDecodeError:
|
|
538
|
+
raise ApiError(
|
|
539
|
+
status_code=_response.status_code,
|
|
540
|
+
headers=dict(_response.headers),
|
|
541
|
+
body=_response.text,
|
|
542
|
+
)
|
|
543
|
+
raise ApiError(
|
|
544
|
+
status_code=_response.status_code,
|
|
545
|
+
headers=dict(_response.headers),
|
|
546
|
+
body=_response_json,
|
|
547
|
+
)
|
|
@@ -0,0 +1,44 @@
|
|
|
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_dataset_run_item_request import CreateDatasetRunItemRequest
|
|
10
|
+
from .paginated_dataset_run_items import PaginatedDatasetRunItems
|
|
11
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
12
|
+
"CreateDatasetRunItemRequest": ".create_dataset_run_item_request",
|
|
13
|
+
"PaginatedDatasetRunItems": ".paginated_dataset_run_items",
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
18
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
19
|
+
if module_name is None:
|
|
20
|
+
raise AttributeError(
|
|
21
|
+
f"No {attr_name} found in _dynamic_imports for module name -> {__name__}"
|
|
22
|
+
)
|
|
23
|
+
try:
|
|
24
|
+
module = import_module(module_name, __package__)
|
|
25
|
+
if module_name == f".{attr_name}":
|
|
26
|
+
return module
|
|
27
|
+
else:
|
|
28
|
+
return getattr(module, attr_name)
|
|
29
|
+
except ImportError as e:
|
|
30
|
+
raise ImportError(
|
|
31
|
+
f"Failed to import {attr_name} from {module_name}: {e}"
|
|
32
|
+
) from e
|
|
33
|
+
except AttributeError as e:
|
|
34
|
+
raise AttributeError(
|
|
35
|
+
f"Failed to get {attr_name} from {module_name}: {e}"
|
|
36
|
+
) from e
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def __dir__():
|
|
40
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
41
|
+
return sorted(lazy_attrs)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
__all__ = ["CreateDatasetRunItemRequest", "PaginatedDatasetRunItems"]
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
import pydantic
|
|
7
|
+
import typing_extensions
|
|
8
|
+
from ...core.pydantic_utilities import UniversalBaseModel
|
|
9
|
+
from ...core.serialization import FieldMetadata
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class CreateDatasetRunItemRequest(UniversalBaseModel):
|
|
13
|
+
run_name: typing_extensions.Annotated[str, FieldMetadata(alias="runName")]
|
|
14
|
+
run_description: typing_extensions.Annotated[
|
|
15
|
+
typing.Optional[str], FieldMetadata(alias="runDescription")
|
|
16
|
+
] = pydantic.Field(default=None)
|
|
17
|
+
"""
|
|
18
|
+
Description of the run. If run exists, description will be updated.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
metadata: typing.Optional[typing.Any] = pydantic.Field(default=None)
|
|
22
|
+
"""
|
|
23
|
+
Metadata of the dataset run, updates run if run already exists
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
dataset_item_id: typing_extensions.Annotated[
|
|
27
|
+
str, FieldMetadata(alias="datasetItemId")
|
|
28
|
+
]
|
|
29
|
+
observation_id: typing_extensions.Annotated[
|
|
30
|
+
typing.Optional[str], FieldMetadata(alias="observationId")
|
|
31
|
+
] = None
|
|
32
|
+
trace_id: typing_extensions.Annotated[
|
|
33
|
+
typing.Optional[str], FieldMetadata(alias="traceId")
|
|
34
|
+
] = pydantic.Field(default=None)
|
|
35
|
+
"""
|
|
36
|
+
traceId should always be provided. For compatibility with older SDK versions it can also be inferred from the provided observationId.
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
dataset_version: typing_extensions.Annotated[
|
|
40
|
+
typing.Optional[dt.datetime], FieldMetadata(alias="datasetVersion")
|
|
41
|
+
] = pydantic.Field(default=None)
|
|
42
|
+
"""
|
|
43
|
+
ISO 8601 timestamp (RFC 3339, Section 5.6) in UTC (e.g., "2026-01-21T14:35:42Z").
|
|
44
|
+
Specifies the dataset version to use for this experiment run.
|
|
45
|
+
If provided, the experiment will use dataset items as they existed at or before this timestamp.
|
|
46
|
+
If not provided, uses the latest version of dataset items.
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
50
|
+
extra="allow", frozen=True
|
|
51
|
+
)
|
|
@@ -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.dataset_run_item import DatasetRunItem
|
|
7
|
+
from ...core.pydantic_utilities import UniversalBaseModel
|
|
8
|
+
from ...utils.pagination.types.meta_response import MetaResponse
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class PaginatedDatasetRunItems(UniversalBaseModel):
|
|
12
|
+
data: typing.List[DatasetRunItem]
|
|
13
|
+
meta: MetaResponse
|
|
14
|
+
|
|
15
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
16
|
+
extra="allow", frozen=True
|
|
17
|
+
)
|