rapidata 2.28.4__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.
- rapidata/__init__.py +1 -1
- rapidata/api_client/__init__.py +44 -17
- rapidata/api_client/api/__init__.py +1 -0
- rapidata/api_client/api/benchmark_api.py +2766 -0
- rapidata/api_client/api/campaign_api.py +0 -780
- rapidata/api_client/api/coco_api.py +0 -571
- rapidata/api_client/api/customer_rapid_api.py +332 -1
- rapidata/api_client/api/datapoint_api.py +0 -524
- rapidata/api_client/api/dataset_api.py +595 -2276
- rapidata/api_client/api/feedback_api.py +0 -270
- rapidata/api_client/api/identity_api.py +74 -888
- rapidata/api_client/api/leaderboard_api.py +1642 -259
- rapidata/api_client/api/order_api.py +617 -5692
- rapidata/api_client/api/pipeline_api.py +31 -334
- rapidata/api_client/api/validation_set_api.py +469 -3356
- rapidata/api_client/api/workflow_api.py +0 -799
- rapidata/api_client/models/__init__.py +43 -17
- rapidata/api_client/models/add_campaign_model.py +3 -3
- rapidata/api_client/models/add_validation_rapid_model.py +1 -3
- rapidata/api_client/models/add_validation_text_rapid_model.py +1 -3
- rapidata/api_client/models/and_user_filter_model.py +106 -0
- rapidata/api_client/models/and_user_filter_model_filters_inner.py +282 -0
- rapidata/api_client/models/benchmark_query_result.py +94 -0
- rapidata/api_client/models/benchmark_query_result_paged_result.py +105 -0
- rapidata/api_client/models/boost_leaderboard_model.py +89 -0
- rapidata/api_client/models/clone_order_model.py +2 -4
- rapidata/api_client/models/create_benchmark_model.py +87 -0
- rapidata/api_client/models/create_benchmark_participant_model.py +87 -0
- rapidata/api_client/models/create_benchmark_participant_result.py +89 -0
- rapidata/api_client/models/create_benchmark_result.py +87 -0
- rapidata/api_client/models/create_datapoint_result.py +4 -16
- rapidata/api_client/models/create_leaderboard_model.py +18 -2
- rapidata/api_client/models/create_leaderboard_result.py +5 -3
- rapidata/api_client/models/create_order_model.py +3 -3
- rapidata/api_client/models/file_asset_input.py +104 -0
- rapidata/api_client/models/file_asset_input1.py +104 -0
- rapidata/api_client/models/file_asset_input1_file.py +168 -0
- rapidata/api_client/models/file_asset_input2.py +104 -0
- rapidata/api_client/models/file_asset_input_file.py +182 -0
- rapidata/api_client/models/form_file_wrapper.py +120 -0
- rapidata/api_client/models/get_benchmark_by_id_query.py +96 -0
- rapidata/api_client/models/get_benchmark_by_id_query_result.py +94 -0
- rapidata/api_client/models/get_benchmark_by_id_query_result_paged_result.py +105 -0
- rapidata/api_client/models/get_benchmark_by_id_result.py +94 -0
- rapidata/api_client/models/get_participant_by_id_result.py +6 -22
- rapidata/api_client/models/get_standing_by_id_result.py +113 -0
- rapidata/api_client/models/get_validation_rapids_result.py +3 -3
- rapidata/api_client/models/get_workflow_results_result.py +3 -3
- rapidata/api_client/models/local_file_wrapper.py +120 -0
- rapidata/api_client/models/multi_asset_input.py +110 -0
- rapidata/api_client/models/multi_asset_input1.py +110 -0
- rapidata/api_client/models/multi_asset_input1_assets_inner.py +170 -0
- rapidata/api_client/models/multi_asset_input2.py +110 -0
- rapidata/api_client/models/multi_asset_input_assets_inner.py +170 -0
- rapidata/api_client/models/not_user_filter_model.py +3 -3
- rapidata/api_client/models/or_user_filter_model.py +3 -3
- rapidata/api_client/models/participant_by_benchmark.py +102 -0
- rapidata/api_client/models/participant_by_benchmark_paged_result.py +105 -0
- rapidata/api_client/models/participant_by_leaderboard.py +6 -2
- rapidata/api_client/models/participant_status.py +1 -4
- rapidata/api_client/models/pipeline_id_workflow_config_put_request.py +140 -0
- rapidata/api_client/models/potential_validation_rapid.py +103 -0
- rapidata/api_client/models/potential_validation_rapid_paged_result.py +105 -0
- rapidata/api_client/models/potential_validation_rapid_truth.py +280 -0
- rapidata/api_client/models/prompt_asset_metadata_input.py +3 -3
- rapidata/api_client/models/prompt_asset_metadata_input_asset.py +170 -0
- rapidata/api_client/models/prompt_by_benchmark_result.py +92 -0
- rapidata/api_client/models/prompt_by_benchmark_result_paged_result.py +105 -0
- rapidata/api_client/models/prompt_metadata_input.py +5 -3
- rapidata/api_client/models/proxy_file_wrapper.py +114 -0
- rapidata/api_client/models/query_validation_model.py +97 -0
- rapidata/api_client/models/rapid_model.py +3 -3
- rapidata/api_client/models/simple_workflow_config.py +3 -3
- rapidata/api_client/models/simple_workflow_model1.py +3 -3
- rapidata/api_client/models/standing_by_leaderboard.py +113 -0
- rapidata/api_client/models/standing_by_leaderboard_paged_result.py +105 -0
- rapidata/api_client/models/standing_status.py +38 -0
- rapidata/api_client/models/stream_file_wrapper.py +116 -0
- rapidata/api_client/models/submit_coco_model.py +1 -3
- rapidata/api_client/models/submit_prompt_model.py +89 -0
- rapidata/api_client/models/text_asset_input.py +100 -0
- rapidata/api_client/models/transcription_metadata_input.py +5 -3
- rapidata/api_client/models/validation_set_zip_post_request_blueprint.py +252 -0
- rapidata/api_client/models/zip_entry_file_wrapper.py +120 -0
- rapidata/api_client_README.md +67 -76
- rapidata/rapidata_client/benchmark/leaderboard/__init__.py +0 -0
- rapidata/rapidata_client/benchmark/leaderboard/rapidata_leaderboard.py +62 -0
- rapidata/rapidata_client/benchmark/rapidata_benchmark.py +227 -0
- rapidata/rapidata_client/benchmark/rapidata_benchmark_manager.py +83 -0
- rapidata/rapidata_client/filter/not_filter.py +2 -2
- rapidata/rapidata_client/filter/or_filter.py +2 -2
- rapidata/rapidata_client/metadata/__init__.py +1 -0
- rapidata/rapidata_client/metadata/_media_asset_metadata.py +8 -1
- rapidata/rapidata_client/metadata/_prompt_identifier_metadata.py +15 -0
- rapidata/rapidata_client/order/_rapidata_dataset.py +6 -6
- rapidata/rapidata_client/order/_rapidata_order_builder.py +4 -4
- rapidata/rapidata_client/order/rapidata_order.py +1 -1
- rapidata/rapidata_client/rapidata_client.py +3 -3
- rapidata/rapidata_client/validation/rapidata_validation_set.py +1 -1
- rapidata/rapidata_client/validation/rapids/rapids.py +4 -6
- rapidata/service/openapi_service.py +5 -0
- {rapidata-2.28.4.dist-info → rapidata-2.29.0.dist-info}/METADATA +1 -1
- {rapidata-2.28.4.dist-info → rapidata-2.29.0.dist-info}/RECORD +106 -57
- rapidata/rapidata_client/leaderboard/rapidata_leaderboard.py +0 -127
- rapidata/rapidata_client/leaderboard/rapidata_leaderboard_manager.py +0 -92
- /rapidata/rapidata_client/{leaderboard → benchmark}/__init__.py +0 -0
- {rapidata-2.28.4.dist-info → rapidata-2.29.0.dist-info}/LICENSE +0 -0
- {rapidata-2.28.4.dist-info → rapidata-2.29.0.dist-info}/WHEEL +0 -0
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
from rapidata.service.openapi_service import OpenAPIService
|
|
2
|
-
from rapidata.rapidata_client.leaderboard.rapidata_leaderboard import RapidataLeaderboard
|
|
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.root_filter import RootFilter
|
|
6
|
-
from rapidata.api_client.models.filter import Filter
|
|
7
|
-
from rapidata.api_client.models.sort_criterion import SortCriterion
|
|
8
|
-
from rapidata.api_client.models.create_leaderboard_model import CreateLeaderboardModel
|
|
9
|
-
|
|
10
|
-
class RapidataLeaderboardManager:
|
|
11
|
-
"""
|
|
12
|
-
A manager for leaderboards.
|
|
13
|
-
|
|
14
|
-
Used to create and retrieve leaderboards.
|
|
15
|
-
|
|
16
|
-
Args:
|
|
17
|
-
openapi_service: The OpenAPIService instance for API interaction.
|
|
18
|
-
"""
|
|
19
|
-
def __init__(self, openapi_service: OpenAPIService):
|
|
20
|
-
self.__openapi_service = openapi_service
|
|
21
|
-
|
|
22
|
-
def create_new_leaderboard(self, name: str, instruction: str, prompts: list[str], show_prompt: bool = False) -> RapidataLeaderboard:
|
|
23
|
-
"""
|
|
24
|
-
Creates a new leaderboard with the given name, instruction, and prompts.
|
|
25
|
-
|
|
26
|
-
Args:
|
|
27
|
-
leaderboard_name: The name of the leaderboard. Will be used to identify the leaderboard on the overview.
|
|
28
|
-
instruction: The instruction for the leaderboard. Will determine how the models will be evaluated.
|
|
29
|
-
prompts: The prompts for the leaderboard. Will be registered for the leaderboard and able to be retrieved again later.
|
|
30
|
-
show_prompt: Whether to show the prompt to the users when they are evaluating the models.
|
|
31
|
-
"""
|
|
32
|
-
if not isinstance(name, str):
|
|
33
|
-
raise ValueError("Name must be a string.")
|
|
34
|
-
|
|
35
|
-
if not isinstance(instruction, str):
|
|
36
|
-
raise ValueError("Instruction must be a string.")
|
|
37
|
-
|
|
38
|
-
if not isinstance(show_prompt, bool):
|
|
39
|
-
raise ValueError("Show prompt must be a boolean.")
|
|
40
|
-
|
|
41
|
-
if not isinstance(prompts, list) or not all(isinstance(prompt, str) for prompt in prompts):
|
|
42
|
-
raise ValueError("Prompts must be a list of strings.")
|
|
43
|
-
|
|
44
|
-
leaderboard_id = self.__register_new_leaderboard(name, instruction, show_prompt)
|
|
45
|
-
leaderboard = RapidataLeaderboard(name, instruction, show_prompt, leaderboard_id, self.__openapi_service)
|
|
46
|
-
leaderboard._register_prompts(prompts)
|
|
47
|
-
return leaderboard
|
|
48
|
-
|
|
49
|
-
def get_leaderboard_by_id(self, leaderboard_id: str) -> RapidataLeaderboard:
|
|
50
|
-
"""
|
|
51
|
-
Retrieves a leaderboard by its ID.
|
|
52
|
-
|
|
53
|
-
Args:
|
|
54
|
-
leaderboard_id: The ID of the leaderboard.
|
|
55
|
-
"""
|
|
56
|
-
leaderboard_result = self.__openapi_service.leaderboard_api.leaderboard_leaderboard_id_get(
|
|
57
|
-
leaderboard_id=leaderboard_id
|
|
58
|
-
)
|
|
59
|
-
return RapidataLeaderboard(leaderboard_result.name, leaderboard_result.instruction, leaderboard_result.show_prompt, leaderboard_id, self.__openapi_service)
|
|
60
|
-
|
|
61
|
-
def find_leaderboards(self, name: str = "", amount: int = 10) -> list[RapidataLeaderboard]:
|
|
62
|
-
"""
|
|
63
|
-
Find your recent leaderboards given criteria. If nothing is provided, it will return the most recent leaderboard.
|
|
64
|
-
|
|
65
|
-
Args:
|
|
66
|
-
name (str, optional): The name of the leaderboard - matching leaderboard will contain the name. Defaults to "" for any leaderboard.
|
|
67
|
-
amount (int, optional): The amount of leaderboards to return. Defaults to 10.
|
|
68
|
-
"""
|
|
69
|
-
leaderboard_result = self.__openapi_service.leaderboard_api.leaderboards_get(
|
|
70
|
-
request=QueryModel(
|
|
71
|
-
page=PageInfo(
|
|
72
|
-
index=1,
|
|
73
|
-
size=amount
|
|
74
|
-
),
|
|
75
|
-
filter=RootFilter(filters=[Filter(field="Name", operator="Contains", value=name)]),
|
|
76
|
-
sortCriteria=[SortCriterion(direction="Desc", propertyName="CreatedAt")]
|
|
77
|
-
)
|
|
78
|
-
)
|
|
79
|
-
leaderboards = []
|
|
80
|
-
for leaderboard in leaderboard_result.items:
|
|
81
|
-
leaderboards.append(RapidataLeaderboard(leaderboard.name, leaderboard.instruction, leaderboard.show_prompt, leaderboard.id, self.__openapi_service))
|
|
82
|
-
return leaderboards
|
|
83
|
-
|
|
84
|
-
def __register_new_leaderboard(self, name: str, instruction: str, show_prompt: bool) -> str:
|
|
85
|
-
leaderboard_id = self.__openapi_service.leaderboard_api.leaderboard_post(
|
|
86
|
-
CreateLeaderboardModel(
|
|
87
|
-
name=name,
|
|
88
|
-
instruction=instruction,
|
|
89
|
-
showPrompt=show_prompt
|
|
90
|
-
)
|
|
91
|
-
).id
|
|
92
|
-
return leaderboard_id
|
|
File without changes
|
|
File without changes
|
|
File without changes
|