rapidata 2.36.0__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 +4 -1
- rapidata/api_client/api/leaderboard_api.py +295 -6
- rapidata/api_client/api/validation_set_api.py +537 -312
- rapidata/api_client/models/__init__.py +4 -1
- 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/asset_type.py +40 -0
- rapidata/api_client/models/prompt_type.py +38 -0
- rapidata/api_client/models/rapid_modality.py +46 -0
- rapidata/api_client/models/update_leaderboard_model.py +91 -0
- rapidata/api_client/models/validation_set_model.py +54 -3
- rapidata/api_client_README.md +9 -4
- rapidata/rapidata_client/workflow/_free_text_workflow.py +9 -2
- {rapidata-2.36.0.dist-info → rapidata-2.36.1.dist-info}/METADATA +1 -1
- {rapidata-2.36.0.dist-info → rapidata-2.36.1.dist-info}/RECORD +18 -14
- {rapidata-2.36.0.dist-info → rapidata-2.36.1.dist-info}/LICENSE +0 -0
- {rapidata-2.36.0.dist-info → rapidata-2.36.1.dist-info}/WHEEL +0 -0
|
@@ -21,7 +21,6 @@ from rapidata.api_client.models.add_validation_rapid_model import AddValidationR
|
|
|
21
21
|
from rapidata.api_client.models.add_validation_rapid_model_payload import AddValidationRapidModelPayload
|
|
22
22
|
from rapidata.api_client.models.add_validation_rapid_model_truth import AddValidationRapidModelTruth
|
|
23
23
|
from rapidata.api_client.models.add_validation_rapid_result import AddValidationRapidResult
|
|
24
|
-
from rapidata.api_client.models.add_validation_text_rapid_model import AddValidationTextRapidModel
|
|
25
24
|
from rapidata.api_client.models.age_group import AgeGroup
|
|
26
25
|
from rapidata.api_client.models.age_user_filter_model import AgeUserFilterModel
|
|
27
26
|
from rapidata.api_client.models.aggregator_type import AggregatorType
|
|
@@ -33,6 +32,7 @@ from rapidata.api_client.models.are_rapids_active_result import AreRapidsActiveR
|
|
|
33
32
|
from rapidata.api_client.models.asset_metadata import AssetMetadata
|
|
34
33
|
from rapidata.api_client.models.asset_metadata_asset import AssetMetadataAsset
|
|
35
34
|
from rapidata.api_client.models.asset_metadata_model import AssetMetadataModel
|
|
35
|
+
from rapidata.api_client.models.asset_type import AssetType
|
|
36
36
|
from rapidata.api_client.models.attach_category_rapid_blueprint import AttachCategoryRapidBlueprint
|
|
37
37
|
from rapidata.api_client.models.attach_category_result import AttachCategoryResult
|
|
38
38
|
from rapidata.api_client.models.attach_category_truth import AttachCategoryTruth
|
|
@@ -292,6 +292,7 @@ from rapidata.api_client.models.prompt_by_benchmark_result_paged_result import P
|
|
|
292
292
|
from rapidata.api_client.models.prompt_metadata import PromptMetadata
|
|
293
293
|
from rapidata.api_client.models.prompt_metadata_input import PromptMetadataInput
|
|
294
294
|
from rapidata.api_client.models.prompt_metadata_model import PromptMetadataModel
|
|
295
|
+
from rapidata.api_client.models.prompt_type import PromptType
|
|
295
296
|
from rapidata.api_client.models.proxy_file_wrapper import ProxyFileWrapper
|
|
296
297
|
from rapidata.api_client.models.public_order_model import PublicOrderModel
|
|
297
298
|
from rapidata.api_client.models.public_rapid_response import PublicRapidResponse
|
|
@@ -299,6 +300,7 @@ from rapidata.api_client.models.public_text_metadata_input import PublicTextMeta
|
|
|
299
300
|
from rapidata.api_client.models.query_model import QueryModel
|
|
300
301
|
from rapidata.api_client.models.query_validation_model import QueryValidationModel
|
|
301
302
|
from rapidata.api_client.models.rapid_issue import RapidIssue
|
|
303
|
+
from rapidata.api_client.models.rapid_modality import RapidModality
|
|
302
304
|
from rapidata.api_client.models.rapid_model import RapidModel
|
|
303
305
|
from rapidata.api_client.models.rapid_model_paged_result import RapidModelPagedResult
|
|
304
306
|
from rapidata.api_client.models.rapid_model_referee import RapidModelReferee
|
|
@@ -378,6 +380,7 @@ from rapidata.api_client.models.unlock_order_result import UnlockOrderResult
|
|
|
378
380
|
from rapidata.api_client.models.update_benchmark_name_model import UpdateBenchmarkNameModel
|
|
379
381
|
from rapidata.api_client.models.update_dataset_name_model import UpdateDatasetNameModel
|
|
380
382
|
from rapidata.api_client.models.update_dimensions_model import UpdateDimensionsModel
|
|
383
|
+
from rapidata.api_client.models.update_leaderboard_model import UpdateLeaderboardModel
|
|
381
384
|
from rapidata.api_client.models.update_leaderboard_name_model import UpdateLeaderboardNameModel
|
|
382
385
|
from rapidata.api_client.models.update_leaderboard_response_config_model import UpdateLeaderboardResponseConfigModel
|
|
383
386
|
from rapidata.api_client.models.update_order_name_model import UpdateOrderNameModel
|
|
@@ -30,8 +30,8 @@ class AddValidationRapidModel(BaseModel):
|
|
|
30
30
|
The model for adding a validation rapid.
|
|
31
31
|
""" # noqa: E501
|
|
32
32
|
payload: AddValidationRapidModelPayload
|
|
33
|
-
metadata: List[DatasetDatasetIdDatapointsPostRequestMetadataInner] = Field(description="Some metadata to attach to the rapid.")
|
|
34
|
-
truth: AddValidationRapidModelTruth
|
|
33
|
+
metadata: Optional[List[DatasetDatasetIdDatapointsPostRequestMetadataInner]] = Field(default=None, description="Some metadata to attach to the rapid.")
|
|
34
|
+
truth: Optional[AddValidationRapidModelTruth] = None
|
|
35
35
|
random_correct_probability: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The probability for an answer to be correct when randomly guessing.", alias="randomCorrectProbability")
|
|
36
36
|
explanation: Optional[StrictStr] = Field(default=None, description="An explanation for the users if they answer the rapid incorrectly.")
|
|
37
37
|
__properties: ClassVar[List[str]] = ["payload", "metadata", "truth", "randomCorrectProbability", "explanation"]
|
|
@@ -88,6 +88,16 @@ class AddValidationRapidModel(BaseModel):
|
|
|
88
88
|
# override the default output from pydantic by calling `to_dict()` of truth
|
|
89
89
|
if self.truth:
|
|
90
90
|
_dict['truth'] = self.truth.to_dict()
|
|
91
|
+
# set to None if metadata (nullable) is None
|
|
92
|
+
# and model_fields_set contains the field
|
|
93
|
+
if self.metadata is None and "metadata" in self.model_fields_set:
|
|
94
|
+
_dict['metadata'] = None
|
|
95
|
+
|
|
96
|
+
# set to None if truth (nullable) is None
|
|
97
|
+
# and model_fields_set contains the field
|
|
98
|
+
if self.truth is None and "truth" in self.model_fields_set:
|
|
99
|
+
_dict['truth'] = None
|
|
100
|
+
|
|
91
101
|
# set to None if random_correct_probability (nullable) is None
|
|
92
102
|
# and model_fields_set contains the field
|
|
93
103
|
if self.random_correct_probability is None and "random_correct_probability" in self.model_fields_set:
|
|
@@ -87,6 +87,9 @@ class AddValidationRapidModelTruth(BaseModel):
|
|
|
87
87
|
|
|
88
88
|
@field_validator('actual_instance')
|
|
89
89
|
def actual_instance_must_validate_oneof(cls, v):
|
|
90
|
+
if v is None:
|
|
91
|
+
return v
|
|
92
|
+
|
|
90
93
|
instance = AddValidationRapidModelTruth.model_construct()
|
|
91
94
|
error_messages = []
|
|
92
95
|
match = 0
|
|
@@ -164,9 +167,12 @@ class AddValidationRapidModelTruth(BaseModel):
|
|
|
164
167
|
return cls.from_json(json.dumps(obj))
|
|
165
168
|
|
|
166
169
|
@classmethod
|
|
167
|
-
def from_json(cls, json_str: str) -> Self:
|
|
170
|
+
def from_json(cls, json_str: Optional[str]) -> Self:
|
|
168
171
|
"""Returns the object represented by the json string"""
|
|
169
172
|
instance = cls.model_construct()
|
|
173
|
+
if json_str is None:
|
|
174
|
+
return instance
|
|
175
|
+
|
|
170
176
|
error_messages = []
|
|
171
177
|
match = 0
|
|
172
178
|
|
|
@@ -0,0 +1,40 @@
|
|
|
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 AssetType(str, Enum):
|
|
22
|
+
"""
|
|
23
|
+
AssetType
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
allowed enum values
|
|
28
|
+
"""
|
|
29
|
+
NONE = 'None'
|
|
30
|
+
IMAGE = 'Image'
|
|
31
|
+
VIDEO = 'Video'
|
|
32
|
+
AUDIO = 'Audio'
|
|
33
|
+
TEXT = 'Text'
|
|
34
|
+
|
|
35
|
+
@classmethod
|
|
36
|
+
def from_json(cls, json_str: str) -> Self:
|
|
37
|
+
"""Create an instance of AssetType from a JSON string"""
|
|
38
|
+
return cls(json.loads(json_str))
|
|
39
|
+
|
|
40
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Rapidata.Dataset
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import json
|
|
17
|
+
from enum import Enum
|
|
18
|
+
from typing_extensions import Self
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class PromptType(str, Enum):
|
|
22
|
+
"""
|
|
23
|
+
PromptType
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
allowed enum values
|
|
28
|
+
"""
|
|
29
|
+
NONE = 'None'
|
|
30
|
+
TEXT = 'Text'
|
|
31
|
+
ASSET = 'Asset'
|
|
32
|
+
|
|
33
|
+
@classmethod
|
|
34
|
+
def from_json(cls, json_str: str) -> Self:
|
|
35
|
+
"""Create an instance of PromptType from a JSON string"""
|
|
36
|
+
return cls(json.loads(json_str))
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,46 @@
|
|
|
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 RapidModality(str, Enum):
|
|
22
|
+
"""
|
|
23
|
+
RapidModality
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
allowed enum values
|
|
28
|
+
"""
|
|
29
|
+
NONE = 'None'
|
|
30
|
+
BOUNDINGBOX = 'BoundingBox'
|
|
31
|
+
CLASSIFY = 'Classify'
|
|
32
|
+
COMPARE = 'Compare'
|
|
33
|
+
FREETEXT = 'FreeText'
|
|
34
|
+
LINE = 'Line'
|
|
35
|
+
LOCATE = 'Locate'
|
|
36
|
+
NAMEDENTITY = 'NamedEntity'
|
|
37
|
+
POLYGON = 'Polygon'
|
|
38
|
+
SCRUB = 'Scrub'
|
|
39
|
+
TRANSCRIPTION = 'Transcription'
|
|
40
|
+
|
|
41
|
+
@classmethod
|
|
42
|
+
def from_json(cls, json_str: str) -> Self:
|
|
43
|
+
"""Create an instance of RapidModality from a JSON string"""
|
|
44
|
+
return cls(json.loads(json_str))
|
|
45
|
+
|
|
46
|
+
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Rapidata.Dataset
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class UpdateLeaderboardModel(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
The model used to update a leaderboard.
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
name: Optional[StrictStr] = None
|
|
30
|
+
response_budget: Optional[StrictInt] = Field(default=None, alias="responseBudget")
|
|
31
|
+
min_responses: Optional[StrictInt] = Field(default=None, alias="minResponses")
|
|
32
|
+
__properties: ClassVar[List[str]] = ["name", "responseBudget", "minResponses"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of UpdateLeaderboardModel from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
return _dict
|
|
74
|
+
|
|
75
|
+
@classmethod
|
|
76
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
77
|
+
"""Create an instance of UpdateLeaderboardModel from a dict"""
|
|
78
|
+
if obj is None:
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
if not isinstance(obj, dict):
|
|
82
|
+
return cls.model_validate(obj)
|
|
83
|
+
|
|
84
|
+
_obj = cls.model_validate({
|
|
85
|
+
"name": obj.get("name"),
|
|
86
|
+
"responseBudget": obj.get("responseBudget"),
|
|
87
|
+
"minResponses": obj.get("minResponses")
|
|
88
|
+
})
|
|
89
|
+
return _obj
|
|
90
|
+
|
|
91
|
+
|
|
@@ -18,8 +18,8 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from datetime import datetime
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
|
-
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
@@ -29,10 +29,43 @@ class ValidationSetModel(BaseModel):
|
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
id: StrictStr
|
|
31
31
|
name: StrictStr
|
|
32
|
+
asset_type: Optional[StrictStr] = Field(default=None, alias="assetType")
|
|
33
|
+
modality: Optional[StrictStr] = None
|
|
34
|
+
prompt_type: Optional[StrictStr] = Field(default=None, alias="promptType")
|
|
32
35
|
owner_id: StrictStr = Field(alias="ownerId")
|
|
33
36
|
owner_mail: StrictStr = Field(alias="ownerMail")
|
|
34
37
|
created_at: datetime = Field(alias="createdAt")
|
|
35
|
-
__properties: ClassVar[List[str]] = ["id", "name", "ownerId", "ownerMail", "createdAt"]
|
|
38
|
+
__properties: ClassVar[List[str]] = ["id", "name", "assetType", "modality", "promptType", "ownerId", "ownerMail", "createdAt"]
|
|
39
|
+
|
|
40
|
+
@field_validator('asset_type')
|
|
41
|
+
def asset_type_validate_enum(cls, value):
|
|
42
|
+
"""Validates the enum"""
|
|
43
|
+
if value is None:
|
|
44
|
+
return value
|
|
45
|
+
|
|
46
|
+
if value not in set(['None', 'Image', 'Video', 'Audio', 'Text']):
|
|
47
|
+
raise ValueError("must be one of enum values ('None', 'Image', 'Video', 'Audio', 'Text')")
|
|
48
|
+
return value
|
|
49
|
+
|
|
50
|
+
@field_validator('modality')
|
|
51
|
+
def modality_validate_enum(cls, value):
|
|
52
|
+
"""Validates the enum"""
|
|
53
|
+
if value is None:
|
|
54
|
+
return value
|
|
55
|
+
|
|
56
|
+
if value not in set(['None', 'BoundingBox', 'Classify', 'Compare', 'FreeText', 'Line', 'Locate', 'NamedEntity', 'Polygon', 'Scrub', 'Transcription']):
|
|
57
|
+
raise ValueError("must be one of enum values ('None', 'BoundingBox', 'Classify', 'Compare', 'FreeText', 'Line', 'Locate', 'NamedEntity', 'Polygon', 'Scrub', 'Transcription')")
|
|
58
|
+
return value
|
|
59
|
+
|
|
60
|
+
@field_validator('prompt_type')
|
|
61
|
+
def prompt_type_validate_enum(cls, value):
|
|
62
|
+
"""Validates the enum"""
|
|
63
|
+
if value is None:
|
|
64
|
+
return value
|
|
65
|
+
|
|
66
|
+
if value not in set(['None', 'Text', 'Asset']):
|
|
67
|
+
raise ValueError("must be one of enum values ('None', 'Text', 'Asset')")
|
|
68
|
+
return value
|
|
36
69
|
|
|
37
70
|
model_config = ConfigDict(
|
|
38
71
|
populate_by_name=True,
|
|
@@ -73,6 +106,21 @@ class ValidationSetModel(BaseModel):
|
|
|
73
106
|
exclude=excluded_fields,
|
|
74
107
|
exclude_none=True,
|
|
75
108
|
)
|
|
109
|
+
# set to None if asset_type (nullable) is None
|
|
110
|
+
# and model_fields_set contains the field
|
|
111
|
+
if self.asset_type is None and "asset_type" in self.model_fields_set:
|
|
112
|
+
_dict['assetType'] = None
|
|
113
|
+
|
|
114
|
+
# set to None if modality (nullable) is None
|
|
115
|
+
# and model_fields_set contains the field
|
|
116
|
+
if self.modality is None and "modality" in self.model_fields_set:
|
|
117
|
+
_dict['modality'] = None
|
|
118
|
+
|
|
119
|
+
# set to None if prompt_type (nullable) is None
|
|
120
|
+
# and model_fields_set contains the field
|
|
121
|
+
if self.prompt_type is None and "prompt_type" in self.model_fields_set:
|
|
122
|
+
_dict['promptType'] = None
|
|
123
|
+
|
|
76
124
|
return _dict
|
|
77
125
|
|
|
78
126
|
@classmethod
|
|
@@ -87,6 +135,9 @@ class ValidationSetModel(BaseModel):
|
|
|
87
135
|
_obj = cls.model_validate({
|
|
88
136
|
"id": obj.get("id"),
|
|
89
137
|
"name": obj.get("name"),
|
|
138
|
+
"assetType": obj.get("assetType"),
|
|
139
|
+
"modality": obj.get("modality"),
|
|
140
|
+
"promptType": obj.get("promptType"),
|
|
90
141
|
"ownerId": obj.get("ownerId"),
|
|
91
142
|
"ownerMail": obj.get("ownerMail"),
|
|
92
143
|
"createdAt": obj.get("createdAt")
|
rapidata/api_client_README.md
CHANGED
|
@@ -136,6 +136,7 @@ Class | Method | HTTP request | Description
|
|
|
136
136
|
*LeaderboardApi* | [**leaderboard_leaderboard_id_participants_get**](rapidata/api_client/docs/LeaderboardApi.md#leaderboard_leaderboard_id_participants_get) | **GET** /leaderboard/{leaderboardId}/participants | queries all the participants connected to leaderboard by its ID.
|
|
137
137
|
*LeaderboardApi* | [**leaderboard_leaderboard_id_participants_participant_id_submit_post**](rapidata/api_client/docs/LeaderboardApi.md#leaderboard_leaderboard_id_participants_participant_id_submit_post) | **POST** /leaderboard/{leaderboardId}/participants/{participantId}/submit | Submits a participant to a leaderboard.
|
|
138
138
|
*LeaderboardApi* | [**leaderboard_leaderboard_id_participants_post**](rapidata/api_client/docs/LeaderboardApi.md#leaderboard_leaderboard_id_participants_post) | **POST** /leaderboard/{leaderboardId}/participants | Creates a participant in a leaderboard.
|
|
139
|
+
*LeaderboardApi* | [**leaderboard_leaderboard_id_patch**](rapidata/api_client/docs/LeaderboardApi.md#leaderboard_leaderboard_id_patch) | **PATCH** /leaderboard/{leaderboardId} | Updates the response config of a leaderboard.
|
|
139
140
|
*LeaderboardApi* | [**leaderboard_leaderboard_id_prompts_get**](rapidata/api_client/docs/LeaderboardApi.md#leaderboard_leaderboard_id_prompts_get) | **GET** /leaderboard/{leaderboardId}/prompts | returns the paged prompts of a leaderboard by its ID.
|
|
140
141
|
*LeaderboardApi* | [**leaderboard_leaderboard_id_prompts_post**](rapidata/api_client/docs/LeaderboardApi.md#leaderboard_leaderboard_id_prompts_post) | **POST** /leaderboard/{leaderboardId}/prompts | adds a new prompt to a leaderboard.
|
|
141
142
|
*LeaderboardApi* | [**leaderboard_leaderboard_id_response_config_put**](rapidata/api_client/docs/LeaderboardApi.md#leaderboard_leaderboard_id_response_config_put) | **PUT** /leaderboard/{leaderboardId}/response-config | Updates the response config of a leaderboard.
|
|
@@ -189,21 +190,22 @@ Class | Method | HTTP request | Description
|
|
|
189
190
|
*UserRapidApi* | [**rapid_response_post**](rapidata/api_client/docs/UserRapidApi.md#rapid_response_post) | **POST** /rapid/response | Submits a response for a Rapid.
|
|
190
191
|
*UserRapidApi* | [**rapid_skip_post**](rapidata/api_client/docs/UserRapidApi.md#rapid_skip_post) | **POST** /rapid/skip | Skips a Rapid for the user.
|
|
191
192
|
*ValidationSetApi* | [**validation_set_post**](rapidata/api_client/docs/ValidationSetApi.md#validation_set_post) | **POST** /validation-set | Creates a new empty validation set.
|
|
193
|
+
*ValidationSetApi* | [**validation_set_recommended_get**](rapidata/api_client/docs/ValidationSetApi.md#validation_set_recommended_get) | **GET** /validation-set/recommended | Gets a validation set that is available to the user and best matches the provided parameters.
|
|
192
194
|
*ValidationSetApi* | [**validation_set_validation_set_id_delete**](rapidata/api_client/docs/ValidationSetApi.md#validation_set_validation_set_id_delete) | **DELETE** /validation-set/{validationSetId} | Gets a validation set by the id.
|
|
193
195
|
*ValidationSetApi* | [**validation_set_validation_set_id_dimensions_patch**](rapidata/api_client/docs/ValidationSetApi.md#validation_set_validation_set_id_dimensions_patch) | **PATCH** /validation-set/{validationSetId}/dimensions | Updates the dimensions of all rapids within a validation set.
|
|
194
196
|
*ValidationSetApi* | [**validation_set_validation_set_id_dimensions_put**](rapidata/api_client/docs/ValidationSetApi.md#validation_set_validation_set_id_dimensions_put) | **PUT** /validation-set/{validationSetId}/dimensions | Updates the dimensions of all rapids within a validation set.
|
|
195
197
|
*ValidationSetApi* | [**validation_set_validation_set_id_export_get**](rapidata/api_client/docs/ValidationSetApi.md#validation_set_validation_set_id_export_get) | **GET** /validation-set/{validationSetId}/export | Exports all rapids of a validation-set to a file.
|
|
196
198
|
*ValidationSetApi* | [**validation_set_validation_set_id_get**](rapidata/api_client/docs/ValidationSetApi.md#validation_set_validation_set_id_get) | **GET** /validation-set/{validationSetId} | Gets a validation set by the id.
|
|
197
|
-
*ValidationSetApi* | [**validation_set_validation_set_id_rapid_files_post**](rapidata/api_client/docs/ValidationSetApi.md#validation_set_validation_set_id_rapid_files_post) | **POST** /validation-set/{validationSetId}/rapid/files | Adds a new validation rapid to the specified validation set using files to create the assets.
|
|
198
199
|
*ValidationSetApi* | [**validation_set_validation_set_id_rapid_post**](rapidata/api_client/docs/ValidationSetApi.md#validation_set_validation_set_id_rapid_post) | **POST** /validation-set/{validationSetId}/rapid | Adds a new validation rapid to the specified validation set using files to create the assets.
|
|
199
|
-
*ValidationSetApi* | [**validation_set_validation_set_id_rapid_texts_post**](rapidata/api_client/docs/ValidationSetApi.md#validation_set_validation_set_id_rapid_texts_post) | **POST** /validation-set/{validationSetId}/rapid/texts | Adds a new validation rapid to the specified validation set using text sources to create the assets.
|
|
200
200
|
*ValidationSetApi* | [**validation_set_validation_set_id_rapids_get**](rapidata/api_client/docs/ValidationSetApi.md#validation_set_validation_set_id_rapids_get) | **GET** /validation-set/{validationSetId}/rapids | Queries the validation rapids for a specific validation set.
|
|
201
201
|
*ValidationSetApi* | [**validation_set_validation_set_id_shouldalert_patch**](rapidata/api_client/docs/ValidationSetApi.md#validation_set_validation_set_id_shouldalert_patch) | **PATCH** /validation-set/{validationSetId}/shouldalert | Updates the dimensions of all rapids within a validation set.
|
|
202
202
|
*ValidationSetApi* | [**validation_set_validation_set_id_shouldalert_put**](rapidata/api_client/docs/ValidationSetApi.md#validation_set_validation_set_id_shouldalert_put) | **PUT** /validation-set/{validationSetId}/shouldalert | Updates the of all rapshouldAlert property of all rapids within a validation set.
|
|
203
|
+
*ValidationSetApi* | [**validation_set_validation_set_id_update_labeling_hints_post**](rapidata/api_client/docs/ValidationSetApi.md#validation_set_validation_set_id_update_labeling_hints_post) | **POST** /validation-set/{validationSetId}/update-labeling-hints | Refreshes the labeling hints for a validation set.
|
|
204
|
+
*ValidationSetApi* | [**validation_set_validation_set_id_visibility_patch**](rapidata/api_client/docs/ValidationSetApi.md#validation_set_validation_set_id_visibility_patch) | **PATCH** /validation-set/{validationSetId}/visibility | Updates the visibility of a validation set.
|
|
203
205
|
*ValidationSetApi* | [**validation_set_zip_compare_post**](rapidata/api_client/docs/ValidationSetApi.md#validation_set_zip_compare_post) | **POST** /validation-set/zip/compare | Imports a compare validation set from a zip file.
|
|
204
206
|
*ValidationSetApi* | [**validation_set_zip_post**](rapidata/api_client/docs/ValidationSetApi.md#validation_set_zip_post) | **POST** /validation-set/zip | Imports a validation set from a zip file.
|
|
205
207
|
*ValidationSetApi* | [**validation_sets_available_get**](rapidata/api_client/docs/ValidationSetApi.md#validation_sets_available_get) | **GET** /validation-sets/available | Gets the available validation sets for the current user.
|
|
206
|
-
*ValidationSetApi* | [**validation_sets_get**](rapidata/api_client/docs/ValidationSetApi.md#validation_sets_get) | **GET** /validation-sets | Queries validation sets based on the provided filter, paging and sorting criteria.
|
|
208
|
+
*ValidationSetApi* | [**validation_sets_get**](rapidata/api_client/docs/ValidationSetApi.md#validation_sets_get) | **GET** /validation-sets | Queries available validation sets based on the provided filter, paging and sorting criteria.
|
|
207
209
|
*WorkflowApi* | [**workflow_delete_delete**](rapidata/api_client/docs/WorkflowApi.md#workflow_delete_delete) | **DELETE** /workflow/delete | Deletes a workflow.
|
|
208
210
|
*WorkflowApi* | [**workflow_workflow_id_compare_ab_summary_get**](rapidata/api_client/docs/WorkflowApi.md#workflow_workflow_id_compare_ab_summary_get) | **GET** /workflow/{workflowId}/compare-ab-summary | Calculates a summary of the results for a simple compare workflow. The summary includes the number of times an asset at each index was the winner.
|
|
209
211
|
*WorkflowApi* | [**workflow_workflow_id_get**](rapidata/api_client/docs/WorkflowApi.md#workflow_workflow_id_get) | **GET** /workflow/{workflowId} | Get a workflow by its ID.
|
|
@@ -221,7 +223,6 @@ Class | Method | HTTP request | Description
|
|
|
221
223
|
- [AddValidationRapidModelPayload](rapidata/api_client/docs/AddValidationRapidModelPayload.md)
|
|
222
224
|
- [AddValidationRapidModelTruth](rapidata/api_client/docs/AddValidationRapidModelTruth.md)
|
|
223
225
|
- [AddValidationRapidResult](rapidata/api_client/docs/AddValidationRapidResult.md)
|
|
224
|
-
- [AddValidationTextRapidModel](rapidata/api_client/docs/AddValidationTextRapidModel.md)
|
|
225
226
|
- [AgeGroup](rapidata/api_client/docs/AgeGroup.md)
|
|
226
227
|
- [AgeUserFilterModel](rapidata/api_client/docs/AgeUserFilterModel.md)
|
|
227
228
|
- [AggregatorType](rapidata/api_client/docs/AggregatorType.md)
|
|
@@ -233,6 +234,7 @@ Class | Method | HTTP request | Description
|
|
|
233
234
|
- [AssetMetadata](rapidata/api_client/docs/AssetMetadata.md)
|
|
234
235
|
- [AssetMetadataAsset](rapidata/api_client/docs/AssetMetadataAsset.md)
|
|
235
236
|
- [AssetMetadataModel](rapidata/api_client/docs/AssetMetadataModel.md)
|
|
237
|
+
- [AssetType](rapidata/api_client/docs/AssetType.md)
|
|
236
238
|
- [AttachCategoryRapidBlueprint](rapidata/api_client/docs/AttachCategoryRapidBlueprint.md)
|
|
237
239
|
- [AttachCategoryResult](rapidata/api_client/docs/AttachCategoryResult.md)
|
|
238
240
|
- [AttachCategoryTruth](rapidata/api_client/docs/AttachCategoryTruth.md)
|
|
@@ -492,6 +494,7 @@ Class | Method | HTTP request | Description
|
|
|
492
494
|
- [PromptMetadata](rapidata/api_client/docs/PromptMetadata.md)
|
|
493
495
|
- [PromptMetadataInput](rapidata/api_client/docs/PromptMetadataInput.md)
|
|
494
496
|
- [PromptMetadataModel](rapidata/api_client/docs/PromptMetadataModel.md)
|
|
497
|
+
- [PromptType](rapidata/api_client/docs/PromptType.md)
|
|
495
498
|
- [ProxyFileWrapper](rapidata/api_client/docs/ProxyFileWrapper.md)
|
|
496
499
|
- [PublicOrderModel](rapidata/api_client/docs/PublicOrderModel.md)
|
|
497
500
|
- [PublicRapidResponse](rapidata/api_client/docs/PublicRapidResponse.md)
|
|
@@ -499,6 +502,7 @@ Class | Method | HTTP request | Description
|
|
|
499
502
|
- [QueryModel](rapidata/api_client/docs/QueryModel.md)
|
|
500
503
|
- [QueryValidationModel](rapidata/api_client/docs/QueryValidationModel.md)
|
|
501
504
|
- [RapidIssue](rapidata/api_client/docs/RapidIssue.md)
|
|
505
|
+
- [RapidModality](rapidata/api_client/docs/RapidModality.md)
|
|
502
506
|
- [RapidModel](rapidata/api_client/docs/RapidModel.md)
|
|
503
507
|
- [RapidModelPagedResult](rapidata/api_client/docs/RapidModelPagedResult.md)
|
|
504
508
|
- [RapidModelReferee](rapidata/api_client/docs/RapidModelReferee.md)
|
|
@@ -578,6 +582,7 @@ Class | Method | HTTP request | Description
|
|
|
578
582
|
- [UpdateBenchmarkNameModel](rapidata/api_client/docs/UpdateBenchmarkNameModel.md)
|
|
579
583
|
- [UpdateDatasetNameModel](rapidata/api_client/docs/UpdateDatasetNameModel.md)
|
|
580
584
|
- [UpdateDimensionsModel](rapidata/api_client/docs/UpdateDimensionsModel.md)
|
|
585
|
+
- [UpdateLeaderboardModel](rapidata/api_client/docs/UpdateLeaderboardModel.md)
|
|
581
586
|
- [UpdateLeaderboardNameModel](rapidata/api_client/docs/UpdateLeaderboardNameModel.md)
|
|
582
587
|
- [UpdateLeaderboardResponseConfigModel](rapidata/api_client/docs/UpdateLeaderboardResponseConfigModel.md)
|
|
583
588
|
- [UpdateOrderNameModel](rapidata/api_client/docs/UpdateOrderNameModel.md)
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
from typing import Any
|
|
2
2
|
from rapidata.api_client.models.simple_workflow_model import SimpleWorkflowModel
|
|
3
|
-
from rapidata.api_client.models.simple_workflow_model_blueprint import
|
|
3
|
+
from rapidata.api_client.models.simple_workflow_model_blueprint import (
|
|
4
|
+
SimpleWorkflowModelBlueprint,
|
|
5
|
+
)
|
|
4
6
|
from rapidata.rapidata_client.workflow import Workflow
|
|
5
7
|
from rapidata.api_client.models.free_text_rapid_blueprint import FreeTextRapidBlueprint
|
|
6
8
|
|
|
@@ -17,11 +19,14 @@ class FreeTextWorkflow(Workflow):
|
|
|
17
19
|
|
|
18
20
|
Args:
|
|
19
21
|
instruction (str): The instruction to be presented for free text input.
|
|
22
|
+
validation_system_prompt (str): The system prompt to determine if the provided free text response is spam or not.
|
|
23
|
+
Should always specify that the LLM should respond with 'not spam' or 'spam'.
|
|
20
24
|
"""
|
|
21
25
|
|
|
22
|
-
def __init__(self, instruction: str):
|
|
26
|
+
def __init__(self, instruction: str, validation_system_prompt: str | None = None):
|
|
23
27
|
super().__init__(type="SimpleWorkflowConfig")
|
|
24
28
|
self._instruction = instruction
|
|
29
|
+
self._validation_system_prompt = validation_system_prompt
|
|
25
30
|
|
|
26
31
|
def _to_dict(self) -> dict[str, Any]:
|
|
27
32
|
return {
|
|
@@ -29,6 +34,7 @@ class FreeTextWorkflow(Workflow):
|
|
|
29
34
|
"blueprint": {
|
|
30
35
|
"_t": "FreeTextBlueprint",
|
|
31
36
|
"question": self._instruction,
|
|
37
|
+
"validationSystemPrompt": self._validation_system_prompt,
|
|
32
38
|
},
|
|
33
39
|
}
|
|
34
40
|
|
|
@@ -36,6 +42,7 @@ class FreeTextWorkflow(Workflow):
|
|
|
36
42
|
blueprint = FreeTextRapidBlueprint(
|
|
37
43
|
_t="FreeTextBlueprint",
|
|
38
44
|
question=self._instruction,
|
|
45
|
+
validationSystemPrompt=self._validation_system_prompt,
|
|
39
46
|
)
|
|
40
47
|
|
|
41
48
|
return SimpleWorkflowModel(
|