rapidata 2.35.1__py3-none-any.whl → 3.0.0a8__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 rapidata might be problematic. Click here for more details.
- rapidata/__init__.py +25 -16
- rapidata/api_client/__init__.py +84 -408
- rapidata/api_client/api/__init__.py +6 -2
- rapidata/api_client/api/asset_api.py +853 -0
- rapidata/api_client/api/audience_api.py +2505 -0
- rapidata/api_client/api/benchmark_api.py +904 -245
- rapidata/api_client/api/campaign_api.py +582 -24
- rapidata/api_client/api/client_api.py +38 -33
- rapidata/api_client/api/compare_workflow_api.py +11 -10
- rapidata/api_client/api/customer_rapid_api.py +364 -123
- rapidata/api_client/api/datapoint_api.py +8 -6
- rapidata/api_client/api/dataset_api.py +240 -1516
- rapidata/api_client/api/evaluation_workflow_api.py +29 -82
- rapidata/api_client/api/feedback_api.py +11 -11
- rapidata/api_client/api/grouped_ranking_workflow_api.py +319 -0
- rapidata/api_client/api/identity_api.py +26 -300
- rapidata/api_client/api/job_api.py +3902 -0
- rapidata/api_client/api/job_definition_api.py +319 -0
- rapidata/api_client/api/job_revision_api.py +335 -0
- rapidata/api_client/api/leaderboard_api.py +140 -2067
- rapidata/api_client/api/newsletter_api.py +20 -19
- rapidata/api_client/api/order_api.py +375 -91
- rapidata/api_client/api/participant_api.py +80 -118
- rapidata/api_client/api/pipeline_api.py +24 -1480
- rapidata/api_client/api/prompt_api.py +11 -11
- rapidata/api_client/api/rapidata_identity_api_api.py +5 -4
- rapidata/api_client/api/sample_api.py +300 -0
- rapidata/api_client/api/simple_workflow_api.py +11 -10
- rapidata/api_client/api/survey_api.py +304 -0
- rapidata/api_client/api/user_rapid_api.py +35 -31
- rapidata/api_client/api/validation_set_api.py +377 -1835
- rapidata/api_client/api/workflow_api.py +32 -26
- rapidata/api_client/api_client.py +2 -2
- rapidata/api_client/configuration.py +16 -29
- rapidata/api_client/exceptions.py +2 -2
- rapidata/api_client/models/__init__.py +65 -382
- rapidata/api_client/models/ab_test_selection_a_inner.py +1 -1
- rapidata/api_client/models/add_rapid_to_audience_model.py +144 -0
- rapidata/api_client/models/add_user_response_result.py +10 -5
- rapidata/api_client/models/add_validation_rapid_model.py +49 -26
- rapidata/api_client/models/add_validation_rapid_model_asset.py +154 -0
- rapidata/api_client/models/add_validation_rapid_model_context_asset.py +160 -0
- rapidata/api_client/models/add_validation_rapid_model_metadata_inner.py +140 -0
- rapidata/api_client/models/add_validation_rapid_model_truth.py +7 -1
- rapidata/api_client/models/add_validation_rapid_new_model.py +137 -0
- rapidata/api_client/models/add_validation_rapid_new_model_asset.py +182 -0
- rapidata/api_client/models/add_validation_rapid_new_model_truth.py +286 -0
- rapidata/api_client/models/age_user_filter_model.py +2 -2
- rapidata/api_client/models/age_user_filter_model_age_group.py +41 -0
- rapidata/api_client/models/aggregated_orders_model.py +98 -0
- rapidata/api_client/models/aggregator_type.py +4 -2
- rapidata/api_client/models/and_filter.py +121 -0
- rapidata/api_client/models/and_filter_filters_inner.py +282 -0
- rapidata/api_client/models/are_rapids_active_result.py +2 -2
- rapidata/api_client/models/asset_metadata.py +11 -9
- rapidata/api_client/models/asset_type.py +40 -0
- rapidata/api_client/models/attach_category_rapid_blueprint.py +13 -3
- rapidata/api_client/models/attach_category_rapid_blueprint_category.py +89 -0
- rapidata/api_client/models/audience_job_state.py +38 -0
- rapidata/api_client/models/audience_status.py +39 -0
- rapidata/api_client/models/benchmark_query_result.py +5 -3
- rapidata/api_client/models/boost_leaderboard_model.py +5 -5
- rapidata/api_client/models/boost_mode.py +37 -0
- rapidata/api_client/models/boost_query_result.py +7 -10
- rapidata/api_client/models/boost_query_result_boost_mode.py +37 -0
- rapidata/api_client/models/boost_query_result_boost_status.py +39 -0
- rapidata/api_client/models/boosting_profile.py +91 -0
- rapidata/api_client/models/box_shape.py +4 -33
- rapidata/api_client/models/campaign_filter.py +98 -0
- rapidata/api_client/models/campaign_query_result.py +15 -13
- rapidata/api_client/models/campaign_status.py +2 -2
- rapidata/api_client/models/change_boost_model.py +89 -0
- rapidata/api_client/models/classification_metadata.py +12 -1
- rapidata/api_client/models/classify_payload.py +14 -15
- rapidata/api_client/models/classify_payload_category.py +89 -0
- rapidata/api_client/models/client_model.py +25 -35
- rapidata/api_client/models/clients_query_result.py +5 -5
- rapidata/api_client/models/clone_order_model.py +4 -4
- rapidata/api_client/models/clone_order_result.py +9 -4
- rapidata/api_client/models/compare_rapid_blueprint.py +5 -3
- rapidata/api_client/models/compare_rapid_blueprint1.py +96 -0
- rapidata/api_client/models/compare_workflow_config.py +34 -23
- rapidata/api_client/models/compare_workflow_config_context_asset.py +174 -0
- rapidata/api_client/models/compare_workflow_config_model.py +15 -5
- rapidata/api_client/models/compare_workflow_model.py +34 -6
- rapidata/api_client/models/compare_workflow_model1.py +20 -9
- rapidata/api_client/models/compare_workflow_model_context_asset.py +160 -0
- rapidata/api_client/models/compare_workflow_model_metadata_inner.py +154 -0
- rapidata/api_client/models/compare_workflow_model_pair_maker_config.py +1 -1
- rapidata/api_client/models/comparison_operator.py +2 -2
- rapidata/api_client/models/conditional_validation_selection.py +6 -11
- rapidata/api_client/models/conditional_validation_selection_validation_chance.py +103 -0
- rapidata/api_client/models/confidence_interval.py +89 -0
- rapidata/api_client/models/count_metadata.py +12 -1
- rapidata/api_client/models/country_filter.py +98 -0
- rapidata/api_client/models/create_audience_request.py +122 -0
- rapidata/api_client/models/create_audience_result.py +87 -0
- rapidata/api_client/models/create_benchmark_model.py +5 -5
- rapidata/api_client/models/create_benchmark_participant_model.py +5 -5
- rapidata/api_client/models/create_benchmark_participant_result.py +4 -4
- rapidata/api_client/models/create_benchmark_prompt_result.py +87 -0
- rapidata/api_client/models/create_benchmark_result.py +2 -2
- rapidata/api_client/models/create_bridge_token_result.py +2 -2
- rapidata/api_client/models/create_client_model.py +6 -13
- rapidata/api_client/models/create_complex_order_model.py +9 -9
- rapidata/api_client/models/create_complex_order_result.py +2 -2
- rapidata/api_client/models/create_customer_client_result.py +2 -2
- rapidata/api_client/models/create_datapoint_from_files_model.py +3 -3
- rapidata/api_client/models/create_datapoint_from_text_sources_model.py +3 -3
- rapidata/api_client/models/create_datapoint_from_urls_model.py +3 -3
- rapidata/api_client/models/create_datapoint_model.py +124 -0
- rapidata/api_client/models/create_datapoint_model_asset.py +154 -0
- rapidata/api_client/models/create_datapoint_model_context_asset.py +160 -0
- rapidata/api_client/models/create_datapoint_model_metadata_inner.py +154 -0
- rapidata/api_client/models/create_datapoint_result.py +2 -2
- rapidata/api_client/models/create_dataset_endpoint_input.py +87 -0
- rapidata/api_client/models/create_dataset_endpoint_output.py +87 -0
- rapidata/api_client/models/create_demographic_rapid_model.py +45 -7
- rapidata/api_client/models/create_demographic_rapid_model_asset.py +160 -0
- rapidata/api_client/models/create_demographic_rapid_model_context_asset.py +160 -0
- rapidata/api_client/models/create_demographic_rapid_model_new.py +119 -0
- rapidata/api_client/models/create_empty_validation_set_result.py +2 -2
- rapidata/api_client/models/create_job_definition_endpoint_input.py +119 -0
- rapidata/api_client/models/create_job_definition_endpoint_output.py +89 -0
- rapidata/api_client/models/create_job_endpoint_input.py +100 -0
- rapidata/api_client/models/create_job_endpoint_output.py +89 -0
- rapidata/api_client/models/create_job_revision_endpoint_input.py +127 -0
- rapidata/api_client/models/create_job_revision_endpoint_output.py +89 -0
- rapidata/api_client/models/create_leaderboard_model.py +42 -15
- rapidata/api_client/models/create_leaderboard_result.py +2 -2
- rapidata/api_client/models/create_order_definition_model.py +119 -0
- rapidata/api_client/models/create_order_definition_result.py +87 -0
- rapidata/api_client/models/create_order_definition_revision_model.py +117 -0
- rapidata/api_client/models/create_order_definition_revision_result.py +87 -0
- rapidata/api_client/models/create_order_model.py +30 -101
- rapidata/api_client/models/create_order_model_referee.py +12 -12
- rapidata/api_client/models/create_order_model_workflow.py +35 -21
- rapidata/api_client/models/create_order_result.py +2 -2
- rapidata/api_client/models/create_rapid_result.py +2 -2
- rapidata/api_client/models/create_sample_model.py +13 -7
- rapidata/api_client/models/create_sample_model_asset.py +154 -0
- rapidata/api_client/models/create_sample_model_obsolete.py +87 -0
- rapidata/api_client/models/create_simple_pipeline_model_pipeline_steps_inner.py +8 -22
- rapidata/api_client/models/create_unsupported_order_model.py +6 -6
- rapidata/api_client/models/create_validation_set_model.py +5 -5
- rapidata/api_client/models/datapoint_model.py +3 -3
- rapidata/api_client/models/datapoint_state.py +2 -2
- rapidata/api_client/models/definition_type.py +49 -0
- rapidata/api_client/models/demographic_filter.py +100 -0
- rapidata/api_client/models/dynamic_client_registration_request.py +21 -36
- rapidata/api_client/models/early_stopping_referee_model.py +3 -3
- rapidata/api_client/models/effort_capped_selection.py +2 -11
- rapidata/api_client/models/elo_config.py +2 -2
- rapidata/api_client/models/elo_config_model.py +6 -6
- rapidata/api_client/models/entity_tag_header_value.py +93 -0
- rapidata/api_client/models/evaluation_workflow_config.py +13 -3
- rapidata/api_client/models/evaluation_workflow_model.py +16 -6
- rapidata/api_client/models/existing_asset_input.py +109 -0
- rapidata/api_client/models/existing_asset_input_metadata_value.py +126 -0
- rapidata/api_client/models/feature_flag.py +2 -2
- rapidata/api_client/models/feature_flag_model.py +6 -6
- rapidata/api_client/models/feedback_model.py +7 -7
- rapidata/api_client/models/file_asset.py +3 -5
- rapidata/api_client/models/file_asset_input_file.py +8 -22
- rapidata/api_client/models/file_asset_metadata_value.py +252 -0
- rapidata/api_client/models/file_asset_model_metadata_value.py +18 -88
- rapidata/api_client/models/file_stream_result.py +122 -0
- rapidata/api_client/models/file_type.py +2 -2
- rapidata/api_client/models/file_type_metadata.py +11 -6
- rapidata/api_client/models/file_type_metadata_model.py +2 -8
- rapidata/api_client/models/filter.py +7 -25
- rapidata/api_client/models/filter_operator.py +2 -2
- rapidata/api_client/models/fork_benchmark_result.py +87 -0
- rapidata/api_client/models/form_file_wrapper.py +17 -2
- rapidata/api_client/models/free_text_payload.py +10 -3
- rapidata/api_client/models/free_text_rapid_blueprint.py +10 -3
- rapidata/api_client/models/gender_user_filter_model.py +2 -2
- rapidata/api_client/models/gender_user_filter_model_gender.py +38 -0
- rapidata/api_client/models/get_asset_metadata_result.py +100 -0
- rapidata/api_client/models/get_audience_by_id_result.py +118 -0
- rapidata/api_client/models/get_available_validation_sets_result.py +2 -2
- rapidata/api_client/models/get_benchmark_by_id_result.py +8 -4
- rapidata/api_client/models/get_boost_result.py +97 -0
- rapidata/api_client/models/get_boost_result_boost_mode.py +37 -0
- rapidata/api_client/models/get_boost_result_boost_status.py +39 -0
- rapidata/api_client/models/get_compare_ab_summary_result.py +5 -5
- rapidata/api_client/models/get_compare_workflow_results_model.py +7 -7
- rapidata/api_client/models/get_compare_workflow_results_result.py +5 -5
- rapidata/api_client/models/get_datapoint_by_id_result.py +10 -21
- rapidata/api_client/models/get_datapoint_by_id_result_asset.py +170 -0
- rapidata/api_client/models/get_dataset_by_id_result.py +2 -2
- rapidata/api_client/models/get_dataset_progress_result.py +2 -2
- rapidata/api_client/models/get_evaluation_workflow_results_model.py +119 -0
- rapidata/api_client/models/get_failed_datapoints_result.py +5 -5
- rapidata/api_client/models/get_failed_datapoints_result_datapoint.py +100 -0
- rapidata/api_client/models/get_file_metadata_result.py +100 -0
- rapidata/api_client/models/get_grouped_ranking_workflow_results_model.py +106 -0
- rapidata/api_client/models/get_grouped_ranking_workflow_results_result.py +97 -0
- rapidata/api_client/models/get_grouped_ranking_workflow_results_result_paged_result.py +105 -0
- rapidata/api_client/models/get_job_by_id_endpoint_output.py +130 -0
- rapidata/api_client/models/get_job_definition_by_id_endpoint_output.py +95 -0
- rapidata/api_client/models/get_job_revision_endpoint_output.py +133 -0
- rapidata/api_client/models/get_leaderboard_by_id_result.py +31 -4
- rapidata/api_client/models/get_order_by_id_result.py +12 -5
- rapidata/api_client/models/get_participant_by_id_result.py +4 -6
- rapidata/api_client/models/get_pipeline_by_id_result.py +5 -5
- rapidata/api_client/models/get_public_orders_result.py +2 -2
- rapidata/api_client/models/get_public_responses_result.py +95 -0
- rapidata/api_client/models/get_public_responses_result_response.py +112 -0
- rapidata/api_client/models/get_rapid_responses_result.py +6 -12
- rapidata/api_client/models/get_recommended_validation_set_result.py +95 -0
- rapidata/api_client/models/get_responses_for_rapid_result.py +106 -0
- rapidata/api_client/models/get_responses_for_rapid_result_response.py +103 -0
- rapidata/api_client/models/get_responses_for_rapid_result_response_result.py +266 -0
- rapidata/api_client/models/get_responses_result.py +5 -5
- rapidata/api_client/models/get_responses_result_response.py +103 -0
- rapidata/api_client/models/get_sample_by_id_result.py +125 -0
- rapidata/api_client/models/get_simple_workflow_results_model.py +20 -15
- rapidata/api_client/models/get_standing_by_id_result.py +6 -14
- rapidata/api_client/models/get_validation_rapids_result.py +32 -41
- rapidata/api_client/models/get_validation_set_by_id_result.py +10 -4
- rapidata/api_client/models/get_workflow_by_id_result.py +5 -5
- rapidata/api_client/models/get_workflow_by_id_result_workflow.py +23 -9
- rapidata/api_client/models/get_workflow_progress_result.py +5 -11
- rapidata/api_client/models/get_workflow_results_result.py +34 -23
- rapidata/api_client/models/get_workflow_results_result_response.py +103 -0
- rapidata/api_client/models/google_one_tap_login_model.py +4 -4
- rapidata/api_client/models/grouped_ranking_workflow_config.py +155 -0
- rapidata/api_client/models/grouped_ranking_workflow_config_context_assets_value.py +170 -0
- rapidata/api_client/models/grouped_ranking_workflow_model.py +147 -0
- rapidata/api_client/models/grouped_ranking_workflow_model1.py +121 -0
- rapidata/api_client/models/i_artifact_model.py +182 -0
- rapidata/api_client/models/i_artifact_model_campaign_artifact_model.py +98 -0
- rapidata/api_client/models/i_artifact_model_dataset_artifact_model.py +98 -0
- rapidata/api_client/models/i_artifact_model_file_artifact_model.py +98 -0
- rapidata/api_client/models/i_artifact_model_workflow_artifact_model.py +98 -0
- rapidata/api_client/models/i_artifact_model_workflow_config_artifact_model.py +102 -0
- rapidata/api_client/models/i_asset.py +170 -0
- rapidata/api_client/models/i_asset_file_asset.py +111 -0
- rapidata/api_client/models/i_asset_input.py +156 -0
- rapidata/api_client/models/i_asset_input_existing_asset_input.py +118 -0
- rapidata/api_client/models/i_asset_input_multi_asset_input.py +128 -0
- rapidata/api_client/models/i_asset_input_text_asset_input.py +118 -0
- rapidata/api_client/models/i_asset_model.py +170 -0
- rapidata/api_client/models/i_asset_model_file_asset_model.py +113 -0
- rapidata/api_client/models/i_asset_model_multi_asset_model.py +123 -0
- rapidata/api_client/models/i_asset_model_null_asset_model.py +111 -0
- rapidata/api_client/models/i_asset_model_text_asset_model.py +113 -0
- rapidata/api_client/models/i_asset_multi_asset.py +121 -0
- rapidata/api_client/models/i_asset_null_asset.py +109 -0
- rapidata/api_client/models/i_asset_text_asset.py +111 -0
- rapidata/api_client/models/i_audience_filter.py +184 -0
- rapidata/api_client/models/i_audience_filter_and_audience_filter.py +106 -0
- rapidata/api_client/models/i_audience_filter_country_audience_filter.py +96 -0
- rapidata/api_client/models/i_audience_filter_country_filter.py +96 -0
- rapidata/api_client/models/i_audience_filter_language_audience_filter.py +96 -0
- rapidata/api_client/models/i_audience_filter_language_filter.py +96 -0
- rapidata/api_client/models/i_audience_filter_not_audience_filter.py +102 -0
- rapidata/api_client/models/i_audience_filter_or_audience_filter.py +106 -0
- rapidata/api_client/models/i_campaign_filter.py +296 -0
- rapidata/api_client/models/i_campaign_filter_and_filter.py +117 -0
- rapidata/api_client/models/i_campaign_filter_campaign_filter.py +98 -0
- rapidata/api_client/models/i_campaign_filter_campaign_session_count_filter.py +101 -0
- rapidata/api_client/models/i_campaign_filter_country_filter.py +98 -0
- rapidata/api_client/models/i_campaign_filter_demographic_filter.py +100 -0
- rapidata/api_client/models/i_campaign_filter_device_filter.py +106 -0
- rapidata/api_client/models/i_campaign_filter_language_filter.py +98 -0
- rapidata/api_client/models/i_campaign_filter_new_user_filter.py +96 -0
- rapidata/api_client/models/i_campaign_filter_not_filter.py +113 -0
- rapidata/api_client/models/i_campaign_filter_or_filter.py +117 -0
- rapidata/api_client/models/i_campaign_filter_response_count_filter.py +103 -0
- rapidata/api_client/models/i_campaign_filter_user_action_restriction_filter.py +106 -0
- rapidata/api_client/models/i_campaign_filter_user_score_filter.py +102 -0
- rapidata/api_client/models/i_campaign_filter_user_state_filter.py +106 -0
- rapidata/api_client/models/i_dataset_metadata_input.py +154 -0
- rapidata/api_client/models/i_dataset_metadata_input_prompt_asset_metadata_input.py +100 -0
- rapidata/api_client/models/i_dataset_metadata_input_prompt_metadata_input.py +96 -0
- rapidata/api_client/models/i_dataset_metadata_input_transcription_metadata_input.py +96 -0
- rapidata/api_client/models/i_dataset_model.py +126 -0
- rapidata/api_client/models/i_dataset_model_clone_dataset_model.py +98 -0
- rapidata/api_client/models/i_metadata.py +252 -0
- rapidata/api_client/models/i_metadata_classification_metadata.py +109 -0
- rapidata/api_client/models/i_metadata_count_metadata.py +109 -0
- rapidata/api_client/models/i_metadata_duration_metadata.py +110 -0
- rapidata/api_client/models/i_metadata_file_type_metadata.py +110 -0
- rapidata/api_client/models/i_metadata_image_dimension_metadata.py +111 -0
- rapidata/api_client/models/i_metadata_input.py +126 -0
- rapidata/api_client/models/i_metadata_input_text_metadata_input.py +111 -0
- rapidata/api_client/models/i_metadata_location_metadata.py +111 -0
- rapidata/api_client/models/i_metadata_model.py +252 -0
- rapidata/api_client/models/i_metadata_model_classification_metadata_model.py +96 -0
- rapidata/api_client/models/i_metadata_model_count_metadata_model.py +96 -0
- rapidata/api_client/models/i_metadata_model_file_type_metadata_model.py +97 -0
- rapidata/api_client/models/i_metadata_model_image_dimension_metadata_model.py +98 -0
- rapidata/api_client/models/i_metadata_model_location_metadata_model.py +98 -0
- rapidata/api_client/models/i_metadata_model_original_filename_metadata_model.py +96 -0
- rapidata/api_client/models/i_metadata_model_source_url_metadata_model.py +96 -0
- rapidata/api_client/models/i_metadata_model_streams_metadata_model.py +100 -0
- rapidata/api_client/models/i_metadata_model_text_metadata_model.py +101 -0
- rapidata/api_client/models/i_metadata_model_video_duration_metadata_model.py +97 -0
- rapidata/api_client/models/i_metadata_original_filename_metadata.py +109 -0
- rapidata/api_client/models/i_metadata_source_url_metadata.py +109 -0
- rapidata/api_client/models/i_metadata_streams_metadata.py +113 -0
- rapidata/api_client/models/i_metadata_text_metadata.py +114 -0
- rapidata/api_client/models/i_metadata_video_duration_metadata.py +110 -0
- rapidata/api_client/models/i_order_workflow_model.py +168 -0
- rapidata/api_client/models/i_order_workflow_model_compare_workflow_model.py +146 -0
- rapidata/api_client/models/i_order_workflow_model_evaluation_workflow_model.py +108 -0
- rapidata/api_client/models/i_order_workflow_model_grouped_ranking_workflow_model.py +147 -0
- rapidata/api_client/models/i_order_workflow_model_simple_workflow_model.py +110 -0
- rapidata/api_client/models/i_pair_maker_config.py +126 -0
- rapidata/api_client/models/i_pair_maker_config_model.py +126 -0
- rapidata/api_client/models/i_pair_maker_config_model_online_pair_maker_config_model.py +98 -0
- rapidata/api_client/models/i_pair_maker_config_online_pair_maker_config.py +98 -0
- rapidata/api_client/models/i_pair_maker_information.py +126 -0
- rapidata/api_client/models/i_pair_maker_information_online_pair_maker_information.py +100 -0
- rapidata/api_client/models/i_pipeline_artifact_model.py +126 -0
- rapidata/api_client/models/i_pipeline_artifact_model_create_dataset_artifact_model.py +102 -0
- rapidata/api_client/models/i_pipeline_model.py +126 -0
- rapidata/api_client/models/i_pipeline_model_create_simple_pipeline_model.py +116 -0
- rapidata/api_client/models/i_pipeline_step_model.py +168 -0
- rapidata/api_client/models/i_pipeline_step_model_dataset_evaluation_step_model.py +102 -0
- rapidata/api_client/models/i_pipeline_step_model_send_completion_mail_step_model.py +98 -0
- rapidata/api_client/models/i_pipeline_step_model_workflow_aggregation_step_model.py +103 -0
- rapidata/api_client/models/i_pipeline_step_model_workflow_labeling_step_model.py +96 -0
- rapidata/api_client/models/i_rapid_blueprint.py +252 -0
- rapidata/api_client/models/i_rapid_blueprint_attach_category_rapid_blueprint.py +108 -0
- rapidata/api_client/models/i_rapid_blueprint_bounding_box_rapid_blueprint.py +96 -0
- rapidata/api_client/models/i_rapid_blueprint_compare_rapid_blueprint.py +98 -0
- rapidata/api_client/models/i_rapid_blueprint_free_text_rapid_blueprint.py +105 -0
- rapidata/api_client/models/i_rapid_blueprint_line_rapid_blueprint.py +96 -0
- rapidata/api_client/models/i_rapid_blueprint_locate_rapid_blueprint.py +96 -0
- rapidata/api_client/models/i_rapid_blueprint_named_entity_rapid_blueprint.py +98 -0
- rapidata/api_client/models/i_rapid_blueprint_polygon_rapid_blueprint.py +96 -0
- rapidata/api_client/models/i_rapid_blueprint_scrub_rapid_blueprint.py +96 -0
- rapidata/api_client/models/i_rapid_blueprint_transcription_rapid_blueprint.py +96 -0
- rapidata/api_client/models/i_rapid_payload.py +252 -0
- rapidata/api_client/models/i_rapid_payload_bounding_box_payload.py +96 -0
- rapidata/api_client/models/i_rapid_payload_classify_payload.py +106 -0
- rapidata/api_client/models/i_rapid_payload_compare_payload.py +96 -0
- rapidata/api_client/models/i_rapid_payload_free_text_payload.py +105 -0
- rapidata/api_client/models/i_rapid_payload_line_payload.py +96 -0
- rapidata/api_client/models/i_rapid_payload_locate_payload.py +96 -0
- rapidata/api_client/models/i_rapid_payload_named_entity_payload.py +98 -0
- rapidata/api_client/models/i_rapid_payload_polygon_payload.py +96 -0
- rapidata/api_client/models/i_rapid_payload_scrub_payload.py +96 -0
- rapidata/api_client/models/i_rapid_payload_transcription_payload.py +106 -0
- rapidata/api_client/models/i_rapid_result.py +266 -0
- rapidata/api_client/models/i_rapid_result_attach_category_result.py +98 -0
- rapidata/api_client/models/i_rapid_result_bounding_box_result.py +106 -0
- rapidata/api_client/models/i_rapid_result_compare_result.py +98 -0
- rapidata/api_client/models/i_rapid_result_free_text_result.py +98 -0
- rapidata/api_client/models/i_rapid_result_line_result.py +106 -0
- rapidata/api_client/models/i_rapid_result_locate_result.py +106 -0
- rapidata/api_client/models/i_rapid_result_named_entity_result.py +106 -0
- rapidata/api_client/models/i_rapid_result_polygon_result.py +106 -0
- rapidata/api_client/models/i_rapid_result_scrub_result.py +98 -0
- rapidata/api_client/models/i_rapid_result_skip_result.py +96 -0
- rapidata/api_client/models/i_rapid_result_transcription_result.py +106 -0
- rapidata/api_client/models/i_referee_config.py +154 -0
- rapidata/api_client/models/i_referee_config_naive_referee_config.py +96 -0
- rapidata/api_client/models/i_referee_config_never_ending_referee_config.py +94 -0
- rapidata/api_client/models/i_referee_config_probabilistic_attach_category_referee_config.py +98 -0
- rapidata/api_client/models/i_referee_info.py +154 -0
- rapidata/api_client/models/i_referee_info_naive_referee_info.py +96 -0
- rapidata/api_client/models/i_referee_info_never_ending_referee_info.py +94 -0
- rapidata/api_client/models/i_referee_info_probabilistic_attach_category_referee_info.py +98 -0
- rapidata/api_client/models/i_referee_model.py +140 -0
- rapidata/api_client/models/i_referee_model_early_stopping_referee_model.py +98 -0
- rapidata/api_client/models/i_referee_model_naive_referee_model.py +96 -0
- rapidata/api_client/models/i_selection.py +240 -0
- rapidata/api_client/models/i_selection_ab_test_selection.py +122 -0
- rapidata/api_client/models/i_selection_capped_selection.py +108 -0
- rapidata/api_client/models/i_selection_conditional_validation_selection.py +110 -0
- rapidata/api_client/models/i_selection_demographic_selection.py +98 -0
- rapidata/api_client/models/i_selection_effort_capped_selection.py +101 -0
- rapidata/api_client/models/i_selection_labeling_selection.py +103 -0
- rapidata/api_client/models/i_selection_shuffling_selection.py +106 -0
- rapidata/api_client/models/i_selection_static_selection.py +96 -0
- rapidata/api_client/models/i_selection_validation_selection.py +98 -0
- rapidata/api_client/models/i_user_filter_model.py +296 -0
- rapidata/api_client/models/i_user_filter_model_age_user_filter_model.py +104 -0
- rapidata/api_client/models/i_user_filter_model_and_user_filter_model.py +106 -0
- rapidata/api_client/models/i_user_filter_model_campaign_user_filter_model.py +96 -0
- rapidata/api_client/models/i_user_filter_model_country_user_filter_model.py +96 -0
- rapidata/api_client/models/i_user_filter_model_custom_user_filter_model.py +98 -0
- rapidata/api_client/models/i_user_filter_model_device_user_filter_model.py +104 -0
- rapidata/api_client/models/i_user_filter_model_gender_user_filter_model.py +104 -0
- rapidata/api_client/models/i_user_filter_model_language_user_filter_model.py +96 -0
- rapidata/api_client/models/i_user_filter_model_new_user_filter_model.py +94 -0
- rapidata/api_client/models/i_user_filter_model_not_user_filter_model.py +102 -0
- rapidata/api_client/models/i_user_filter_model_or_user_filter_model.py +106 -0
- rapidata/api_client/models/i_user_filter_model_response_count_user_filter_model.py +101 -0
- rapidata/api_client/models/i_user_filter_model_user_score_user_filter_model.py +105 -0
- rapidata/api_client/models/i_validation_metadata_input.py +140 -0
- rapidata/api_client/models/i_validation_metadata_input_prompt_asset_metadata_input.py +100 -0
- rapidata/api_client/models/i_validation_metadata_input_prompt_metadata_input.py +96 -0
- rapidata/api_client/models/i_validation_truth.py +280 -0
- rapidata/api_client/models/i_validation_truth_attach_category_truth.py +96 -0
- rapidata/api_client/models/i_validation_truth_bounding_box_truth.py +102 -0
- rapidata/api_client/models/i_validation_truth_compare_truth.py +96 -0
- rapidata/api_client/models/i_validation_truth_empty_validation_truth.py +94 -0
- rapidata/api_client/models/i_validation_truth_line_truth.py +94 -0
- rapidata/api_client/models/i_validation_truth_locate_box_truth.py +108 -0
- rapidata/api_client/models/i_validation_truth_model.py +294 -0
- rapidata/api_client/models/i_validation_truth_model_attach_category_truth_model.py +96 -0
- rapidata/api_client/models/i_validation_truth_model_bounding_box_truth_model.py +102 -0
- rapidata/api_client/models/i_validation_truth_model_classify_truth_model.py +96 -0
- rapidata/api_client/models/i_validation_truth_model_compare_truth_model.py +96 -0
- rapidata/api_client/models/i_validation_truth_model_empty_validation_truth_model.py +94 -0
- rapidata/api_client/models/i_validation_truth_model_line_truth_model.py +94 -0
- rapidata/api_client/models/i_validation_truth_model_locate_box_truth_model.py +108 -0
- rapidata/api_client/models/i_validation_truth_model_multi_compare_truth_model.py +96 -0
- rapidata/api_client/models/i_validation_truth_model_named_entity_truth_model.py +104 -0
- rapidata/api_client/models/i_validation_truth_model_polygon_truth_model.py +94 -0
- rapidata/api_client/models/i_validation_truth_model_scrub_truth_model.py +104 -0
- rapidata/api_client/models/i_validation_truth_model_skip_truth_model.py +94 -0
- rapidata/api_client/models/i_validation_truth_model_transcription_truth_model.py +115 -0
- rapidata/api_client/models/i_validation_truth_multi_compare_truth.py +96 -0
- rapidata/api_client/models/i_validation_truth_named_entity_truth.py +104 -0
- rapidata/api_client/models/i_validation_truth_polygon_truth.py +94 -0
- rapidata/api_client/models/i_validation_truth_scrub_truth.py +104 -0
- rapidata/api_client/models/i_validation_truth_skip_truth.py +94 -0
- rapidata/api_client/models/i_validation_truth_transcription_truth.py +115 -0
- rapidata/api_client/models/i_workflow_config.py +168 -0
- rapidata/api_client/models/i_workflow_config_compare_workflow_config.py +142 -0
- rapidata/api_client/models/i_workflow_config_evaluation_workflow_config.py +114 -0
- rapidata/api_client/models/i_workflow_config_grouped_ranking_workflow_config.py +155 -0
- rapidata/api_client/models/i_workflow_config_simple_workflow_config.py +116 -0
- rapidata/api_client/models/i_workflow_model.py +168 -0
- rapidata/api_client/models/i_workflow_model_compare_workflow_model.py +145 -0
- rapidata/api_client/models/i_workflow_model_evaluation_workflow_model.py +115 -0
- rapidata/api_client/models/i_workflow_model_grouped_ranking_workflow_model.py +121 -0
- rapidata/api_client/models/i_workflow_model_simple_workflow_model.py +119 -0
- rapidata/api_client/models/image_dimension_metadata.py +12 -1
- rapidata/api_client/models/inquire_file_metadata_result.py +100 -0
- rapidata/api_client/models/inspect_report_result.py +2 -2
- rapidata/api_client/models/job_definition_revision_state.py +38 -0
- rapidata/api_client/models/json_web_key.py +2 -36
- rapidata/api_client/models/json_web_key_set.py +2 -22
- rapidata/api_client/models/labeling_selection.py +11 -13
- rapidata/api_client/models/language_filter.py +98 -0
- rapidata/api_client/models/leaderboard_query_result.py +29 -2
- rapidata/api_client/models/leaderboards_query_result.py +135 -0
- rapidata/api_client/models/line_result.py +3 -3
- rapidata/api_client/models/line_result_line.py +97 -0
- rapidata/api_client/models/line_result_line_point.py +89 -0
- rapidata/api_client/models/locate_coordinate.py +4 -13
- rapidata/api_client/models/location_metadata.py +12 -1
- rapidata/api_client/models/logic_operator.py +2 -2
- rapidata/api_client/models/metadata_i_order_metadata_input.py +154 -0
- rapidata/api_client/models/metadata_i_order_metadata_input_metadata_prompt_asset_metadata_input.py +100 -0
- rapidata/api_client/models/metadata_i_order_metadata_input_metadata_prompt_metadata_input.py +96 -0
- rapidata/api_client/models/metadata_i_order_metadata_input_metadata_transcription_metadata_input.py +96 -0
- rapidata/api_client/models/metadata_prompt_asset_metadata_input.py +100 -0
- rapidata/api_client/models/metadata_prompt_metadata_input.py +96 -0
- rapidata/api_client/models/metadata_transcription_metadata_input.py +96 -0
- rapidata/api_client/models/multi_asset.py +6 -6
- rapidata/api_client/models/multi_asset_assets_inner.py +170 -0
- rapidata/api_client/models/multi_asset_input.py +21 -1
- rapidata/api_client/models/multi_asset_input1_assets_inner.py +40 -12
- rapidata/api_client/models/multi_asset_input3_assets_inner.py +40 -12
- rapidata/api_client/models/multi_asset_input_assets_inner.py +16 -30
- rapidata/api_client/models/multi_asset_model.py +3 -3
- rapidata/api_client/models/naive_referee_model.py +2 -2
- rapidata/api_client/models/named_classification.py +4 -13
- rapidata/api_client/models/new_user_filter.py +96 -0
- rapidata/api_client/models/newsletter_model.py +6 -6
- rapidata/api_client/models/not_available_yet_result.py +4 -13
- rapidata/api_client/models/not_filter.py +117 -0
- rapidata/api_client/models/null_asset.py +3 -5
- rapidata/api_client/models/online_pair_maker_config_model.py +3 -3
- rapidata/api_client/models/option_of_aggregator_type.py +49 -0
- rapidata/api_client/models/or_filter.py +121 -0
- rapidata/api_client/models/order_model.py +15 -14
- rapidata/api_client/models/order_state.py +2 -2
- rapidata/api_client/models/original_filename_metadata.py +12 -1
- rapidata/api_client/models/page_info.py +2 -7
- rapidata/api_client/models/paged_result_aggregated_orders_model.py +105 -0
- rapidata/api_client/models/paged_result_benchmark_query_result.py +105 -0
- rapidata/api_client/models/paged_result_campaign_query_result.py +105 -0
- rapidata/api_client/models/paged_result_clients_query_result.py +105 -0
- rapidata/api_client/models/paged_result_datapoint_model.py +105 -0
- rapidata/api_client/models/paged_result_get_compare_workflow_results_result.py +105 -0
- rapidata/api_client/models/paged_result_get_grouped_ranking_workflow_results_result.py +105 -0
- rapidata/api_client/models/paged_result_get_validation_rapids_result.py +105 -0
- rapidata/api_client/models/paged_result_get_workflow_results_result.py +105 -0
- rapidata/api_client/models/paged_result_i_workflow_model.py +105 -0
- rapidata/api_client/models/paged_result_leaderboard_query_result.py +105 -0
- rapidata/api_client/models/paged_result_leaderboards_query_result.py +105 -0
- rapidata/api_client/models/paged_result_of_aggregated_orders_model.py +103 -0
- rapidata/api_client/models/paged_result_of_benchmark_query_result.py +103 -0
- rapidata/api_client/models/paged_result_of_campaign_query_result.py +103 -0
- rapidata/api_client/models/paged_result_of_clients_query_result.py +103 -0
- rapidata/api_client/models/paged_result_of_get_compare_workflow_results_result.py +103 -0
- rapidata/api_client/models/paged_result_of_get_grouped_ranking_workflow_results_result.py +103 -0
- rapidata/api_client/models/paged_result_of_get_validation_rapids_result.py +103 -0
- rapidata/api_client/models/paged_result_of_get_workflow_results_result.py +103 -0
- rapidata/api_client/models/paged_result_of_i_workflow_model.py +103 -0
- rapidata/api_client/models/paged_result_of_leaderboards_query_result.py +103 -0
- rapidata/api_client/models/paged_result_of_order_model.py +103 -0
- rapidata/api_client/models/paged_result_of_participant_by_benchmark.py +103 -0
- rapidata/api_client/models/paged_result_of_prompt_by_benchmark_result.py +103 -0
- rapidata/api_client/models/paged_result_of_query_audiences_result.py +103 -0
- rapidata/api_client/models/paged_result_of_query_datapoints_by_dataset_id_result.py +103 -0
- rapidata/api_client/models/paged_result_of_query_job_definitions_result.py +103 -0
- rapidata/api_client/models/paged_result_of_query_job_revisions_result.py +103 -0
- rapidata/api_client/models/paged_result_of_query_jobs_result.py +103 -0
- rapidata/api_client/models/paged_result_of_query_rapids_for_audience_result.py +103 -0
- rapidata/api_client/models/paged_result_of_query_validation_rapid_eligibility_result.py +103 -0
- rapidata/api_client/models/paged_result_of_rapid_model.py +103 -0
- rapidata/api_client/models/paged_result_of_runs_by_leaderboard_result.py +103 -0
- rapidata/api_client/models/paged_result_of_sample_by_identifier.py +103 -0
- rapidata/api_client/models/paged_result_of_sample_by_participant.py +103 -0
- rapidata/api_client/models/paged_result_of_standing_by_leaderboard.py +103 -0
- rapidata/api_client/models/paged_result_of_validation_set_model.py +103 -0
- rapidata/api_client/models/paged_result_order_model.py +105 -0
- rapidata/api_client/models/paged_result_participant_by_benchmark.py +105 -0
- rapidata/api_client/models/paged_result_potential_validation_rapid.py +105 -0
- rapidata/api_client/models/paged_result_prompt_by_benchmark_result.py +105 -0
- rapidata/api_client/models/paged_result_query_audiences_result.py +105 -0
- rapidata/api_client/models/paged_result_query_datapoints_by_dataset_id_result.py +105 -0
- rapidata/api_client/models/paged_result_query_validation_rapid_eligibility_result.py +105 -0
- rapidata/api_client/models/paged_result_rapid_model.py +105 -0
- rapidata/api_client/models/paged_result_runs_by_leaderboard_result.py +105 -0
- rapidata/api_client/models/paged_result_sample_by_identifier.py +105 -0
- rapidata/api_client/models/paged_result_sample_by_participant.py +105 -0
- rapidata/api_client/models/paged_result_standing_by_leaderboard.py +105 -0
- rapidata/api_client/models/paged_result_validation_set_model.py +105 -0
- rapidata/api_client/models/participant_by_benchmark.py +6 -14
- rapidata/api_client/models/participant_status.py +2 -2
- rapidata/api_client/models/polygon_result.py +3 -3
- rapidata/api_client/models/polygon_result_coordinate.py +89 -0
- rapidata/api_client/models/polygon_result_shape.py +95 -0
- rapidata/api_client/models/preliminary_download_model.py +5 -5
- rapidata/api_client/models/preview_order_model.py +5 -5
- rapidata/api_client/models/problem_details.py +2 -20
- rapidata/api_client/models/prompt_asset_metadata_input.py +4 -6
- rapidata/api_client/models/prompt_asset_metadata_input_asset.py +25 -41
- rapidata/api_client/models/prompt_by_benchmark_result.py +5 -5
- rapidata/api_client/models/prompt_metadata.py +12 -1
- rapidata/api_client/models/prompt_metadata_input.py +5 -7
- rapidata/api_client/models/prompt_type.py +38 -0
- rapidata/api_client/models/proxy_file_wrapper.py +17 -2
- rapidata/api_client/models/public_order_model.py +2 -2
- rapidata/api_client/models/public_rapid_response.py +112 -0
- rapidata/api_client/models/query_audiences_result.py +118 -0
- rapidata/api_client/models/query_datapoints_by_dataset_id_result.py +95 -0
- rapidata/api_client/models/query_job_definitions_result.py +97 -0
- rapidata/api_client/models/query_job_revisions_result.py +95 -0
- rapidata/api_client/models/query_jobs_result.py +103 -0
- rapidata/api_client/models/query_model.py +10 -5
- rapidata/api_client/models/query_rapids_for_audience_result.py +150 -0
- rapidata/api_client/models/query_validation_rapid_eligibility_model_query_validation_model.py +107 -0
- rapidata/api_client/models/query_validation_rapid_eligibility_result.py +103 -0
- rapidata/api_client/models/query_validation_rapid_eligibility_result_truth.py +280 -0
- rapidata/api_client/models/rapid_issue.py +2 -2
- rapidata/api_client/models/rapid_modality.py +46 -0
- rapidata/api_client/models/rapid_model.py +33 -49
- rapidata/api_client/models/rapid_result_model.py +7 -7
- rapidata/api_client/models/rapid_skipped_model.py +5 -5
- rapidata/api_client/models/rapid_state.py +2 -2
- rapidata/api_client/models/read_bridge_token_keys_result.py +10 -24
- rapidata/api_client/models/reference_asset_input.py +100 -0
- rapidata/api_client/models/report_model.py +9 -15
- rapidata/api_client/models/response_count_filter.py +103 -0
- rapidata/api_client/models/response_count_user_filter_model.py +2 -8
- rapidata/api_client/models/retrieval_mode.py +2 -2
- rapidata/api_client/models/root_filter.py +5 -14
- rapidata/api_client/models/run_status.py +2 -2
- rapidata/api_client/models/runs_by_leaderboard_result.py +6 -12
- rapidata/api_client/models/sample_by_identifier.py +125 -0
- rapidata/api_client/models/sample_by_identifier_paged_result.py +105 -0
- rapidata/api_client/models/sample_by_participant.py +7 -8
- rapidata/api_client/models/scrub_range.py +2 -2
- rapidata/api_client/models/send_survey_model.py +87 -0
- rapidata/api_client/models/simple_workflow_config.py +15 -5
- rapidata/api_client/models/simple_workflow_config_blueprint.py +37 -23
- rapidata/api_client/models/simple_workflow_config_model.py +11 -3
- rapidata/api_client/models/simple_workflow_model.py +14 -4
- rapidata/api_client/models/simple_workflow_model1.py +4 -11
- rapidata/api_client/models/simple_workflow_model_blueprint.py +1 -1
- rapidata/api_client/models/sort_criterion.py +5 -11
- rapidata/api_client/models/sort_direction.py +2 -2
- rapidata/api_client/models/source_url_metadata.py +12 -1
- rapidata/api_client/models/standing_by_benchmark.py +113 -0
- rapidata/api_client/models/standing_by_leaderboard.py +19 -21
- rapidata/api_client/models/standing_status.py +2 -2
- rapidata/api_client/models/standings_by_benchmark_result.py +95 -0
- rapidata/api_client/models/standings_by_leaderboard_result.py +2 -2
- rapidata/api_client/models/start_preliminary_download_result.py +87 -0
- rapidata/api_client/models/sticky_state.py +3 -2
- rapidata/api_client/models/stream_file_wrapper.py +25 -3
- rapidata/api_client/models/streams_metadata.py +12 -1
- rapidata/api_client/models/string_segment.py +105 -0
- rapidata/api_client/models/submit_order_model.py +5 -5
- rapidata/api_client/models/submit_participant_result.py +2 -2
- rapidata/api_client/models/submit_prompt_model.py +9 -14
- rapidata/api_client/models/submit_prompt_model_prompt_asset.py +40 -12
- rapidata/api_client/models/tags_by_benchmark_result.py +2 -2
- rapidata/api_client/models/text_asset.py +3 -5
- rapidata/api_client/models/text_asset_input.py +21 -1
- rapidata/api_client/models/text_metadata.py +18 -2
- rapidata/api_client/models/text_metadata_input.py +111 -0
- rapidata/api_client/models/text_metadata_model.py +7 -2
- rapidata/api_client/models/transcription_metadata.py +9 -1
- rapidata/api_client/models/transcription_metadata_input.py +5 -7
- rapidata/api_client/models/transcription_word.py +2 -2
- rapidata/api_client/models/translated_string.py +2 -2
- rapidata/api_client/models/unlock_order_result.py +2 -2
- rapidata/api_client/models/update_audience_request.py +113 -0
- rapidata/api_client/models/update_benchmark_model.py +99 -0
- rapidata/api_client/models/update_benchmark_name_model.py +5 -5
- rapidata/api_client/models/update_campaign_model.py +11 -11
- rapidata/api_client/models/update_dataset_name_model.py +5 -5
- rapidata/api_client/models/update_dimensions_model.py +3 -3
- rapidata/api_client/models/update_job_definition_endpoint_input.py +92 -0
- rapidata/api_client/models/update_leaderboard_model.py +106 -0
- rapidata/api_client/models/update_leaderboard_name_model.py +5 -5
- rapidata/api_client/models/update_leaderboard_response_config_model.py +5 -5
- rapidata/api_client/models/update_order_name_model.py +5 -5
- rapidata/api_client/models/update_participant_model.py +92 -0
- rapidata/api_client/models/update_participant_name_model.py +5 -5
- rapidata/api_client/models/update_priority_model.py +87 -0
- rapidata/api_client/models/update_prompt_tags_model.py +5 -5
- rapidata/api_client/models/update_should_alert_model.py +4 -4
- rapidata/api_client/models/update_validation_rapid_model.py +35 -14
- rapidata/api_client/models/update_validation_rapid_model_context_asset.py +160 -0
- rapidata/api_client/models/update_validation_set_model.py +120 -0
- rapidata/api_client/models/upload_asset_result.py +102 -0
- rapidata/api_client/models/upload_file_from_url_result.py +87 -0
- rapidata/api_client/models/upload_file_result.py +87 -0
- rapidata/api_client/models/user_action_restriction.py +37 -0
- rapidata/api_client/models/user_action_restriction_filter.py +101 -0
- rapidata/api_client/models/user_score_filter.py +102 -0
- rapidata/api_client/models/user_state.py +38 -0
- rapidata/api_client/models/user_state_filter.py +101 -0
- rapidata/api_client/models/validation_chance.py +20 -3
- rapidata/api_client/models/validation_problem_details.py +117 -0
- rapidata/api_client/models/validation_set_model.py +39 -5
- rapidata/api_client/models/validation_set_overview_model.py +2 -2
- rapidata/api_client/models/video_duration_metadata.py +12 -1
- rapidata/api_client/models/workflow_aggregation_step_model.py +3 -12
- rapidata/api_client/models/workflow_config_artifact_model_workflow_config.py +23 -9
- rapidata/api_client/models/workflow_state.py +2 -2
- rapidata/api_client/models/zip_entry_file_wrapper.py +33 -2
- rapidata/api_client/rest.py +2 -2
- rapidata/api_client_README.md +384 -318
- rapidata/rapidata_client/__init__.py +17 -22
- rapidata/rapidata_client/api/rapidata_api_client.py +253 -0
- rapidata/rapidata_client/audience/__init__.py +2 -0
- rapidata/rapidata_client/audience/audience_example_handler.py +168 -0
- rapidata/rapidata_client/audience/rapidata_audience.py +287 -0
- rapidata/rapidata_client/audience/rapidata_audience_manager.py +162 -0
- rapidata/rapidata_client/benchmark/_detail_mapper.py +11 -9
- rapidata/rapidata_client/benchmark/leaderboard/rapidata_leaderboard.py +98 -54
- rapidata/rapidata_client/benchmark/participant/_participant.py +90 -46
- rapidata/rapidata_client/benchmark/rapidata_benchmark.py +388 -225
- rapidata/rapidata_client/benchmark/rapidata_benchmark_manager.py +172 -65
- rapidata/rapidata_client/config/__init__.py +4 -0
- rapidata/rapidata_client/config/logger.py +135 -0
- rapidata/rapidata_client/config/logging_config.py +55 -0
- rapidata/rapidata_client/config/managed_print.py +6 -0
- rapidata/rapidata_client/config/order_config.py +14 -0
- rapidata/rapidata_client/config/rapidata_config.py +36 -0
- rapidata/rapidata_client/config/tracer.py +184 -0
- rapidata/rapidata_client/config/upload_config.py +64 -0
- rapidata/rapidata_client/datapoints/__init__.py +8 -3
- rapidata/rapidata_client/datapoints/_asset_uploader.py +184 -0
- rapidata/rapidata_client/datapoints/_datapoint.py +92 -0
- rapidata/rapidata_client/datapoints/_datapoint_uploader.py +47 -0
- rapidata/rapidata_client/datapoints/_datapoints_validator.py +70 -0
- rapidata/rapidata_client/datapoints/assets/__init__.py +0 -10
- rapidata/rapidata_client/datapoints/assets/constants.py +7 -0
- rapidata/rapidata_client/datapoints/metadata/__init__.py +0 -2
- rapidata/rapidata_client/datapoints/metadata/_private_text_metadata.py +5 -6
- rapidata/rapidata_client/datapoints/metadata/_prompt_identifier_metadata.py +4 -5
- rapidata/rapidata_client/datapoints/metadata/_public_text_metadata.py +5 -6
- rapidata/rapidata_client/datapoints/metadata/_select_words_metadata.py +3 -4
- rapidata/rapidata_client/dataset/__init__.py +1 -0
- rapidata/rapidata_client/dataset/_rapidata_dataset.py +55 -0
- rapidata/rapidata_client/demographic/demographic_manager.py +44 -19
- rapidata/rapidata_client/exceptions/failed_upload_exception.py +15 -41
- rapidata/rapidata_client/filter/_backend_filter_mapper.py +134 -0
- rapidata/rapidata_client/filter/_base_filter.py +13 -8
- rapidata/rapidata_client/filter/age_filter.py +26 -10
- rapidata/rapidata_client/filter/and_filter.py +36 -11
- rapidata/rapidata_client/filter/campaign_filter.py +21 -10
- rapidata/rapidata_client/filter/country_filter.py +46 -12
- rapidata/rapidata_client/filter/custom_filter.py +25 -12
- rapidata/rapidata_client/filter/gender_filter.py +25 -10
- rapidata/rapidata_client/filter/language_filter.py +51 -21
- rapidata/rapidata_client/filter/models/age_group.py +14 -12
- rapidata/rapidata_client/filter/models/gender.py +12 -8
- rapidata/rapidata_client/filter/new_user_filter.py +14 -4
- rapidata/rapidata_client/filter/not_filter.py +35 -11
- rapidata/rapidata_client/filter/or_filter.py +36 -11
- rapidata/rapidata_client/filter/rapidata_filters.py +17 -23
- rapidata/rapidata_client/filter/response_count_filter.py +51 -20
- rapidata/rapidata_client/filter/user_score_filter.py +62 -24
- rapidata/rapidata_client/job/__init__.py +3 -0
- rapidata/rapidata_client/job/job_definition.py +110 -0
- rapidata/rapidata_client/job/job_manager.py +758 -0
- rapidata/rapidata_client/job/rapidata_job.py +326 -0
- rapidata/rapidata_client/order/__init__.py +2 -0
- rapidata/rapidata_client/order/_rapidata_order_builder.py +273 -122
- rapidata/rapidata_client/order/rapidata_order.py +316 -160
- rapidata/rapidata_client/order/rapidata_order_manager.py +680 -421
- rapidata/rapidata_client/rapidata_client.py +115 -37
- rapidata/rapidata_client/referee/__init__.py +1 -1
- rapidata/rapidata_client/referee/_base_referee.py +14 -3
- rapidata/rapidata_client/referee/_early_stopping_referee.py +32 -17
- rapidata/rapidata_client/referee/_naive_referee.py +24 -3
- rapidata/rapidata_client/results/__init__.py +3 -0
- rapidata/rapidata_client/{order → results}/rapidata_results.py +86 -63
- rapidata/rapidata_client/selection/__init__.py +1 -1
- rapidata/rapidata_client/selection/_base_selection.py +9 -2
- rapidata/rapidata_client/selection/ab_test_selection.py +28 -20
- rapidata/rapidata_client/selection/capped_selection.py +23 -16
- rapidata/rapidata_client/selection/conditional_validation_selection.py +43 -24
- rapidata/rapidata_client/selection/demographic_selection.py +21 -6
- rapidata/rapidata_client/selection/effort_selection.py +31 -8
- rapidata/rapidata_client/selection/labeling_selection.py +34 -11
- rapidata/rapidata_client/selection/{retrieval_modes.py → rapidata_retrieval_modes.py} +7 -4
- rapidata/rapidata_client/selection/rapidata_selections.py +23 -14
- rapidata/rapidata_client/selection/shuffling_selection.py +21 -13
- rapidata/rapidata_client/selection/static_selection.py +19 -8
- rapidata/rapidata_client/selection/validation_selection.py +20 -4
- rapidata/rapidata_client/settings/__init__.py +2 -0
- rapidata/rapidata_client/settings/_rapidata_setting.py +22 -3
- rapidata/rapidata_client/settings/alert_on_fast_response.py +8 -5
- rapidata/rapidata_client/settings/allow_neither_both.py +3 -0
- rapidata/rapidata_client/settings/custom_setting.py +3 -2
- rapidata/rapidata_client/settings/free_text_minimum_characters.py +9 -4
- rapidata/rapidata_client/settings/models/translation_behaviour_options.py +3 -2
- rapidata/rapidata_client/settings/mute_video.py +15 -0
- rapidata/rapidata_client/settings/no_shuffle.py +4 -2
- rapidata/rapidata_client/settings/play_video_until_the_end.py +7 -4
- rapidata/rapidata_client/settings/rapidata_settings.py +22 -9
- rapidata/rapidata_client/settings/swap_context_instruction.py +20 -0
- rapidata/rapidata_client/settings/translation_behaviour.py +7 -5
- rapidata/rapidata_client/utils/__init__.py +3 -0
- rapidata/rapidata_client/utils/threaded_uploader.py +153 -0
- rapidata/rapidata_client/validation/__init__.py +2 -0
- rapidata/rapidata_client/validation/rapidata_validation_set.py +96 -18
- rapidata/rapidata_client/validation/rapids/__init__.py +2 -0
- rapidata/rapidata_client/validation/rapids/_validation_rapid_uploader.py +48 -0
- rapidata/rapidata_client/validation/rapids/box.py +37 -12
- rapidata/rapidata_client/validation/rapids/rapids.py +29 -83
- rapidata/rapidata_client/validation/rapids/rapids_manager.py +369 -211
- rapidata/rapidata_client/validation/validation_set_manager.py +505 -276
- rapidata/rapidata_client/workflow/__init__.py +2 -2
- rapidata/rapidata_client/workflow/_base_workflow.py +25 -7
- rapidata/rapidata_client/workflow/_classify_workflow.py +58 -15
- rapidata/rapidata_client/workflow/_compare_workflow.py +44 -9
- rapidata/rapidata_client/workflow/_draw_workflow.py +40 -10
- rapidata/rapidata_client/workflow/_evaluation_workflow.py +28 -7
- rapidata/rapidata_client/workflow/_free_text_workflow.py +46 -9
- rapidata/rapidata_client/workflow/_locate_workflow.py +40 -10
- rapidata/rapidata_client/workflow/_multi_ranking_workflow.py +90 -0
- rapidata/rapidata_client/workflow/_select_words_workflow.py +51 -11
- rapidata/rapidata_client/workflow/_timestamp_workflow.py +42 -11
- rapidata/service/__init__.py +0 -1
- rapidata/service/credential_manager.py +14 -14
- rapidata/service/openapi_service.py +119 -34
- rapidata/types/__init__.py +149 -0
- rapidata-3.0.0a8.dist-info/METADATA +32 -0
- rapidata-3.0.0a8.dist-info/RECORD +1083 -0
- {rapidata-2.35.1.dist-info → rapidata-3.0.0a8.dist-info}/WHEEL +1 -1
- rapidata/rapidata_client/api/rapidata_exception.py +0 -107
- rapidata/rapidata_client/country_codes/__init__.py +0 -1
- rapidata/rapidata_client/country_codes/country_codes.py +0 -19
- rapidata/rapidata_client/datapoints/assets/_base_asset.py +0 -11
- rapidata/rapidata_client/datapoints/assets/_media_asset.py +0 -306
- rapidata/rapidata_client/datapoints/assets/_multi_asset.py +0 -61
- rapidata/rapidata_client/datapoints/assets/_sessions.py +0 -35
- rapidata/rapidata_client/datapoints/assets/_text_asset.py +0 -34
- rapidata/rapidata_client/datapoints/assets/data_type_enum.py +0 -8
- rapidata/rapidata_client/datapoints/datapoint.py +0 -108
- rapidata/rapidata_client/datapoints/metadata/_media_asset_metadata.py +0 -22
- rapidata/rapidata_client/datapoints/metadata/_prompt_metadata.py +0 -18
- rapidata/rapidata_client/logging/__init__.py +0 -2
- rapidata/rapidata_client/logging/logger.py +0 -122
- rapidata/rapidata_client/logging/output_manager.py +0 -20
- rapidata/rapidata_client/order/_rapidata_dataset.py +0 -396
- rapidata/rapidata_client/workflow/_ranking_workflow.py +0 -47
- rapidata/service/local_file_service.py +0 -25
- rapidata-2.35.1.dist-info/METADATA +0 -35
- rapidata-2.35.1.dist-info/RECORD +0 -657
- {rapidata-2.35.1.dist-info → rapidata-3.0.0a8.dist-info/licenses}/LICENSE +0 -0
|
@@ -1,32 +1,48 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from typing import Any
|
|
1
3
|
import requests
|
|
2
4
|
from packaging import version
|
|
3
5
|
from rapidata import __version__
|
|
4
|
-
|
|
6
|
+
import uuid
|
|
7
|
+
import random
|
|
5
8
|
from rapidata.service.openapi_service import OpenAPIService
|
|
6
9
|
|
|
10
|
+
from rapidata.rapidata_client.benchmark.rapidata_benchmark_manager import (
|
|
11
|
+
RapidataBenchmarkManager,
|
|
12
|
+
)
|
|
13
|
+
from rapidata.rapidata_client.audience.rapidata_audience_manager import (
|
|
14
|
+
RapidataAudienceManager,
|
|
15
|
+
)
|
|
7
16
|
from rapidata.rapidata_client.order.rapidata_order_manager import RapidataOrderManager
|
|
8
|
-
from rapidata.rapidata_client.benchmark.rapidata_benchmark_manager import RapidataBenchmarkManager
|
|
9
|
-
|
|
10
17
|
from rapidata.rapidata_client.validation.validation_set_manager import (
|
|
11
18
|
ValidationSetManager,
|
|
12
19
|
)
|
|
13
20
|
|
|
14
21
|
from rapidata.rapidata_client.demographic.demographic_manager import DemographicManager
|
|
15
22
|
|
|
16
|
-
from rapidata.rapidata_client.
|
|
23
|
+
from rapidata.rapidata_client.config import (
|
|
24
|
+
logger,
|
|
25
|
+
tracer,
|
|
26
|
+
managed_print,
|
|
27
|
+
rapidata_config,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
from rapidata.rapidata_client.datapoints._asset_uploader import AssetUploader
|
|
31
|
+
from rapidata.rapidata_client.job.job_manager import JobManager
|
|
32
|
+
|
|
17
33
|
|
|
18
34
|
class RapidataClient:
|
|
19
35
|
"""The Rapidata client is the main entry point for interacting with the Rapidata API. It allows you to create orders and validation sets."""
|
|
20
36
|
|
|
21
37
|
def __init__(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
38
|
+
self,
|
|
39
|
+
client_id: str | None = None,
|
|
40
|
+
client_secret: str | None = None,
|
|
41
|
+
environment: str = "rapidata.ai",
|
|
42
|
+
oauth_scope: str = "openid roles",
|
|
43
|
+
cert_path: str | None = None,
|
|
44
|
+
token: dict | None = None,
|
|
45
|
+
leeway: int = 60,
|
|
30
46
|
):
|
|
31
47
|
"""Initialize the RapidataClient. If both the client_id and client_secret are None, it will try using your credentials under "~/.config/rapidata/credentials.json".
|
|
32
48
|
If this is not successful, it will open a browser window and ask you to log in, then save your new credentials in said json file.
|
|
@@ -43,48 +59,110 @@ class RapidataClient:
|
|
|
43
59
|
Attributes:
|
|
44
60
|
order (RapidataOrderManager): The RapidataOrderManager instance.
|
|
45
61
|
validation (ValidationSetManager): The ValidationSetManager instance.
|
|
62
|
+
audience (RapidataAudienceManager): The RapidataAudienceManager instance.
|
|
63
|
+
job (JobManager): The JobManager instance.
|
|
64
|
+
mri (RapidataBenchmarkManager): The RapidataBenchmarkManager instance.
|
|
46
65
|
"""
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
logger.debug("Initializing OpenAPIService")
|
|
51
|
-
self._openapi_service = OpenAPIService(
|
|
52
|
-
client_id=client_id,
|
|
53
|
-
client_secret=client_secret,
|
|
54
|
-
environment=environment,
|
|
55
|
-
oauth_scope=oauth_scope,
|
|
56
|
-
cert_path=cert_path,
|
|
57
|
-
token=token,
|
|
58
|
-
leeway=leeway,
|
|
66
|
+
tracer.set_session_id(
|
|
67
|
+
uuid.UUID(int=random.Random().getrandbits(128), version=4).hex
|
|
59
68
|
)
|
|
60
69
|
|
|
61
|
-
|
|
62
|
-
|
|
70
|
+
with tracer.start_as_current_span("RapidataClient.__init__"):
|
|
71
|
+
logger.debug("Checking version")
|
|
72
|
+
self._check_version()
|
|
73
|
+
if environment != "rapidata.ai":
|
|
74
|
+
rapidata_config.logging.enable_otlp = False
|
|
75
|
+
|
|
76
|
+
logger.debug("Initializing OpenAPIService")
|
|
77
|
+
self._openapi_service = OpenAPIService(
|
|
78
|
+
client_id=client_id,
|
|
79
|
+
client_secret=client_secret,
|
|
80
|
+
environment=environment,
|
|
81
|
+
oauth_scope=oauth_scope,
|
|
82
|
+
cert_path=cert_path,
|
|
83
|
+
token=token,
|
|
84
|
+
leeway=leeway,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
self._asset_uploader = AssetUploader(openapi_service=self._openapi_service)
|
|
88
|
+
|
|
89
|
+
logger.debug("Initializing RapidataOrderManager")
|
|
90
|
+
self.order = RapidataOrderManager(openapi_service=self._openapi_service)
|
|
91
|
+
|
|
92
|
+
logger.debug("Initializing ValidationSetManager")
|
|
93
|
+
self.validation = ValidationSetManager(openapi_service=self._openapi_service)
|
|
63
94
|
|
|
64
|
-
|
|
65
|
-
|
|
95
|
+
logger.debug("Initializing JobManager")
|
|
96
|
+
self.job = JobManager(openapi_service=self._openapi_service)
|
|
66
97
|
|
|
67
|
-
|
|
68
|
-
|
|
98
|
+
logger.debug("Initializing RapidataBenchmarkManager")
|
|
99
|
+
self.mri = RapidataBenchmarkManager(openapi_service=self._openapi_service)
|
|
100
|
+
|
|
101
|
+
logger.debug("Initializing RapidataAudienceManager")
|
|
102
|
+
self.audience = RapidataAudienceManager(
|
|
103
|
+
openapi_service=self._openapi_service
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
logger.debug("Initializing RapidataDemographicManager")
|
|
107
|
+
self._demographic = DemographicManager(
|
|
108
|
+
openapi_service=self._openapi_service
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
self._check_beta_features() # can't be in the trace for some reason
|
|
69
112
|
|
|
70
|
-
logger.debug("Initializing RapidataBenchmarkManager")
|
|
71
|
-
self.mri = RapidataBenchmarkManager(openapi_service=self._openapi_service)
|
|
72
|
-
|
|
73
113
|
def reset_credentials(self):
|
|
74
114
|
"""Reset the credentials saved in the configuration file for the current environment."""
|
|
115
|
+
logger.info("Resetting credentials")
|
|
75
116
|
self._openapi_service.reset_credentials()
|
|
117
|
+
logger.info("Credentials reset")
|
|
118
|
+
|
|
119
|
+
def clear_all_caches(self):
|
|
120
|
+
"""Clear all caches for the client."""
|
|
121
|
+
self._asset_uploader.clear_cache()
|
|
122
|
+
logger.info("All caches cleared")
|
|
123
|
+
|
|
124
|
+
def _check_beta_features(self):
|
|
125
|
+
"""Enable beta features for the client."""
|
|
126
|
+
with tracer.start_as_current_span("RapidataClient.check_beta_features"):
|
|
127
|
+
result: dict[str, Any] = json.loads(
|
|
128
|
+
self._openapi_service.api_client.call_api(
|
|
129
|
+
"GET",
|
|
130
|
+
f"https://auth.{self._openapi_service.environment}/connect/userinfo",
|
|
131
|
+
)
|
|
132
|
+
.read()
|
|
133
|
+
.decode("utf-8")
|
|
134
|
+
)
|
|
135
|
+
logger.debug("Userinfo: %s", result)
|
|
136
|
+
if "Admin" not in result.get("role", []):
|
|
137
|
+
logger.debug("User is not an admin, not enabling beta features")
|
|
138
|
+
return
|
|
139
|
+
|
|
140
|
+
logger.debug("User is an admin, enabling beta features")
|
|
141
|
+
rapidata_config.enableBetaFeatures = True
|
|
76
142
|
|
|
77
143
|
def _check_version(self):
|
|
78
144
|
try:
|
|
79
145
|
response = requests.get(
|
|
80
146
|
"https://api.github.com/repos/RapidataAI/rapidata-python-sdk/releases/latest",
|
|
81
147
|
headers={"Accept": "application/vnd.github.v3+json"},
|
|
82
|
-
timeout=3
|
|
148
|
+
timeout=3,
|
|
83
149
|
)
|
|
84
150
|
if response.status_code == 200:
|
|
85
151
|
latest_version = response.json()["tag_name"].lstrip("v")
|
|
86
152
|
if version.parse(latest_version) > version.parse(__version__):
|
|
87
|
-
managed_print(
|
|
88
|
-
|
|
153
|
+
managed_print(
|
|
154
|
+
f"""A new version of the Rapidata SDK is available: {latest_version}
|
|
155
|
+
Your current version is: {__version__}"""
|
|
156
|
+
)
|
|
157
|
+
else:
|
|
158
|
+
logger.debug(
|
|
159
|
+
"Current version is up to date. Version: %s", __version__
|
|
160
|
+
)
|
|
89
161
|
except Exception as e:
|
|
90
|
-
logger.debug(
|
|
162
|
+
logger.debug("Failed to check for updates: %s", e)
|
|
163
|
+
|
|
164
|
+
def __str__(self) -> str:
|
|
165
|
+
return f"RapidataClient(environment={self._openapi_service.environment})"
|
|
166
|
+
|
|
167
|
+
def __repr__(self) -> str:
|
|
168
|
+
return self.__str__()
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
from abc import ABC, abstractmethod
|
|
2
|
-
from typing import
|
|
2
|
+
from typing import Mapping
|
|
3
|
+
import json
|
|
4
|
+
|
|
5
|
+
from rapidata.api_client.models.i_referee_model import IRefereeModel
|
|
6
|
+
|
|
3
7
|
|
|
4
8
|
class Referee(ABC):
|
|
5
9
|
"""
|
|
6
|
-
The referee defines when a rapid is considered complete.
|
|
10
|
+
The referee defines when a rapid is considered complete.
|
|
7
11
|
"""
|
|
12
|
+
|
|
8
13
|
@abstractmethod
|
|
9
14
|
def _to_dict(self) -> Mapping[str, str | int | float]:
|
|
10
15
|
"""
|
|
@@ -13,8 +18,14 @@ class Referee(ABC):
|
|
|
13
18
|
pass
|
|
14
19
|
|
|
15
20
|
@abstractmethod
|
|
16
|
-
def _to_model(self) ->
|
|
21
|
+
def _to_model(self) -> IRefereeModel:
|
|
17
22
|
"""
|
|
18
23
|
Convert the referee to a referee configuration model.
|
|
19
24
|
"""
|
|
20
25
|
pass
|
|
26
|
+
|
|
27
|
+
def __str__(self) -> str:
|
|
28
|
+
return json.dumps(self._to_dict())
|
|
29
|
+
|
|
30
|
+
def __repr__(self) -> str:
|
|
31
|
+
return self.__str__()
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
from
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
2
3
|
from rapidata.rapidata_client.referee._base_referee import Referee
|
|
3
|
-
from
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from rapidata.api_client.models.i_referee_model import IRefereeModel
|
|
6
8
|
|
|
7
9
|
|
|
8
10
|
class EarlyStoppingReferee(Referee):
|
|
@@ -15,39 +17,52 @@ class EarlyStoppingReferee(Referee):
|
|
|
15
17
|
The threshold behaves logarithmically, meaning small increments (e.g., from 0.99
|
|
16
18
|
to 0.999) can significantly impact the stopping criteria.
|
|
17
19
|
|
|
18
|
-
This referee is supported for the classification and compare tasks (in compare,
|
|
20
|
+
This referee is supported for the classification and compare tasks (in compare,
|
|
19
21
|
the two options are treated as the categories).
|
|
20
22
|
|
|
21
23
|
Args:
|
|
22
24
|
threshold (float, optional): The confidence threshold for early stopping.
|
|
23
25
|
Defaults to 0.999.
|
|
24
|
-
|
|
26
|
+
max_responses (int, optional): The maximum number of votes allowed
|
|
25
27
|
before stopping. Defaults to 100.
|
|
26
28
|
|
|
27
29
|
Attributes:
|
|
28
30
|
threshold (float): The confidence threshold for early stopping.
|
|
29
|
-
|
|
31
|
+
max_responses (int): The maximum number of votes allowed before stopping.
|
|
30
32
|
"""
|
|
31
33
|
|
|
32
|
-
def __init__(self, threshold: float = 0.999,
|
|
34
|
+
def __init__(self, threshold: float = 0.999, max_responses: int = 100):
|
|
33
35
|
if threshold <= 0 or threshold >= 1:
|
|
34
36
|
raise ValueError("The threshold must be between 0 and 1.")
|
|
35
|
-
if
|
|
37
|
+
if max_responses < 1:
|
|
36
38
|
raise ValueError("The number of responses must be greater than 0.")
|
|
37
|
-
|
|
39
|
+
|
|
38
40
|
self.threshold = threshold
|
|
39
|
-
self.
|
|
41
|
+
self.max_responses = max_responses
|
|
40
42
|
|
|
41
43
|
def _to_dict(self):
|
|
42
44
|
return {
|
|
43
45
|
"_t": "ProbabilisticAttachCategoryRefereeConfig",
|
|
44
46
|
"threshold": self.threshold,
|
|
45
|
-
"maxVotes": self.
|
|
47
|
+
"maxVotes": self.max_responses,
|
|
46
48
|
}
|
|
47
49
|
|
|
48
|
-
def _to_model(self) ->
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
threshold=self.threshold,
|
|
52
|
-
maxVotes=self.max_vote_count,
|
|
50
|
+
def _to_model(self) -> IRefereeModel:
|
|
51
|
+
from rapidata.api_client.models.i_referee_model_early_stopping_referee_model import (
|
|
52
|
+
IRefereeModelEarlyStoppingRefereeModel,
|
|
53
53
|
)
|
|
54
|
+
from rapidata.api_client.models.i_referee_model import IRefereeModel
|
|
55
|
+
|
|
56
|
+
return IRefereeModel(
|
|
57
|
+
actual_instance=IRefereeModelEarlyStoppingRefereeModel(
|
|
58
|
+
_t="EarlyStoppingReferee",
|
|
59
|
+
threshold=self.threshold,
|
|
60
|
+
maxVotes=self.max_responses,
|
|
61
|
+
)
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
def __str__(self) -> str:
|
|
65
|
+
return f"EarlyStoppingReferee(threshold={self.threshold}, max_responses={self.max_responses})"
|
|
66
|
+
|
|
67
|
+
def __repr__(self) -> str:
|
|
68
|
+
return self.__str__()
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
from
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
2
3
|
from rapidata.rapidata_client.referee._base_referee import Referee
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from rapidata.api_client.models.i_referee_model import IRefereeModel
|
|
3
8
|
|
|
4
9
|
|
|
5
10
|
class NaiveReferee(Referee):
|
|
@@ -29,5 +34,21 @@ class NaiveReferee(Referee):
|
|
|
29
34
|
"guessesRequired": self.responses,
|
|
30
35
|
}
|
|
31
36
|
|
|
32
|
-
def _to_model(self):
|
|
33
|
-
|
|
37
|
+
def _to_model(self) -> IRefereeModel:
|
|
38
|
+
from rapidata.api_client.models.i_referee_model_naive_referee_model import (
|
|
39
|
+
IRefereeModelNaiveRefereeModel,
|
|
40
|
+
)
|
|
41
|
+
from rapidata.api_client.models.i_referee_model import IRefereeModel
|
|
42
|
+
|
|
43
|
+
return IRefereeModel(
|
|
44
|
+
actual_instance=IRefereeModelNaiveRefereeModel(
|
|
45
|
+
_t="NaiveReferee",
|
|
46
|
+
totalVotes=self.responses,
|
|
47
|
+
)
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
def __str__(self) -> str:
|
|
51
|
+
return f"NaiveReferee(responses={self.responses})"
|
|
52
|
+
|
|
53
|
+
def __repr__(self) -> str:
|
|
54
|
+
return self.__str__()
|
|
@@ -1,57 +1,69 @@
|
|
|
1
|
-
import
|
|
2
|
-
from
|
|
3
|
-
from pandas.core.indexes.base import Index
|
|
1
|
+
from typing import TYPE_CHECKING, Any
|
|
2
|
+
from rapidata.rapidata_client.config import managed_print
|
|
4
3
|
import json
|
|
5
|
-
|
|
4
|
+
|
|
5
|
+
if TYPE_CHECKING:
|
|
6
|
+
import pandas as pd
|
|
7
|
+
from pandas.core.indexes.base import Index
|
|
8
|
+
|
|
6
9
|
|
|
7
10
|
class RapidataResults(dict):
|
|
8
11
|
"""
|
|
9
12
|
A specialized dictionary class for handling Rapidata API results.
|
|
10
13
|
Extends the built-in dict class with specialized methods.
|
|
11
14
|
"""
|
|
12
|
-
|
|
15
|
+
|
|
16
|
+
def to_pandas(self, split_details: bool = False) -> "pd.DataFrame":
|
|
13
17
|
"""
|
|
14
18
|
Warning:
|
|
15
19
|
This method is currently under development. The structure of the results may change in the future.
|
|
16
20
|
|
|
17
21
|
Converts the results to a pandas DataFrame.
|
|
18
|
-
|
|
22
|
+
|
|
19
23
|
For Compare results, creates standardized A/B columns for metrics.
|
|
20
24
|
For regular results, flattens nested dictionaries into columns with underscore-separated names.
|
|
21
|
-
|
|
25
|
+
|
|
22
26
|
Args:
|
|
23
27
|
split_details: If True, splits each datapoint by its detailed results,
|
|
24
28
|
creating a row for each response with global metrics copied.
|
|
25
|
-
|
|
29
|
+
|
|
26
30
|
Returns:
|
|
27
31
|
pd.DataFrame: A DataFrame containing the processed results
|
|
28
|
-
|
|
32
|
+
|
|
29
33
|
Raises:
|
|
30
34
|
ValueError: If split_details is True but no detailed results are found
|
|
31
35
|
"""
|
|
36
|
+
import pandas as pd
|
|
37
|
+
from pandas.core.indexes.base import Index
|
|
38
|
+
|
|
32
39
|
if "results" not in self or not self["results"]:
|
|
33
40
|
return pd.DataFrame()
|
|
34
|
-
|
|
41
|
+
|
|
35
42
|
if self["info"].get("orderType") is None:
|
|
36
|
-
managed_print(
|
|
37
|
-
|
|
43
|
+
managed_print(
|
|
44
|
+
"Warning: Results are old and Order type is not specified. Dataframe might be wrong."
|
|
45
|
+
)
|
|
46
|
+
|
|
38
47
|
# Check for detailed results if split_details is True
|
|
39
48
|
if split_details:
|
|
40
49
|
if not self._has_detailed_results():
|
|
41
50
|
raise ValueError("No detailed results found in the data")
|
|
42
51
|
return self._to_pandas_with_detailed_results()
|
|
43
|
-
|
|
44
|
-
if
|
|
52
|
+
|
|
53
|
+
if (
|
|
54
|
+
self["info"].get("orderType") == "Compare"
|
|
55
|
+
or self["info"].get("orderType") == "Ranking"
|
|
56
|
+
):
|
|
45
57
|
return self._compare_to_pandas()
|
|
46
|
-
|
|
58
|
+
|
|
47
59
|
# Get the structure from first item
|
|
48
60
|
first_item = self["results"][0]
|
|
49
61
|
columns = []
|
|
50
62
|
path_map = {} # Maps flattened column names to paths to reach the values
|
|
51
|
-
|
|
63
|
+
|
|
52
64
|
# Build the column structure once
|
|
53
65
|
self._build_column_structure(first_item, columns, path_map)
|
|
54
|
-
|
|
66
|
+
|
|
55
67
|
# Extract data using the known structure
|
|
56
68
|
data = []
|
|
57
69
|
for item in self["results"]:
|
|
@@ -60,82 +72,86 @@ class RapidataResults(dict):
|
|
|
60
72
|
value = self._get_value_from_path(item, path)
|
|
61
73
|
row.append(value)
|
|
62
74
|
data.append(row)
|
|
63
|
-
|
|
75
|
+
|
|
64
76
|
return pd.DataFrame(data, columns=Index(columns))
|
|
65
|
-
|
|
77
|
+
|
|
66
78
|
def _has_detailed_results(self) -> bool:
|
|
67
79
|
"""
|
|
68
80
|
Checks if the results contain detailed results.
|
|
69
|
-
|
|
81
|
+
|
|
70
82
|
Returns:
|
|
71
83
|
bool: True if detailed results exist, False otherwise
|
|
72
84
|
"""
|
|
73
85
|
if not self.get("results"):
|
|
74
86
|
return False
|
|
75
|
-
|
|
87
|
+
|
|
76
88
|
first_result = self["results"][0]
|
|
77
|
-
return "detailedResults" in first_result and isinstance(
|
|
78
|
-
|
|
79
|
-
|
|
89
|
+
return "detailedResults" in first_result and isinstance(
|
|
90
|
+
first_result["detailedResults"], list
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
def _to_pandas_with_detailed_results(self) -> "pd.DataFrame":
|
|
80
94
|
"""
|
|
81
95
|
Converts results to a pandas DataFrame with detailed results split into separate rows.
|
|
82
|
-
|
|
96
|
+
|
|
83
97
|
Returns:
|
|
84
98
|
pd.DataFrame: A DataFrame with one row per detailed result
|
|
85
99
|
"""
|
|
100
|
+
import pandas as pd
|
|
101
|
+
|
|
86
102
|
rows = []
|
|
87
|
-
|
|
103
|
+
|
|
88
104
|
for result in self["results"]:
|
|
89
105
|
# Get all non-detailed results fields
|
|
90
106
|
base_data = {k: v for k, v in result.items() if k != "detailedResults"}
|
|
91
|
-
|
|
107
|
+
|
|
92
108
|
# Process each detailed result
|
|
93
109
|
for detailed_result in result["detailedResults"]:
|
|
94
110
|
row = base_data.copy() # Copy base data for each detailed result
|
|
95
|
-
|
|
111
|
+
|
|
96
112
|
# Add flattened detailed result data
|
|
97
113
|
flattened = self._flatten_dict(detailed_result)
|
|
98
114
|
for key, value in flattened.items():
|
|
99
115
|
row[key] = value
|
|
100
|
-
|
|
116
|
+
|
|
101
117
|
rows.append(row)
|
|
102
|
-
|
|
118
|
+
|
|
103
119
|
return pd.DataFrame(rows)
|
|
104
|
-
|
|
105
|
-
def _flatten_dict(self, d: dict[str, Any], parent_key: str =
|
|
120
|
+
|
|
121
|
+
def _flatten_dict(self, d: dict[str, Any], parent_key: str = "") -> dict[str, Any]:
|
|
106
122
|
"""
|
|
107
123
|
Flattens a nested dictionary into a single-level dictionary with underscore-separated keys.
|
|
108
|
-
|
|
124
|
+
|
|
109
125
|
Args:
|
|
110
126
|
d: The dictionary to flatten
|
|
111
127
|
parent_key: The parent key for nested dictionaries
|
|
112
|
-
|
|
128
|
+
|
|
113
129
|
Returns:
|
|
114
130
|
dict: A flattened dictionary
|
|
115
131
|
"""
|
|
116
132
|
items: list[tuple[str, Any]] = []
|
|
117
|
-
|
|
133
|
+
|
|
118
134
|
for key, value in d.items():
|
|
119
135
|
new_key = f"{parent_key}_{key}" if parent_key else key
|
|
120
|
-
|
|
136
|
+
|
|
121
137
|
if isinstance(value, dict):
|
|
122
138
|
items.extend(self._flatten_dict(value, new_key).items())
|
|
123
139
|
else:
|
|
124
140
|
items.append((new_key, value))
|
|
125
|
-
|
|
141
|
+
|
|
126
142
|
return dict(items)
|
|
127
143
|
|
|
128
144
|
def _build_column_structure(
|
|
129
|
-
self,
|
|
130
|
-
d: dict[str, Any],
|
|
131
|
-
columns: list[str],
|
|
132
|
-
path_map: dict[str, list[str]],
|
|
133
|
-
parent_key: str =
|
|
134
|
-
current_path: list[str] | None = None
|
|
145
|
+
self,
|
|
146
|
+
d: dict[str, Any],
|
|
147
|
+
columns: list[str],
|
|
148
|
+
path_map: dict[str, list[str]],
|
|
149
|
+
parent_key: str = "",
|
|
150
|
+
current_path: list[str] | None = None,
|
|
135
151
|
) -> None:
|
|
136
152
|
"""
|
|
137
153
|
Builds the column structure and paths to reach values in nested dictionaries.
|
|
138
|
-
|
|
154
|
+
|
|
139
155
|
Args:
|
|
140
156
|
d: The dictionary to analyze
|
|
141
157
|
columns: List to store column names
|
|
@@ -145,25 +161,27 @@ class RapidataResults(dict):
|
|
|
145
161
|
"""
|
|
146
162
|
if current_path is None:
|
|
147
163
|
current_path = []
|
|
148
|
-
|
|
164
|
+
|
|
149
165
|
for key, value in d.items():
|
|
150
166
|
new_key = f"{parent_key}_{key}" if parent_key else key
|
|
151
167
|
new_path: list[str] = current_path + [key]
|
|
152
|
-
|
|
168
|
+
|
|
153
169
|
if isinstance(value, dict):
|
|
154
|
-
self._build_column_structure(
|
|
170
|
+
self._build_column_structure(
|
|
171
|
+
value, columns, path_map, new_key, new_path
|
|
172
|
+
)
|
|
155
173
|
else:
|
|
156
174
|
columns.append(new_key)
|
|
157
175
|
path_map[new_key] = new_path
|
|
158
|
-
|
|
176
|
+
|
|
159
177
|
def _get_value_from_path(self, d: dict[str, Any], path: list[str]) -> Any:
|
|
160
178
|
"""
|
|
161
179
|
Retrieves a value from a nested dictionary using a path list.
|
|
162
|
-
|
|
180
|
+
|
|
163
181
|
Args:
|
|
164
182
|
d: The dictionary to retrieve the value from
|
|
165
183
|
path: List of keys forming the path to the desired value
|
|
166
|
-
|
|
184
|
+
|
|
167
185
|
Returns:
|
|
168
186
|
The value at the specified path, or None if the path doesn't exist
|
|
169
187
|
"""
|
|
@@ -171,10 +189,12 @@ class RapidataResults(dict):
|
|
|
171
189
|
d = d.get(key, {})
|
|
172
190
|
return d.get(path[-1])
|
|
173
191
|
|
|
174
|
-
def _compare_to_pandas(self) -> pd.DataFrame:
|
|
192
|
+
def _compare_to_pandas(self) -> "pd.DataFrame":
|
|
175
193
|
"""
|
|
176
194
|
Converts Compare results to a pandas DataFrame dynamically.
|
|
177
195
|
"""
|
|
196
|
+
import pandas as pd
|
|
197
|
+
|
|
178
198
|
if not self.get("results"):
|
|
179
199
|
return pd.DataFrame()
|
|
180
200
|
|
|
@@ -190,10 +210,11 @@ class RapidataResults(dict):
|
|
|
190
210
|
continue
|
|
191
211
|
|
|
192
212
|
assets = [asset for asset in assets if asset not in ["Both", "Neither"]]
|
|
193
|
-
|
|
213
|
+
|
|
194
214
|
# Initialize row with non-comparative fields
|
|
195
215
|
row = {
|
|
196
|
-
key: value
|
|
216
|
+
key: value
|
|
217
|
+
for key, value in result.items()
|
|
197
218
|
if not isinstance(value, dict)
|
|
198
219
|
}
|
|
199
220
|
row["assetA"] = assets[0]
|
|
@@ -203,26 +224,28 @@ class RapidataResults(dict):
|
|
|
203
224
|
for key, values in result.items():
|
|
204
225
|
if isinstance(values, dict) and len(values) >= 2:
|
|
205
226
|
# Add main asset columns
|
|
206
|
-
for i, asset in enumerate(
|
|
227
|
+
for i, asset in enumerate(
|
|
228
|
+
assets[:2]
|
|
229
|
+
): # Limit to first 2 main assets
|
|
207
230
|
column_prefix = "A_" if i == 0 else "B_"
|
|
208
|
-
row[f
|
|
209
|
-
|
|
231
|
+
row[f"{column_prefix}{key}"] = values.get(asset, 0)
|
|
232
|
+
|
|
210
233
|
# Add special option columns if they exist
|
|
211
234
|
if "Both" in values:
|
|
212
|
-
row[f
|
|
235
|
+
row[f"Both_{key}"] = values.get("Both", 0)
|
|
213
236
|
if "Neither" in values:
|
|
214
|
-
row[f
|
|
215
|
-
|
|
237
|
+
row[f"Neither_{key}"] = values.get("Neither", 0)
|
|
238
|
+
|
|
216
239
|
rows.append(row)
|
|
217
|
-
|
|
240
|
+
|
|
218
241
|
return pd.DataFrame(rows)
|
|
219
242
|
|
|
220
|
-
def to_json(self, path: str="./results.json") -> None:
|
|
243
|
+
def to_json(self, path: str = "./results.json") -> None:
|
|
221
244
|
"""
|
|
222
245
|
Saves the results to a JSON file.
|
|
223
|
-
|
|
246
|
+
|
|
224
247
|
Args:
|
|
225
248
|
path: The file path where the JSON should be saved. Defaults to "./results.json".
|
|
226
249
|
"""
|
|
227
|
-
with open(path,
|
|
250
|
+
with open(path, "w") as f:
|
|
228
251
|
json.dump(self, f)
|
|
@@ -7,5 +7,5 @@ from .capped_selection import CappedSelection
|
|
|
7
7
|
from .shuffling_selection import ShufflingSelection
|
|
8
8
|
from .ab_test_selection import AbTestSelection
|
|
9
9
|
from .static_selection import StaticSelection
|
|
10
|
-
from .
|
|
10
|
+
from .rapidata_retrieval_modes import RapidataRetrievalMode
|
|
11
11
|
from .effort_selection import EffortSelection
|