rapidata 2.35.2__py3-none-any.whl → 2.36.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 +2 -1
- rapidata/api_client/__init__.py +21 -3
- 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/pipeline_api.py +0 -873
- rapidata/api_client/api/sample_api.py +299 -0
- rapidata/api_client/models/__init__.py +20 -3
- rapidata/api_client/models/and_filter.py +121 -0
- rapidata/api_client/models/and_filter_filters_inner.py +268 -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/public_rapid_response.py +112 -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/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_README.md +24 -6
- rapidata/rapidata_client/__init__.py +5 -13
- rapidata/rapidata_client/benchmark/participant/_participant.py +45 -26
- rapidata/rapidata_client/benchmark/rapidata_benchmark.py +26 -2
- rapidata/rapidata_client/benchmark/rapidata_benchmark_manager.py +73 -30
- rapidata/rapidata_client/config/__init__.py +1 -0
- rapidata/rapidata_client/config/config.py +33 -0
- rapidata/rapidata_client/datapoints/assets/_sessions.py +13 -8
- rapidata/rapidata_client/order/_rapidata_dataset.py +23 -33
- rapidata/rapidata_client/order/rapidata_order_manager.py +298 -219
- rapidata/rapidata_client/workflow/_compare_workflow.py +7 -2
- {rapidata-2.35.2.dist-info → rapidata-2.36.0.dist-info}/METADATA +1 -1
- {rapidata-2.35.2.dist-info → rapidata-2.36.0.dist-info}/RECORD +55 -31
- {rapidata-2.35.2.dist-info → rapidata-2.36.0.dist-info}/LICENSE +0 -0
- {rapidata-2.35.2.dist-info → rapidata-2.36.0.dist-info}/WHEEL +0 -0
|
@@ -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(
|
|
@@ -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 FreeTextPayload(BaseModel):
|
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for FreeTextPayload", alias="_t")
|
|
30
30
|
question: StrictStr
|
|
31
|
-
|
|
31
|
+
validation_system_prompt: Optional[StrictStr] = Field(default=None, alias="validationSystemPrompt")
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "question", "validationSystemPrompt"]
|
|
32
33
|
|
|
33
34
|
@field_validator('t')
|
|
34
35
|
def t_validate_enum(cls, value):
|
|
@@ -76,6 +77,11 @@ class FreeTextPayload(BaseModel):
|
|
|
76
77
|
exclude=excluded_fields,
|
|
77
78
|
exclude_none=True,
|
|
78
79
|
)
|
|
80
|
+
# set to None if validation_system_prompt (nullable) is None
|
|
81
|
+
# and model_fields_set contains the field
|
|
82
|
+
if self.validation_system_prompt is None and "validation_system_prompt" in self.model_fields_set:
|
|
83
|
+
_dict['validationSystemPrompt'] = None
|
|
84
|
+
|
|
79
85
|
return _dict
|
|
80
86
|
|
|
81
87
|
@classmethod
|
|
@@ -89,7 +95,8 @@ class FreeTextPayload(BaseModel):
|
|
|
89
95
|
|
|
90
96
|
_obj = cls.model_validate({
|
|
91
97
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'FreeTextPayload',
|
|
92
|
-
"question": obj.get("question")
|
|
98
|
+
"question": obj.get("question"),
|
|
99
|
+
"validationSystemPrompt": obj.get("validationSystemPrompt")
|
|
93
100
|
})
|
|
94
101
|
return _obj
|
|
95
102
|
|
|
@@ -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 FreeTextRapidBlueprint(BaseModel):
|
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for FreeTextBlueprint", alias="_t")
|
|
30
30
|
question: StrictStr
|
|
31
|
-
|
|
31
|
+
validation_system_prompt: Optional[StrictStr] = Field(default=None, alias="validationSystemPrompt")
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "question", "validationSystemPrompt"]
|
|
32
33
|
|
|
33
34
|
@field_validator('t')
|
|
34
35
|
def t_validate_enum(cls, value):
|
|
@@ -76,6 +77,11 @@ class FreeTextRapidBlueprint(BaseModel):
|
|
|
76
77
|
exclude=excluded_fields,
|
|
77
78
|
exclude_none=True,
|
|
78
79
|
)
|
|
80
|
+
# set to None if validation_system_prompt (nullable) is None
|
|
81
|
+
# and model_fields_set contains the field
|
|
82
|
+
if self.validation_system_prompt is None and "validation_system_prompt" in self.model_fields_set:
|
|
83
|
+
_dict['validationSystemPrompt'] = None
|
|
84
|
+
|
|
79
85
|
return _dict
|
|
80
86
|
|
|
81
87
|
@classmethod
|
|
@@ -89,7 +95,8 @@ class FreeTextRapidBlueprint(BaseModel):
|
|
|
89
95
|
|
|
90
96
|
_obj = cls.model_validate({
|
|
91
97
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'FreeTextBlueprint',
|
|
92
|
-
"question": obj.get("question")
|
|
98
|
+
"question": obj.get("question"),
|
|
99
|
+
"validationSystemPrompt": obj.get("validationSystemPrompt")
|
|
93
100
|
})
|
|
94
101
|
return _obj
|
|
95
102
|
|
|
@@ -27,7 +27,8 @@ class GetCompareAbSummaryResult(BaseModel):
|
|
|
27
27
|
GetCompareAbSummaryResult
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
winner_counts: Dict[str, Union[StrictFloat, StrictInt]] = Field(alias="winnerCounts")
|
|
30
|
-
|
|
30
|
+
win_counter: Dict[str, Union[StrictFloat, StrictInt]] = Field(alias="winCounter")
|
|
31
|
+
__properties: ClassVar[List[str]] = ["winnerCounts", "winCounter"]
|
|
31
32
|
|
|
32
33
|
model_config = ConfigDict(
|
|
33
34
|
populate_by_name=True,
|
|
@@ -80,7 +81,8 @@ class GetCompareAbSummaryResult(BaseModel):
|
|
|
80
81
|
return cls.model_validate(obj)
|
|
81
82
|
|
|
82
83
|
_obj = cls.model_validate({
|
|
83
|
-
"winnerCounts": obj.get("winnerCounts")
|
|
84
|
+
"winnerCounts": obj.get("winnerCounts"),
|
|
85
|
+
"winCounter": obj.get("winCounter")
|
|
84
86
|
})
|
|
85
87
|
return _obj
|
|
86
88
|
|
|
@@ -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_filter_filters_inner import AndFilterFiltersInner
|
|
23
|
+
from rapidata.api_client.models.feature_flag import FeatureFlag
|
|
22
24
|
from typing import Optional, Set
|
|
23
25
|
from typing_extensions import Self
|
|
24
26
|
|
|
@@ -35,7 +37,10 @@ class GetLeaderboardByIdResult(BaseModel):
|
|
|
35
37
|
is_inversed: StrictBool = Field(alias="isInversed")
|
|
36
38
|
response_budget: StrictInt = Field(alias="responseBudget")
|
|
37
39
|
min_responses: StrictInt = Field(alias="minResponses")
|
|
38
|
-
|
|
40
|
+
validation_set_id: Optional[StrictStr] = Field(default=None, alias="validationSetId")
|
|
41
|
+
filters: List[AndFilterFiltersInner]
|
|
42
|
+
feature_flags: List[FeatureFlag] = Field(alias="featureFlags")
|
|
43
|
+
__properties: ClassVar[List[str]] = ["id", "orderId", "name", "instruction", "showPrompt", "showPromptAsset", "isInversed", "responseBudget", "minResponses", "validationSetId", "filters", "featureFlags"]
|
|
39
44
|
|
|
40
45
|
model_config = ConfigDict(
|
|
41
46
|
populate_by_name=True,
|
|
@@ -76,11 +81,30 @@ class GetLeaderboardByIdResult(BaseModel):
|
|
|
76
81
|
exclude=excluded_fields,
|
|
77
82
|
exclude_none=True,
|
|
78
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
|
|
79
98
|
# set to None if order_id (nullable) is None
|
|
80
99
|
# and model_fields_set contains the field
|
|
81
100
|
if self.order_id is None and "order_id" in self.model_fields_set:
|
|
82
101
|
_dict['orderId'] = None
|
|
83
102
|
|
|
103
|
+
# set to None if validation_set_id (nullable) is None
|
|
104
|
+
# and model_fields_set contains the field
|
|
105
|
+
if self.validation_set_id is None and "validation_set_id" in self.model_fields_set:
|
|
106
|
+
_dict['validationSetId'] = None
|
|
107
|
+
|
|
84
108
|
return _dict
|
|
85
109
|
|
|
86
110
|
@classmethod
|
|
@@ -101,7 +125,10 @@ class GetLeaderboardByIdResult(BaseModel):
|
|
|
101
125
|
"showPromptAsset": obj.get("showPromptAsset"),
|
|
102
126
|
"isInversed": obj.get("isInversed"),
|
|
103
127
|
"responseBudget": obj.get("responseBudget"),
|
|
104
|
-
"minResponses": obj.get("minResponses")
|
|
128
|
+
"minResponses": obj.get("minResponses"),
|
|
129
|
+
"validationSetId": obj.get("validationSetId"),
|
|
130
|
+
"filters": [AndFilterFiltersInner.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None,
|
|
131
|
+
"featureFlags": [FeatureFlag.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None
|
|
105
132
|
})
|
|
106
133
|
return _obj
|
|
107
134
|
|
|
@@ -0,0 +1,95 @@
|
|
|
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
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from rapidata.api_client.models.public_rapid_response import PublicRapidResponse
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class GetPublicResponsesResult(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
GetPublicResponsesResult
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
responses: List[PublicRapidResponse]
|
|
31
|
+
__properties: ClassVar[List[str]] = ["responses"]
|
|
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 GetPublicResponsesResult 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
|
+
# override the default output from pydantic by calling `to_dict()` of each item in responses (list)
|
|
73
|
+
_items = []
|
|
74
|
+
if self.responses:
|
|
75
|
+
for _item_responses in self.responses:
|
|
76
|
+
if _item_responses:
|
|
77
|
+
_items.append(_item_responses.to_dict())
|
|
78
|
+
_dict['responses'] = _items
|
|
79
|
+
return _dict
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
+
"""Create an instance of GetPublicResponsesResult 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
|
+
"responses": [PublicRapidResponse.from_dict(_item) for _item in obj["responses"]] if obj.get("responses") is not None else None
|
|
92
|
+
})
|
|
93
|
+
return _obj
|
|
94
|
+
|
|
95
|
+
|
|
@@ -0,0 +1,126 @@
|
|
|
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 datetime import datetime
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from rapidata.api_client.models.datapoint_asset import DatapointAsset
|
|
24
|
+
from rapidata.api_client.models.get_validation_rapids_result_asset import GetValidationRapidsResultAsset
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class GetSampleByIdResult(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
GetSampleByIdResult
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
id: StrictStr
|
|
33
|
+
identifier: StrictStr
|
|
34
|
+
participant_id: StrictStr = Field(alias="participantId")
|
|
35
|
+
participant_name: StrictStr = Field(alias="participantName")
|
|
36
|
+
asset: DatapointAsset
|
|
37
|
+
prompt: Optional[StrictStr] = None
|
|
38
|
+
prompt_asset: Optional[GetValidationRapidsResultAsset] = Field(default=None, alias="promptAsset")
|
|
39
|
+
tags: List[StrictStr]
|
|
40
|
+
created_at: Optional[datetime] = Field(default=None, alias="createdAt")
|
|
41
|
+
owner_id: Optional[StrictStr] = Field(default=None, alias="ownerId")
|
|
42
|
+
owner_mail: StrictStr = Field(alias="ownerMail")
|
|
43
|
+
__properties: ClassVar[List[str]] = ["id", "identifier", "participantId", "participantName", "asset", "prompt", "promptAsset", "tags", "createdAt", "ownerId", "ownerMail"]
|
|
44
|
+
|
|
45
|
+
model_config = ConfigDict(
|
|
46
|
+
populate_by_name=True,
|
|
47
|
+
validate_assignment=True,
|
|
48
|
+
protected_namespaces=(),
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def to_str(self) -> str:
|
|
53
|
+
"""Returns the string representation of the model using alias"""
|
|
54
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
55
|
+
|
|
56
|
+
def to_json(self) -> str:
|
|
57
|
+
"""Returns the JSON representation of the model using alias"""
|
|
58
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
59
|
+
return json.dumps(self.to_dict())
|
|
60
|
+
|
|
61
|
+
@classmethod
|
|
62
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
63
|
+
"""Create an instance of GetSampleByIdResult from a JSON string"""
|
|
64
|
+
return cls.from_dict(json.loads(json_str))
|
|
65
|
+
|
|
66
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
67
|
+
"""Return the dictionary representation of the model using alias.
|
|
68
|
+
|
|
69
|
+
This has the following differences from calling pydantic's
|
|
70
|
+
`self.model_dump(by_alias=True)`:
|
|
71
|
+
|
|
72
|
+
* `None` is only added to the output dict for nullable fields that
|
|
73
|
+
were set at model initialization. Other fields with value `None`
|
|
74
|
+
are ignored.
|
|
75
|
+
"""
|
|
76
|
+
excluded_fields: Set[str] = set([
|
|
77
|
+
])
|
|
78
|
+
|
|
79
|
+
_dict = self.model_dump(
|
|
80
|
+
by_alias=True,
|
|
81
|
+
exclude=excluded_fields,
|
|
82
|
+
exclude_none=True,
|
|
83
|
+
)
|
|
84
|
+
# override the default output from pydantic by calling `to_dict()` of asset
|
|
85
|
+
if self.asset:
|
|
86
|
+
_dict['asset'] = self.asset.to_dict()
|
|
87
|
+
# override the default output from pydantic by calling `to_dict()` of prompt_asset
|
|
88
|
+
if self.prompt_asset:
|
|
89
|
+
_dict['promptAsset'] = self.prompt_asset.to_dict()
|
|
90
|
+
# set to None if prompt (nullable) is None
|
|
91
|
+
# and model_fields_set contains the field
|
|
92
|
+
if self.prompt is None and "prompt" in self.model_fields_set:
|
|
93
|
+
_dict['prompt'] = None
|
|
94
|
+
|
|
95
|
+
# set to None if prompt_asset (nullable) is None
|
|
96
|
+
# and model_fields_set contains the field
|
|
97
|
+
if self.prompt_asset is None and "prompt_asset" in self.model_fields_set:
|
|
98
|
+
_dict['promptAsset'] = None
|
|
99
|
+
|
|
100
|
+
return _dict
|
|
101
|
+
|
|
102
|
+
@classmethod
|
|
103
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
104
|
+
"""Create an instance of GetSampleByIdResult from a dict"""
|
|
105
|
+
if obj is None:
|
|
106
|
+
return None
|
|
107
|
+
|
|
108
|
+
if not isinstance(obj, dict):
|
|
109
|
+
return cls.model_validate(obj)
|
|
110
|
+
|
|
111
|
+
_obj = cls.model_validate({
|
|
112
|
+
"id": obj.get("id"),
|
|
113
|
+
"identifier": obj.get("identifier"),
|
|
114
|
+
"participantId": obj.get("participantId"),
|
|
115
|
+
"participantName": obj.get("participantName"),
|
|
116
|
+
"asset": DatapointAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
|
|
117
|
+
"prompt": obj.get("prompt"),
|
|
118
|
+
"promptAsset": GetValidationRapidsResultAsset.from_dict(obj["promptAsset"]) if obj.get("promptAsset") is not None else None,
|
|
119
|
+
"tags": obj.get("tags"),
|
|
120
|
+
"createdAt": obj.get("createdAt"),
|
|
121
|
+
"ownerId": obj.get("ownerId"),
|
|
122
|
+
"ownerMail": obj.get("ownerMail")
|
|
123
|
+
})
|
|
124
|
+
return _obj
|
|
125
|
+
|
|
126
|
+
|