rapidata 2.31.0__py3-none-any.whl → 2.31.2__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.

@@ -109,6 +109,7 @@ from rapidata.api_client.models.create_order_model_referee import CreateOrderMod
109
109
  from rapidata.api_client.models.create_order_model_workflow import CreateOrderModelWorkflow
110
110
  from rapidata.api_client.models.create_order_result import CreateOrderResult
111
111
  from rapidata.api_client.models.create_rapid_result import CreateRapidResult
112
+ from rapidata.api_client.models.create_sample_model import CreateSampleModel
112
113
  from rapidata.api_client.models.create_simple_pipeline_model import CreateSimplePipelineModel
113
114
  from rapidata.api_client.models.create_simple_pipeline_model_artifacts_inner import CreateSimplePipelineModelArtifactsInner
114
115
  from rapidata.api_client.models.create_simple_pipeline_model_pipeline_steps_inner import CreateSimplePipelineModelPipelineStepsInner
@@ -0,0 +1,87 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class CreateSampleModel(BaseModel):
26
+ """
27
+ The model used to create a sample to a participant.
28
+ """ # noqa: E501
29
+ identifier: StrictStr = Field(description="The identifier used to correlate samples of different participants.")
30
+ __properties: ClassVar[List[str]] = ["identifier"]
31
+
32
+ model_config = ConfigDict(
33
+ populate_by_name=True,
34
+ validate_assignment=True,
35
+ protected_namespaces=(),
36
+ )
37
+
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.model_dump(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of CreateSampleModel from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ """
63
+ excluded_fields: Set[str] = set([
64
+ ])
65
+
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude=excluded_fields,
69
+ exclude_none=True,
70
+ )
71
+ return _dict
72
+
73
+ @classmethod
74
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
+ """Create an instance of CreateSampleModel from a dict"""
76
+ if obj is None:
77
+ return None
78
+
79
+ if not isinstance(obj, dict):
80
+ return cls.model_validate(obj)
81
+
82
+ _obj = cls.model_validate({
83
+ "identifier": obj.get("identifier")
84
+ })
85
+ return _obj
86
+
87
+
@@ -76,7 +76,6 @@ Class | Method | HTTP request | Description
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
77
  *BenchmarkApi* | [**benchmark_benchmark_id_name_put**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_name_put) | **PUT** /benchmark/{benchmarkId}/name | Updates the name of a benchmark.
78
78
  *BenchmarkApi* | [**benchmark_benchmark_id_participant_participant_id_delete**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_participant_participant_id_delete) | **DELETE** /benchmark/{benchmarkId}/participant/{participantId} | Deletes a participant on a benchmark.
79
- *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.
80
79
  *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
81
80
  *BenchmarkApi* | [**benchmark_benchmark_id_participants_participant_id_disable_post**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_participants_participant_id_disable_post) | **POST** /benchmark/{benchmarkId}/participants/{participantId}/disable | This endpoint disables a participant in a benchmark. this means that the participant will no longer actively be matched up against other participants and not collect further results. It will still be visible in the leaderboard.
82
81
  *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.
@@ -163,6 +162,11 @@ Class | Method | HTTP request | Description
163
162
  *OrderApi* | [**order_unsupported_post**](rapidata/api_client/docs/OrderApi.md#order_unsupported_post) | **POST** /order/unsupported | Notifies the admins that a user wants to create an order with an unsupported label type or data type.
164
163
  *OrderApi* | [**orders_get**](rapidata/api_client/docs/OrderApi.md#orders_get) | **GET** /orders | Queries orders based on a filter, page, and sort criteria.
165
164
  *OrderApi* | [**orders_public_get**](rapidata/api_client/docs/OrderApi.md#orders_public_get) | **GET** /orders/public | Retrieves orders that are public and can be cloned by any user.
165
+ *ParticipantApi* | [**participant_participant_id_delete**](rapidata/api_client/docs/ParticipantApi.md#participant_participant_id_delete) | **DELETE** /participant/{participantId} | Deletes a participant on a benchmark.
166
+ *ParticipantApi* | [**participant_participant_id_get**](rapidata/api_client/docs/ParticipantApi.md#participant_participant_id_get) | **GET** /participant/{participantId} | Gets a participant by it's Id.
167
+ *ParticipantApi* | [**participant_participant_id_sample_post**](rapidata/api_client/docs/ParticipantApi.md#participant_participant_id_sample_post) | **POST** /participant/{participantId}/sample | Adds a sample to a participant.
168
+ *ParticipantApi* | [**participant_sample_sample_id_delete**](rapidata/api_client/docs/ParticipantApi.md#participant_sample_sample_id_delete) | **DELETE** /participant-sample/{sampleId} | Deletes a sample.
169
+ *ParticipantApi* | [**participants_participant_id_submit_post**](rapidata/api_client/docs/ParticipantApi.md#participants_participant_id_submit_post) | **POST** /participants/{participantId}/submit | Submits a participant to a benchmark.
166
170
  *PipelineApi* | [**pipeline_id_workflow_config_artifact_id_put**](rapidata/api_client/docs/PipelineApi.md#pipeline_id_workflow_config_artifact_id_put) | **PUT** /pipeline/{id}/workflow-config/{artifactId} | Updates the workflow configuration for a pipeline.
167
171
  *PipelineApi* | [**pipeline_id_workflow_config_put**](rapidata/api_client/docs/PipelineApi.md#pipeline_id_workflow_config_put) | **PUT** /pipeline/{id}/workflow-config | Updates the workflow configuration for a pipeline.
168
172
  *PipelineApi* | [**pipeline_pipeline_id_campaign_artifact_id_put**](rapidata/api_client/docs/PipelineApi.md#pipeline_pipeline_id_campaign_artifact_id_put) | **PUT** /pipeline/{pipelineId}/campaign/{artifactId} | Updates a specific campaign for a pipeline.
@@ -297,6 +301,7 @@ Class | Method | HTTP request | Description
297
301
  - [CreateOrderModelWorkflow](rapidata/api_client/docs/CreateOrderModelWorkflow.md)
298
302
  - [CreateOrderResult](rapidata/api_client/docs/CreateOrderResult.md)
299
303
  - [CreateRapidResult](rapidata/api_client/docs/CreateRapidResult.md)
304
+ - [CreateSampleModel](rapidata/api_client/docs/CreateSampleModel.md)
300
305
  - [CreateSimplePipelineModel](rapidata/api_client/docs/CreateSimplePipelineModel.md)
301
306
  - [CreateSimplePipelineModelArtifactsInner](rapidata/api_client/docs/CreateSimplePipelineModelArtifactsInner.md)
302
307
  - [CreateSimplePipelineModelPipelineStepsInner](rapidata/api_client/docs/CreateSimplePipelineModelPipelineStepsInner.md)
@@ -1,4 +1,5 @@
1
1
  class RapidataDataTypes:
2
+ # deprecated use Literal["media", "text"] instead
2
3
  MEDIA = "media" # any form of image, video or audio
3
4
  TEXT = "text"
4
5
 
@@ -37,8 +37,8 @@ class RapidataFilters:
37
37
  This ensures the order is only shown to users in the US and Germany whose phones are set to English.
38
38
 
39
39
  Info:
40
- The or and not filter support the | and ~ operators respectively.
41
- The and is given by the elements in the list.
40
+ The OR, AND and NOT filter support the |, & and ~ operators respectively.
41
+ The AND is additionally given by the elements in the list.
42
42
 
43
43
  ```python
44
44
  from rapidata import AgeFilter, LanguageFilter, CountryFilter
@@ -1,9 +1,7 @@
1
- from typing import Sequence, Optional
2
- from urllib3._collections import HTTPHeaderDict # type: ignore[import]
1
+ from typing import Sequence, Optional, Literal
3
2
  from itertools import zip_longest
4
3
 
5
4
  from rapidata.service.openapi_service import OpenAPIService
6
- from rapidata.rapidata_client.assets.data_type_enum import RapidataDataTypes
7
5
  from rapidata.rapidata_client.order.rapidata_order import RapidataOrder
8
6
  from rapidata.rapidata_client.order._rapidata_order_builder import RapidataOrderBuilder
9
7
  from rapidata.rapidata_client.metadata import PromptMetadata, SelectWordsMetadata, PrivateTextMetadata, MediaAssetMetadata, Metadata
@@ -21,8 +19,6 @@ from rapidata.rapidata_client.workflow import (
21
19
  TimestampWorkflow,
22
20
  RankingWorkflow
23
21
  )
24
- from rapidata.rapidata_client.selection.validation_selection import ValidationSelection
25
- from rapidata.rapidata_client.selection.labeling_selection import LabelingSelection
26
22
  from rapidata.rapidata_client.assets import MediaAsset, TextAsset, MultiAsset
27
23
  from rapidata.rapidata_client.filter import RapidataFilter
28
24
  from rapidata.rapidata_client.filter.rapidata_filters import RapidataFilters
@@ -140,7 +136,7 @@ class RapidataOrderManager:
140
136
  instruction: str,
141
137
  answer_options: list[str],
142
138
  datapoints: list[str],
143
- data_type: str = RapidataDataTypes.MEDIA,
139
+ data_type: Literal["media", "text"] = "media",
144
140
  responses_per_datapoint: int = 10,
145
141
  contexts: list[str] | None = None,
146
142
  media_contexts: list[str] | None = None,
@@ -161,8 +157,8 @@ class RapidataOrderManager:
161
157
  instruction (str): The instruction for how the data should be classified.
162
158
  answer_options (list[str]): The list of options for the classification.
163
159
  datapoints (list[str]): The list of datapoints for the classification - each datapoint will be labeled.
164
- data_type (str, optional): The data type of the datapoints. Defaults to RapidataDataTypes.MEDIA. \n
165
- Other option: RapidataDataTypes.TEXT ("text").
160
+ data_type (str, optional): The data type of the datapoints. Defaults to "media" (any form of image, video or audio). \n
161
+ Other option: "text".
166
162
  responses_per_datapoint (int, optional): The number of responses that will be collected per datapoint. Defaults to 10.
167
163
  contexts (list[str], optional): The list of contexts for the classification. Defaults to None.\n
168
164
  If provided has to be the same length as datapoints and will be shown in addition to the instruction and options. (Therefore will be different for each datapoint)
@@ -181,12 +177,12 @@ class RapidataOrderManager:
181
177
  This will NOT be shown to the labelers but will be included in the result purely for your own reference.
182
178
  """
183
179
 
184
- if data_type == RapidataDataTypes.MEDIA:
180
+ if data_type == "media":
185
181
  assets = [MediaAsset(path=path) for path in datapoints]
186
- elif data_type == RapidataDataTypes.TEXT:
182
+ elif data_type == "text":
187
183
  assets = [TextAsset(text=text) for text in datapoints]
188
184
  else:
189
- raise ValueError(f"Unsupported data type: {data_type}, must be one of {RapidataDataTypes._possible_values()}")
185
+ raise ValueError(f"Unsupported data type: {data_type}, must be one of 'media' or 'text'")
190
186
 
191
187
  return self._create_general_order(
192
188
  name=name,
@@ -210,7 +206,7 @@ class RapidataOrderManager:
210
206
  name: str,
211
207
  instruction: str,
212
208
  datapoints: list[list[str]],
213
- data_type: str = RapidataDataTypes.MEDIA,
209
+ data_type: Literal["media", "text"] = "media",
214
210
  responses_per_datapoint: int = 10,
215
211
  contexts: list[str] | None = None,
216
212
  media_contexts: list[str] | None = None,
@@ -229,8 +225,8 @@ class RapidataOrderManager:
229
225
  name (str): The name of the order. (Will not be shown to the labeler)
230
226
  instruction (str): The instruction for the comparison. Will be shown along side each datapoint.
231
227
  datapoints (list[list[str]]): Outher list is the datapoints, inner list is the options for the comparison - each datapoint will be labeled.
232
- data_type (str, optional): The data type of the datapoints. Defaults to RapidataDataTypes.MEDIA. \n
233
- Other option: RapidataDataTypes.TEXT ("text").
228
+ data_type (str, optional): The data type of the datapoints. Defaults to "media" (any form of image, video or audio). \n
229
+ Other option: "text".
234
230
  responses_per_datapoint (int, optional): The number of responses that will be collected per datapoint. Defaults to 10.
235
231
  contexts (list[str], optional): The list of contexts for the comparison. Defaults to None.\n
236
232
  If provided has to be the same length as datapoints and will be shown in addition to the instruction. (Therefore will be different for each datapoint)
@@ -256,12 +252,12 @@ class RapidataOrderManager:
256
252
  if any(len(datapoint) != 2 for datapoint in datapoints):
257
253
  raise ValueError("Each datapoint must contain exactly two options")
258
254
 
259
- if data_type == RapidataDataTypes.MEDIA:
255
+ if data_type == "media":
260
256
  assets = [MultiAsset([MediaAsset(path=path) for path in datapoint]) for datapoint in datapoints]
261
- elif data_type == RapidataDataTypes.TEXT:
257
+ elif data_type == "text":
262
258
  assets = [MultiAsset([TextAsset(text=text) for text in datapoint]) for datapoint in datapoints]
263
259
  else:
264
- raise ValueError(f"Unsupported data type: {data_type}, must be one of {RapidataDataTypes._possible_values()}")
260
+ raise ValueError(f"Unsupported data type: {data_type}, must be one of 'media' or 'text'")
265
261
 
266
262
  return self._create_general_order(
267
263
  name=name,
@@ -286,7 +282,7 @@ class RapidataOrderManager:
286
282
  datapoints: list[str],
287
283
  total_comparison_budget: int,
288
284
  responses_per_comparison: int = 1,
289
- data_type: str = RapidataDataTypes.MEDIA,
285
+ data_type: Literal["media", "text"] = "media",
290
286
  random_comparisons_ratio: float = 0.5,
291
287
  context: Optional[str] = None,
292
288
  validation_set_id: Optional[str] = None,
@@ -306,8 +302,8 @@ class RapidataOrderManager:
306
302
  datapoints (list[str]): A list of datapoints that will participate in the ranking.
307
303
  total_comparison_budget (int): The total number of (pairwise-)comparisons that can be made.
308
304
  responses_per_comparison (int, optional): The number of responses collected per comparison. Defaults to 1.
309
- data_type (str, optional): The data type of the datapoints. Defaults to RapidataDataTypes.MEDIA. \n
310
- Other option: RapidataDataTypes.TEXT ("text").
305
+ data_type (str, optional): The data type of the datapoints. Defaults to "media" (any form of image, video or audio). \n
306
+ Other option: "text".
311
307
  random_comparisons_ratio (float, optional): The fraction of random comparisons in the ranking process.
312
308
  The rest will focus on pairing similarly ranked datapoints. Defaults to 0.5 and can be left untouched.
313
309
  context (str, optional): The context for all the comparison. Defaults to None.\n
@@ -319,12 +315,12 @@ class RapidataOrderManager:
319
315
  selections (Sequence[RapidataSelection], optional): The list of selections for the order. Defaults to []. Decides in what order the tasks should be shown.
320
316
  """
321
317
 
322
- if data_type == RapidataDataTypes.MEDIA:
318
+ if data_type == "media":
323
319
  assets = [MediaAsset(path=path) for path in datapoints]
324
- elif data_type == RapidataDataTypes.TEXT:
320
+ elif data_type == "text":
325
321
  assets = [TextAsset(text=text) for text in datapoints]
326
322
  else:
327
- raise ValueError(f"Unsupported data type: {data_type}, must be one of {RapidataDataTypes._possible_values()}")
323
+ raise ValueError(f"Unsupported data type: {data_type}, must be one of 'media' or 'text'")
328
324
 
329
325
  return self._create_general_order(
330
326
  name=name,
@@ -346,7 +342,7 @@ class RapidataOrderManager:
346
342
  name: str,
347
343
  instruction: str,
348
344
  datapoints: list[str],
349
- data_type: str = RapidataDataTypes.MEDIA,
345
+ data_type: Literal["media", "text"] = "media",
350
346
  responses_per_datapoint: int = 10,
351
347
  filters: Sequence[RapidataFilter] = [],
352
348
  settings: Sequence[RapidataSetting] = [],
@@ -362,8 +358,8 @@ class RapidataOrderManager:
362
358
  name (str): The name of the order.
363
359
  instruction (str): The instruction to answer with free text. Will be shown along side each datapoint.
364
360
  datapoints (list[str]): The list of datapoints for the free text - each datapoint will be labeled.
365
- data_type (str, optional): The data type of the datapoints. Defaults to RapidataDataTypes.MEDIA. \n
366
- Other option: RapidataDataTypes.TEXT ("text").
361
+ data_type (str, optional): The data type of the datapoints. Defaults to "media" (any form of image, video or audio). \n
362
+ Other option: "text".
367
363
  responses_per_datapoint (int, optional): The number of responses that will be collected per datapoint. Defaults to 10.
368
364
  filters (Sequence[RapidataFilter], optional): The list of filters for the free text. Defaults to []. Decides who the tasks should be shown to.
369
365
  settings (Sequence[RapidataSetting], optional): The list of settings for the free text. Defaults to []. Decides how the tasks should be shown.
@@ -373,12 +369,12 @@ class RapidataOrderManager:
373
369
  This will NOT be shown to the labelers but will be included in the result purely for your own reference.
374
370
  """
375
371
 
376
- if data_type == RapidataDataTypes.MEDIA:
372
+ if data_type == "media":
377
373
  assets = [MediaAsset(path=path) for path in datapoints]
378
- elif data_type == RapidataDataTypes.TEXT:
374
+ elif data_type == "text":
379
375
  assets = [TextAsset(text=text) for text in datapoints]
380
376
  else:
381
- raise ValueError(f"Unsupported data type: {data_type}, must be one of {RapidataDataTypes._possible_values()}")
377
+ raise ValueError(f"Unsupported data type: {data_type}, must be one of 'media' or 'text'")
382
378
 
383
379
  return self._create_general_order(
384
380
  name=name,
@@ -44,7 +44,7 @@ class Rapid():
44
44
  openapi_service.validation_api.validation_set_validation_set_id_rapid_post(
45
45
  validation_set_id=validationSetId,
46
46
  model=model,
47
- files=[asset.to_file() for asset in files],
47
+ files=[asset.to_file() for asset in files if asset.is_local()],
48
48
  urls=[asset.path for asset in files if not asset.is_local()]
49
49
  )
50
50
 
@@ -1,11 +1,10 @@
1
1
  import os
2
2
  from rapidata.api_client import AttachCategoryTruth, BoundingBoxTruth, BoxShape, ClassifyPayload, ComparePayload, CompareTruth, LinePayload, LocateBoxTruth, LocatePayload, ScrubPayload, ScrubRange, ScrubTruth, TranscriptionPayload, TranscriptionTruth, TranscriptionWord
3
- from rapidata.rapidata_client.assets.data_type_enum import RapidataDataTypes
4
3
  from rapidata.rapidata_client.assets import MediaAsset, TextAsset, MultiAsset
5
4
  from rapidata.rapidata_client.metadata import Metadata
6
5
  from rapidata.rapidata_client.validation.rapids.box import Box
7
6
 
8
- from typing import Sequence
7
+ from typing import Sequence, Literal
9
8
 
10
9
  from rapidata.rapidata_client.validation.rapids.rapids import Rapid
11
10
 
@@ -21,7 +20,7 @@ class RapidsManager:
21
20
  answer_options: list[str],
22
21
  datapoint: str,
23
22
  truths: list[str],
24
- data_type: str = RapidataDataTypes.MEDIA,
23
+ data_type: Literal["media", "text"] = "media",
25
24
  metadata: Sequence[Metadata] = [],
26
25
  explanation: str | None = None,
27
26
  ) -> Rapid:
@@ -32,16 +31,16 @@ class RapidsManager:
32
31
  answer_options (list[str]): The options that the labeler can choose from to answer the question.
33
32
  datapoint (str): The datapoint that the labeler will be labeling.
34
33
  truths (list[str]): The correct answers to the question.
35
- data_type (str, optional): The type of the datapoint. Defaults to RapidataDataTypes.MEDIA.
34
+ data_type (str, optional): The type of the datapoint. Defaults to "media" (any form of image, video or audio).
36
35
  metadata (Sequence[Metadata], optional): The metadata that is attached to the rapid. Defaults to [].
37
36
  """
38
37
 
39
- if data_type == RapidataDataTypes.MEDIA:
38
+ if data_type == "media":
40
39
  asset = MediaAsset(datapoint)
41
- elif data_type == RapidataDataTypes.TEXT:
40
+ elif data_type == "text":
42
41
  asset = TextAsset(datapoint)
43
42
  else:
44
- raise ValueError(f"Unsupported data type: {data_type}")
43
+ raise ValueError(f"Unsupported data type: {data_type}, must be one of 'media' or 'text'")
45
44
 
46
45
  if not isinstance(truths, list):
47
46
  raise ValueError("Truths must be a list of strings")
@@ -69,7 +68,7 @@ class RapidsManager:
69
68
  instruction: str,
70
69
  truth: str,
71
70
  datapoint: list[str],
72
- data_type: str = RapidataDataTypes.MEDIA,
71
+ data_type: Literal["media", "text"] = "media",
73
72
  metadata: Sequence[Metadata] = [],
74
73
  explanation: str | None = None,
75
74
  ) -> Rapid:
@@ -79,13 +78,13 @@ class RapidsManager:
79
78
  instruction (str): The instruction that the labeler will be comparing the assets on.
80
79
  truth (str): The correct answer to the comparison. (has to be one of the assets)
81
80
  datapoint (list[str]): The two assets that the labeler will be comparing.
82
- data_type (str, optional): The type of the datapoint. Defaults to RapidataDataTypes.MEDIA.
81
+ data_type (str, optional): The type of the datapoint. Defaults to "media" (any form of image, video or audio).
83
82
  metadata (Sequence[Metadata], optional): The metadata that is attached to the rapid. Defaults to [].
84
83
  """
85
84
 
86
- if data_type == RapidataDataTypes.MEDIA:
85
+ if data_type == "media":
87
86
  assets = [MediaAsset(image) for image in datapoint]
88
- elif data_type == RapidataDataTypes.TEXT:
87
+ elif data_type == "text":
89
88
  assets = [TextAsset(text) for text in datapoint]
90
89
  else:
91
90
  raise ValueError(f"Unsupported data type: {data_type}")
@@ -1,8 +1,8 @@
1
+ from typing import Literal
1
2
  from rapidata.api_client import QueryModel
2
3
  from rapidata.rapidata_client.validation.rapidata_validation_set import RapidataValidationSet
3
4
  from rapidata.api_client.models.create_validation_set_model import CreateValidationSetModel
4
5
  from rapidata.service.openapi_service import OpenAPIService
5
- from rapidata.rapidata_client.assets.data_type_enum import RapidataDataTypes
6
6
  from rapidata.rapidata_client.validation.rapids.rapids_manager import RapidsManager
7
7
  from rapidata.rapidata_client.validation.rapids.rapids import Rapid
8
8
  from rapidata.rapidata_client.metadata import PromptMetadata, MediaAssetMetadata
@@ -36,7 +36,7 @@ class ValidationSetManager:
36
36
  answer_options: list[str],
37
37
  datapoints: list[str],
38
38
  truths: list[list[str]],
39
- data_type: str = RapidataDataTypes.MEDIA,
39
+ data_type: Literal["media", "text"] = "media",
40
40
  contexts: list[str] | None = None,
41
41
  media_contexts: list[str] | None = None,
42
42
  explanations: list[str | None] | None = None,
@@ -54,7 +54,7 @@ class ValidationSetManager:
54
54
  options: ["yes", "no", "maybe"]
55
55
  datapoints: ["datapoint1", "datapoint2"]
56
56
  truths: [["yes"], ["no", "maybe"]] -> first datapoint correct answer is "yes", second datapoint is "no" or "maybe"
57
- data_type (str, optional): The type of data. Defaults to RapidataDataTypes.MEDIA. Other option: RapidataDataTypes.TEXT ("text").
57
+ data_type (str, optional): The type of data. Defaults to "media" (any form of image, video or audio). Other option: "text".
58
58
  contexts (list[str], optional): The contexts for each datapoint. Defaults to None.\n
59
59
  If provided has to be the same length as datapoints and will be shown in addition to the instruction and answer options. (Therefore will be different for each datapoint)
60
60
  Will be match up with the datapoints using the list index.
@@ -119,7 +119,7 @@ class ValidationSetManager:
119
119
  instruction: str,
120
120
  datapoints: list[list[str]],
121
121
  truths: list[str],
122
- data_type: str = RapidataDataTypes.MEDIA,
122
+ data_type: Literal["media", "text"] = "media",
123
123
  contexts: list[str] | None = None,
124
124
  media_contexts: list[str] | None = None,
125
125
  explanation: list[str | None] | None = None,
@@ -137,7 +137,7 @@ class ValidationSetManager:
137
137
  truths: ["image1.jpg", "image4.jpg"] -> first comparison image1.jpg has a cat, second comparison image4.jpg has a cat
138
138
  datapoints (list[list[str]]): The compare datapoints to create the validation set with.
139
139
  Outer list is for each comparison, inner list the two images/texts that will be compared.
140
- data_type (str, optional): The type of data. Defaults to RapidataDataTypes.MEDIA. Other option: RapidataDataTypes.TEXT ("text").
140
+ data_type (str, optional): The type of data. Defaults to "media" (any form of image, video or audio). Other option: "text".
141
141
  contexts (list[str], optional): The contexts for each datapoint. Defaults to None.\n
142
142
  If provided has to be the same length as datapoints and will be shown in addition to the instruction and truth. (Therefore will be different for each datapoint)
143
143
  Will be match up with the datapoints using the list index.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: rapidata
3
- Version: 2.31.0
3
+ Version: 2.31.2
4
4
  Summary: Rapidata package containing the Rapidata Python Client to interact with the Rapidata Web API in an easy way.
5
5
  License: Apache-2.0
6
6
  Author: Rapidata AG
@@ -1,7 +1,7 @@
1
- rapidata/__init__.py,sha256=1J7X3wXGT2IlF9-Mt576ztUEGkXceBvfVxybgbO52wE,865
2
- rapidata/api_client/__init__.py,sha256=BgSOExnifSldFqbuk1ZWdHbrLKlntelU0IjKYUFf3MM,33738
3
- rapidata/api_client/api/__init__.py,sha256=V_nI5gljvhY0TmFLOdzpys9e1l9J6PokA8IxeYmynyg,1422
4
- rapidata/api_client/api/benchmark_api.py,sha256=1TzLL4lratyFaFbNiCtfW8l_yIRRil4u6xpvM0250UE,140976
1
+ rapidata/__init__.py,sha256=9zyk6BW1q7xJJLiOcamEdO068ieM1eeWdrwsNKnABBA,865
2
+ rapidata/api_client/__init__.py,sha256=bnGUWzPGaDhjFiRafYK3n8XNtHV_hr0C6yKNKmExsaE,33882
3
+ rapidata/api_client/api/__init__.py,sha256=qjLeeJSnuPF_ar_nLknjnOqStBQnoCiz-O_rfZUBZrE,1489
4
+ rapidata/api_client/api/benchmark_api.py,sha256=QB2smhWy12mZakh1aGlUH5d5DA0MbEJGdJy8mQToJnU,130931
5
5
  rapidata/api_client/api/campaign_api.py,sha256=406gNDALFb0sJhfx727ZM5_0GDX4iB0w5ym2dExLm4g,49894
6
6
  rapidata/api_client/api/client_api.py,sha256=KKgUrEKfqmEAqUCRqcYKRb6G3GLwD6R-JSUsShmo7r8,54313
7
7
  rapidata/api_client/api/coco_api.py,sha256=d1ypa-JfIoPFEJwn3l-INZM5bS2wB1ifuJuvYXLSRC4,24165
@@ -15,6 +15,7 @@ rapidata/api_client/api/identity_api.py,sha256=LmK6cTXssNjCa1BteOMc8P4FsyRiHQ_Kr
15
15
  rapidata/api_client/api/leaderboard_api.py,sha256=7h-nUh8EhMo84slSRE2EErZr9rRxiN6P0TBEHFKSIb8,177224
16
16
  rapidata/api_client/api/newsletter_api.py,sha256=3NU6HO5Gtm-RH-nx5hcp2CCE4IZmWHwTfCLMMz-Xpq4,22655
17
17
  rapidata/api_client/api/order_api.py,sha256=BfMsOGSovNizk1prukw18wH1-e0LrmmsCJy-vQhZdq4,210747
18
+ rapidata/api_client/api/participant_api.py,sha256=YEwqQNwkpJlKMJ_tVf6FsUfRdq2URUugoJsO5w2x8Lg,54944
18
19
  rapidata/api_client/api/pipeline_api.py,sha256=s1_0GG3Rr-_yFzZ0TcBAgNGVrbQX_cjx2tnv3-1CmZw,96625
19
20
  rapidata/api_client/api/rapid_api.py,sha256=2omzmCbZxfseGTwEMFGESrkSH-FlkP0JmqIWJqgm8fM,97187
20
21
  rapidata/api_client/api/rapidata_identity_api_api.py,sha256=-kgoDuLdh-R4MQ7JPi3kQ0WDFKbmI0MkCjxwHXBmksA,9824
@@ -27,7 +28,7 @@ rapidata/api_client/api_client.py,sha256=EDhxAOUc5JFWvFsF1zc726Q7GoEFkuB8uor5SlG
27
28
  rapidata/api_client/api_response.py,sha256=eMxw1mpmJcoGZ3gs9z6jM4oYoZ10Gjk333s9sKxGv7s,652
28
29
  rapidata/api_client/configuration.py,sha256=g472vHVPLBotq8EkfSXP4sbp7xnn-3sb8O8BBlRWK1I,15931
29
30
  rapidata/api_client/exceptions.py,sha256=eLLd1fxM0Ygf3IIG6aNx9hdy79drst5Cem0UjI_NamM,5978
30
- rapidata/api_client/models/__init__.py,sha256=HnxPQRDj_6h0FLeItYyO5anP8kxqMI53cWuzCDKfRYM,31775
31
+ rapidata/api_client/models/__init__.py,sha256=2aRs3QoYG90e4vTVqsQI1R5yIKRS3LhG8vAhjLPrwJk,31852
31
32
  rapidata/api_client/models/ab_test_selection.py,sha256=xQcE1BgKSnkTcmIuroeVOAQcAhGkHLlMP9XjakMFgDc,4327
32
33
  rapidata/api_client/models/ab_test_selection_a_inner.py,sha256=VsCi27NBGxAtupB_sQZCzUEsTNNgSGV_Mo-Fi0UY1Jw,11657
33
34
  rapidata/api_client/models/add_campaign_artifact_result.py,sha256=4IvFVS-tLlL6eHsWp-IZ_ul5T30-h3YEwd2B5ioBbgY,2582
@@ -154,6 +155,7 @@ rapidata/api_client/models/create_order_model_user_filters_inner.py,sha256=o_VLp
154
155
  rapidata/api_client/models/create_order_model_workflow.py,sha256=cy7bD2kWvLkCgFdrViAG63xtYDIdVOn0dD74GRxni_A,6638
155
156
  rapidata/api_client/models/create_order_result.py,sha256=Mo6_p9rPw9h1BOOviBoGeEDHFAaz1Tu7syEzviRP7vc,3390
156
157
  rapidata/api_client/models/create_rapid_result.py,sha256=ECREjyzsTg6leWTF19E-QtqmyaTIeIZzpp_sO9iA4kY,2535
158
+ rapidata/api_client/models/create_sample_model.py,sha256=Xg4I0iqxbGqViXmyz0MVvFqqf7HLfgbIAoCrhzOasz8,2646
157
159
  rapidata/api_client/models/create_simple_pipeline_model.py,sha256=loLhevw-sZap22HDFGDF1aphPBznt1M-wBY31haihNY,4729
158
160
  rapidata/api_client/models/create_simple_pipeline_model_artifacts_inner.py,sha256=EvOz0EpU3RIfZ1rw6EGOkGiFzGi1Zm0YmeDKNQ7WWS8,5027
159
161
  rapidata/api_client/models/create_simple_pipeline_model_pipeline_steps_inner.py,sha256=6N8-Xsybow21NhHKVzKv-QDJR4rPZYkAzgorIVyTod4,8837
@@ -524,7 +526,7 @@ rapidata/api_client/models/workflow_split_model_filter_configs_inner.py,sha256=1
524
526
  rapidata/api_client/models/workflow_state.py,sha256=5LAK1se76RCoozeVB6oxMPb8p_5bhLZJqn7q5fFQWis,850
525
527
  rapidata/api_client/models/zip_entry_file_wrapper.py,sha256=06CoNJD3x511K3rnSmkrwwhc9GbQxwxF-c0ldOyJbAs,4240
526
528
  rapidata/api_client/rest.py,sha256=rtIMcgINZOUaDFaJIinJkXRSddNJmXvMRMfgO2Ezk2o,10835
527
- rapidata/api_client_README.md,sha256=xdgbo29fmH1jD1-o5U7eT9noDoh8yBQWextKrM4L1_k,59284
529
+ rapidata/api_client_README.md,sha256=gr0R771p4eGlwrWMcTdFATDBWpSpvkTp7R2lbu2Fl08,60177
528
530
  rapidata/rapidata_client/__init__.py,sha256=MLl41ZPDYezE9ookAjHS75wFqfCTOKq-U01GJbHFjrA,1133
529
531
  rapidata/rapidata_client/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
530
532
  rapidata/rapidata_client/api/rapidata_exception.py,sha256=BIdmHRrJUGW-Mqhp1H_suemZaR6w9TgjWq-ZW5iUPdQ,3878
@@ -534,7 +536,7 @@ rapidata/rapidata_client/assets/_media_asset.py,sha256=LEQtIPHNPVwuIA5ua_3x82aTt
534
536
  rapidata/rapidata_client/assets/_multi_asset.py,sha256=OzU5VxRh3Igku4HC60tEc0XECHh5C2k-k35AbqW7eG8,1842
535
537
  rapidata/rapidata_client/assets/_sessions.py,sha256=Dgcb61Q4gLwU5hurnv6sN2Jvw-ZV7vjhVWXog5Wq4aw,1094
536
538
  rapidata/rapidata_client/assets/_text_asset.py,sha256=bZHBrvbHSzF0qePoJ5LqYq__2ZDspzCeYi1nDbiIako,796
537
- rapidata/rapidata_client/assets/data_type_enum.py,sha256=ELC-ymeKnQlfNAzfqsI7MmUuRiGYamCHVcTc0qR6Fm4,185
539
+ rapidata/rapidata_client/assets/data_type_enum.py,sha256=v6gR2Wqenb9H_Bs6dKmUrkbjYRDD3tZmeoL5f8LlAcM,239
538
540
  rapidata/rapidata_client/benchmark/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
539
541
  rapidata/rapidata_client/benchmark/leaderboard/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
540
542
  rapidata/rapidata_client/benchmark/leaderboard/rapidata_leaderboard.py,sha256=BDI0xJkTumbZy4dYqkzXy074jC9eaVWoJJDZ84uvatE,3906
@@ -559,7 +561,7 @@ rapidata/rapidata_client/filter/models/gender.py,sha256=aXg6Kql2BIy8d5d1lCVi1axM
559
561
  rapidata/rapidata_client/filter/new_user_filter.py,sha256=qU7d6cSslGEO_N1tYPS4Ru3cGbQYH2_I5dJPNPHvtCM,369
560
562
  rapidata/rapidata_client/filter/not_filter.py,sha256=05uZMNPfguNPONP2uYYtuxx-5UAYdmc8gwSAEHMiK3k,1183
561
563
  rapidata/rapidata_client/filter/or_filter.py,sha256=EomsXyYec4beAA63LYfIsh8dO4So1duI7VlLW8VPfzY,1339
562
- rapidata/rapidata_client/filter/rapidata_filters.py,sha256=l_pPOA56f8hiacAgr3om5j6IpTP-BGOB247c_uhuYzM,2194
564
+ rapidata/rapidata_client/filter/rapidata_filters.py,sha256=4UqpfD2SfxVKRsxWL7uOf3sTeW7dpwxzOqLEMNHERWY,2215
563
565
  rapidata/rapidata_client/filter/response_count_filter.py,sha256=sDv9Dvy0FbnIQRSAxFGrUf9SIMISTNxnlAQcrFKBjXE,1989
564
566
  rapidata/rapidata_client/filter/user_score_filter.py,sha256=2C78zkWm5TnfkxGbV1ER2xB7s9ynpacaibzyRZKG8Cc,1566
565
567
  rapidata/rapidata_client/logging/__init__.py,sha256=4gLxePW8TvgYDZmPWMcf6fA8bEyu35vMKOmlPj5oXNE,110
@@ -577,7 +579,7 @@ rapidata/rapidata_client/order/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5
577
579
  rapidata/rapidata_client/order/_rapidata_dataset.py,sha256=5OIeIDvqAnb38KfjTsgj5JN7k5xKRhC-1_G-VulzO2c,21216
578
580
  rapidata/rapidata_client/order/_rapidata_order_builder.py,sha256=PyRXNazBffj98Qp7S09QmuIGzNTE-YoUhI8YEvlSCps,12838
579
581
  rapidata/rapidata_client/order/rapidata_order.py,sha256=bYTa7GtR_TEvfAZJZ1Aliy4yPsc-wo8L8tyqtegupyM,12675
580
- rapidata/rapidata_client/order/rapidata_order_manager.py,sha256=Kdup91It_M4zGveZER-CjTG0e5NJTSJzBiRqGufuT-I,37778
582
+ rapidata/rapidata_client/order/rapidata_order_manager.py,sha256=28Lb8iUh_Bun-ijiNGiCjrLn5Rkzbx7lgsgA63M_Jm0,37255
581
583
  rapidata/rapidata_client/order/rapidata_results.py,sha256=ZY0JyHMBZlR6-t6SqKt2OLEO6keR_KvKg9Wk6_I29x4,8653
582
584
  rapidata/rapidata_client/rapidata_client.py,sha256=jTkpu0YcizoxAzbfNdnY1S0xXX6Q0KEMi8boo0f2F5c,4274
583
585
  rapidata/rapidata_client/referee/__init__.py,sha256=q0Hv9nmfEpyChejtyMLT8hWKL0vTTf_UgUXPYNJ-H6M,153
@@ -613,9 +615,9 @@ rapidata/rapidata_client/validation/__init__.py,sha256=s5wHVtcJkncXSFuL9I0zNwccN
613
615
  rapidata/rapidata_client/validation/rapidata_validation_set.py,sha256=h6aicVyrBePfzS5-cPk_hPgmePUqCB3yAbGB_tTXYg0,1814
614
616
  rapidata/rapidata_client/validation/rapids/__init__.py,sha256=WU5PPwtTJlte6U90MDakzx4I8Y0laj7siw9teeXj5R0,21
615
617
  rapidata/rapidata_client/validation/rapids/box.py,sha256=t3_Kn6doKXdnJdtbwefXnYKPiTKHneJl9E2inkDSqL8,589
616
- rapidata/rapidata_client/validation/rapids/rapids.py,sha256=bsDPp8IJ_7dQOJP7U9IVqfLKctY5YP58gDBX8Ixrpc4,3827
617
- rapidata/rapidata_client/validation/rapids/rapids_manager.py,sha256=s5VAq8H5CKACWfmIQuz9kHC8t2nd-xEHGGUj9pIfXKI,14386
618
- rapidata/rapidata_client/validation/validation_set_manager.py,sha256=yQTZSAnqTT0xnwESPIEykQG-34UP9oyoavpNA0KuRIU,30626
618
+ rapidata/rapidata_client/validation/rapids/rapids.py,sha256=WH2EQVhWShHIfXLbaV9-hiVN-ENyXzBZYcQIxdq-RjA,3847
619
+ rapidata/rapidata_client/validation/rapids/rapids_manager.py,sha256=O-AWNQ84zNd8w8JEfCTnWDGAuiDz-Cy17MV1nt7xi2I,14338
620
+ rapidata/rapidata_client/validation/validation_set_manager.py,sha256=7eLh9REoOLRvHR8Ao0oQkPU8REPdLYRP88WXsxX9-fU,30576
619
621
  rapidata/rapidata_client/workflow/__init__.py,sha256=7nXcY91xkxjHudBc9H0fP35eBBtgwHGWTQKbb-M4h7Y,477
620
622
  rapidata/rapidata_client/workflow/_base_workflow.py,sha256=XyIZFKS_RxAuwIHS848S3AyLEHqd07oTD_5jm2oUbsw,762
621
623
  rapidata/rapidata_client/workflow/_classify_workflow.py,sha256=9bT54wxVJgxC-zLk6MVNbseFpzYrvFPjt7DHvxqYfnk,1736
@@ -631,7 +633,7 @@ rapidata/service/__init__.py,sha256=s9bS1AJZaWIhLtJX_ZA40_CK39rAAkwdAmymTMbeWl4,
631
633
  rapidata/service/credential_manager.py,sha256=pUEEtp6VrFWYhfUUtyqmS0AlRqe2Y0kFkY6o22IT4KM,8682
632
634
  rapidata/service/local_file_service.py,sha256=pgorvlWcx52Uh3cEG6VrdMK_t__7dacQ_5AnfY14BW8,877
633
635
  rapidata/service/openapi_service.py,sha256=xoGBACpUhG0H-tadSBa8A91LHyfI7n-FCT2JlrERqco,5221
634
- rapidata-2.31.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
635
- rapidata-2.31.0.dist-info/METADATA,sha256=I0oM2qAap3-ZDUa67lvb0L8wgIY9K3x9HArj6dW0ALc,1264
636
- rapidata-2.31.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
637
- rapidata-2.31.0.dist-info/RECORD,,
636
+ rapidata-2.31.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
637
+ rapidata-2.31.2.dist-info/METADATA,sha256=vwntCIsDSw71O6RSok27uOXpRGiueh8M210PoaOT_Gw,1264
638
+ rapidata-2.31.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
639
+ rapidata-2.31.2.dist-info/RECORD,,