rapidata 2.35.3__py3-none-any.whl → 2.36.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rapidata might be problematic. Click here for more details.
- rapidata/__init__.py +1 -1
- rapidata/api_client/__init__.py +25 -4
- rapidata/api_client/api/__init__.py +1 -0
- rapidata/api_client/api/benchmark_api.py +294 -0
- rapidata/api_client/api/campaign_api.py +268 -0
- rapidata/api_client/api/customer_rapid_api.py +247 -0
- rapidata/api_client/api/leaderboard_api.py +295 -6
- rapidata/api_client/api/pipeline_api.py +0 -873
- rapidata/api_client/api/sample_api.py +299 -0
- rapidata/api_client/api/validation_set_api.py +537 -312
- rapidata/api_client/models/__init__.py +24 -4
- rapidata/api_client/models/add_validation_rapid_model.py +12 -2
- rapidata/api_client/models/add_validation_rapid_model_truth.py +7 -1
- rapidata/api_client/models/and_filter.py +121 -0
- rapidata/api_client/models/and_filter_filters_inner.py +268 -0
- rapidata/api_client/models/asset_type.py +40 -0
- rapidata/api_client/models/boost_mode.py +37 -0
- rapidata/api_client/models/boost_query_result.py +10 -1
- rapidata/api_client/models/campaign_filter.py +98 -0
- rapidata/api_client/models/change_boost_model.py +89 -0
- rapidata/api_client/models/compare_rapid_blueprint.py +5 -3
- rapidata/api_client/models/compare_rapid_blueprint1.py +96 -0
- rapidata/api_client/models/country_filter.py +98 -0
- rapidata/api_client/models/create_leaderboard_model.py +32 -2
- rapidata/api_client/models/demographic_filter.py +100 -0
- rapidata/api_client/models/feature_flag_model.py +4 -4
- rapidata/api_client/models/free_text_payload.py +10 -3
- rapidata/api_client/models/free_text_rapid_blueprint.py +10 -3
- rapidata/api_client/models/get_compare_ab_summary_result.py +4 -2
- rapidata/api_client/models/get_leaderboard_by_id_result.py +29 -2
- rapidata/api_client/models/get_public_responses_result.py +95 -0
- rapidata/api_client/models/get_sample_by_id_result.py +126 -0
- rapidata/api_client/models/language_filter.py +98 -0
- rapidata/api_client/models/leaderboard_query_result.py +29 -2
- rapidata/api_client/models/new_user_filter.py +96 -0
- rapidata/api_client/models/not_filter.py +117 -0
- rapidata/api_client/models/or_filter.py +121 -0
- rapidata/api_client/models/prompt_type.py +38 -0
- rapidata/api_client/models/public_rapid_response.py +112 -0
- rapidata/api_client/models/rapid_modality.py +46 -0
- rapidata/api_client/models/response_count_filter.py +109 -0
- rapidata/api_client/models/sample_by_identifier.py +126 -0
- rapidata/api_client/models/sample_by_identifier_paged_result.py +105 -0
- rapidata/api_client/models/simple_workflow_config_blueprint.py +37 -23
- rapidata/api_client/models/update_leaderboard_model.py +91 -0
- rapidata/api_client/models/user_score_filter.py +102 -0
- rapidata/api_client/models/user_state.py +38 -0
- rapidata/api_client/models/user_state_filter.py +101 -0
- rapidata/api_client/models/validation_set_model.py +54 -3
- rapidata/api_client_README.md +33 -10
- rapidata/rapidata_client/benchmark/rapidata_benchmark.py +26 -2
- rapidata/rapidata_client/order/rapidata_order_manager.py +298 -219
- rapidata/rapidata_client/workflow/_compare_workflow.py +7 -2
- rapidata/rapidata_client/workflow/_free_text_workflow.py +9 -2
- {rapidata-2.35.3.dist-info → rapidata-2.36.1.dist-info}/METADATA +1 -1
- {rapidata-2.35.3.dist-info → rapidata-2.36.1.dist-info}/RECORD +58 -32
- {rapidata-2.35.3.dist-info → rapidata-2.36.1.dist-info}/LICENSE +0 -0
- {rapidata-2.35.3.dist-info → rapidata-2.36.1.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
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 BoostMode(str, Enum):
|
|
22
|
+
"""
|
|
23
|
+
BoostMode
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
allowed enum values
|
|
28
|
+
"""
|
|
29
|
+
AUTOMATIC = 'Automatic'
|
|
30
|
+
MANUAL = 'Manual'
|
|
31
|
+
|
|
32
|
+
@classmethod
|
|
33
|
+
def from_json(cls, json_str: str) -> Self:
|
|
34
|
+
"""Create an instance of BoostMode from a JSON string"""
|
|
35
|
+
return cls(json.loads(json_str))
|
|
36
|
+
|
|
37
|
+
|
|
@@ -27,10 +27,11 @@ class BoostQueryResult(BaseModel):
|
|
|
27
27
|
BoostQueryResult
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
status: StrictStr
|
|
30
|
+
mode: StrictStr
|
|
30
31
|
active_campaigns: List[StrictStr] = Field(alias="activeCampaigns")
|
|
31
32
|
inactive_campaigns: List[StrictStr] = Field(alias="inactiveCampaigns")
|
|
32
33
|
unknown_campaigns: List[StrictInt] = Field(alias="unknownCampaigns")
|
|
33
|
-
__properties: ClassVar[List[str]] = ["status", "activeCampaigns", "inactiveCampaigns", "unknownCampaigns"]
|
|
34
|
+
__properties: ClassVar[List[str]] = ["status", "mode", "activeCampaigns", "inactiveCampaigns", "unknownCampaigns"]
|
|
34
35
|
|
|
35
36
|
@field_validator('status')
|
|
36
37
|
def status_validate_enum(cls, value):
|
|
@@ -39,6 +40,13 @@ class BoostQueryResult(BaseModel):
|
|
|
39
40
|
raise ValueError("must be one of enum values ('Active', 'Inactive', 'Partial', 'Unknown')")
|
|
40
41
|
return value
|
|
41
42
|
|
|
43
|
+
@field_validator('mode')
|
|
44
|
+
def mode_validate_enum(cls, value):
|
|
45
|
+
"""Validates the enum"""
|
|
46
|
+
if value not in set(['Automatic', 'Manual']):
|
|
47
|
+
raise ValueError("must be one of enum values ('Automatic', 'Manual')")
|
|
48
|
+
return value
|
|
49
|
+
|
|
42
50
|
model_config = ConfigDict(
|
|
43
51
|
populate_by_name=True,
|
|
44
52
|
validate_assignment=True,
|
|
@@ -91,6 +99,7 @@ class BoostQueryResult(BaseModel):
|
|
|
91
99
|
|
|
92
100
|
_obj = cls.model_validate({
|
|
93
101
|
"status": obj.get("status"),
|
|
102
|
+
"mode": obj.get("mode"),
|
|
94
103
|
"activeCampaigns": obj.get("activeCampaigns"),
|
|
95
104
|
"inactiveCampaigns": obj.get("inactiveCampaigns"),
|
|
96
105
|
"unknownCampaigns": obj.get("unknownCampaigns")
|
|
@@ -0,0 +1,98 @@
|
|
|
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, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class CampaignFilter(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
CampaignFilter
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
t: StrictStr = Field(description="Discriminator value for CampaignFilter", alias="_t")
|
|
30
|
+
campaign_ids: List[StrictStr] = Field(alias="campaignIds")
|
|
31
|
+
execution_order: Optional[StrictInt] = Field(default=None, alias="executionOrder")
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "campaignIds", "executionOrder"]
|
|
33
|
+
|
|
34
|
+
@field_validator('t')
|
|
35
|
+
def t_validate_enum(cls, value):
|
|
36
|
+
"""Validates the enum"""
|
|
37
|
+
if value not in set(['CampaignFilter']):
|
|
38
|
+
raise ValueError("must be one of enum values ('CampaignFilter')")
|
|
39
|
+
return value
|
|
40
|
+
|
|
41
|
+
model_config = ConfigDict(
|
|
42
|
+
populate_by_name=True,
|
|
43
|
+
validate_assignment=True,
|
|
44
|
+
protected_namespaces=(),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def to_str(self) -> str:
|
|
49
|
+
"""Returns the string representation of the model using alias"""
|
|
50
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
51
|
+
|
|
52
|
+
def to_json(self) -> str:
|
|
53
|
+
"""Returns the JSON representation of the model using alias"""
|
|
54
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
55
|
+
return json.dumps(self.to_dict())
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
59
|
+
"""Create an instance of CampaignFilter from a JSON string"""
|
|
60
|
+
return cls.from_dict(json.loads(json_str))
|
|
61
|
+
|
|
62
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
63
|
+
"""Return the dictionary representation of the model using alias.
|
|
64
|
+
|
|
65
|
+
This has the following differences from calling pydantic's
|
|
66
|
+
`self.model_dump(by_alias=True)`:
|
|
67
|
+
|
|
68
|
+
* `None` is only added to the output dict for nullable fields that
|
|
69
|
+
were set at model initialization. Other fields with value `None`
|
|
70
|
+
are ignored.
|
|
71
|
+
"""
|
|
72
|
+
excluded_fields: Set[str] = set([
|
|
73
|
+
])
|
|
74
|
+
|
|
75
|
+
_dict = self.model_dump(
|
|
76
|
+
by_alias=True,
|
|
77
|
+
exclude=excluded_fields,
|
|
78
|
+
exclude_none=True,
|
|
79
|
+
)
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of CampaignFilter from a dict"""
|
|
85
|
+
if obj is None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
if not isinstance(obj, dict):
|
|
89
|
+
return cls.model_validate(obj)
|
|
90
|
+
|
|
91
|
+
_obj = cls.model_validate({
|
|
92
|
+
"_t": obj.get("_t") if obj.get("_t") is not None else 'CampaignFilter',
|
|
93
|
+
"campaignIds": obj.get("campaignIds"),
|
|
94
|
+
"executionOrder": obj.get("executionOrder")
|
|
95
|
+
})
|
|
96
|
+
return _obj
|
|
97
|
+
|
|
98
|
+
|
|
@@ -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, Field, StrictBool
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class ChangeBoostModel(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
The model to update the manual boost status. or putting it back to autopilot.
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
is_manual: StrictBool = Field(description="If the manual overwrite should be applied", alias="isManual")
|
|
30
|
+
is_active: StrictBool = Field(description="If manual is set to true it will overrule the system with this.", alias="isActive")
|
|
31
|
+
__properties: ClassVar[List[str]] = ["isManual", "isActive"]
|
|
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 ChangeBoostModel 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 ChangeBoostModel 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
|
+
"isManual": obj.get("isManual"),
|
|
85
|
+
"isActive": obj.get("isActive")
|
|
86
|
+
})
|
|
87
|
+
return _obj
|
|
88
|
+
|
|
89
|
+
|
|
@@ -18,7 +18,7 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from typing import Optional, Set
|
|
23
23
|
from typing_extensions import Self
|
|
24
24
|
|
|
@@ -28,7 +28,8 @@ class CompareRapidBlueprint(BaseModel):
|
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for CompareBlueprint", alias="_t")
|
|
30
30
|
criteria: StrictStr
|
|
31
|
-
|
|
31
|
+
index_identifiers: Optional[List[StrictStr]] = Field(default=None, alias="indexIdentifiers")
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "criteria", "indexIdentifiers"]
|
|
32
33
|
|
|
33
34
|
@field_validator('t')
|
|
34
35
|
def t_validate_enum(cls, value):
|
|
@@ -89,7 +90,8 @@ class CompareRapidBlueprint(BaseModel):
|
|
|
89
90
|
|
|
90
91
|
_obj = cls.model_validate({
|
|
91
92
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'CompareBlueprint',
|
|
92
|
-
"criteria": obj.get("criteria")
|
|
93
|
+
"criteria": obj.get("criteria"),
|
|
94
|
+
"indexIdentifiers": obj.get("indexIdentifiers")
|
|
93
95
|
})
|
|
94
96
|
return _obj
|
|
95
97
|
|
|
@@ -0,0 +1,96 @@
|
|
|
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, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class CompareRapidBlueprint1(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
CompareRapidBlueprint1
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
t: StrictStr = Field(description="Discriminator value for CompareBlueprint", alias="_t")
|
|
30
|
+
criteria: StrictStr
|
|
31
|
+
__properties: ClassVar[List[str]] = ["_t", "criteria"]
|
|
32
|
+
|
|
33
|
+
@field_validator('t')
|
|
34
|
+
def t_validate_enum(cls, value):
|
|
35
|
+
"""Validates the enum"""
|
|
36
|
+
if value not in set(['CompareBlueprint']):
|
|
37
|
+
raise ValueError("must be one of enum values ('CompareBlueprint')")
|
|
38
|
+
return value
|
|
39
|
+
|
|
40
|
+
model_config = ConfigDict(
|
|
41
|
+
populate_by_name=True,
|
|
42
|
+
validate_assignment=True,
|
|
43
|
+
protected_namespaces=(),
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def to_str(self) -> str:
|
|
48
|
+
"""Returns the string representation of the model using alias"""
|
|
49
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
50
|
+
|
|
51
|
+
def to_json(self) -> str:
|
|
52
|
+
"""Returns the JSON representation of the model using alias"""
|
|
53
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
54
|
+
return json.dumps(self.to_dict())
|
|
55
|
+
|
|
56
|
+
@classmethod
|
|
57
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
58
|
+
"""Create an instance of CompareRapidBlueprint1 from a JSON string"""
|
|
59
|
+
return cls.from_dict(json.loads(json_str))
|
|
60
|
+
|
|
61
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
62
|
+
"""Return the dictionary representation of the model using alias.
|
|
63
|
+
|
|
64
|
+
This has the following differences from calling pydantic's
|
|
65
|
+
`self.model_dump(by_alias=True)`:
|
|
66
|
+
|
|
67
|
+
* `None` is only added to the output dict for nullable fields that
|
|
68
|
+
were set at model initialization. Other fields with value `None`
|
|
69
|
+
are ignored.
|
|
70
|
+
"""
|
|
71
|
+
excluded_fields: Set[str] = set([
|
|
72
|
+
])
|
|
73
|
+
|
|
74
|
+
_dict = self.model_dump(
|
|
75
|
+
by_alias=True,
|
|
76
|
+
exclude=excluded_fields,
|
|
77
|
+
exclude_none=True,
|
|
78
|
+
)
|
|
79
|
+
return _dict
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
+
"""Create an instance of CompareRapidBlueprint1 from a dict"""
|
|
84
|
+
if obj is None:
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
if not isinstance(obj, dict):
|
|
88
|
+
return cls.model_validate(obj)
|
|
89
|
+
|
|
90
|
+
_obj = cls.model_validate({
|
|
91
|
+
"_t": obj.get("_t") if obj.get("_t") is not None else 'CompareBlueprint',
|
|
92
|
+
"criteria": obj.get("criteria")
|
|
93
|
+
})
|
|
94
|
+
return _obj
|
|
95
|
+
|
|
96
|
+
|
|
@@ -0,0 +1,98 @@
|
|
|
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, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class CountryFilter(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
CountryFilter
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
t: StrictStr = Field(description="Discriminator value for CountryFilter", alias="_t")
|
|
30
|
+
countries: List[StrictStr]
|
|
31
|
+
execution_order: Optional[StrictInt] = Field(default=None, alias="executionOrder")
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "countries", "executionOrder"]
|
|
33
|
+
|
|
34
|
+
@field_validator('t')
|
|
35
|
+
def t_validate_enum(cls, value):
|
|
36
|
+
"""Validates the enum"""
|
|
37
|
+
if value not in set(['CountryFilter']):
|
|
38
|
+
raise ValueError("must be one of enum values ('CountryFilter')")
|
|
39
|
+
return value
|
|
40
|
+
|
|
41
|
+
model_config = ConfigDict(
|
|
42
|
+
populate_by_name=True,
|
|
43
|
+
validate_assignment=True,
|
|
44
|
+
protected_namespaces=(),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def to_str(self) -> str:
|
|
49
|
+
"""Returns the string representation of the model using alias"""
|
|
50
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
51
|
+
|
|
52
|
+
def to_json(self) -> str:
|
|
53
|
+
"""Returns the JSON representation of the model using alias"""
|
|
54
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
55
|
+
return json.dumps(self.to_dict())
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
59
|
+
"""Create an instance of CountryFilter from a JSON string"""
|
|
60
|
+
return cls.from_dict(json.loads(json_str))
|
|
61
|
+
|
|
62
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
63
|
+
"""Return the dictionary representation of the model using alias.
|
|
64
|
+
|
|
65
|
+
This has the following differences from calling pydantic's
|
|
66
|
+
`self.model_dump(by_alias=True)`:
|
|
67
|
+
|
|
68
|
+
* `None` is only added to the output dict for nullable fields that
|
|
69
|
+
were set at model initialization. Other fields with value `None`
|
|
70
|
+
are ignored.
|
|
71
|
+
"""
|
|
72
|
+
excluded_fields: Set[str] = set([
|
|
73
|
+
])
|
|
74
|
+
|
|
75
|
+
_dict = self.model_dump(
|
|
76
|
+
by_alias=True,
|
|
77
|
+
exclude=excluded_fields,
|
|
78
|
+
exclude_none=True,
|
|
79
|
+
)
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of CountryFilter from a dict"""
|
|
85
|
+
if obj is None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
if not isinstance(obj, dict):
|
|
89
|
+
return cls.model_validate(obj)
|
|
90
|
+
|
|
91
|
+
_obj = cls.model_validate({
|
|
92
|
+
"_t": obj.get("_t") if obj.get("_t") is not None else 'CountryFilter',
|
|
93
|
+
"countries": obj.get("countries"),
|
|
94
|
+
"executionOrder": obj.get("executionOrder")
|
|
95
|
+
})
|
|
96
|
+
return _obj
|
|
97
|
+
|
|
98
|
+
|
|
@@ -19,6 +19,8 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from rapidata.api_client.models.and_user_filter_model_filters_inner import AndUserFilterModelFiltersInner
|
|
23
|
+
from rapidata.api_client.models.feature_flag_model import FeatureFlagModel
|
|
22
24
|
from typing import Optional, Set
|
|
23
25
|
from typing_extensions import Self
|
|
24
26
|
|
|
@@ -36,7 +38,9 @@ class CreateLeaderboardModel(BaseModel):
|
|
|
36
38
|
min_responses: Optional[StrictInt] = Field(default=None, description="The minimum amount of responses that need to be collected per comparison.", alias="minResponses")
|
|
37
39
|
is_inversed: Optional[StrictBool] = Field(default=None, description="If the results should be inversed, meaning people should select the worse model.", alias="isInversed")
|
|
38
40
|
validation_set_id: Optional[StrictStr] = Field(default=None, description="The Validation set that should be attached to every run.", alias="validationSetId")
|
|
39
|
-
|
|
41
|
+
filters: Optional[List[AndUserFilterModelFiltersInner]] = Field(default=None, description="The filters will be applied on every order that is created by this leaderboard.")
|
|
42
|
+
feature_flags: Optional[List[FeatureFlagModel]] = Field(default=None, description="Feature flags that will be applied to every order that is created by this leaderboard.", alias="featureFlags")
|
|
43
|
+
__properties: ClassVar[List[str]] = ["benchmarkId", "benchmarkName", "name", "instruction", "showPrompt", "showPromptAsset", "responseBudget", "minResponses", "isInversed", "validationSetId", "filters", "featureFlags"]
|
|
40
44
|
|
|
41
45
|
model_config = ConfigDict(
|
|
42
46
|
populate_by_name=True,
|
|
@@ -77,6 +81,20 @@ class CreateLeaderboardModel(BaseModel):
|
|
|
77
81
|
exclude=excluded_fields,
|
|
78
82
|
exclude_none=True,
|
|
79
83
|
)
|
|
84
|
+
# override the default output from pydantic by calling `to_dict()` of each item in filters (list)
|
|
85
|
+
_items = []
|
|
86
|
+
if self.filters:
|
|
87
|
+
for _item_filters in self.filters:
|
|
88
|
+
if _item_filters:
|
|
89
|
+
_items.append(_item_filters.to_dict())
|
|
90
|
+
_dict['filters'] = _items
|
|
91
|
+
# override the default output from pydantic by calling `to_dict()` of each item in feature_flags (list)
|
|
92
|
+
_items = []
|
|
93
|
+
if self.feature_flags:
|
|
94
|
+
for _item_feature_flags in self.feature_flags:
|
|
95
|
+
if _item_feature_flags:
|
|
96
|
+
_items.append(_item_feature_flags.to_dict())
|
|
97
|
+
_dict['featureFlags'] = _items
|
|
80
98
|
# set to None if benchmark_id (nullable) is None
|
|
81
99
|
# and model_fields_set contains the field
|
|
82
100
|
if self.benchmark_id is None and "benchmark_id" in self.model_fields_set:
|
|
@@ -92,6 +110,16 @@ class CreateLeaderboardModel(BaseModel):
|
|
|
92
110
|
if self.validation_set_id is None and "validation_set_id" in self.model_fields_set:
|
|
93
111
|
_dict['validationSetId'] = None
|
|
94
112
|
|
|
113
|
+
# set to None if filters (nullable) is None
|
|
114
|
+
# and model_fields_set contains the field
|
|
115
|
+
if self.filters is None and "filters" in self.model_fields_set:
|
|
116
|
+
_dict['filters'] = None
|
|
117
|
+
|
|
118
|
+
# set to None if feature_flags (nullable) is None
|
|
119
|
+
# and model_fields_set contains the field
|
|
120
|
+
if self.feature_flags is None and "feature_flags" in self.model_fields_set:
|
|
121
|
+
_dict['featureFlags'] = None
|
|
122
|
+
|
|
95
123
|
return _dict
|
|
96
124
|
|
|
97
125
|
@classmethod
|
|
@@ -113,7 +141,9 @@ class CreateLeaderboardModel(BaseModel):
|
|
|
113
141
|
"responseBudget": obj.get("responseBudget"),
|
|
114
142
|
"minResponses": obj.get("minResponses"),
|
|
115
143
|
"isInversed": obj.get("isInversed"),
|
|
116
|
-
"validationSetId": obj.get("validationSetId")
|
|
144
|
+
"validationSetId": obj.get("validationSetId"),
|
|
145
|
+
"filters": [AndUserFilterModelFiltersInner.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None,
|
|
146
|
+
"featureFlags": [FeatureFlagModel.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None
|
|
117
147
|
})
|
|
118
148
|
return _obj
|
|
119
149
|
|
|
@@ -0,0 +1,100 @@
|
|
|
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, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class DemographicFilter(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
DemographicFilter
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
t: StrictStr = Field(description="Discriminator value for DemographicFilter", alias="_t")
|
|
30
|
+
identifier: StrictStr
|
|
31
|
+
values: List[StrictStr]
|
|
32
|
+
execution_order: Optional[StrictInt] = Field(default=None, alias="executionOrder")
|
|
33
|
+
__properties: ClassVar[List[str]] = ["_t", "identifier", "values", "executionOrder"]
|
|
34
|
+
|
|
35
|
+
@field_validator('t')
|
|
36
|
+
def t_validate_enum(cls, value):
|
|
37
|
+
"""Validates the enum"""
|
|
38
|
+
if value not in set(['DemographicFilter']):
|
|
39
|
+
raise ValueError("must be one of enum values ('DemographicFilter')")
|
|
40
|
+
return value
|
|
41
|
+
|
|
42
|
+
model_config = ConfigDict(
|
|
43
|
+
populate_by_name=True,
|
|
44
|
+
validate_assignment=True,
|
|
45
|
+
protected_namespaces=(),
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def to_str(self) -> str:
|
|
50
|
+
"""Returns the string representation of the model using alias"""
|
|
51
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
52
|
+
|
|
53
|
+
def to_json(self) -> str:
|
|
54
|
+
"""Returns the JSON representation of the model using alias"""
|
|
55
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
56
|
+
return json.dumps(self.to_dict())
|
|
57
|
+
|
|
58
|
+
@classmethod
|
|
59
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
60
|
+
"""Create an instance of DemographicFilter from a JSON string"""
|
|
61
|
+
return cls.from_dict(json.loads(json_str))
|
|
62
|
+
|
|
63
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
64
|
+
"""Return the dictionary representation of the model using alias.
|
|
65
|
+
|
|
66
|
+
This has the following differences from calling pydantic's
|
|
67
|
+
`self.model_dump(by_alias=True)`:
|
|
68
|
+
|
|
69
|
+
* `None` is only added to the output dict for nullable fields that
|
|
70
|
+
were set at model initialization. Other fields with value `None`
|
|
71
|
+
are ignored.
|
|
72
|
+
"""
|
|
73
|
+
excluded_fields: Set[str] = set([
|
|
74
|
+
])
|
|
75
|
+
|
|
76
|
+
_dict = self.model_dump(
|
|
77
|
+
by_alias=True,
|
|
78
|
+
exclude=excluded_fields,
|
|
79
|
+
exclude_none=True,
|
|
80
|
+
)
|
|
81
|
+
return _dict
|
|
82
|
+
|
|
83
|
+
@classmethod
|
|
84
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
85
|
+
"""Create an instance of DemographicFilter from a dict"""
|
|
86
|
+
if obj is None:
|
|
87
|
+
return None
|
|
88
|
+
|
|
89
|
+
if not isinstance(obj, dict):
|
|
90
|
+
return cls.model_validate(obj)
|
|
91
|
+
|
|
92
|
+
_obj = cls.model_validate({
|
|
93
|
+
"_t": obj.get("_t") if obj.get("_t") is not None else 'DemographicFilter',
|
|
94
|
+
"identifier": obj.get("identifier"),
|
|
95
|
+
"values": obj.get("values"),
|
|
96
|
+
"executionOrder": obj.get("executionOrder")
|
|
97
|
+
})
|
|
98
|
+
return _obj
|
|
99
|
+
|
|
100
|
+
|
|
@@ -17,17 +17,17 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict,
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
22
|
from typing import Optional, Set
|
|
23
23
|
from typing_extensions import Self
|
|
24
24
|
|
|
25
25
|
class FeatureFlagModel(BaseModel):
|
|
26
26
|
"""
|
|
27
|
-
|
|
27
|
+
FeatureFlagModel
|
|
28
28
|
""" # noqa: E501
|
|
29
|
-
key: StrictStr
|
|
30
|
-
value: StrictStr
|
|
29
|
+
key: StrictStr
|
|
30
|
+
value: StrictStr
|
|
31
31
|
__properties: ClassVar[List[str]] = ["key", "value"]
|
|
32
32
|
|
|
33
33
|
model_config = ConfigDict(
|