rapidata 2.12.0__py3-none-any.whl → 2.13.1__py3-none-any.whl

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

Potentially problematic release.


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

Files changed (70) hide show
  1. rapidata/__init__.py +1 -5
  2. rapidata/api_client/__init__.py +17 -39
  3. rapidata/api_client/api/__init__.py +0 -1
  4. rapidata/api_client/api/campaign_api.py +13 -13
  5. rapidata/api_client/api/datapoint_api.py +6 -6
  6. rapidata/api_client/api/dataset_api.py +574 -16
  7. rapidata/api_client/api/rapid_api.py +262 -0
  8. rapidata/api_client/api/validation_api.py +7 -7
  9. rapidata/api_client/models/__init__.py +17 -38
  10. rapidata/api_client/models/add_campaign_model.py +3 -3
  11. rapidata/api_client/models/add_campaign_model_user_filters_inner.py +224 -0
  12. rapidata/api_client/models/campaign_query_result.py +105 -0
  13. rapidata/api_client/models/campaign_query_result_paged_result.py +105 -0
  14. rapidata/api_client/models/classification_metadata_model.py +2 -4
  15. rapidata/api_client/models/compare_workflow_config.py +8 -10
  16. rapidata/api_client/models/compare_workflow_config_model.py +9 -11
  17. rapidata/api_client/models/compare_workflow_config_model_pair_maker_config.py +8 -22
  18. rapidata/api_client/models/compare_workflow_config_pair_maker_config.py +8 -22
  19. rapidata/api_client/models/compare_workflow_model.py +8 -10
  20. rapidata/api_client/models/compare_workflow_model1.py +8 -10
  21. rapidata/api_client/models/compare_workflow_model1_pair_maker_information.py +8 -22
  22. rapidata/api_client/models/compare_workflow_model_pair_maker_config.py +10 -24
  23. rapidata/api_client/models/count_metadata_model.py +2 -4
  24. rapidata/api_client/models/create_datapoint_from_urls_model.py +87 -0
  25. rapidata/api_client/models/create_datapoint_result.py +97 -0
  26. rapidata/api_client/models/create_order_model_user_filters_inner.py +23 -9
  27. rapidata/api_client/models/datapoint_state.py +38 -0
  28. rapidata/api_client/models/demographic.py +89 -0
  29. rapidata/api_client/models/demographic_metadata_model.py +18 -9
  30. rapidata/api_client/models/elo_config.py +91 -0
  31. rapidata/api_client/models/elo_config_model.py +91 -0
  32. rapidata/api_client/models/file_asset_model.py +18 -13
  33. rapidata/api_client/models/file_asset_model_metadata_value.py +266 -0
  34. rapidata/api_client/models/get_compare_workflow_results_model.py +1 -9
  35. rapidata/api_client/models/get_compare_workflow_results_result.py +6 -15
  36. rapidata/api_client/models/get_datapoint_by_id_result.py +114 -0
  37. rapidata/api_client/models/get_dataset_progress_result.py +93 -0
  38. rapidata/api_client/models/get_simple_workflow_results_result.py +3 -3
  39. rapidata/api_client/models/image_dimension_metadata_model.py +2 -4
  40. rapidata/api_client/models/inspect_report_result.py +92 -0
  41. rapidata/api_client/models/location_metadata_model.py +2 -4
  42. rapidata/api_client/models/multi_asset_model.py +18 -13
  43. rapidata/api_client/models/new_user_filter_model.py +94 -0
  44. rapidata/api_client/models/new_user_filter_model1.py +94 -0
  45. rapidata/api_client/models/null_asset_model.py +18 -13
  46. rapidata/api_client/models/online_pair_maker_config_model.py +1 -1
  47. rapidata/api_client/models/original_filename_metadata_model.py +2 -4
  48. rapidata/api_client/models/prompt_metadata_input.py +2 -4
  49. rapidata/api_client/models/prompt_metadata_model.py +2 -4
  50. rapidata/api_client/models/query_validation_rapids_result.py +14 -9
  51. rapidata/api_client/models/query_validation_rapids_result_asset.py +40 -40
  52. rapidata/api_client/models/report_model.py +11 -4
  53. rapidata/api_client/models/source_url_metadata_model.py +96 -0
  54. rapidata/api_client/models/text_asset_model.py +18 -13
  55. rapidata/api_client/models/text_metadata_model.py +2 -4
  56. rapidata/api_client/models/transcription_metadata_input.py +2 -4
  57. rapidata/api_client/models/transcription_metadata_model.py +1 -3
  58. rapidata/api_client/models/translated_prompt_metadata_model.py +2 -4
  59. rapidata/api_client/models/upload_from_s3_result.py +87 -0
  60. rapidata/api_client_README.md +20 -39
  61. rapidata/rapidata_client/metadata/_base_metadata.py +0 -3
  62. rapidata/rapidata_client/metadata/_private_text_metadata.py +2 -1
  63. rapidata/rapidata_client/metadata/_prompt_metadata.py +3 -3
  64. rapidata/rapidata_client/metadata/_public_text_metadata.py +2 -1
  65. rapidata/rapidata_client/metadata/_select_words_metadata.py +2 -4
  66. rapidata/rapidata_client/validation/validation_set_manager.py +3 -2
  67. {rapidata-2.12.0.dist-info → rapidata-2.13.1.dist-info}/METADATA +1 -1
  68. {rapidata-2.12.0.dist-info → rapidata-2.13.1.dist-info}/RECORD +70 -53
  69. {rapidata-2.12.0.dist-info → rapidata-2.13.1.dist-info}/LICENSE +0 -0
  70. {rapidata-2.12.0.dist-info → rapidata-2.13.1.dist-info}/WHEEL +0 -0
@@ -0,0 +1,38 @@
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 json
17
+ from enum import Enum
18
+ from typing_extensions import Self
19
+
20
+
21
+ class DatapointState(str, Enum):
22
+ """
23
+ DatapointState
24
+ """
25
+
26
+ """
27
+ allowed enum values
28
+ """
29
+ READY = 'Ready'
30
+ PENDING = 'Pending'
31
+ FAILED = 'Failed'
32
+
33
+ @classmethod
34
+ def from_json(cls, json_str: str) -> Self:
35
+ """Create an instance of DatapointState from a JSON string"""
36
+ return cls(json.loads(json_str))
37
+
38
+
@@ -0,0 +1,89 @@
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, StrictFloat, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Union
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class Demographic(BaseModel):
26
+ """
27
+ Demographic
28
+ """ # noqa: E501
29
+ value: StrictStr
30
+ confidence: Union[StrictFloat, StrictInt]
31
+ __properties: ClassVar[List[str]] = ["value", "confidence"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of Demographic from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ return _dict
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
+ """Create an instance of Demographic from a dict"""
77
+ if obj is None:
78
+ return None
79
+
80
+ if not isinstance(obj, dict):
81
+ return cls.model_validate(obj)
82
+
83
+ _obj = cls.model_validate({
84
+ "value": obj.get("value"),
85
+ "confidence": obj.get("confidence")
86
+ })
87
+ return _obj
88
+
89
+
@@ -17,8 +17,9 @@ import pprint
17
17
  import re # noqa: F401
18
18
  import json
19
19
 
20
- from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator
21
- from typing import Any, ClassVar, Dict, List, Union
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from rapidata.api_client.models.demographic import Demographic
22
23
  from typing import Optional, Set
23
24
  from typing_extensions import Self
24
25
 
@@ -27,10 +28,8 @@ class DemographicMetadataModel(BaseModel):
27
28
  DemographicMetadataModel
28
29
  """ # noqa: E501
29
30
  t: StrictStr = Field(description="Discriminator value for DemographicMetadata", alias="_t")
30
- confidence: Union[StrictFloat, StrictInt]
31
- value: StrictStr
32
- identifier: StrictStr
33
- __properties: ClassVar[List[str]] = ["_t", "confidence", "value", "identifier"]
31
+ demographics: Optional[Dict[str, Demographic]] = None
32
+ __properties: ClassVar[List[str]] = ["_t", "demographics"]
34
33
 
35
34
  @field_validator('t')
36
35
  def t_validate_enum(cls, value):
@@ -78,6 +77,13 @@ class DemographicMetadataModel(BaseModel):
78
77
  exclude=excluded_fields,
79
78
  exclude_none=True,
80
79
  )
80
+ # override the default output from pydantic by calling `to_dict()` of each value in demographics (dict)
81
+ _field_dict = {}
82
+ if self.demographics:
83
+ for _key_demographics in self.demographics:
84
+ if self.demographics[_key_demographics]:
85
+ _field_dict[_key_demographics] = self.demographics[_key_demographics].to_dict()
86
+ _dict['demographics'] = _field_dict
81
87
  return _dict
82
88
 
83
89
  @classmethod
@@ -91,9 +97,12 @@ class DemographicMetadataModel(BaseModel):
91
97
 
92
98
  _obj = cls.model_validate({
93
99
  "_t": obj.get("_t") if obj.get("_t") is not None else 'DemographicMetadata',
94
- "confidence": obj.get("confidence"),
95
- "value": obj.get("value"),
96
- "identifier": obj.get("identifier")
100
+ "demographics": dict(
101
+ (_k, Demographic.from_dict(_v))
102
+ for _k, _v in obj["demographics"].items()
103
+ )
104
+ if obj.get("demographics") is not None
105
+ else None
97
106
  })
98
107
  return _obj
99
108
 
@@ -0,0 +1,91 @@
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, StrictInt
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class EloConfig(BaseModel):
26
+ """
27
+ EloConfig
28
+ """ # noqa: E501
29
+ starting_elo: Optional[StrictInt] = Field(default=None, alias="startingElo")
30
+ k_factor: Optional[StrictInt] = Field(default=None, alias="kFactor")
31
+ scaling_factor: Optional[StrictInt] = Field(default=None, alias="scalingFactor")
32
+ __properties: ClassVar[List[str]] = ["startingElo", "kFactor", "scalingFactor"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of EloConfig from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ return _dict
74
+
75
+ @classmethod
76
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
77
+ """Create an instance of EloConfig from a dict"""
78
+ if obj is None:
79
+ return None
80
+
81
+ if not isinstance(obj, dict):
82
+ return cls.model_validate(obj)
83
+
84
+ _obj = cls.model_validate({
85
+ "startingElo": obj.get("startingElo"),
86
+ "kFactor": obj.get("kFactor"),
87
+ "scalingFactor": obj.get("scalingFactor")
88
+ })
89
+ return _obj
90
+
91
+
@@ -0,0 +1,91 @@
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, StrictInt
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class EloConfigModel(BaseModel):
26
+ """
27
+ These parameters affect how the ELO algorithms behaves
28
+ """ # noqa: E501
29
+ starting_elo: Optional[StrictInt] = Field(default=None, description="The starting ELO score for each datapoint.", alias="startingElo")
30
+ k_factor: Optional[StrictInt] = Field(default=None, description="The K-factor to use in the ELO calculation. Determines the maximum possible change in a player's Elo rating after a single match. Higher K-Factor values result in larger rating changes.", alias="kFactor")
31
+ scaling_factor: Optional[StrictInt] = Field(default=None, description="Scaling factor to use in the ELO calculation. Adjusts the sensitivity of the Elo rating system to differences in player ratings. It affects how much the rating changes based on the expected outcome versus the actual outcome.", alias="scalingFactor")
32
+ __properties: ClassVar[List[str]] = ["startingElo", "kFactor", "scalingFactor"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of EloConfigModel from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ return _dict
74
+
75
+ @classmethod
76
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
77
+ """Create an instance of EloConfigModel from a dict"""
78
+ if obj is None:
79
+ return None
80
+
81
+ if not isinstance(obj, dict):
82
+ return cls.model_validate(obj)
83
+
84
+ _obj = cls.model_validate({
85
+ "startingElo": obj.get("startingElo"),
86
+ "kFactor": obj.get("kFactor"),
87
+ "scalingFactor": obj.get("scalingFactor")
88
+ })
89
+ return _obj
90
+
91
+
@@ -19,7 +19,7 @@ import json
19
19
 
20
20
  from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
21
21
  from typing import Any, ClassVar, Dict, List
22
- from rapidata.api_client.models.file_asset_model_metadata_inner import FileAssetModelMetadataInner
22
+ from rapidata.api_client.models.file_asset_model_metadata_value import FileAssetModelMetadataValue
23
23
  from typing import Optional, Set
24
24
  from typing_extensions import Self
25
25
 
@@ -27,17 +27,17 @@ class FileAssetModel(BaseModel):
27
27
  """
28
28
  FileAssetModel
29
29
  """ # noqa: E501
30
- t: StrictStr = Field(description="Discriminator value for FileAssetModel", alias="_t")
30
+ t: StrictStr = Field(description="Discriminator value for FileAsset", alias="_t")
31
31
  file_name: StrictStr = Field(alias="fileName")
32
- metadata: List[FileAssetModelMetadataInner]
32
+ metadata: Dict[str, FileAssetModelMetadataValue]
33
33
  identifier: StrictStr
34
34
  __properties: ClassVar[List[str]] = ["_t", "fileName", "metadata", "identifier"]
35
35
 
36
36
  @field_validator('t')
37
37
  def t_validate_enum(cls, value):
38
38
  """Validates the enum"""
39
- if value not in set(['FileAssetModel']):
40
- raise ValueError("must be one of enum values ('FileAssetModel')")
39
+ if value not in set(['FileAsset']):
40
+ raise ValueError("must be one of enum values ('FileAsset')")
41
41
  return value
42
42
 
43
43
  model_config = ConfigDict(
@@ -79,13 +79,13 @@ class FileAssetModel(BaseModel):
79
79
  exclude=excluded_fields,
80
80
  exclude_none=True,
81
81
  )
82
- # override the default output from pydantic by calling `to_dict()` of each item in metadata (list)
83
- _items = []
82
+ # override the default output from pydantic by calling `to_dict()` of each value in metadata (dict)
83
+ _field_dict = {}
84
84
  if self.metadata:
85
- for _item_metadata in self.metadata:
86
- if _item_metadata:
87
- _items.append(_item_metadata.to_dict())
88
- _dict['metadata'] = _items
85
+ for _key_metadata in self.metadata:
86
+ if self.metadata[_key_metadata]:
87
+ _field_dict[_key_metadata] = self.metadata[_key_metadata].to_dict()
88
+ _dict['metadata'] = _field_dict
89
89
  return _dict
90
90
 
91
91
  @classmethod
@@ -98,9 +98,14 @@ class FileAssetModel(BaseModel):
98
98
  return cls.model_validate(obj)
99
99
 
100
100
  _obj = cls.model_validate({
101
- "_t": obj.get("_t") if obj.get("_t") is not None else 'FileAssetModel',
101
+ "_t": obj.get("_t") if obj.get("_t") is not None else 'FileAsset',
102
102
  "fileName": obj.get("fileName"),
103
- "metadata": [FileAssetModelMetadataInner.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None,
103
+ "metadata": dict(
104
+ (_k, FileAssetModelMetadataValue.from_dict(_v))
105
+ for _k, _v in obj["metadata"].items()
106
+ )
107
+ if obj.get("metadata") is not None
108
+ else None,
104
109
  "identifier": obj.get("identifier")
105
110
  })
106
111
  return _obj