rapidata 2.28.5__py3-none-any.whl → 2.29.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of rapidata might be problematic. Click here for more details.

Files changed (84) hide show
  1. rapidata/__init__.py +1 -1
  2. rapidata/api_client/__init__.py +41 -8
  3. rapidata/api_client/api/__init__.py +1 -0
  4. rapidata/api_client/api/benchmark_api.py +2766 -0
  5. rapidata/api_client/api/customer_rapid_api.py +332 -1
  6. rapidata/api_client/api/dataset_api.py +16 -0
  7. rapidata/api_client/api/leaderboard_api.py +1392 -270
  8. rapidata/api_client/models/__init__.py +40 -8
  9. rapidata/api_client/models/add_campaign_model.py +3 -3
  10. rapidata/api_client/models/and_user_filter_model.py +106 -0
  11. rapidata/api_client/models/and_user_filter_model_filters_inner.py +282 -0
  12. rapidata/api_client/models/benchmark_query_result.py +94 -0
  13. rapidata/api_client/models/benchmark_query_result_paged_result.py +105 -0
  14. rapidata/api_client/models/boost_leaderboard_model.py +89 -0
  15. rapidata/api_client/models/create_benchmark_model.py +87 -0
  16. rapidata/api_client/models/create_benchmark_participant_model.py +87 -0
  17. rapidata/api_client/models/create_benchmark_participant_result.py +89 -0
  18. rapidata/api_client/models/create_benchmark_result.py +87 -0
  19. rapidata/api_client/models/create_datapoint_result.py +4 -16
  20. rapidata/api_client/models/create_leaderboard_model.py +18 -2
  21. rapidata/api_client/models/create_leaderboard_result.py +5 -3
  22. rapidata/api_client/models/create_order_model.py +3 -3
  23. rapidata/api_client/models/file_asset_input.py +104 -0
  24. rapidata/api_client/models/file_asset_input1.py +104 -0
  25. rapidata/api_client/models/file_asset_input1_file.py +168 -0
  26. rapidata/api_client/models/file_asset_input2.py +104 -0
  27. rapidata/api_client/models/file_asset_input_file.py +182 -0
  28. rapidata/api_client/models/form_file_wrapper.py +120 -0
  29. rapidata/api_client/models/get_benchmark_by_id_query.py +96 -0
  30. rapidata/api_client/models/get_benchmark_by_id_query_result.py +94 -0
  31. rapidata/api_client/models/get_benchmark_by_id_query_result_paged_result.py +105 -0
  32. rapidata/api_client/models/get_benchmark_by_id_result.py +94 -0
  33. rapidata/api_client/models/get_participant_by_id_result.py +6 -26
  34. rapidata/api_client/models/get_standing_by_id_result.py +113 -0
  35. rapidata/api_client/models/local_file_wrapper.py +120 -0
  36. rapidata/api_client/models/multi_asset_input.py +110 -0
  37. rapidata/api_client/models/multi_asset_input1.py +110 -0
  38. rapidata/api_client/models/multi_asset_input1_assets_inner.py +170 -0
  39. rapidata/api_client/models/multi_asset_input2.py +110 -0
  40. rapidata/api_client/models/multi_asset_input_assets_inner.py +170 -0
  41. rapidata/api_client/models/not_user_filter_model.py +3 -3
  42. rapidata/api_client/models/or_user_filter_model.py +3 -3
  43. rapidata/api_client/models/participant_by_benchmark.py +102 -0
  44. rapidata/api_client/models/participant_by_benchmark_paged_result.py +105 -0
  45. rapidata/api_client/models/participant_status.py +1 -4
  46. rapidata/api_client/models/potential_validation_rapid.py +103 -0
  47. rapidata/api_client/models/potential_validation_rapid_paged_result.py +105 -0
  48. rapidata/api_client/models/potential_validation_rapid_truth.py +280 -0
  49. rapidata/api_client/models/prompt_asset_metadata_input.py +3 -3
  50. rapidata/api_client/models/prompt_asset_metadata_input_asset.py +170 -0
  51. rapidata/api_client/models/prompt_by_benchmark_result.py +92 -0
  52. rapidata/api_client/models/prompt_by_benchmark_result_paged_result.py +105 -0
  53. rapidata/api_client/models/prompt_metadata_input.py +5 -3
  54. rapidata/api_client/models/proxy_file_wrapper.py +114 -0
  55. rapidata/api_client/models/query_validation_model.py +97 -0
  56. rapidata/api_client/models/standing_by_leaderboard.py +113 -0
  57. rapidata/api_client/models/standing_by_leaderboard_paged_result.py +105 -0
  58. rapidata/api_client/models/standing_status.py +38 -0
  59. rapidata/api_client/models/stream_file_wrapper.py +116 -0
  60. rapidata/api_client/models/submit_prompt_model.py +89 -0
  61. rapidata/api_client/models/text_asset_input.py +100 -0
  62. rapidata/api_client/models/transcription_metadata_input.py +5 -3
  63. rapidata/api_client/models/zip_entry_file_wrapper.py +120 -0
  64. rapidata/api_client_README.md +62 -16
  65. rapidata/rapidata_client/benchmark/leaderboard/__init__.py +0 -0
  66. rapidata/rapidata_client/benchmark/leaderboard/rapidata_leaderboard.py +62 -0
  67. rapidata/rapidata_client/benchmark/rapidata_benchmark.py +227 -0
  68. rapidata/rapidata_client/benchmark/rapidata_benchmark_manager.py +83 -0
  69. rapidata/rapidata_client/filter/not_filter.py +2 -2
  70. rapidata/rapidata_client/filter/or_filter.py +2 -2
  71. rapidata/rapidata_client/metadata/__init__.py +1 -0
  72. rapidata/rapidata_client/metadata/_media_asset_metadata.py +8 -1
  73. rapidata/rapidata_client/metadata/_prompt_identifier_metadata.py +15 -0
  74. rapidata/rapidata_client/order/_rapidata_dataset.py +6 -6
  75. rapidata/rapidata_client/order/_rapidata_order_builder.py +4 -4
  76. rapidata/rapidata_client/rapidata_client.py +3 -3
  77. rapidata/service/openapi_service.py +5 -0
  78. {rapidata-2.28.5.dist-info → rapidata-2.29.0.dist-info}/METADATA +1 -1
  79. {rapidata-2.28.5.dist-info → rapidata-2.29.0.dist-info}/RECORD +82 -35
  80. rapidata/rapidata_client/leaderboard/rapidata_leaderboard.py +0 -127
  81. rapidata/rapidata_client/leaderboard/rapidata_leaderboard_manager.py +0 -92
  82. /rapidata/rapidata_client/{leaderboard → benchmark}/__init__.py +0 -0
  83. {rapidata-2.28.5.dist-info → rapidata-2.29.0.dist-info}/LICENSE +0 -0
  84. {rapidata-2.28.5.dist-info → rapidata-2.29.0.dist-info}/WHEEL +0 -0
@@ -55,15 +55,14 @@ configuration.api_key['bearer'] = os.environ["API_KEY"]
55
55
  # Enter a context with an instance of the API client
56
56
  with rapidata.api_client.ApiClient(configuration) as api_client:
57
57
  # Create an instance of the API class
58
- api_instance = rapidata.api_client.CampaignApi(api_client)
58
+ api_instance = rapidata.api_client.BenchmarkApi(api_client)
59
+ benchmark_id = 'benchmark_id_example' # str |
59
60
 
60
61
  try:
61
- # Gets the status of the boost.
62
- api_response = api_instance.campaign_boost_status_get()
63
- print("The response of CampaignApi->campaign_boost_status_get:\n")
64
- pprint(api_response)
62
+ # Deletes a single benchmark.
63
+ api_instance.benchmark_benchmark_id_delete(benchmark_id)
65
64
  except ApiException as e:
66
- print("Exception when calling CampaignApi->campaign_boost_status_get: %s\n" % e)
65
+ print("Exception when calling BenchmarkApi->benchmark_benchmark_id_delete: %s\n" % e)
67
66
 
68
67
  ```
69
68
 
@@ -73,6 +72,16 @@ All URIs are relative to *http://localhost*
73
72
 
74
73
  Class | Method | HTTP request | Description
75
74
  ------------ | ------------- | ------------- | -------------
75
+ *BenchmarkApi* | [**benchmark_benchmark_id_delete**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_delete) | **DELETE** /benchmark/{benchmarkId} | Deletes a single benchmark.
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_participant_participant_id_get**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_participant_participant_id_get) | **GET** /benchmark/{benchmarkId}/participant/{participantId} | Gets a participant by it's Id.
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
79
+ *BenchmarkApi* | [**benchmark_benchmark_id_participants_participant_id_submit_post**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_participants_participant_id_submit_post) | **POST** /benchmark/{benchmarkId}/participants/{participantId}/submit | Submits a participant to a benchmark.
80
+ *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.
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.
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.
83
+ *BenchmarkApi* | [**benchmark_post**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_post) | **POST** /benchmark | Creates a benchmark
84
+ *BenchmarkApi* | [**benchmarks_get**](rapidata/api_client/docs/BenchmarkApi.md#benchmarks_get) | **GET** /benchmarks | Queries all benchmarks of the user.
76
85
  *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.
77
86
  *CampaignApi* | [**campaign_campaign_id_pause_post**](rapidata/api_client/docs/CampaignApi.md#campaign_campaign_id_pause_post) | **POST** /campaign/{campaignId}/pause | Pauses a campaign.
78
87
  *CampaignApi* | [**campaign_campaign_id_resume_post**](rapidata/api_client/docs/CampaignApi.md#campaign_campaign_id_resume_post) | **POST** /campaign/{campaignId}/resume | Resumes a campaign.
@@ -86,6 +95,7 @@ Class | Method | HTTP request | Description
86
95
  *CocoApi* | [**coco_coco_set_id_submit_post**](rapidata/api_client/docs/CocoApi.md#coco_coco_set_id_submit_post) | **POST** /coco/{cocoSetId}/submit | Creates a new validation set based on a previously uploaded CoCo set.
87
96
  *CocoApi* | [**coco_post**](rapidata/api_client/docs/CocoApi.md#coco_post) | **POST** /coco | Uploads a CoCo set to the system.
88
97
  *CompareWorkflowApi* | [**workflow_compare_workflow_id_results_get**](rapidata/api_client/docs/CompareWorkflowApi.md#workflow_compare_workflow_id_results_get) | **GET** /workflow/compare/{workflowId}/results | Get the result overview for a compare workflow.
98
+ *CustomerRapidApi* | [**rapid_correlation_id_validation_potential_get**](rapidata/api_client/docs/CustomerRapidApi.md#rapid_correlation_id_validation_potential_get) | **GET** /rapid/{correlationId}/validation-potential | Queries rapids that are potentially eligible for validation set creation.
89
99
  *CustomerRapidApi* | [**rapid_demographic_post**](rapidata/api_client/docs/CustomerRapidApi.md#rapid_demographic_post) | **POST** /rapid/demographic | Creates a new Demographic Rapid.
90
100
  *CustomerRapidApi* | [**rapid_rapid_id_delete**](rapidata/api_client/docs/CustomerRapidApi.md#rapid_rapid_id_delete) | **DELETE** /rapid/{rapidId} | Deletes a rapid.
91
101
  *CustomerRapidApi* | [**rapid_rapid_id_responses_get**](rapidata/api_client/docs/CustomerRapidApi.md#rapid_rapid_id_responses_get) | **GET** /rapid/{rapidId}/responses | Gets all responses for a given rapid.
@@ -112,14 +122,18 @@ Class | Method | HTTP request | Description
112
122
  *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.
113
123
  *IdentityApi* | [**identity_referrer_post**](rapidata/api_client/docs/IdentityApi.md#identity_referrer_post) | **POST** /identity/referrer | Sets the referrer for the current customer.
114
124
  *IdentityApi* | [**identity_temporary_post**](rapidata/api_client/docs/IdentityApi.md#identity_temporary_post) | **POST** /identity/temporary | Registers and logs in a temporary customer.
125
+ *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.
126
+ *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.
115
127
  *LeaderboardApi* | [**leaderboard_leaderboard_id_delete**](rapidata/api_client/docs/LeaderboardApi.md#leaderboard_leaderboard_id_delete) | **DELETE** /leaderboard/{leaderboardId} | Deletes a leaderboard by its ID.
116
128
  *LeaderboardApi* | [**leaderboard_leaderboard_id_get**](rapidata/api_client/docs/LeaderboardApi.md#leaderboard_leaderboard_id_get) | **GET** /leaderboard/{leaderboardId} | Gets a leaderboard by its ID.
117
- *LeaderboardApi* | [**leaderboard_leaderboard_id_participants_get**](rapidata/api_client/docs/LeaderboardApi.md#leaderboard_leaderboard_id_participants_get) | **GET** /leaderboard/{leaderboardId}/participants | queries all the participants of a leaderboard by its ID.
129
+ *LeaderboardApi* | [**leaderboard_leaderboard_id_participant_participant_id_get**](rapidata/api_client/docs/LeaderboardApi.md#leaderboard_leaderboard_id_participant_participant_id_get) | **GET** /leaderboard/{leaderboardId}/participant/{participantId} | Gets a participant by its ID.
130
+ *LeaderboardApi* | [**leaderboard_leaderboard_id_participants_get**](rapidata/api_client/docs/LeaderboardApi.md#leaderboard_leaderboard_id_participants_get) | **GET** /leaderboard/{leaderboardId}/participants | queries all the participants connected to leaderboard by its ID.
118
131
  *LeaderboardApi* | [**leaderboard_leaderboard_id_participants_participant_id_submit_post**](rapidata/api_client/docs/LeaderboardApi.md#leaderboard_leaderboard_id_participants_participant_id_submit_post) | **POST** /leaderboard/{leaderboardId}/participants/{participantId}/submit | Submits a participant to a leaderboard.
119
132
  *LeaderboardApi* | [**leaderboard_leaderboard_id_participants_post**](rapidata/api_client/docs/LeaderboardApi.md#leaderboard_leaderboard_id_participants_post) | **POST** /leaderboard/{leaderboardId}/participants | Creates a participant in a leaderboard.
120
133
  *LeaderboardApi* | [**leaderboard_leaderboard_id_prompts_get**](rapidata/api_client/docs/LeaderboardApi.md#leaderboard_leaderboard_id_prompts_get) | **GET** /leaderboard/{leaderboardId}/prompts | returns the paged prompts of a leaderboard by its ID.
121
134
  *LeaderboardApi* | [**leaderboard_leaderboard_id_prompts_post**](rapidata/api_client/docs/LeaderboardApi.md#leaderboard_leaderboard_id_prompts_post) | **POST** /leaderboard/{leaderboardId}/prompts | adds a new prompt to a leaderboard.
122
- *LeaderboardApi* | [**leaderboard_participant_participant_id_get**](rapidata/api_client/docs/LeaderboardApi.md#leaderboard_participant_participant_id_get) | **GET** /leaderboard/participant/{participantId} | Gets a participant by its ID.
135
+ *LeaderboardApi* | [**leaderboard_leaderboard_id_refresh_post**](rapidata/api_client/docs/LeaderboardApi.md#leaderboard_leaderboard_id_refresh_post) | **POST** /leaderboard/{leaderboardId}/refresh | This will force an update to all standings of a leaderboard. this could happen if the recorded matches and scores are out of sync
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.
123
137
  *LeaderboardApi* | [**leaderboard_post**](rapidata/api_client/docs/LeaderboardApi.md#leaderboard_post) | **POST** /leaderboard | Creates a new leaderboard with the specified name and criteria.
124
138
  *LeaderboardApi* | [**leaderboards_get**](rapidata/api_client/docs/LeaderboardApi.md#leaderboards_get) | **GET** /leaderboards | Queries all leaderboards of the user.
125
139
  *NewsletterApi* | [**newsletter_subscribe_post**](rapidata/api_client/docs/NewsletterApi.md#newsletter_subscribe_post) | **POST** /newsletter/subscribe | Signs a user up to the newsletter.
@@ -195,6 +209,8 @@ Class | Method | HTTP request | Description
195
209
  - [AgeGroup](rapidata/api_client/docs/AgeGroup.md)
196
210
  - [AgeUserFilterModel](rapidata/api_client/docs/AgeUserFilterModel.md)
197
211
  - [AggregatorType](rapidata/api_client/docs/AggregatorType.md)
212
+ - [AndUserFilterModel](rapidata/api_client/docs/AndUserFilterModel.md)
213
+ - [AndUserFilterModelFiltersInner](rapidata/api_client/docs/AndUserFilterModelFiltersInner.md)
198
214
  - [AreRapidsActiveResult](rapidata/api_client/docs/AreRapidsActiveResult.md)
199
215
  - [AssetMetadata](rapidata/api_client/docs/AssetMetadata.md)
200
216
  - [AssetMetadataAsset](rapidata/api_client/docs/AssetMetadataAsset.md)
@@ -202,7 +218,9 @@ Class | Method | HTTP request | Description
202
218
  - [AttachCategoryRapidBlueprint](rapidata/api_client/docs/AttachCategoryRapidBlueprint.md)
203
219
  - [AttachCategoryResult](rapidata/api_client/docs/AttachCategoryResult.md)
204
220
  - [AttachCategoryTruth](rapidata/api_client/docs/AttachCategoryTruth.md)
205
- - [BaseError](rapidata/api_client/docs/BaseError.md)
221
+ - [BenchmarkQueryResult](rapidata/api_client/docs/BenchmarkQueryResult.md)
222
+ - [BenchmarkQueryResultPagedResult](rapidata/api_client/docs/BenchmarkQueryResultPagedResult.md)
223
+ - [BoostLeaderboardModel](rapidata/api_client/docs/BoostLeaderboardModel.md)
206
224
  - [BoostQueryResult](rapidata/api_client/docs/BoostQueryResult.md)
207
225
  - [BoostStatus](rapidata/api_client/docs/BoostStatus.md)
208
226
  - [BoundingBoxPayload](rapidata/api_client/docs/BoundingBoxPayload.md)
@@ -247,6 +265,10 @@ Class | Method | HTTP request | Description
247
265
  - [CountMetadata](rapidata/api_client/docs/CountMetadata.md)
248
266
  - [CountMetadataModel](rapidata/api_client/docs/CountMetadataModel.md)
249
267
  - [CountryUserFilterModel](rapidata/api_client/docs/CountryUserFilterModel.md)
268
+ - [CreateBenchmarkModel](rapidata/api_client/docs/CreateBenchmarkModel.md)
269
+ - [CreateBenchmarkParticipantModel](rapidata/api_client/docs/CreateBenchmarkParticipantModel.md)
270
+ - [CreateBenchmarkParticipantResult](rapidata/api_client/docs/CreateBenchmarkParticipantResult.md)
271
+ - [CreateBenchmarkResult](rapidata/api_client/docs/CreateBenchmarkResult.md)
250
272
  - [CreateBridgeTokenResult](rapidata/api_client/docs/CreateBridgeTokenResult.md)
251
273
  - [CreateClientModel](rapidata/api_client/docs/CreateClientModel.md)
252
274
  - [CreateComplexOrderModel](rapidata/api_client/docs/CreateComplexOrderModel.md)
@@ -263,12 +285,9 @@ Class | Method | HTTP request | Description
263
285
  - [CreateDemographicRapidModel](rapidata/api_client/docs/CreateDemographicRapidModel.md)
264
286
  - [CreateEmptyValidationSetResult](rapidata/api_client/docs/CreateEmptyValidationSetResult.md)
265
287
  - [CreateLeaderboardModel](rapidata/api_client/docs/CreateLeaderboardModel.md)
266
- - [CreateLeaderboardParticipantModel](rapidata/api_client/docs/CreateLeaderboardParticipantModel.md)
267
- - [CreateLeaderboardParticipantResult](rapidata/api_client/docs/CreateLeaderboardParticipantResult.md)
268
288
  - [CreateLeaderboardResult](rapidata/api_client/docs/CreateLeaderboardResult.md)
269
289
  - [CreateOrderModel](rapidata/api_client/docs/CreateOrderModel.md)
270
290
  - [CreateOrderModelReferee](rapidata/api_client/docs/CreateOrderModelReferee.md)
271
- - [CreateOrderModelUserFiltersInner](rapidata/api_client/docs/CreateOrderModelUserFiltersInner.md)
272
291
  - [CreateOrderModelWorkflow](rapidata/api_client/docs/CreateOrderModelWorkflow.md)
273
292
  - [CreateOrderResult](rapidata/api_client/docs/CreateOrderResult.md)
274
293
  - [CreateRapidResult](rapidata/api_client/docs/CreateRapidResult.md)
@@ -303,6 +322,11 @@ Class | Method | HTTP request | Description
303
322
  - [FeedbackModel](rapidata/api_client/docs/FeedbackModel.md)
304
323
  - [FileArtifactModel](rapidata/api_client/docs/FileArtifactModel.md)
305
324
  - [FileAsset](rapidata/api_client/docs/FileAsset.md)
325
+ - [FileAssetInput](rapidata/api_client/docs/FileAssetInput.md)
326
+ - [FileAssetInput1](rapidata/api_client/docs/FileAssetInput1.md)
327
+ - [FileAssetInput1File](rapidata/api_client/docs/FileAssetInput1File.md)
328
+ - [FileAssetInput2](rapidata/api_client/docs/FileAssetInput2.md)
329
+ - [FileAssetInputFile](rapidata/api_client/docs/FileAssetInputFile.md)
306
330
  - [FileAssetModel](rapidata/api_client/docs/FileAssetModel.md)
307
331
  - [FileAssetModelMetadataValue](rapidata/api_client/docs/FileAssetModelMetadataValue.md)
308
332
  - [FileType](rapidata/api_client/docs/FileType.md)
@@ -310,12 +334,14 @@ Class | Method | HTTP request | Description
310
334
  - [FileTypeMetadataModel](rapidata/api_client/docs/FileTypeMetadataModel.md)
311
335
  - [Filter](rapidata/api_client/docs/Filter.md)
312
336
  - [FilterOperator](rapidata/api_client/docs/FilterOperator.md)
337
+ - [FormFileWrapper](rapidata/api_client/docs/FormFileWrapper.md)
313
338
  - [FreeTextPayload](rapidata/api_client/docs/FreeTextPayload.md)
314
339
  - [FreeTextRapidBlueprint](rapidata/api_client/docs/FreeTextRapidBlueprint.md)
315
340
  - [FreeTextResult](rapidata/api_client/docs/FreeTextResult.md)
316
341
  - [Gender](rapidata/api_client/docs/Gender.md)
317
342
  - [GenderUserFilterModel](rapidata/api_client/docs/GenderUserFilterModel.md)
318
343
  - [GetAvailableValidationSetsResult](rapidata/api_client/docs/GetAvailableValidationSetsResult.md)
344
+ - [GetBenchmarkByIdResult](rapidata/api_client/docs/GetBenchmarkByIdResult.md)
319
345
  - [GetCompareAbSummaryResult](rapidata/api_client/docs/GetCompareAbSummaryResult.md)
320
346
  - [GetCompareWorkflowResultsModel](rapidata/api_client/docs/GetCompareWorkflowResultsModel.md)
321
347
  - [GetCompareWorkflowResultsResult](rapidata/api_client/docs/GetCompareWorkflowResultsResult.md)
@@ -333,6 +359,7 @@ Class | Method | HTTP request | Description
333
359
  - [GetRapidResponsesResult](rapidata/api_client/docs/GetRapidResponsesResult.md)
334
360
  - [GetResponsesResult](rapidata/api_client/docs/GetResponsesResult.md)
335
361
  - [GetSimpleWorkflowResultsModel](rapidata/api_client/docs/GetSimpleWorkflowResultsModel.md)
362
+ - [GetStandingByIdResult](rapidata/api_client/docs/GetStandingByIdResult.md)
336
363
  - [GetValidationRapidsResult](rapidata/api_client/docs/GetValidationRapidsResult.md)
337
364
  - [GetValidationRapidsResultAsset](rapidata/api_client/docs/GetValidationRapidsResultAsset.md)
338
365
  - [GetValidationRapidsResultPagedResult](rapidata/api_client/docs/GetValidationRapidsResultPagedResult.md)
@@ -363,6 +390,7 @@ Class | Method | HTTP request | Description
363
390
  - [LineRapidBlueprint](rapidata/api_client/docs/LineRapidBlueprint.md)
364
391
  - [LineResult](rapidata/api_client/docs/LineResult.md)
365
392
  - [LineTruth](rapidata/api_client/docs/LineTruth.md)
393
+ - [LocalFileWrapper](rapidata/api_client/docs/LocalFileWrapper.md)
366
394
  - [LocateBoxTruth](rapidata/api_client/docs/LocateBoxTruth.md)
367
395
  - [LocateCoordinate](rapidata/api_client/docs/LocateCoordinate.md)
368
396
  - [LocatePayload](rapidata/api_client/docs/LocatePayload.md)
@@ -374,6 +402,11 @@ Class | Method | HTTP request | Description
374
402
  - [LogicOperator](rapidata/api_client/docs/LogicOperator.md)
375
403
  - [MetadataVisibilities](rapidata/api_client/docs/MetadataVisibilities.md)
376
404
  - [MultiAsset](rapidata/api_client/docs/MultiAsset.md)
405
+ - [MultiAssetInput](rapidata/api_client/docs/MultiAssetInput.md)
406
+ - [MultiAssetInput1](rapidata/api_client/docs/MultiAssetInput1.md)
407
+ - [MultiAssetInput1AssetsInner](rapidata/api_client/docs/MultiAssetInput1AssetsInner.md)
408
+ - [MultiAssetInput2](rapidata/api_client/docs/MultiAssetInput2.md)
409
+ - [MultiAssetInputAssetsInner](rapidata/api_client/docs/MultiAssetInputAssetsInner.md)
377
410
  - [MultiAssetModel](rapidata/api_client/docs/MultiAssetModel.md)
378
411
  - [MultiCompareTruth](rapidata/api_client/docs/MultiCompareTruth.md)
379
412
  - [NaiveRefereeConfig](rapidata/api_client/docs/NaiveRefereeConfig.md)
@@ -402,28 +435,34 @@ Class | Method | HTTP request | Description
402
435
  - [OriginalFilenameMetadata](rapidata/api_client/docs/OriginalFilenameMetadata.md)
403
436
  - [OriginalFilenameMetadataModel](rapidata/api_client/docs/OriginalFilenameMetadataModel.md)
404
437
  - [PageInfo](rapidata/api_client/docs/PageInfo.md)
405
- - [ParticipantByLeaderboard](rapidata/api_client/docs/ParticipantByLeaderboard.md)
406
- - [ParticipantByLeaderboardPagedResult](rapidata/api_client/docs/ParticipantByLeaderboardPagedResult.md)
438
+ - [ParticipantByBenchmark](rapidata/api_client/docs/ParticipantByBenchmark.md)
439
+ - [ParticipantByBenchmarkPagedResult](rapidata/api_client/docs/ParticipantByBenchmarkPagedResult.md)
407
440
  - [ParticipantStatus](rapidata/api_client/docs/ParticipantStatus.md)
408
441
  - [PipelineIdWorkflowConfigPutRequest](rapidata/api_client/docs/PipelineIdWorkflowConfigPutRequest.md)
409
442
  - [PolygonPayload](rapidata/api_client/docs/PolygonPayload.md)
410
443
  - [PolygonRapidBlueprint](rapidata/api_client/docs/PolygonRapidBlueprint.md)
411
444
  - [PolygonResult](rapidata/api_client/docs/PolygonResult.md)
412
445
  - [PolygonTruth](rapidata/api_client/docs/PolygonTruth.md)
446
+ - [PotentialValidationRapid](rapidata/api_client/docs/PotentialValidationRapid.md)
447
+ - [PotentialValidationRapidPagedResult](rapidata/api_client/docs/PotentialValidationRapidPagedResult.md)
448
+ - [PotentialValidationRapidTruth](rapidata/api_client/docs/PotentialValidationRapidTruth.md)
413
449
  - [PreliminaryDownloadModel](rapidata/api_client/docs/PreliminaryDownloadModel.md)
414
450
  - [PreliminaryDownloadResult](rapidata/api_client/docs/PreliminaryDownloadResult.md)
415
451
  - [PrivateTextMetadataInput](rapidata/api_client/docs/PrivateTextMetadataInput.md)
416
452
  - [ProbabilisticAttachCategoryRefereeConfig](rapidata/api_client/docs/ProbabilisticAttachCategoryRefereeConfig.md)
417
453
  - [ProbabilisticAttachCategoryRefereeInfo](rapidata/api_client/docs/ProbabilisticAttachCategoryRefereeInfo.md)
418
454
  - [PromptAssetMetadataInput](rapidata/api_client/docs/PromptAssetMetadataInput.md)
419
- - [PromptByLeaderboardResult](rapidata/api_client/docs/PromptByLeaderboardResult.md)
420
- - [PromptByLeaderboardResultPagedResult](rapidata/api_client/docs/PromptByLeaderboardResultPagedResult.md)
455
+ - [PromptAssetMetadataInputAsset](rapidata/api_client/docs/PromptAssetMetadataInputAsset.md)
456
+ - [PromptByBenchmarkResult](rapidata/api_client/docs/PromptByBenchmarkResult.md)
457
+ - [PromptByBenchmarkResultPagedResult](rapidata/api_client/docs/PromptByBenchmarkResultPagedResult.md)
421
458
  - [PromptMetadata](rapidata/api_client/docs/PromptMetadata.md)
422
459
  - [PromptMetadataInput](rapidata/api_client/docs/PromptMetadataInput.md)
423
460
  - [PromptMetadataModel](rapidata/api_client/docs/PromptMetadataModel.md)
461
+ - [ProxyFileWrapper](rapidata/api_client/docs/ProxyFileWrapper.md)
424
462
  - [PublicOrderModel](rapidata/api_client/docs/PublicOrderModel.md)
425
463
  - [PublicTextMetadataInput](rapidata/api_client/docs/PublicTextMetadataInput.md)
426
464
  - [QueryModel](rapidata/api_client/docs/QueryModel.md)
465
+ - [QueryValidationModel](rapidata/api_client/docs/QueryValidationModel.md)
427
466
  - [RapidIssue](rapidata/api_client/docs/RapidIssue.md)
428
467
  - [RapidModel](rapidata/api_client/docs/RapidModel.md)
429
468
  - [RapidModelPagedResult](rapidata/api_client/docs/RapidModelPagedResult.md)
@@ -461,14 +500,20 @@ Class | Method | HTTP request | Description
461
500
  - [SortDirection](rapidata/api_client/docs/SortDirection.md)
462
501
  - [SourceUrlMetadata](rapidata/api_client/docs/SourceUrlMetadata.md)
463
502
  - [SourceUrlMetadataModel](rapidata/api_client/docs/SourceUrlMetadataModel.md)
503
+ - [StandingByLeaderboard](rapidata/api_client/docs/StandingByLeaderboard.md)
504
+ - [StandingByLeaderboardPagedResult](rapidata/api_client/docs/StandingByLeaderboardPagedResult.md)
505
+ - [StandingStatus](rapidata/api_client/docs/StandingStatus.md)
464
506
  - [StaticSelection](rapidata/api_client/docs/StaticSelection.md)
465
507
  - [StickyState](rapidata/api_client/docs/StickyState.md)
508
+ - [StreamFileWrapper](rapidata/api_client/docs/StreamFileWrapper.md)
466
509
  - [StreamsMetadata](rapidata/api_client/docs/StreamsMetadata.md)
467
510
  - [StreamsMetadataModel](rapidata/api_client/docs/StreamsMetadataModel.md)
468
511
  - [SubmitCocoModel](rapidata/api_client/docs/SubmitCocoModel.md)
469
512
  - [SubmitCocoResult](rapidata/api_client/docs/SubmitCocoResult.md)
470
513
  - [SubmitParticipantResult](rapidata/api_client/docs/SubmitParticipantResult.md)
514
+ - [SubmitPromptModel](rapidata/api_client/docs/SubmitPromptModel.md)
471
515
  - [TextAsset](rapidata/api_client/docs/TextAsset.md)
516
+ - [TextAssetInput](rapidata/api_client/docs/TextAssetInput.md)
472
517
  - [TextAssetModel](rapidata/api_client/docs/TextAssetModel.md)
473
518
  - [TextMetadata](rapidata/api_client/docs/TextMetadata.md)
474
519
  - [TextMetadataModel](rapidata/api_client/docs/TextMetadataModel.md)
@@ -509,6 +554,7 @@ Class | Method | HTTP request | Description
509
554
  - [WorkflowSplitModel](rapidata/api_client/docs/WorkflowSplitModel.md)
510
555
  - [WorkflowSplitModelFilterConfigsInner](rapidata/api_client/docs/WorkflowSplitModelFilterConfigsInner.md)
511
556
  - [WorkflowState](rapidata/api_client/docs/WorkflowState.md)
557
+ - [ZipEntryFileWrapper](rapidata/api_client/docs/ZipEntryFileWrapper.md)
512
558
 
513
559
 
514
560
  <a id="documentation-for-authorization"></a>
@@ -0,0 +1,62 @@
1
+ import pandas as pd
2
+
3
+ from rapidata.api_client.models.query_model import QueryModel
4
+ from rapidata.api_client.models.page_info import PageInfo
5
+ from rapidata.api_client.models.sort_criterion import SortCriterion
6
+
7
+ from rapidata.service.openapi_service import OpenAPIService
8
+
9
+
10
+ class RapidataLeaderboard:
11
+ """
12
+ An instance of a Rapidata leaderboard.
13
+
14
+ Used to interact with a specific leaderboard in the Rapidata system, such as retrieving prompts and evaluating models.
15
+
16
+ Args:
17
+ name: The name that will be used to identify the leaderboard on the overview.
18
+ instruction: The instruction that will determine what how the models will be evaluated.
19
+ show_prompt: Whether to show the prompt to the users.
20
+ id: The ID of the leaderboard.
21
+ openapi_service: The OpenAPIService instance for API interaction.
22
+ """
23
+ def __init__(self, name: str, instruction: str, show_prompt: bool, id: str, openapi_service: OpenAPIService):
24
+ self.__openapi_service = openapi_service
25
+ self.name = name
26
+ self.instruction = instruction
27
+ self.show_prompt = show_prompt
28
+ self.id = id
29
+
30
+ def get_standings(self) -> pd.DataFrame:
31
+ """
32
+ Returns the standings of the leaderboard.
33
+ """
34
+ participants = self.__openapi_service.leaderboard_api.leaderboard_leaderboard_id_standings_get(
35
+ leaderboard_id=self.id,
36
+ request=QueryModel(
37
+ page=PageInfo(index=1, size=1000),
38
+ sortCriteria=[SortCriterion(direction="Desc", propertyName="Score")]
39
+ )
40
+ )
41
+
42
+ standings = []
43
+ for participant in participants.items:
44
+ standings.append({
45
+ "name": participant.name,
46
+ "wins": participant.wins,
47
+ "total_matches": participant.total_matches,
48
+ "score": round(participant.score, 2) if participant.score is not None else None,
49
+ })
50
+
51
+ return pd.DataFrame(standings)
52
+
53
+ def __str__(self) -> str:
54
+ return f"RapidataLeaderboard(name={self.name}, instruction={self.instruction}, show_prompt={self.show_prompt}, leaderboard_id={self.id})"
55
+
56
+ def __repr__(self) -> str:
57
+ return self.__str__()
58
+
59
+
60
+
61
+
62
+
@@ -0,0 +1,227 @@
1
+ from rapidata.api_client.models.root_filter import RootFilter
2
+ from rapidata.api_client.models.filter import Filter
3
+ from rapidata.api_client.models.query_model import QueryModel
4
+ from rapidata.api_client.models.page_info import PageInfo
5
+ from rapidata.api_client.models.create_leaderboard_model import CreateLeaderboardModel
6
+ from rapidata.api_client.models.create_benchmark_participant_model import CreateBenchmarkParticipantModel
7
+ from rapidata.api_client.models.submit_prompt_model import SubmitPromptModel
8
+
9
+ from rapidata.rapidata_client.logging import logger
10
+ from rapidata.service.openapi_service import OpenAPIService
11
+
12
+ from rapidata.rapidata_client.benchmark.leaderboard.rapidata_leaderboard import RapidataLeaderboard
13
+ from rapidata.rapidata_client.metadata import PromptIdentifierMetadata
14
+ from rapidata.rapidata_client.assets import MediaAsset
15
+ from rapidata.rapidata_client.order._rapidata_dataset import RapidataDataset
16
+
17
+ class RapidataBenchmark:
18
+ """
19
+ An instance of a Rapidata benchmark.
20
+
21
+ Used to interact with a specific benchmark in the Rapidata system, such as retrieving prompts and evaluating models.
22
+
23
+ Args:
24
+ name: The name that will be used to identify the benchmark on the overview.
25
+ id: The id of the benchmark.
26
+ openapi_service: The OpenAPI service to use to interact with the Rapidata API.
27
+ """
28
+ def __init__(self, name: str, id: str, openapi_service: OpenAPIService):
29
+ self.name = name
30
+ self.id = id
31
+ self.__openapi_service = openapi_service
32
+ self.__prompts: list[str] = []
33
+ self.__leaderboards: list[RapidataLeaderboard] = []
34
+ self.__identifiers: list[str] = []
35
+
36
+ def __instantiate_prompts(self) -> None:
37
+ current_page = 1
38
+ total_pages = None
39
+
40
+ while True:
41
+ prompts_result = self.__openapi_service.benchmark_api.benchmark_benchmark_id_prompts_get(
42
+ benchmark_id=self.id,
43
+ request=QueryModel(
44
+ page=PageInfo(
45
+ index=current_page,
46
+ size=100
47
+ )
48
+ )
49
+ )
50
+
51
+ if prompts_result.total_pages is None:
52
+ raise ValueError("An error occurred while fetching prompts: total_pages is None")
53
+
54
+ total_pages = prompts_result.total_pages
55
+
56
+ self.__prompts.extend([prompt.prompt for prompt in prompts_result.items])
57
+ self.__identifiers.extend([prompt.identifier for prompt in prompts_result.items])
58
+
59
+ if current_page >= total_pages:
60
+ break
61
+
62
+ current_page += 1
63
+
64
+ @property
65
+ def prompts(self) -> list[str]:
66
+ """
67
+ Returns the prompts that are registered for the leaderboard.
68
+ """
69
+ if not self.__prompts:
70
+ self.__instantiate_prompts()
71
+
72
+ return self.__prompts
73
+
74
+ @property
75
+ def identifiers(self) -> list[str]:
76
+ if not self.__identifiers:
77
+ self.__instantiate_prompts()
78
+
79
+ return self.__identifiers
80
+
81
+ @property
82
+ def leaderboards(self) -> list[RapidataLeaderboard]:
83
+ """
84
+ Returns the leaderboards that are registered for the benchmark.
85
+ """
86
+ if not self.__leaderboards:
87
+ current_page = 1
88
+ total_pages = None
89
+
90
+ while True:
91
+ leaderboards_result = self.__openapi_service.leaderboard_api.leaderboards_get(
92
+ request=QueryModel(
93
+ filter=RootFilter(
94
+ filters=[
95
+ Filter(field="BenchmarkId", operator="Eq", value=self.id)
96
+ ]
97
+ ),
98
+ page=PageInfo(
99
+ index=current_page,
100
+ size=100
101
+ )
102
+ )
103
+ )
104
+
105
+ if leaderboards_result.total_pages is None:
106
+ raise ValueError("An error occurred while fetching leaderboards: total_pages is None")
107
+
108
+ total_pages = leaderboards_result.total_pages
109
+
110
+ self.__leaderboards.extend([
111
+ RapidataLeaderboard(
112
+ leaderboard.name,
113
+ leaderboard.instruction,
114
+ leaderboard.show_prompt,
115
+ leaderboard.id,
116
+ self.__openapi_service
117
+ ) for leaderboard in leaderboards_result.items])
118
+
119
+ if current_page >= total_pages:
120
+ break
121
+
122
+ current_page += 1
123
+
124
+ return self.__leaderboards
125
+
126
+ def add_prompt(self, identifier: str, prompt: str):
127
+ """
128
+ Adds a prompt to the benchmark.
129
+ """
130
+ if not isinstance(identifier, str) or not isinstance(prompt, str):
131
+ raise ValueError("Identifier and prompt must be strings.")
132
+
133
+ if identifier in self.identifiers:
134
+ raise ValueError("Identifier already exists in the benchmark.")
135
+
136
+ self.__identifiers.append(identifier)
137
+ self.__prompts.append(prompt)
138
+
139
+ self.__openapi_service.benchmark_api.benchmark_benchmark_id_prompt_post(
140
+ benchmark_id=self.id,
141
+ submit_prompt_model=SubmitPromptModel(
142
+ identifier=identifier,
143
+ prompt=prompt,
144
+ )
145
+ )
146
+
147
+ def create_leaderboard(self, name: str, instruction: str, show_prompt: bool) -> RapidataLeaderboard:
148
+ """
149
+ Creates a new leaderboard for the benchmark.
150
+ """
151
+ leaderboard_result = self.__openapi_service.leaderboard_api.leaderboard_post(
152
+ create_leaderboard_model=CreateLeaderboardModel(
153
+ benchmarkId=self.id,
154
+ name=name,
155
+ instruction=instruction,
156
+ showPrompt=show_prompt
157
+ )
158
+ )
159
+
160
+ assert leaderboard_result.benchmark_id == self.id, "The leaderboard was not created for the correct benchmark."
161
+
162
+ return RapidataLeaderboard(
163
+ name,
164
+ instruction,
165
+ show_prompt,
166
+ leaderboard_result.id,
167
+ self.__openapi_service
168
+ )
169
+
170
+ def evaluate_model(self, name: str, media: list[str], identifiers: list[str]) -> None:
171
+ """
172
+ Evaluates a model on the benchmark across all leaderboards.
173
+
174
+ Args:
175
+ name: The name of the model.
176
+ media: The generated images/videos that will be used to evaluate the model.
177
+ identifiers: The identifiers that correspond to the media. The order of the identifiers must match the order of the media.
178
+ The identifiers that are used must be registered for the benchmark. To see the registered identifiers, use the identifiers property.
179
+ """
180
+ if not media:
181
+ raise ValueError("Media must be a non-empty list of strings")
182
+
183
+ if len(media) != len(identifiers):
184
+ raise ValueError("Media and identifiers must have the same length")
185
+
186
+ if not all(identifier in self.identifiers for identifier in identifiers):
187
+ raise ValueError("All identifiers must be in the registered identifiers list. To see the registered identifiers, use the identifiers property.\
188
+ \nTo see the prompts that are associated with the identifiers, use the prompts property.")
189
+
190
+ # happens before the creation of the participant to ensure all media paths are valid
191
+ assets = []
192
+ prompts_metadata: list[list[PromptIdentifierMetadata]] = []
193
+ for media_path, identifier in zip(media, identifiers):
194
+ assets.append(MediaAsset(media_path))
195
+ prompts_metadata.append([PromptIdentifierMetadata(identifier=identifier)])
196
+
197
+ participant_result = self.__openapi_service.benchmark_api.benchmark_benchmark_id_participants_post(
198
+ benchmark_id=self.id,
199
+ create_benchmark_participant_model=CreateBenchmarkParticipantModel(
200
+ name=name,
201
+ )
202
+ )
203
+
204
+ dataset = RapidataDataset(participant_result.dataset_id, self.__openapi_service)
205
+
206
+ try:
207
+ dataset._add_datapoints(assets, prompts_metadata)
208
+ except Exception as e:
209
+ logger.warning(f"An error occurred while adding datapoints to the dataset: {e}")
210
+ upload_progress = self.__openapi_service.dataset_api.dataset_dataset_id_progress_get(
211
+ dataset_id=dataset.id
212
+ )
213
+ if upload_progress.ready == 0:
214
+ raise RuntimeError("None of the media was uploaded successfully. Please check the media paths and try again.")
215
+
216
+ logger.warning(f"{upload_progress.failed} datapoints failed to upload. \n{upload_progress.ready} datapoints were uploaded successfully. \nEvaluation will continue with the uploaded datapoints.")
217
+
218
+ self.__openapi_service.benchmark_api.benchmark_benchmark_id_participants_participant_id_submit_post(
219
+ benchmark_id=self.id,
220
+ participant_id=participant_result.participant_id
221
+ )
222
+
223
+ def __str__(self) -> str:
224
+ return f"RapidataBenchmark(name={self.name}, id={self.id})"
225
+
226
+ def __repr__(self) -> str:
227
+ return self.__str__()
@@ -0,0 +1,83 @@
1
+ from rapidata.rapidata_client.benchmark.rapidata_benchmark import RapidataBenchmark
2
+ from rapidata.api_client.models.create_benchmark_model import CreateBenchmarkModel
3
+ from rapidata.service.openapi_service import OpenAPIService
4
+ from rapidata.api_client.models.query_model import QueryModel
5
+ from rapidata.api_client.models.page_info import PageInfo
6
+ from rapidata.api_client.models.root_filter import RootFilter
7
+ from rapidata.api_client.models.filter import Filter
8
+ from rapidata.api_client.models.sort_criterion import SortCriterion
9
+
10
+ class RapidataBenchmarkManager:
11
+ """
12
+ A manager for benchmarks.
13
+
14
+ Used to create and retrieve benchmarks.
15
+
16
+ A benchmark is a collection of leaderboards.
17
+
18
+ Args:
19
+ openapi_service: The OpenAPIService instance for API interaction.
20
+ """
21
+ def __init__(self, openapi_service: OpenAPIService):
22
+ self.__openapi_service = openapi_service
23
+
24
+ def create_new_benchmark(self,
25
+ name: str,
26
+ identifiers: list[str],
27
+ prompts: list[str],
28
+ ) -> RapidataBenchmark:
29
+ """
30
+ Creates a new benchmark with the given name, prompts, and leaderboards.
31
+
32
+ Args:
33
+ name: The name of the benchmark.
34
+ prompts: The prompts that will be registered for the benchmark.
35
+ """
36
+ if not isinstance(name, str):
37
+ raise ValueError("Name must be a string.")
38
+
39
+ if not isinstance(prompts, list) or not all(isinstance(prompt, str) for prompt in prompts):
40
+ raise ValueError("Prompts must be a list of strings.")
41
+
42
+ if not isinstance(identifiers, list) or not all(isinstance(identifier, str) for identifier in identifiers):
43
+ raise ValueError("Identifiers must be a list of strings.")
44
+
45
+ if len(identifiers) != len(prompts):
46
+ raise ValueError("Identifiers and prompts must have the same length.")
47
+
48
+ if len(set(identifiers)) != len(identifiers):
49
+ raise ValueError("Identifiers must be unique.")
50
+
51
+ benchmark_result = self.__openapi_service.benchmark_api.benchmark_post(
52
+ create_benchmark_model=CreateBenchmarkModel(
53
+ name=name,
54
+ )
55
+ )
56
+
57
+ benchmark = RapidataBenchmark(name, benchmark_result.id, self.__openapi_service)
58
+ for identifier, prompt in zip(identifiers, prompts):
59
+ benchmark.add_prompt(identifier, prompt)
60
+
61
+ return benchmark
62
+
63
+ def get_benchmark_by_id(self, id: str) -> RapidataBenchmark:
64
+ """
65
+ Returns a benchmark by its ID.
66
+ """
67
+ benchmark_result = self.__openapi_service.benchmark_api.benchmark_benchmark_id_get(
68
+ benchmark_id=id
69
+ )
70
+ return RapidataBenchmark(benchmark_result.name, benchmark_result.id, self.__openapi_service)
71
+
72
+ def find_benchmarks(self, name: str = "", amount: int = 10) -> list[RapidataBenchmark]:
73
+ """
74
+ Returns a list of benchmarks by their name.
75
+ """
76
+ benchmark_result = self.__openapi_service.benchmark_api.benchmarks_get(
77
+ QueryModel(
78
+ page=PageInfo(index=1, size=amount),
79
+ filter=RootFilter(filters=[Filter(field="Name", operator="Contains", value=name)]),
80
+ sortCriteria=[SortCriterion(direction="Desc", propertyName="CreatedAt")]
81
+ )
82
+ )
83
+ return [RapidataBenchmark(benchmark.name, benchmark.id, self.__openapi_service) for benchmark in benchmark_result.items]
@@ -1,7 +1,7 @@
1
1
  from typing import Any
2
2
  from rapidata.rapidata_client.filter._base_filter import RapidataFilter
3
3
  from rapidata.api_client.models.not_user_filter_model import NotUserFilterModel
4
- from rapidata.api_client.models.create_order_model_user_filters_inner import CreateOrderModelUserFiltersInner
4
+ from rapidata.api_client.models.and_user_filter_model_filters_inner import AndUserFilterModelFiltersInner
5
5
 
6
6
 
7
7
  class NotFilter(RapidataFilter):
@@ -27,4 +27,4 @@ class NotFilter(RapidataFilter):
27
27
  self.filter = filter
28
28
 
29
29
  def _to_model(self):
30
- return NotUserFilterModel(_t="NotFilter", filter=CreateOrderModelUserFiltersInner(self.filter._to_model()))
30
+ return NotUserFilterModel(_t="NotFilter", filter=AndUserFilterModelFiltersInner(self.filter._to_model()))
@@ -1,7 +1,7 @@
1
1
  from typing import Any
2
2
  from rapidata.rapidata_client.filter._base_filter import RapidataFilter
3
3
  from rapidata.api_client.models.or_user_filter_model import OrUserFilterModel
4
- from rapidata.api_client.models.create_order_model_user_filters_inner import CreateOrderModelUserFiltersInner
4
+ from rapidata.api_client.models.and_user_filter_model_filters_inner import AndUserFilterModelFiltersInner
5
5
 
6
6
 
7
7
  class OrFilter(RapidataFilter):
@@ -27,4 +27,4 @@ class OrFilter(RapidataFilter):
27
27
  self.filters = filters
28
28
 
29
29
  def _to_model(self):
30
- return OrUserFilterModel(_t="OrFilter", filters=[CreateOrderModelUserFiltersInner(filter._to_model()) for filter in self.filters])
30
+ return OrUserFilterModel(_t="OrFilter", filters=[AndUserFilterModelFiltersInner(filter._to_model()) for filter in self.filters])
@@ -4,3 +4,4 @@ from ._public_text_metadata import PublicTextMetadata
4
4
  from ._prompt_metadata import PromptMetadata
5
5
  from ._select_words_metadata import SelectWordsMetadata
6
6
  from ._media_asset_metadata import MediaAssetMetadata
7
+ from ._prompt_identifier_metadata import PromptIdentifierMetadata