rapidata 2.40.7__py3-none-any.whl → 2.41.1__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 +2 -1
- rapidata/api_client/__init__.py +5 -3
- rapidata/api_client/api/benchmark_api.py +610 -7
- rapidata/api_client/api/campaign_api.py +283 -0
- rapidata/api_client/api/evaluation_workflow_api.py +18 -72
- rapidata/api_client/api/identity_api.py +0 -278
- rapidata/api_client/api/leaderboard_api.py +9 -9
- rapidata/api_client/api/validation_set_api.py +5 -15
- rapidata/api_client/models/__init__.py +5 -3
- rapidata/api_client/models/benchmark_query_result.py +3 -1
- rapidata/api_client/models/create_benchmark_participant_result.py +2 -2
- rapidata/api_client/models/create_benchmark_prompt_result.py +87 -0
- rapidata/api_client/models/get_benchmark_by_id_result.py +4 -2
- rapidata/api_client/models/get_evaluation_workflow_results_model.py +114 -0
- rapidata/api_client/models/get_participant_by_id_result.py +2 -4
- rapidata/api_client/models/get_standing_by_id_result.py +2 -9
- rapidata/api_client/models/labeling_selection.py +9 -2
- rapidata/api_client/models/participant_by_benchmark.py +1 -3
- rapidata/api_client/models/standing_by_benchmark.py +113 -0
- rapidata/api_client/models/standing_by_leaderboard.py +1 -3
- rapidata/api_client/models/standings_by_benchmark_result.py +95 -0
- rapidata/api_client/models/sticky_state.py +1 -0
- rapidata/api_client/models/update_benchmark_model.py +5 -3
- rapidata/api_client/models/update_priority_model.py +87 -0
- rapidata/api_client/models/validation_set_model.py +32 -2
- rapidata/api_client_README.md +9 -5
- rapidata/rapidata_client/__init__.py +1 -0
- rapidata/rapidata_client/benchmark/rapidata_benchmark.py +5 -18
- rapidata/rapidata_client/demographic/demographic_manager.py +6 -0
- rapidata/rapidata_client/order/rapidata_order_manager.py +6 -0
- rapidata/rapidata_client/rapidata_client.py +6 -0
- rapidata/rapidata_client/selection/ab_test_selection.py +6 -0
- rapidata/rapidata_client/selection/capped_selection.py +6 -0
- rapidata/rapidata_client/selection/conditional_validation_selection.py +6 -0
- rapidata/rapidata_client/selection/demographic_selection.py +6 -0
- rapidata/rapidata_client/selection/effort_selection.py +6 -0
- rapidata/rapidata_client/selection/labeling_selection.py +6 -0
- rapidata/rapidata_client/selection/rapidata_selections.py +6 -0
- rapidata/rapidata_client/selection/shuffling_selection.py +6 -0
- rapidata/rapidata_client/selection/static_selection.py +6 -0
- rapidata/rapidata_client/selection/validation_selection.py +6 -0
- rapidata/rapidata_client/settings/__init__.py +1 -0
- rapidata/rapidata_client/settings/rapidata_settings.py +9 -0
- rapidata/rapidata_client/settings/swap_context_instruction.py +20 -0
- rapidata/rapidata_client/validation/rapids/rapids.py +13 -0
- rapidata/rapidata_client/validation/rapids/rapids_manager.py +6 -0
- rapidata/rapidata_client/validation/validation_set_manager.py +7 -1
- rapidata/service/openapi_service.py +1 -3
- {rapidata-2.40.7.dist-info → rapidata-2.41.1.dist-info}/METADATA +1 -1
- {rapidata-2.40.7.dist-info → rapidata-2.41.1.dist-info}/RECORD +52 -46
- {rapidata-2.40.7.dist-info → rapidata-2.41.1.dist-info}/LICENSE +0 -0
- {rapidata-2.40.7.dist-info → rapidata-2.41.1.dist-info}/WHEEL +0 -0
rapidata/api_client_README.md
CHANGED
|
@@ -74,18 +74,21 @@ Class | Method | HTTP request | Description
|
|
|
74
74
|
------------ | ------------- | ------------- | -------------
|
|
75
75
|
*BenchmarkApi* | [**benchmark_benchmark_id_delete**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_delete) | **DELETE** /benchmark/{benchmarkId} | Deletes a single benchmark.
|
|
76
76
|
*BenchmarkApi* | [**benchmark_benchmark_id_get**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_get) | **GET** /benchmark/{benchmarkId} | Returns a single benchmark by its ID.
|
|
77
|
+
*BenchmarkApi* | [**benchmark_benchmark_id_leaderboards_get**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_leaderboards_get) | **GET** /benchmark/{benchmarkId}/leaderboards | Queries all leaderboards for the current user's benchmarks.
|
|
77
78
|
*BenchmarkApi* | [**benchmark_benchmark_id_participants_get**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_participants_get) | **GET** /benchmark/{benchmarkId}/participants | Query all participants within a benchmark
|
|
78
79
|
*BenchmarkApi* | [**benchmark_benchmark_id_participants_post**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_participants_post) | **POST** /benchmark/{benchmarkId}/participants | Creates a participant in a benchmark.
|
|
79
80
|
*BenchmarkApi* | [**benchmark_benchmark_id_patch**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_patch) | **PATCH** /benchmark/{benchmarkId} | Updates a benchmark using patch semantics.
|
|
80
81
|
*BenchmarkApi* | [**benchmark_benchmark_id_prompt_post**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_prompt_post) | **POST** /benchmark/{benchmarkId}/prompt | Adds a new prompt to a benchmark.
|
|
81
82
|
*BenchmarkApi* | [**benchmark_benchmark_id_prompts_get**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_prompts_get) | **GET** /benchmark/{benchmarkId}/prompts | Returns the paged prompts of a benchmark by its ID.
|
|
82
83
|
*BenchmarkApi* | [**benchmark_benchmark_id_samples_identifier_get**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_samples_identifier_get) | **GET** /benchmark/{benchmarkId}/samples/{identifier} | Returns the paged prompts of a benchmark by its ID.
|
|
84
|
+
*BenchmarkApi* | [**benchmark_benchmark_id_standings_get**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_standings_get) | **GET** /benchmark/{benchmarkId}/standings | Queries all the standings for a benchmark by its ID.
|
|
83
85
|
*BenchmarkApi* | [**benchmark_benchmark_id_tags_get**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_tags_get) | **GET** /benchmark/{benchmarkId}/tags | Query all tags within a benchmark
|
|
84
86
|
*BenchmarkApi* | [**benchmark_post**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_post) | **POST** /benchmark | Creates a benchmark
|
|
85
87
|
*BenchmarkApi* | [**benchmarks_get**](rapidata/api_client/docs/BenchmarkApi.md#benchmarks_get) | **GET** /benchmarks | Queries all benchmarks of the user.
|
|
86
88
|
*CampaignApi* | [**campaign_boost_put**](rapidata/api_client/docs/CampaignApi.md#campaign_boost_put) | **PUT** /campaign/boost | Updates the boost with manual boosts.
|
|
87
89
|
*CampaignApi* | [**campaign_boost_status_get**](rapidata/api_client/docs/CampaignApi.md#campaign_boost_status_get) | **GET** /campaign/boost/status | Gets the status of the boost.
|
|
88
90
|
*CampaignApi* | [**campaign_campaign_id_pause_post**](rapidata/api_client/docs/CampaignApi.md#campaign_campaign_id_pause_post) | **POST** /campaign/{campaignId}/pause | Pauses a campaign.
|
|
91
|
+
*CampaignApi* | [**campaign_campaign_id_priority_put**](rapidata/api_client/docs/CampaignApi.md#campaign_campaign_id_priority_put) | **PUT** /campaign/{campaignId}/priority | Updates the priority of a campaign.
|
|
89
92
|
*CampaignApi* | [**campaign_campaign_id_resume_post**](rapidata/api_client/docs/CampaignApi.md#campaign_campaign_id_resume_post) | **POST** /campaign/{campaignId}/resume | Resumes a campaign.
|
|
90
93
|
*CampaignApi* | [**campaign_monitor_get**](rapidata/api_client/docs/CampaignApi.md#campaign_monitor_get) | **GET** /campaign/monitor | The monitor endpoint is used to monitor the health of the service
|
|
91
94
|
*CampaignApi* | [**campaigns_get**](rapidata/api_client/docs/CampaignApi.md#campaigns_get) | **GET** /campaigns | Queries orders based on a filter, page, and sort criteria.
|
|
@@ -124,7 +127,6 @@ Class | Method | HTTP request | Description
|
|
|
124
127
|
*IdentityApi* | [**identity_bridge_token_post**](rapidata/api_client/docs/IdentityApi.md#identity_bridge_token_post) | **POST** /identity/bridge-token | Creates a pair of read and write keys for a client. The write key is used to store the authentication result. The read key is used to retrieve the authentication result.
|
|
125
128
|
*IdentityApi* | [**identity_google_one_tap_post**](rapidata/api_client/docs/IdentityApi.md#identity_google_one_tap_post) | **POST** /identity/google-one-tap | Signs in a user using a token received from Google One Tap.
|
|
126
129
|
*IdentityApi* | [**identity_referrer_post**](rapidata/api_client/docs/IdentityApi.md#identity_referrer_post) | **POST** /identity/referrer | Sets the referrer for the current customer.
|
|
127
|
-
*IdentityApi* | [**identity_temporary_post**](rapidata/api_client/docs/IdentityApi.md#identity_temporary_post) | **POST** /identity/temporary | Registers and logs in a temporary customer.
|
|
128
130
|
*LeaderboardApi* | [**benchmark_standing_leaderboard_id_participant_id_get**](rapidata/api_client/docs/LeaderboardApi.md#benchmark_standing_leaderboard_id_participant_id_get) | **GET** /benchmark/standing/{leaderboardId}/{participantId} | Gets a standing by leaderboardId and participantId.
|
|
129
131
|
*LeaderboardApi* | [**leaderboard_leaderboard_id_boost_post**](rapidata/api_client/docs/LeaderboardApi.md#leaderboard_leaderboard_id_boost_post) | **POST** /leaderboard/{leaderboardId}/boost | Boosts a subset of participants within a leaderboard.
|
|
130
132
|
*LeaderboardApi* | [**leaderboard_leaderboard_id_delete**](rapidata/api_client/docs/LeaderboardApi.md#leaderboard_leaderboard_id_delete) | **DELETE** /leaderboard/{leaderboardId} | Deletes a leaderboard by its ID.
|
|
@@ -133,7 +135,7 @@ Class | Method | HTTP request | Description
|
|
|
133
135
|
*LeaderboardApi* | [**leaderboard_leaderboard_id_runs_get**](rapidata/api_client/docs/LeaderboardApi.md#leaderboard_leaderboard_id_runs_get) | **GET** /leaderboard/{leaderboardId}/runs | Gets the runs related to a leaderboard
|
|
134
136
|
*LeaderboardApi* | [**leaderboard_leaderboard_id_standings_get**](rapidata/api_client/docs/LeaderboardApi.md#leaderboard_leaderboard_id_standings_get) | **GET** /leaderboard/{leaderboardId}/standings | queries all the participants connected to leaderboard by its ID.
|
|
135
137
|
*LeaderboardApi* | [**leaderboard_post**](rapidata/api_client/docs/LeaderboardApi.md#leaderboard_post) | **POST** /leaderboard | Creates a new leaderboard with the specified name and criteria.
|
|
136
|
-
*LeaderboardApi* | [**leaderboards_get**](rapidata/api_client/docs/LeaderboardApi.md#leaderboards_get) | **GET** /leaderboards | Queries all leaderboards
|
|
138
|
+
*LeaderboardApi* | [**leaderboards_get**](rapidata/api_client/docs/LeaderboardApi.md#leaderboards_get) | **GET** /leaderboards | Queries all leaderboards for a specific benchmark.
|
|
137
139
|
*NewsletterApi* | [**newsletter_subscribe_post**](rapidata/api_client/docs/NewsletterApi.md#newsletter_subscribe_post) | **POST** /newsletter/subscribe | Signs a user up to the newsletter.
|
|
138
140
|
*NewsletterApi* | [**newsletter_unsubscribe_post**](rapidata/api_client/docs/NewsletterApi.md#newsletter_unsubscribe_post) | **POST** /newsletter/unsubscribe | Unsubscribes a user from the newsletter.
|
|
139
141
|
*OrderApi* | [**order_complex_post**](rapidata/api_client/docs/OrderApi.md#order_complex_post) | **POST** /order/complex | Creates a new order with a custom pipeline.
|
|
@@ -209,7 +211,6 @@ Class | Method | HTTP request | Description
|
|
|
209
211
|
- [AddValidationRapidModel](rapidata/api_client/docs/AddValidationRapidModel.md)
|
|
210
212
|
- [AddValidationRapidModelPayload](rapidata/api_client/docs/AddValidationRapidModelPayload.md)
|
|
211
213
|
- [AddValidationRapidModelTruth](rapidata/api_client/docs/AddValidationRapidModelTruth.md)
|
|
212
|
-
- [AddValidationRapidResult](rapidata/api_client/docs/AddValidationRapidResult.md)
|
|
213
214
|
- [AgeGroup](rapidata/api_client/docs/AgeGroup.md)
|
|
214
215
|
- [AgeUserFilterModel](rapidata/api_client/docs/AgeUserFilterModel.md)
|
|
215
216
|
- [AggregatorType](rapidata/api_client/docs/AggregatorType.md)
|
|
@@ -277,6 +278,7 @@ Class | Method | HTTP request | Description
|
|
|
277
278
|
- [CreateBenchmarkModel](rapidata/api_client/docs/CreateBenchmarkModel.md)
|
|
278
279
|
- [CreateBenchmarkParticipantModel](rapidata/api_client/docs/CreateBenchmarkParticipantModel.md)
|
|
279
280
|
- [CreateBenchmarkParticipantResult](rapidata/api_client/docs/CreateBenchmarkParticipantResult.md)
|
|
281
|
+
- [CreateBenchmarkPromptResult](rapidata/api_client/docs/CreateBenchmarkPromptResult.md)
|
|
280
282
|
- [CreateBenchmarkResult](rapidata/api_client/docs/CreateBenchmarkResult.md)
|
|
281
283
|
- [CreateBridgeTokenResult](rapidata/api_client/docs/CreateBridgeTokenResult.md)
|
|
282
284
|
- [CreateClientModel](rapidata/api_client/docs/CreateClientModel.md)
|
|
@@ -361,6 +363,7 @@ Class | Method | HTTP request | Description
|
|
|
361
363
|
- [GetDatapointByIdResult](rapidata/api_client/docs/GetDatapointByIdResult.md)
|
|
362
364
|
- [GetDatasetByIdResult](rapidata/api_client/docs/GetDatasetByIdResult.md)
|
|
363
365
|
- [GetDatasetProgressResult](rapidata/api_client/docs/GetDatasetProgressResult.md)
|
|
366
|
+
- [GetEvaluationWorkflowResultsModel](rapidata/api_client/docs/GetEvaluationWorkflowResultsModel.md)
|
|
364
367
|
- [GetFailedDatapointsResult](rapidata/api_client/docs/GetFailedDatapointsResult.md)
|
|
365
368
|
- [GetLeaderboardByIdResult](rapidata/api_client/docs/GetLeaderboardByIdResult.md)
|
|
366
369
|
- [GetOrderByIdResult](rapidata/api_client/docs/GetOrderByIdResult.md)
|
|
@@ -496,8 +499,6 @@ Class | Method | HTTP request | Description
|
|
|
496
499
|
- [RapidSkippedModel](rapidata/api_client/docs/RapidSkippedModel.md)
|
|
497
500
|
- [RapidState](rapidata/api_client/docs/RapidState.md)
|
|
498
501
|
- [ReadBridgeTokenKeysResult](rapidata/api_client/docs/ReadBridgeTokenKeysResult.md)
|
|
499
|
-
- [RegisterTemporaryCustomerModel](rapidata/api_client/docs/RegisterTemporaryCustomerModel.md)
|
|
500
|
-
- [RegisterTemporaryCustomerResult](rapidata/api_client/docs/RegisterTemporaryCustomerResult.md)
|
|
501
502
|
- [ReportModel](rapidata/api_client/docs/ReportModel.md)
|
|
502
503
|
- [ResponseCountFilter](rapidata/api_client/docs/ResponseCountFilter.md)
|
|
503
504
|
- [ResponseCountUserFilterModel](rapidata/api_client/docs/ResponseCountUserFilterModel.md)
|
|
@@ -530,9 +531,11 @@ Class | Method | HTTP request | Description
|
|
|
530
531
|
- [SortDirection](rapidata/api_client/docs/SortDirection.md)
|
|
531
532
|
- [SourceUrlMetadata](rapidata/api_client/docs/SourceUrlMetadata.md)
|
|
532
533
|
- [SourceUrlMetadataModel](rapidata/api_client/docs/SourceUrlMetadataModel.md)
|
|
534
|
+
- [StandingByBenchmark](rapidata/api_client/docs/StandingByBenchmark.md)
|
|
533
535
|
- [StandingByLeaderboard](rapidata/api_client/docs/StandingByLeaderboard.md)
|
|
534
536
|
- [StandingByLeaderboardPagedResult](rapidata/api_client/docs/StandingByLeaderboardPagedResult.md)
|
|
535
537
|
- [StandingStatus](rapidata/api_client/docs/StandingStatus.md)
|
|
538
|
+
- [StandingsByBenchmarkResult](rapidata/api_client/docs/StandingsByBenchmarkResult.md)
|
|
536
539
|
- [StandingsByLeaderboardResult](rapidata/api_client/docs/StandingsByLeaderboardResult.md)
|
|
537
540
|
- [StaticSelection](rapidata/api_client/docs/StaticSelection.md)
|
|
538
541
|
- [StickyState](rapidata/api_client/docs/StickyState.md)
|
|
@@ -572,6 +575,7 @@ Class | Method | HTTP request | Description
|
|
|
572
575
|
- [UpdateOrderNameModel](rapidata/api_client/docs/UpdateOrderNameModel.md)
|
|
573
576
|
- [UpdateParticipantModel](rapidata/api_client/docs/UpdateParticipantModel.md)
|
|
574
577
|
- [UpdateParticipantNameModel](rapidata/api_client/docs/UpdateParticipantNameModel.md)
|
|
578
|
+
- [UpdatePriorityModel](rapidata/api_client/docs/UpdatePriorityModel.md)
|
|
575
579
|
- [UpdatePromptTagsModel](rapidata/api_client/docs/UpdatePromptTagsModel.md)
|
|
576
580
|
- [UpdateShouldAlertModel](rapidata/api_client/docs/UpdateShouldAlertModel.md)
|
|
577
581
|
- [UpdateValidationRapidModel](rapidata/api_client/docs/UpdateValidationRapidModel.md)
|
|
@@ -11,12 +11,9 @@ from rapidata.api_client.models.create_benchmark_participant_model import (
|
|
|
11
11
|
CreateBenchmarkParticipantModel,
|
|
12
12
|
)
|
|
13
13
|
from rapidata.api_client.models.create_leaderboard_model import CreateLeaderboardModel
|
|
14
|
-
from rapidata.api_client.models.filter import Filter
|
|
15
|
-
from rapidata.api_client.models.filter_operator import FilterOperator
|
|
16
14
|
from rapidata.api_client.models.file_asset_model import FileAssetModel
|
|
17
15
|
from rapidata.api_client.models.query_model import QueryModel
|
|
18
16
|
from rapidata.api_client.models.page_info import PageInfo
|
|
19
|
-
from rapidata.api_client.models.root_filter import RootFilter
|
|
20
17
|
from rapidata.api_client.models.source_url_metadata_model import SourceUrlMetadataModel
|
|
21
18
|
from rapidata.api_client.models.submit_prompt_model import SubmitPromptModel
|
|
22
19
|
from rapidata.api_client.models.submit_prompt_model_prompt_asset import (
|
|
@@ -155,21 +152,11 @@ class RapidataBenchmark:
|
|
|
155
152
|
total_pages = None
|
|
156
153
|
|
|
157
154
|
while True:
|
|
158
|
-
leaderboards_result = (
|
|
159
|
-
self.
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
Filter(
|
|
164
|
-
field="BenchmarkId",
|
|
165
|
-
operator=FilterOperator.EQ,
|
|
166
|
-
value=self.id,
|
|
167
|
-
)
|
|
168
|
-
]
|
|
169
|
-
),
|
|
170
|
-
page=PageInfo(index=current_page, size=100),
|
|
171
|
-
)
|
|
172
|
-
)
|
|
155
|
+
leaderboards_result = self.__openapi_service.benchmark_api.benchmark_benchmark_id_leaderboards_get(
|
|
156
|
+
benchmark_id=self.id,
|
|
157
|
+
request=QueryModel(
|
|
158
|
+
page=PageInfo(index=current_page, size=100),
|
|
159
|
+
),
|
|
173
160
|
)
|
|
174
161
|
|
|
175
162
|
if leaderboards_result.total_pages is None:
|
|
@@ -131,3 +131,9 @@ Your current version is: {__version__}"""
|
|
|
131
131
|
)
|
|
132
132
|
except Exception as e:
|
|
133
133
|
logger.debug("Failed to check for updates: %s", e)
|
|
134
|
+
|
|
135
|
+
def __str__(self) -> str:
|
|
136
|
+
return f"RapidataClient(environment={self._openapi_service.environment})"
|
|
137
|
+
|
|
138
|
+
def __repr__(self) -> str:
|
|
139
|
+
return self.__str__()
|
|
@@ -40,3 +40,9 @@ class AbTestSelection(RapidataSelection):
|
|
|
40
40
|
for selection in self.b_selections
|
|
41
41
|
],
|
|
42
42
|
)
|
|
43
|
+
|
|
44
|
+
def __str__(self) -> str:
|
|
45
|
+
return f"AbTestSelection(a_selections={self.a_selections}, b_selections={self.b_selections})"
|
|
46
|
+
|
|
47
|
+
def __repr__(self) -> str:
|
|
48
|
+
return self.__str__()
|
|
@@ -33,3 +33,9 @@ class CappedSelection(RapidataSelection):
|
|
|
33
33
|
],
|
|
34
34
|
maxRapids=self.max_rapids,
|
|
35
35
|
)
|
|
36
|
+
|
|
37
|
+
def __str__(self) -> str:
|
|
38
|
+
return f"CappedSelection(selections={self.selections}, max_rapids={self.max_rapids})"
|
|
39
|
+
|
|
40
|
+
def __repr__(self) -> str:
|
|
41
|
+
return self.__str__()
|
|
@@ -72,3 +72,9 @@ class ConditionalValidationSelection(RapidataSelection):
|
|
|
72
72
|
],
|
|
73
73
|
dimensions=self.dimensions,
|
|
74
74
|
)
|
|
75
|
+
|
|
76
|
+
def __str__(self) -> str:
|
|
77
|
+
return f"ConditionalValidationSelection(validation_set_id={self.validation_set_id}, thresholds={self.thresholds}, chances={self.chances}, rapid_counts={self.rapid_counts}, dimensions={self.dimensions})"
|
|
78
|
+
|
|
79
|
+
def __repr__(self) -> str:
|
|
80
|
+
return self.__str__()
|
|
@@ -34,3 +34,9 @@ class DemographicSelection(RapidataSelection):
|
|
|
34
34
|
return DemographicSelectionModel(
|
|
35
35
|
_t="DemographicSelection", keys=self.keys, maxRapids=self.max_rapids
|
|
36
36
|
)
|
|
37
|
+
|
|
38
|
+
def __str__(self) -> str:
|
|
39
|
+
return f"DemographicSelection(keys={self.keys}, max_rapids={self.max_rapids})"
|
|
40
|
+
|
|
41
|
+
def __repr__(self) -> str:
|
|
42
|
+
return self.__str__()
|
|
@@ -35,3 +35,9 @@ class EffortSelection(RapidataSelection):
|
|
|
35
35
|
retrievalMode=self.retrieval_mode.value,
|
|
36
36
|
maxIterations=self.max_iterations,
|
|
37
37
|
)
|
|
38
|
+
|
|
39
|
+
def __str__(self) -> str:
|
|
40
|
+
return f"EffortSelection(effort_budget={self.effort_budget}, retrieval_mode={self.retrieval_mode}, max_iterations={self.max_iterations})"
|
|
41
|
+
|
|
42
|
+
def __repr__(self) -> str:
|
|
43
|
+
return self.__str__()
|
|
@@ -38,3 +38,9 @@ class LabelingSelection(RapidataSelection):
|
|
|
38
38
|
retrievalMode=self.retrieval_mode.value,
|
|
39
39
|
maxIterations=self.max_iterations,
|
|
40
40
|
)
|
|
41
|
+
|
|
42
|
+
def __str__(self) -> str:
|
|
43
|
+
return f"LabelingSelection(amount={self.amount}, retrieval_mode={self.retrieval_mode}, max_iterations={self.max_iterations})"
|
|
44
|
+
|
|
45
|
+
def __repr__(self) -> str:
|
|
46
|
+
return self.__str__()
|
|
@@ -39,3 +39,9 @@ class RapidataSelections:
|
|
|
39
39
|
demographic = DemographicSelection
|
|
40
40
|
capped = CappedSelection
|
|
41
41
|
shuffling = ShufflingSelection
|
|
42
|
+
|
|
43
|
+
def __str__(self) -> str:
|
|
44
|
+
return f"RapidataSelections(labeling={self.labeling}, validation={self.validation}, conditional_validation={self.conditional_validation}, demographic={self.demographic}, capped={self.capped}, shuffling={self.shuffling})"
|
|
45
|
+
|
|
46
|
+
def __repr__(self) -> str:
|
|
47
|
+
return self.__str__()
|
|
@@ -15,3 +15,9 @@ class StaticSelection(RapidataSelection):
|
|
|
15
15
|
|
|
16
16
|
def __init__(self, rapid_ids: list[str]):
|
|
17
17
|
self.rapid_ids = rapid_ids
|
|
18
|
+
|
|
19
|
+
def __str__(self) -> str:
|
|
20
|
+
return f"StaticSelection(rapid_ids={self.rapid_ids})"
|
|
21
|
+
|
|
22
|
+
def __repr__(self) -> str:
|
|
23
|
+
return self.__str__()
|
|
@@ -24,3 +24,9 @@ class ValidationSelection(RapidataSelection):
|
|
|
24
24
|
validationSetId=self.validation_set_id,
|
|
25
25
|
amount=self.amount,
|
|
26
26
|
)
|
|
27
|
+
|
|
28
|
+
def __str__(self) -> str:
|
|
29
|
+
return f"ValidationSelection(validation_set_id={self.validation_set_id}, amount={self.amount})"
|
|
30
|
+
|
|
31
|
+
def __repr__(self) -> str:
|
|
32
|
+
return self.__str__()
|
|
@@ -7,4 +7,5 @@ from .play_video_until_the_end import PlayVideoUntilTheEnd
|
|
|
7
7
|
from .custom_setting import CustomSetting
|
|
8
8
|
from ._rapidata_setting import RapidataSetting
|
|
9
9
|
from .allow_neither_both import AllowNeitherBoth
|
|
10
|
+
from .swap_context_instruction import SwapContextInstruction
|
|
10
11
|
from .rapidata_settings import RapidataSettings
|
|
@@ -5,6 +5,7 @@ from rapidata.rapidata_client.settings import (
|
|
|
5
5
|
NoShuffle,
|
|
6
6
|
PlayVideoUntilTheEnd,
|
|
7
7
|
AllowNeitherBoth,
|
|
8
|
+
SwapContextInstruction,
|
|
8
9
|
)
|
|
9
10
|
|
|
10
11
|
|
|
@@ -21,6 +22,7 @@ class RapidataSettings:
|
|
|
21
22
|
no_shuffle (NoShuffle): Only for classification and compare tasks. If true, the order of the categories / images will not be shuffled and presented in the same order as specified.
|
|
22
23
|
play_video_until_the_end (PlayVideoUntilTheEnd): Allows users to only answer once the video has finished playing.
|
|
23
24
|
allow_neither_both (AllowNeitherBoth): Only for compare tasks. If true, the users will be able to select neither or both instead of exclusively one of the options.
|
|
25
|
+
swap_context_instruction (SwapContextInstruction): Swap the place of the context and instruction.
|
|
24
26
|
|
|
25
27
|
Example:
|
|
26
28
|
```python
|
|
@@ -37,3 +39,10 @@ class RapidataSettings:
|
|
|
37
39
|
no_shuffle = NoShuffle
|
|
38
40
|
play_video_until_the_end = PlayVideoUntilTheEnd
|
|
39
41
|
allow_neither_both = AllowNeitherBoth
|
|
42
|
+
swap_context_instruction = SwapContextInstruction
|
|
43
|
+
|
|
44
|
+
def __str__(self) -> str:
|
|
45
|
+
return f"RapidataSettings(alert_on_fast_response={self.alert_on_fast_response}, translation_behaviour={self.translation_behaviour}, free_text_minimum_characters={self.free_text_minimum_characters}, no_shuffle={self.no_shuffle}, play_video_until_the_end={self.play_video_until_the_end}, allow_neither_both={self.allow_neither_both}, swap_context_instruction={self.swap_context_instruction})"
|
|
46
|
+
|
|
47
|
+
def __repr__(self) -> str:
|
|
48
|
+
return self.__str__()
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from rapidata.rapidata_client.settings._rapidata_setting import RapidataSetting
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class SwapContextInstruction(RapidataSetting):
|
|
5
|
+
"""
|
|
6
|
+
Swap the place of the context and instruction.
|
|
7
|
+
|
|
8
|
+
If set to true, the instruction will be shown on top and the context below. if collapsed, only the instruction will be shown.
|
|
9
|
+
|
|
10
|
+
By default, the context will be shown on top and the instruction below.
|
|
11
|
+
|
|
12
|
+
Args:
|
|
13
|
+
value (bool): Whether to swap the place of the context and instruction.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
def __init__(self, value: bool = True):
|
|
17
|
+
if not isinstance(value, bool):
|
|
18
|
+
raise ValueError("The value must be a boolean.")
|
|
19
|
+
|
|
20
|
+
super().__init__(key="swap_question_and_prompt", value=value)
|
|
@@ -30,6 +30,19 @@ class Rapid:
|
|
|
30
30
|
explanation: str | None = None,
|
|
31
31
|
settings: Sequence[RapidataSetting] | None = None,
|
|
32
32
|
):
|
|
33
|
+
if not isinstance(asset, (MediaAsset, TextAsset, MultiAsset)):
|
|
34
|
+
raise ValueError("Asset must be a MediaAsset, TextAsset, or MultiAsset")
|
|
35
|
+
if not isinstance(metadata, (list, type(None))):
|
|
36
|
+
raise ValueError("Metadata must be a list or None")
|
|
37
|
+
if metadata and not all(isinstance(meta, Metadata) for meta in metadata):
|
|
38
|
+
raise ValueError("Metadata must be a list of Metadata objects")
|
|
39
|
+
if not isinstance(settings, (list, type(None))):
|
|
40
|
+
raise ValueError("Settings must be a list or None")
|
|
41
|
+
if settings and not all(
|
|
42
|
+
isinstance(setting, RapidataSetting) for setting in settings
|
|
43
|
+
):
|
|
44
|
+
raise ValueError("Settings must be a list of RapidataSetting objects")
|
|
45
|
+
|
|
33
46
|
self.asset = asset
|
|
34
47
|
self.metadata = metadata
|
|
35
48
|
self.payload = payload
|
|
@@ -392,3 +392,9 @@ class RapidsManager:
|
|
|
392
392
|
total_coverage = sum(end - start for start, end in merged_ranges)
|
|
393
393
|
|
|
394
394
|
return total_coverage / total_duration
|
|
395
|
+
|
|
396
|
+
def __str__(self) -> str:
|
|
397
|
+
return "RapidsManager"
|
|
398
|
+
|
|
399
|
+
def __repr__(self) -> str:
|
|
400
|
+
return self.__str__()
|
|
@@ -70,7 +70,7 @@ class ValidationSetManager:
|
|
|
70
70
|
settings=settings,
|
|
71
71
|
)
|
|
72
72
|
)
|
|
73
|
-
return self._submit(name=order_name, rapids=rapids, dimensions=
|
|
73
|
+
return self._submit(name=order_name, rapids=rapids, dimensions=None)
|
|
74
74
|
|
|
75
75
|
def create_classification_set(
|
|
76
76
|
self,
|
|
@@ -709,3 +709,9 @@ class ValidationSetManager:
|
|
|
709
709
|
for validation_set in validation_page_result.items
|
|
710
710
|
]
|
|
711
711
|
return validation_sets
|
|
712
|
+
|
|
713
|
+
def __str__(self) -> str:
|
|
714
|
+
return "ValidationSetManager"
|
|
715
|
+
|
|
716
|
+
def __repr__(self) -> str:
|
|
717
|
+
return self.__str__()
|
|
@@ -36,12 +36,10 @@ class OpenAPIService:
|
|
|
36
36
|
cert_path = _get_local_certificate()
|
|
37
37
|
|
|
38
38
|
logger.debug(
|
|
39
|
-
"Using cert_path: %s environment: %s
|
|
39
|
+
"Using cert_path: %s environment: %s client_id: %s",
|
|
40
40
|
cert_path,
|
|
41
41
|
environment,
|
|
42
|
-
token,
|
|
43
42
|
client_id,
|
|
44
|
-
client_secret,
|
|
45
43
|
)
|
|
46
44
|
logger.debug("Initializing OpenAPIService")
|
|
47
45
|
self.credential_manager = CredentialManager(
|