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
|
@@ -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
|
+
|
|
@@ -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 LanguageFilter(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
LanguageFilter
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
t: StrictStr = Field(description="Discriminator value for LanguageFilter", alias="_t")
|
|
30
|
+
languages: List[StrictStr]
|
|
31
|
+
execution_order: Optional[StrictInt] = Field(default=None, alias="executionOrder")
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "languages", "executionOrder"]
|
|
33
|
+
|
|
34
|
+
@field_validator('t')
|
|
35
|
+
def t_validate_enum(cls, value):
|
|
36
|
+
"""Validates the enum"""
|
|
37
|
+
if value not in set(['LanguageFilter']):
|
|
38
|
+
raise ValueError("must be one of enum values ('LanguageFilter')")
|
|
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 LanguageFilter 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 LanguageFilter 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 'LanguageFilter',
|
|
93
|
+
"languages": obj.get("languages"),
|
|
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_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 LeaderboardQueryResult(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 LeaderboardQueryResult(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 LeaderboardQueryResult(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,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, 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 NewUserFilter(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
NewUserFilter
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
t: StrictStr = Field(description="Discriminator value for NewUserFilter", alias="_t")
|
|
30
|
+
execution_order: Optional[StrictInt] = Field(default=None, alias="executionOrder")
|
|
31
|
+
__properties: ClassVar[List[str]] = ["_t", "executionOrder"]
|
|
32
|
+
|
|
33
|
+
@field_validator('t')
|
|
34
|
+
def t_validate_enum(cls, value):
|
|
35
|
+
"""Validates the enum"""
|
|
36
|
+
if value not in set(['NewUserFilter']):
|
|
37
|
+
raise ValueError("must be one of enum values ('NewUserFilter')")
|
|
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 NewUserFilter 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 NewUserFilter 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 'NewUserFilter',
|
|
92
|
+
"executionOrder": obj.get("executionOrder")
|
|
93
|
+
})
|
|
94
|
+
return _obj
|
|
95
|
+
|
|
96
|
+
|