rapidata 2.30.0__py3-none-any.whl → 2.31.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.

@@ -1402,7 +1402,7 @@ class ValidationSetApi:
1402
1402
  _headers: Optional[Dict[StrictStr, Any]] = None,
1403
1403
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1404
1404
  ) -> AddValidationRapidResult:
1405
- """Adds a new validation rapid to the specified validation set using files to create the assets.
1405
+ """(Deprecated) Adds a new validation rapid to the specified validation set using files to create the assets.
1406
1406
 
1407
1407
 
1408
1408
  :param validation_set_id: The ID of the validation set to add the rapid to. (required)
@@ -1432,6 +1432,7 @@ class ValidationSetApi:
1432
1432
  :type _host_index: int, optional
1433
1433
  :return: Returns the result object.
1434
1434
  """ # noqa: E501
1435
+ warnings.warn("POST /validation-set/{validationSetId}/rapid/files is deprecated.", DeprecationWarning)
1435
1436
 
1436
1437
  _param = self._validation_set_validation_set_id_rapid_files_post_serialize(
1437
1438
  validation_set_id=validation_set_id,
@@ -1476,7 +1477,7 @@ class ValidationSetApi:
1476
1477
  _headers: Optional[Dict[StrictStr, Any]] = None,
1477
1478
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1478
1479
  ) -> ApiResponse[AddValidationRapidResult]:
1479
- """Adds a new validation rapid to the specified validation set using files to create the assets.
1480
+ """(Deprecated) Adds a new validation rapid to the specified validation set using files to create the assets.
1480
1481
 
1481
1482
 
1482
1483
  :param validation_set_id: The ID of the validation set to add the rapid to. (required)
@@ -1506,6 +1507,7 @@ class ValidationSetApi:
1506
1507
  :type _host_index: int, optional
1507
1508
  :return: Returns the result object.
1508
1509
  """ # noqa: E501
1510
+ warnings.warn("POST /validation-set/{validationSetId}/rapid/files is deprecated.", DeprecationWarning)
1509
1511
 
1510
1512
  _param = self._validation_set_validation_set_id_rapid_files_post_serialize(
1511
1513
  validation_set_id=validation_set_id,
@@ -1550,7 +1552,7 @@ class ValidationSetApi:
1550
1552
  _headers: Optional[Dict[StrictStr, Any]] = None,
1551
1553
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1552
1554
  ) -> RESTResponseType:
1553
- """Adds a new validation rapid to the specified validation set using files to create the assets.
1555
+ """(Deprecated) Adds a new validation rapid to the specified validation set using files to create the assets.
1554
1556
 
1555
1557
 
1556
1558
  :param validation_set_id: The ID of the validation set to add the rapid to. (required)
@@ -1580,6 +1582,7 @@ class ValidationSetApi:
1580
1582
  :type _host_index: int, optional
1581
1583
  :return: Returns the result object.
1582
1584
  """ # noqa: E501
1585
+ warnings.warn("POST /validation-set/{validationSetId}/rapid/files is deprecated.", DeprecationWarning)
1583
1586
 
1584
1587
  _param = self._validation_set_validation_set_id_rapid_files_post_serialize(
1585
1588
  validation_set_id=validation_set_id,
@@ -1688,6 +1691,343 @@ class ValidationSetApi:
1688
1691
 
1689
1692
 
1690
1693
 
1694
+ @validate_call
1695
+ def validation_set_validation_set_id_rapid_post(
1696
+ self,
1697
+ validation_set_id: Annotated[StrictStr, Field(description="The ID of the validation set to add the rapid to.")],
1698
+ model: Optional[AddValidationRapidModel] = None,
1699
+ files: Optional[List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]]] = None,
1700
+ texts: Annotated[Optional[List[StrictStr]], Field(description="The texts to use for the rapid.")] = None,
1701
+ urls: Annotated[Optional[List[StrictStr]], Field(description="The urls to use for the rapid")] = None,
1702
+ _request_timeout: Union[
1703
+ None,
1704
+ Annotated[StrictFloat, Field(gt=0)],
1705
+ Tuple[
1706
+ Annotated[StrictFloat, Field(gt=0)],
1707
+ Annotated[StrictFloat, Field(gt=0)]
1708
+ ]
1709
+ ] = None,
1710
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1711
+ _content_type: Optional[StrictStr] = None,
1712
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1713
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1714
+ ) -> AddValidationRapidResult:
1715
+ """Adds a new validation rapid to the specified validation set using files to create the assets.
1716
+
1717
+
1718
+ :param validation_set_id: The ID of the validation set to add the rapid to. (required)
1719
+ :type validation_set_id: str
1720
+ :param model:
1721
+ :type model: AddValidationRapidModel
1722
+ :param files:
1723
+ :type files: List[bytearray]
1724
+ :param texts: The texts to use for the rapid.
1725
+ :type texts: List[str]
1726
+ :param urls: The urls to use for the rapid
1727
+ :type urls: List[str]
1728
+ :param _request_timeout: timeout setting for this request. If one
1729
+ number provided, it will be total request
1730
+ timeout. It can also be a pair (tuple) of
1731
+ (connection, read) timeouts.
1732
+ :type _request_timeout: int, tuple(int, int), optional
1733
+ :param _request_auth: set to override the auth_settings for an a single
1734
+ request; this effectively ignores the
1735
+ authentication in the spec for a single request.
1736
+ :type _request_auth: dict, optional
1737
+ :param _content_type: force content-type for the request.
1738
+ :type _content_type: str, Optional
1739
+ :param _headers: set to override the headers for a single
1740
+ request; this effectively ignores the headers
1741
+ in the spec for a single request.
1742
+ :type _headers: dict, optional
1743
+ :param _host_index: set to override the host_index for a single
1744
+ request; this effectively ignores the host_index
1745
+ in the spec for a single request.
1746
+ :type _host_index: int, optional
1747
+ :return: Returns the result object.
1748
+ """ # noqa: E501
1749
+
1750
+ _param = self._validation_set_validation_set_id_rapid_post_serialize(
1751
+ validation_set_id=validation_set_id,
1752
+ model=model,
1753
+ files=files,
1754
+ texts=texts,
1755
+ urls=urls,
1756
+ _request_auth=_request_auth,
1757
+ _content_type=_content_type,
1758
+ _headers=_headers,
1759
+ _host_index=_host_index
1760
+ )
1761
+
1762
+ _response_types_map: Dict[str, Optional[str]] = {
1763
+ '200': "AddValidationRapidResult",
1764
+ }
1765
+ response_data = self.api_client.call_api(
1766
+ *_param,
1767
+ _request_timeout=_request_timeout
1768
+ )
1769
+ response_data.read()
1770
+ return self.api_client.response_deserialize(
1771
+ response_data=response_data,
1772
+ response_types_map=_response_types_map,
1773
+ ).data
1774
+
1775
+
1776
+ @validate_call
1777
+ def validation_set_validation_set_id_rapid_post_with_http_info(
1778
+ self,
1779
+ validation_set_id: Annotated[StrictStr, Field(description="The ID of the validation set to add the rapid to.")],
1780
+ model: Optional[AddValidationRapidModel] = None,
1781
+ files: Optional[List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]]] = None,
1782
+ texts: Annotated[Optional[List[StrictStr]], Field(description="The texts to use for the rapid.")] = None,
1783
+ urls: Annotated[Optional[List[StrictStr]], Field(description="The urls to use for the rapid")] = None,
1784
+ _request_timeout: Union[
1785
+ None,
1786
+ Annotated[StrictFloat, Field(gt=0)],
1787
+ Tuple[
1788
+ Annotated[StrictFloat, Field(gt=0)],
1789
+ Annotated[StrictFloat, Field(gt=0)]
1790
+ ]
1791
+ ] = None,
1792
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1793
+ _content_type: Optional[StrictStr] = None,
1794
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1795
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1796
+ ) -> ApiResponse[AddValidationRapidResult]:
1797
+ """Adds a new validation rapid to the specified validation set using files to create the assets.
1798
+
1799
+
1800
+ :param validation_set_id: The ID of the validation set to add the rapid to. (required)
1801
+ :type validation_set_id: str
1802
+ :param model:
1803
+ :type model: AddValidationRapidModel
1804
+ :param files:
1805
+ :type files: List[bytearray]
1806
+ :param texts: The texts to use for the rapid.
1807
+ :type texts: List[str]
1808
+ :param urls: The urls to use for the rapid
1809
+ :type urls: List[str]
1810
+ :param _request_timeout: timeout setting for this request. If one
1811
+ number provided, it will be total request
1812
+ timeout. It can also be a pair (tuple) of
1813
+ (connection, read) timeouts.
1814
+ :type _request_timeout: int, tuple(int, int), optional
1815
+ :param _request_auth: set to override the auth_settings for an a single
1816
+ request; this effectively ignores the
1817
+ authentication in the spec for a single request.
1818
+ :type _request_auth: dict, optional
1819
+ :param _content_type: force content-type for the request.
1820
+ :type _content_type: str, Optional
1821
+ :param _headers: set to override the headers for a single
1822
+ request; this effectively ignores the headers
1823
+ in the spec for a single request.
1824
+ :type _headers: dict, optional
1825
+ :param _host_index: set to override the host_index for a single
1826
+ request; this effectively ignores the host_index
1827
+ in the spec for a single request.
1828
+ :type _host_index: int, optional
1829
+ :return: Returns the result object.
1830
+ """ # noqa: E501
1831
+
1832
+ _param = self._validation_set_validation_set_id_rapid_post_serialize(
1833
+ validation_set_id=validation_set_id,
1834
+ model=model,
1835
+ files=files,
1836
+ texts=texts,
1837
+ urls=urls,
1838
+ _request_auth=_request_auth,
1839
+ _content_type=_content_type,
1840
+ _headers=_headers,
1841
+ _host_index=_host_index
1842
+ )
1843
+
1844
+ _response_types_map: Dict[str, Optional[str]] = {
1845
+ '200': "AddValidationRapidResult",
1846
+ }
1847
+ response_data = self.api_client.call_api(
1848
+ *_param,
1849
+ _request_timeout=_request_timeout
1850
+ )
1851
+ response_data.read()
1852
+ return self.api_client.response_deserialize(
1853
+ response_data=response_data,
1854
+ response_types_map=_response_types_map,
1855
+ )
1856
+
1857
+
1858
+ @validate_call
1859
+ def validation_set_validation_set_id_rapid_post_without_preload_content(
1860
+ self,
1861
+ validation_set_id: Annotated[StrictStr, Field(description="The ID of the validation set to add the rapid to.")],
1862
+ model: Optional[AddValidationRapidModel] = None,
1863
+ files: Optional[List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]]] = None,
1864
+ texts: Annotated[Optional[List[StrictStr]], Field(description="The texts to use for the rapid.")] = None,
1865
+ urls: Annotated[Optional[List[StrictStr]], Field(description="The urls to use for the rapid")] = None,
1866
+ _request_timeout: Union[
1867
+ None,
1868
+ Annotated[StrictFloat, Field(gt=0)],
1869
+ Tuple[
1870
+ Annotated[StrictFloat, Field(gt=0)],
1871
+ Annotated[StrictFloat, Field(gt=0)]
1872
+ ]
1873
+ ] = None,
1874
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1875
+ _content_type: Optional[StrictStr] = None,
1876
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1877
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1878
+ ) -> RESTResponseType:
1879
+ """Adds a new validation rapid to the specified validation set using files to create the assets.
1880
+
1881
+
1882
+ :param validation_set_id: The ID of the validation set to add the rapid to. (required)
1883
+ :type validation_set_id: str
1884
+ :param model:
1885
+ :type model: AddValidationRapidModel
1886
+ :param files:
1887
+ :type files: List[bytearray]
1888
+ :param texts: The texts to use for the rapid.
1889
+ :type texts: List[str]
1890
+ :param urls: The urls to use for the rapid
1891
+ :type urls: List[str]
1892
+ :param _request_timeout: timeout setting for this request. If one
1893
+ number provided, it will be total request
1894
+ timeout. It can also be a pair (tuple) of
1895
+ (connection, read) timeouts.
1896
+ :type _request_timeout: int, tuple(int, int), optional
1897
+ :param _request_auth: set to override the auth_settings for an a single
1898
+ request; this effectively ignores the
1899
+ authentication in the spec for a single request.
1900
+ :type _request_auth: dict, optional
1901
+ :param _content_type: force content-type for the request.
1902
+ :type _content_type: str, Optional
1903
+ :param _headers: set to override the headers for a single
1904
+ request; this effectively ignores the headers
1905
+ in the spec for a single request.
1906
+ :type _headers: dict, optional
1907
+ :param _host_index: set to override the host_index for a single
1908
+ request; this effectively ignores the host_index
1909
+ in the spec for a single request.
1910
+ :type _host_index: int, optional
1911
+ :return: Returns the result object.
1912
+ """ # noqa: E501
1913
+
1914
+ _param = self._validation_set_validation_set_id_rapid_post_serialize(
1915
+ validation_set_id=validation_set_id,
1916
+ model=model,
1917
+ files=files,
1918
+ texts=texts,
1919
+ urls=urls,
1920
+ _request_auth=_request_auth,
1921
+ _content_type=_content_type,
1922
+ _headers=_headers,
1923
+ _host_index=_host_index
1924
+ )
1925
+
1926
+ _response_types_map: Dict[str, Optional[str]] = {
1927
+ '200': "AddValidationRapidResult",
1928
+ }
1929
+ response_data = self.api_client.call_api(
1930
+ *_param,
1931
+ _request_timeout=_request_timeout
1932
+ )
1933
+ return response_data.response
1934
+
1935
+
1936
+ def _validation_set_validation_set_id_rapid_post_serialize(
1937
+ self,
1938
+ validation_set_id,
1939
+ model,
1940
+ files,
1941
+ texts,
1942
+ urls,
1943
+ _request_auth,
1944
+ _content_type,
1945
+ _headers,
1946
+ _host_index,
1947
+ ) -> RequestSerialized:
1948
+
1949
+ _host = None
1950
+
1951
+ _collection_formats: Dict[str, str] = {
1952
+ 'files': 'multi',
1953
+ 'texts': 'multi',
1954
+ 'urls': 'multi',
1955
+ }
1956
+
1957
+ _path_params: Dict[str, str] = {}
1958
+ _query_params: List[Tuple[str, str]] = []
1959
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1960
+ _form_params: List[Tuple[str, str]] = []
1961
+ _files: Dict[
1962
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1963
+ ] = {}
1964
+ _body_params: Optional[bytes] = None
1965
+
1966
+ # process the path parameters
1967
+ if validation_set_id is not None:
1968
+ _path_params['validationSetId'] = validation_set_id
1969
+ # process the query parameters
1970
+ # process the header parameters
1971
+ # process the form parameters
1972
+ if model is not None:
1973
+ _form_params.append(('model', model))
1974
+ if files is not None:
1975
+ _files['files'] = files
1976
+ if texts is not None:
1977
+ _form_params.append(('texts', texts))
1978
+ if urls is not None:
1979
+ _form_params.append(('urls', urls))
1980
+ # process the body parameter
1981
+
1982
+
1983
+ # set the HTTP header `Accept`
1984
+ if 'Accept' not in _header_params:
1985
+ _header_params['Accept'] = self.api_client.select_header_accept(
1986
+ [
1987
+ 'text/plain',
1988
+ 'application/json',
1989
+ 'text/json'
1990
+ ]
1991
+ )
1992
+
1993
+ # set the HTTP header `Content-Type`
1994
+ if _content_type:
1995
+ _header_params['Content-Type'] = _content_type
1996
+ else:
1997
+ _default_content_type = (
1998
+ self.api_client.select_header_content_type(
1999
+ [
2000
+ 'multipart/form-data'
2001
+ ]
2002
+ )
2003
+ )
2004
+ if _default_content_type is not None:
2005
+ _header_params['Content-Type'] = _default_content_type
2006
+
2007
+ # authentication setting
2008
+ _auth_settings: List[str] = [
2009
+ 'bearer',
2010
+ 'oauth2'
2011
+ ]
2012
+
2013
+ return self.api_client.param_serialize(
2014
+ method='POST',
2015
+ resource_path='/validation-set/{validationSetId}/rapid',
2016
+ path_params=_path_params,
2017
+ query_params=_query_params,
2018
+ header_params=_header_params,
2019
+ body=_body_params,
2020
+ post_params=_form_params,
2021
+ files=_files,
2022
+ auth_settings=_auth_settings,
2023
+ collection_formats=_collection_formats,
2024
+ _host=_host,
2025
+ _request_auth=_request_auth
2026
+ )
2027
+
2028
+
2029
+
2030
+
1691
2031
  @validate_call
1692
2032
  def validation_set_validation_set_id_rapid_texts_post(
1693
2033
  self,
@@ -1706,7 +2046,7 @@ class ValidationSetApi:
1706
2046
  _headers: Optional[Dict[StrictStr, Any]] = None,
1707
2047
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1708
2048
  ) -> AddValidationRapidResult:
1709
- """Adds a new validation rapid to the specified validation set using text sources to create the assets.
2049
+ """(Deprecated) Adds a new validation rapid to the specified validation set using text sources to create the assets.
1710
2050
 
1711
2051
 
1712
2052
  :param validation_set_id: The ID of the validation set to add the rapid to. (required)
@@ -1734,6 +2074,7 @@ class ValidationSetApi:
1734
2074
  :type _host_index: int, optional
1735
2075
  :return: Returns the result object.
1736
2076
  """ # noqa: E501
2077
+ warnings.warn("POST /validation-set/{validationSetId}/rapid/texts is deprecated.", DeprecationWarning)
1737
2078
 
1738
2079
  _param = self._validation_set_validation_set_id_rapid_texts_post_serialize(
1739
2080
  validation_set_id=validation_set_id,
@@ -1776,7 +2117,7 @@ class ValidationSetApi:
1776
2117
  _headers: Optional[Dict[StrictStr, Any]] = None,
1777
2118
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1778
2119
  ) -> ApiResponse[AddValidationRapidResult]:
1779
- """Adds a new validation rapid to the specified validation set using text sources to create the assets.
2120
+ """(Deprecated) Adds a new validation rapid to the specified validation set using text sources to create the assets.
1780
2121
 
1781
2122
 
1782
2123
  :param validation_set_id: The ID of the validation set to add the rapid to. (required)
@@ -1804,6 +2145,7 @@ class ValidationSetApi:
1804
2145
  :type _host_index: int, optional
1805
2146
  :return: Returns the result object.
1806
2147
  """ # noqa: E501
2148
+ warnings.warn("POST /validation-set/{validationSetId}/rapid/texts is deprecated.", DeprecationWarning)
1807
2149
 
1808
2150
  _param = self._validation_set_validation_set_id_rapid_texts_post_serialize(
1809
2151
  validation_set_id=validation_set_id,
@@ -1846,7 +2188,7 @@ class ValidationSetApi:
1846
2188
  _headers: Optional[Dict[StrictStr, Any]] = None,
1847
2189
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1848
2190
  ) -> RESTResponseType:
1849
- """Adds a new validation rapid to the specified validation set using text sources to create the assets.
2191
+ """(Deprecated) Adds a new validation rapid to the specified validation set using text sources to create the assets.
1850
2192
 
1851
2193
 
1852
2194
  :param validation_set_id: The ID of the validation set to add the rapid to. (required)
@@ -1874,6 +2216,7 @@ class ValidationSetApi:
1874
2216
  :type _host_index: int, optional
1875
2217
  :return: Returns the result object.
1876
2218
  """ # noqa: E501
2219
+ warnings.warn("POST /validation-set/{validationSetId}/rapid/texts is deprecated.", DeprecationWarning)
1877
2220
 
1878
2221
  _param = self._validation_set_validation_set_id_rapid_texts_post_serialize(
1879
2222
  validation_set_id=validation_set_id,
@@ -17,7 +17,7 @@ import pprint
17
17
  import re # noqa: F401
18
18
  import json
19
19
 
20
- from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator
21
21
  from typing import Any, ClassVar, Dict, List, Optional, Union
22
22
  from typing import Optional, Set
23
23
  from typing_extensions import Self
@@ -31,10 +31,11 @@ class GetStandingByIdResult(BaseModel):
31
31
  benchmark_id: StrictStr = Field(alias="benchmarkId")
32
32
  dataset_id: StrictStr = Field(alias="datasetId")
33
33
  status: StrictStr
34
+ is_disabled: StrictBool = Field(alias="isDisabled")
34
35
  score: Optional[Union[StrictFloat, StrictInt]] = None
35
36
  wins: StrictInt
36
37
  total_matches: StrictInt = Field(alias="totalMatches")
37
- __properties: ClassVar[List[str]] = ["id", "name", "benchmarkId", "datasetId", "status", "score", "wins", "totalMatches"]
38
+ __properties: ClassVar[List[str]] = ["id", "name", "benchmarkId", "datasetId", "status", "isDisabled", "score", "wins", "totalMatches"]
38
39
 
39
40
  @field_validator('status')
40
41
  def status_validate_enum(cls, value):
@@ -104,6 +105,7 @@ class GetStandingByIdResult(BaseModel):
104
105
  "benchmarkId": obj.get("benchmarkId"),
105
106
  "datasetId": obj.get("datasetId"),
106
107
  "status": obj.get("status"),
108
+ "isDisabled": obj.get("isDisabled"),
107
109
  "score": obj.get("score"),
108
110
  "wins": obj.get("wins"),
109
111
  "totalMatches": obj.get("totalMatches")
@@ -36,8 +36,8 @@ class ParticipantByBenchmark(BaseModel):
36
36
  @field_validator('status')
37
37
  def status_validate_enum(cls, value):
38
38
  """Validates the enum"""
39
- if value not in set(['Created', 'Submitted']):
40
- raise ValueError("must be one of enum values ('Created', 'Submitted')")
39
+ if value not in set(['Created', 'Submitted', 'Disabled']):
40
+ raise ValueError("must be one of enum values ('Created', 'Submitted', 'Disabled')")
41
41
  return value
42
42
 
43
43
  model_config = ConfigDict(
@@ -28,6 +28,7 @@ class ParticipantStatus(str, Enum):
28
28
  """
29
29
  CREATED = 'Created'
30
30
  SUBMITTED = 'Submitted'
31
+ DISABLED = 'Disabled'
31
32
 
32
33
  @classmethod
33
34
  def from_json(cls, json_str: str) -> Self:
@@ -17,7 +17,7 @@ import pprint
17
17
  import re # noqa: F401
18
18
  import json
19
19
 
20
- from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator
21
21
  from typing import Any, ClassVar, Dict, List, Optional, Union
22
22
  from typing import Optional, Set
23
23
  from typing_extensions import Self
@@ -34,7 +34,8 @@ class StandingByLeaderboard(BaseModel):
34
34
  score: Optional[Union[StrictFloat, StrictInt]] = None
35
35
  wins: StrictInt
36
36
  total_matches: StrictInt = Field(alias="totalMatches")
37
- __properties: ClassVar[List[str]] = ["id", "name", "leaderboardId", "datasetId", "status", "score", "wins", "totalMatches"]
37
+ is_disabled: StrictBool = Field(alias="isDisabled")
38
+ __properties: ClassVar[List[str]] = ["id", "name", "leaderboardId", "datasetId", "status", "score", "wins", "totalMatches", "isDisabled"]
38
39
 
39
40
  @field_validator('status')
40
41
  def status_validate_enum(cls, value):
@@ -106,7 +107,8 @@ class StandingByLeaderboard(BaseModel):
106
107
  "status": obj.get("status"),
107
108
  "score": obj.get("score"),
108
109
  "wins": obj.get("wins"),
109
- "totalMatches": obj.get("totalMatches")
110
+ "totalMatches": obj.get("totalMatches"),
111
+ "isDisabled": obj.get("isDisabled")
110
112
  })
111
113
  return _obj
112
114
 
@@ -78,6 +78,7 @@ Class | Method | HTTP request | Description
78
78
  *BenchmarkApi* | [**benchmark_benchmark_id_participant_participant_id_delete**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_participant_participant_id_delete) | **DELETE** /benchmark/{benchmarkId}/participant/{participantId} | Deletes a participant on a benchmark.
79
79
  *BenchmarkApi* | [**benchmark_benchmark_id_participant_participant_id_get**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_participant_participant_id_get) | **GET** /benchmark/{benchmarkId}/participant/{participantId} | Gets a participant by it's Id.
80
80
  *BenchmarkApi* | [**benchmark_benchmark_id_participants_get**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_participants_get) | **GET** /benchmark/{benchmarkId}/participants | Query all participants within a benchmark
81
+ *BenchmarkApi* | [**benchmark_benchmark_id_participants_participant_id_disable_post**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_participants_participant_id_disable_post) | **POST** /benchmark/{benchmarkId}/participants/{participantId}/disable | This endpoint disables a participant in a benchmark. this means that the participant will no longer actively be matched up against other participants and not collect further results. It will still be visible in the leaderboard.
81
82
  *BenchmarkApi* | [**benchmark_benchmark_id_participants_participant_id_submit_post**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_participants_participant_id_submit_post) | **POST** /benchmark/{benchmarkId}/participants/{participantId}/submit | Submits a participant to a benchmark.
82
83
  *BenchmarkApi* | [**benchmark_benchmark_id_participants_post**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_participants_post) | **POST** /benchmark/{benchmarkId}/participants | Creates a participant in a benchmark.
83
84
  *BenchmarkApi* | [**benchmark_benchmark_id_prompt_post**](rapidata/api_client/docs/BenchmarkApi.md#benchmark_benchmark_id_prompt_post) | **POST** /benchmark/{benchmarkId}/prompt | Adds a new prompt to a benchmark.
@@ -184,6 +185,7 @@ Class | Method | HTTP request | Description
184
185
  *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.
185
186
  *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.
186
187
  *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.
188
+ *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.
187
189
  *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.
188
190
  *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.
189
191
  *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.
@@ -1,4 +1,5 @@
1
1
  class RapidataDataTypes:
2
+ # deprecated use Literal["media", "text"] instead
2
3
  MEDIA = "media" # any form of image, video or audio
3
4
  TEXT = "text"
4
5
 
@@ -8,5 +8,6 @@ from .user_score_filter import UserScoreFilter
8
8
  from .custom_filter import CustomFilter
9
9
  from .not_filter import NotFilter
10
10
  from .or_filter import OrFilter
11
+ from .and_filter import AndFilter
11
12
  from .response_count_filter import ResponseCountFilter
12
13
  from .new_user_filter import NewUserFilter
@@ -29,6 +29,26 @@ class RapidataFilter:
29
29
  else:
30
30
  return OrFilter([self, other])
31
31
 
32
+ def __and__(self, other):
33
+ """Enable the & operator to create AndFilter combinations."""
34
+ if not isinstance(other, RapidataFilter):
35
+ return NotImplemented
36
+
37
+ from rapidata.rapidata_client.filter.and_filter import AndFilter
38
+
39
+ # If self is already an AndFilter, extend its filters list
40
+ if isinstance(self, AndFilter):
41
+ if isinstance(other, AndFilter):
42
+ return AndFilter(self.filters + other.filters)
43
+ else:
44
+ return AndFilter(self.filters + [other])
45
+ # If other is an AndFilter, prepend self to its filters
46
+ elif isinstance(other, AndFilter):
47
+ return AndFilter([self] + other.filters)
48
+ # Neither is an AndFilter, create a new one
49
+ else:
50
+ return AndFilter([self, other])
51
+
32
52
  def __invert__(self):
33
53
  """Enable the ~ operator to create NotFilter negations."""
34
54
  from rapidata.rapidata_client.filter.not_filter import NotFilter
@@ -0,0 +1,30 @@
1
+ from typing import Any
2
+ from rapidata.rapidata_client.filter._base_filter import RapidataFilter
3
+ from rapidata.api_client.models.and_user_filter_model import AndUserFilterModel
4
+ from rapidata.api_client.models.and_user_filter_model_filters_inner import AndUserFilterModelFiltersInner
5
+
6
+
7
+ class AndFilter(RapidataFilter):
8
+ """A filter that combines multiple filters with a logical AND operation.
9
+ This class implements a logical AND operation on a list of filters, where the condition is met if all of the filters' conditions are met.
10
+
11
+ Args:
12
+ filters (list[RapidataFilter]): A list of filters to be combined with AND.
13
+
14
+ Example:
15
+ ```python
16
+ from rapidata import AndFilter, LanguageFilter, CountryFilter
17
+
18
+ AndFilter([LanguageFilter(["en"]), CountryFilter(["US"])])
19
+ ```
20
+
21
+ This will match users who have their phone set to English AND are located in the United States.
22
+ """
23
+ def __init__(self, filters: list[RapidataFilter]):
24
+ if not all(isinstance(filter, RapidataFilter) for filter in filters):
25
+ raise ValueError("Filters must be a RapidataFilter object")
26
+
27
+ self.filters = filters
28
+
29
+ def _to_model(self):
30
+ return AndUserFilterModel(_t="AndFilter", filters=[AndUserFilterModelFiltersInner(filter._to_model()) for filter in self.filters])
@@ -5,7 +5,8 @@ from rapidata.rapidata_client.filter import (
5
5
  LanguageFilter,
6
6
  UserScoreFilter,
7
7
  NotFilter,
8
- OrFilter)
8
+ OrFilter,
9
+ AndFilter)
9
10
 
10
11
  class RapidataFilters:
11
12
  """RapidataFilters Classes
@@ -25,6 +26,7 @@ class RapidataFilters:
25
26
  language (LanguageFilter): Filters for users with a specific language.
26
27
  not_filter (NotFilter): Inverts the filter.
27
28
  or_filter (OrFilter): Combines multiple filters with a logical OR operation.
29
+ and_filter (AndFilter): Combines multiple filters with a logical AND operation.
28
30
 
29
31
  Example:
30
32
  ```python
@@ -35,15 +37,15 @@ class RapidataFilters:
35
37
  This ensures the order is only shown to users in the US and Germany whose phones are set to English.
36
38
 
37
39
  Info:
38
- The or and not filter support the | and ~ operators respectively.
39
- The and is given by the elements in the list.
40
+ The OR, AND and NOT filter support the |, & and ~ operators respectively.
41
+ The AND is additionally given by the elements in the list.
40
42
 
41
43
  ```python
42
44
  from rapidata import AgeFilter, LanguageFilter, CountryFilter
43
- filters=[~AgeFilter([AgeGroup.UNDER_18]), CountryFilter(["US"]) | LanguageFilter(["en"])]
45
+ filters=[~AgeFilter([AgeGroup.UNDER_18]), CountryFilter(["US"]) | (CountryFilter(["CA"]) & LanguageFilter(["en"]))]
44
46
  ```
45
47
 
46
- This would return users who are not under 18 years old and are from the US or whose phones are set to English.
48
+ This would return users who are not under 18 years old and are from the US or who are from Canada and whose phones are set to English.
47
49
  """
48
50
  user_score = UserScoreFilter
49
51
  age = AgeFilter
@@ -52,3 +54,4 @@ class RapidataFilters:
52
54
  language = LanguageFilter
53
55
  not_filter = NotFilter
54
56
  or_filter = OrFilter
57
+ and_filter = AndFilter