rapidata 2.41.2__py3-none-any.whl → 2.42.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of rapidata might be problematic. Click here for more details.

Files changed (75) hide show
  1. rapidata/__init__.py +1 -5
  2. rapidata/api_client/__init__.py +14 -14
  3. rapidata/api_client/api/__init__.py +1 -0
  4. rapidata/api_client/api/asset_api.py +851 -0
  5. rapidata/api_client/api/benchmark_api.py +298 -0
  6. rapidata/api_client/api/customer_rapid_api.py +29 -43
  7. rapidata/api_client/api/dataset_api.py +163 -1143
  8. rapidata/api_client/api/participant_api.py +28 -74
  9. rapidata/api_client/api/validation_set_api.py +283 -0
  10. rapidata/api_client/models/__init__.py +13 -14
  11. rapidata/api_client/models/add_validation_rapid_model.py +3 -3
  12. rapidata/api_client/models/add_validation_rapid_new_model.py +152 -0
  13. rapidata/api_client/models/add_validation_rapid_new_model_asset.py +182 -0
  14. rapidata/api_client/models/compare_workflow_model.py +3 -3
  15. rapidata/api_client/models/create_datapoint_from_files_model.py +3 -3
  16. rapidata/api_client/models/create_datapoint_from_text_sources_model.py +3 -3
  17. rapidata/api_client/models/create_datapoint_from_urls_model.py +3 -3
  18. rapidata/api_client/models/create_datapoint_model.py +108 -0
  19. rapidata/api_client/models/create_datapoint_model_asset.py +182 -0
  20. rapidata/api_client/models/create_demographic_rapid_model.py +13 -2
  21. rapidata/api_client/models/create_demographic_rapid_model_asset.py +188 -0
  22. rapidata/api_client/models/create_demographic_rapid_model_new.py +119 -0
  23. rapidata/api_client/models/create_sample_model.py +8 -2
  24. rapidata/api_client/models/create_sample_model_asset.py +182 -0
  25. rapidata/api_client/models/create_sample_model_obsolete.py +87 -0
  26. rapidata/api_client/models/file_asset_input_file.py +8 -22
  27. rapidata/api_client/models/fork_benchmark_result.py +87 -0
  28. rapidata/api_client/models/form_file_wrapper.py +17 -2
  29. rapidata/api_client/models/get_asset_metadata_result.py +100 -0
  30. rapidata/api_client/models/multi_asset_input_assets_inner.py +10 -24
  31. rapidata/api_client/models/prompt_asset_metadata_input.py +3 -3
  32. rapidata/api_client/models/proxy_file_wrapper.py +17 -2
  33. rapidata/api_client/models/stream_file_wrapper.py +25 -3
  34. rapidata/api_client/models/submit_prompt_model.py +3 -3
  35. rapidata/api_client/models/text_metadata.py +6 -1
  36. rapidata/api_client/models/text_metadata_model.py +7 -2
  37. rapidata/api_client/models/upload_file_from_url_result.py +87 -0
  38. rapidata/api_client/models/upload_file_result.py +87 -0
  39. rapidata/api_client/models/zip_entry_file_wrapper.py +33 -2
  40. rapidata/api_client_README.md +28 -25
  41. rapidata/rapidata_client/__init__.py +0 -1
  42. rapidata/rapidata_client/benchmark/participant/_participant.py +24 -22
  43. rapidata/rapidata_client/benchmark/rapidata_benchmark.py +89 -102
  44. rapidata/rapidata_client/datapoints/__init__.py +0 -1
  45. rapidata/rapidata_client/datapoints/_asset_uploader.py +71 -0
  46. rapidata/rapidata_client/datapoints/_datapoint.py +58 -171
  47. rapidata/rapidata_client/datapoints/_datapoint_uploader.py +95 -0
  48. rapidata/rapidata_client/datapoints/assets/__init__.py +0 -11
  49. rapidata/rapidata_client/datapoints/metadata/_media_asset_metadata.py +10 -7
  50. rapidata/rapidata_client/demographic/demographic_manager.py +21 -8
  51. rapidata/rapidata_client/exceptions/failed_upload_exception.py +0 -62
  52. rapidata/rapidata_client/order/_rapidata_order_builder.py +0 -10
  53. rapidata/rapidata_client/order/dataset/_rapidata_dataset.py +67 -187
  54. rapidata/rapidata_client/order/rapidata_order_manager.py +58 -116
  55. rapidata/rapidata_client/settings/translation_behaviour.py +1 -1
  56. rapidata/rapidata_client/validation/rapidata_validation_set.py +9 -5
  57. rapidata/rapidata_client/validation/rapids/_validation_rapid_uploader.py +101 -0
  58. rapidata/rapidata_client/validation/rapids/box.py +35 -11
  59. rapidata/rapidata_client/validation/rapids/rapids.py +26 -128
  60. rapidata/rapidata_client/validation/rapids/rapids_manager.py +123 -104
  61. rapidata/rapidata_client/validation/validation_set_manager.py +25 -34
  62. rapidata/rapidata_client/workflow/_ranking_workflow.py +14 -17
  63. rapidata/rapidata_client/workflow/_select_words_workflow.py +3 -16
  64. rapidata/service/openapi_service.py +8 -3
  65. {rapidata-2.41.2.dist-info → rapidata-2.42.0.dist-info}/METADATA +1 -1
  66. {rapidata-2.41.2.dist-info → rapidata-2.42.0.dist-info}/RECORD +68 -59
  67. {rapidata-2.41.2.dist-info → rapidata-2.42.0.dist-info}/WHEEL +1 -1
  68. rapidata/rapidata_client/datapoints/assets/_base_asset.py +0 -13
  69. rapidata/rapidata_client/datapoints/assets/_media_asset.py +0 -318
  70. rapidata/rapidata_client/datapoints/assets/_multi_asset.py +0 -61
  71. rapidata/rapidata_client/datapoints/assets/_sessions.py +0 -40
  72. rapidata/rapidata_client/datapoints/assets/_text_asset.py +0 -34
  73. rapidata/rapidata_client/datapoints/assets/data_type_enum.py +0 -8
  74. rapidata/rapidata_client/order/dataset/_progress_tracker.py +0 -100
  75. {rapidata-2.41.2.dist-info → rapidata-2.42.0.dist-info}/licenses/LICENSE +0 -0
@@ -16,16 +16,13 @@ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
16
  from typing import Any, Dict, List, Optional, Tuple, Union
17
17
  from typing_extensions import Annotated
18
18
 
19
- from pydantic import Field, StrictBytes, StrictInt, StrictStr
20
- from typing import List, Optional, Tuple, Union
19
+ from pydantic import Field, StrictBytes, StrictStr
20
+ from typing import Optional, Tuple, Union
21
21
  from typing_extensions import Annotated
22
- from rapidata.api_client.models.create_datapoint_from_files_model import CreateDatapointFromFilesModel
23
- from rapidata.api_client.models.create_datapoint_from_text_sources_model import CreateDatapointFromTextSourcesModel
24
- from rapidata.api_client.models.create_datapoint_from_urls_model import CreateDatapointFromUrlsModel
22
+ from rapidata.api_client.models.create_datapoint_model import CreateDatapointModel
25
23
  from rapidata.api_client.models.create_datapoint_result import CreateDatapointResult
26
24
  from rapidata.api_client.models.create_datapoints_from_s3_bucket_model import CreateDatapointsFromS3BucketModel
27
25
  from rapidata.api_client.models.datapoint_model_paged_result import DatapointModelPagedResult
28
- from rapidata.api_client.models.dataset_dataset_id_datapoints_post_request_metadata_inner import DatasetDatasetIdDatapointsPostRequestMetadataInner
29
26
  from rapidata.api_client.models.get_dataset_by_id_result import GetDatasetByIdResult
30
27
  from rapidata.api_client.models.get_dataset_progress_result import GetDatasetProgressResult
31
28
  from rapidata.api_client.models.get_failed_datapoints_result import GetFailedDatapointsResult
@@ -597,10 +594,10 @@ class DatasetApi:
597
594
 
598
595
 
599
596
  @validate_call
600
- def dataset_dataset_id_datapoints_csv_post(
597
+ def dataset_dataset_id_datapoint_post(
601
598
  self,
602
- dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to import the datapoints to.")],
603
- file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="The csv file to import.")] = None,
599
+ dataset_id: StrictStr,
600
+ create_datapoint_model: Optional[CreateDatapointModel] = None,
604
601
  _request_timeout: Union[
605
602
  None,
606
603
  Annotated[StrictFloat, Field(gt=0)],
@@ -613,14 +610,14 @@ class DatasetApi:
613
610
  _content_type: Optional[StrictStr] = None,
614
611
  _headers: Optional[Dict[StrictStr, Any]] = None,
615
612
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
616
- ) -> ImportFromFileResult:
617
- """Creates multiple datapoints from a csv.
613
+ ) -> CreateDatapointResult:
614
+ """Creates a datapoint via the new endpoint.
618
615
 
619
616
 
620
- :param dataset_id: The id of the dataset to import the datapoints to. (required)
617
+ :param dataset_id: (required)
621
618
  :type dataset_id: str
622
- :param file: The csv file to import.
623
- :type file: bytearray
619
+ :param create_datapoint_model:
620
+ :type create_datapoint_model: CreateDatapointModel
624
621
  :param _request_timeout: timeout setting for this request. If one
625
622
  number provided, it will be total request
626
623
  timeout. It can also be a pair (tuple) of
@@ -643,9 +640,9 @@ class DatasetApi:
643
640
  :return: Returns the result object.
644
641
  """ # noqa: E501
645
642
 
646
- _param = self._dataset_dataset_id_datapoints_csv_post_serialize(
643
+ _param = self._dataset_dataset_id_datapoint_post_serialize(
647
644
  dataset_id=dataset_id,
648
- file=file,
645
+ create_datapoint_model=create_datapoint_model,
649
646
  _request_auth=_request_auth,
650
647
  _content_type=_content_type,
651
648
  _headers=_headers,
@@ -653,7 +650,7 @@ class DatasetApi:
653
650
  )
654
651
 
655
652
  _response_types_map: Dict[str, Optional[str]] = {
656
- '200': "ImportFromFileResult",
653
+ '200': "CreateDatapointResult",
657
654
  }
658
655
  response_data = self.api_client.call_api(
659
656
  *_param,
@@ -667,10 +664,10 @@ class DatasetApi:
667
664
 
668
665
 
669
666
  @validate_call
670
- def dataset_dataset_id_datapoints_csv_post_with_http_info(
667
+ def dataset_dataset_id_datapoint_post_with_http_info(
671
668
  self,
672
- dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to import the datapoints to.")],
673
- file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="The csv file to import.")] = None,
669
+ dataset_id: StrictStr,
670
+ create_datapoint_model: Optional[CreateDatapointModel] = None,
674
671
  _request_timeout: Union[
675
672
  None,
676
673
  Annotated[StrictFloat, Field(gt=0)],
@@ -683,14 +680,14 @@ class DatasetApi:
683
680
  _content_type: Optional[StrictStr] = None,
684
681
  _headers: Optional[Dict[StrictStr, Any]] = None,
685
682
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
686
- ) -> ApiResponse[ImportFromFileResult]:
687
- """Creates multiple datapoints from a csv.
683
+ ) -> ApiResponse[CreateDatapointResult]:
684
+ """Creates a datapoint via the new endpoint.
688
685
 
689
686
 
690
- :param dataset_id: The id of the dataset to import the datapoints to. (required)
687
+ :param dataset_id: (required)
691
688
  :type dataset_id: str
692
- :param file: The csv file to import.
693
- :type file: bytearray
689
+ :param create_datapoint_model:
690
+ :type create_datapoint_model: CreateDatapointModel
694
691
  :param _request_timeout: timeout setting for this request. If one
695
692
  number provided, it will be total request
696
693
  timeout. It can also be a pair (tuple) of
@@ -713,9 +710,9 @@ class DatasetApi:
713
710
  :return: Returns the result object.
714
711
  """ # noqa: E501
715
712
 
716
- _param = self._dataset_dataset_id_datapoints_csv_post_serialize(
713
+ _param = self._dataset_dataset_id_datapoint_post_serialize(
717
714
  dataset_id=dataset_id,
718
- file=file,
715
+ create_datapoint_model=create_datapoint_model,
719
716
  _request_auth=_request_auth,
720
717
  _content_type=_content_type,
721
718
  _headers=_headers,
@@ -723,7 +720,7 @@ class DatasetApi:
723
720
  )
724
721
 
725
722
  _response_types_map: Dict[str, Optional[str]] = {
726
- '200': "ImportFromFileResult",
723
+ '200': "CreateDatapointResult",
727
724
  }
728
725
  response_data = self.api_client.call_api(
729
726
  *_param,
@@ -737,10 +734,10 @@ class DatasetApi:
737
734
 
738
735
 
739
736
  @validate_call
740
- def dataset_dataset_id_datapoints_csv_post_without_preload_content(
737
+ def dataset_dataset_id_datapoint_post_without_preload_content(
741
738
  self,
742
- dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to import the datapoints to.")],
743
- file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="The csv file to import.")] = None,
739
+ dataset_id: StrictStr,
740
+ create_datapoint_model: Optional[CreateDatapointModel] = None,
744
741
  _request_timeout: Union[
745
742
  None,
746
743
  Annotated[StrictFloat, Field(gt=0)],
@@ -754,13 +751,13 @@ class DatasetApi:
754
751
  _headers: Optional[Dict[StrictStr, Any]] = None,
755
752
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
756
753
  ) -> RESTResponseType:
757
- """Creates multiple datapoints from a csv.
754
+ """Creates a datapoint via the new endpoint.
758
755
 
759
756
 
760
- :param dataset_id: The id of the dataset to import the datapoints to. (required)
757
+ :param dataset_id: (required)
761
758
  :type dataset_id: str
762
- :param file: The csv file to import.
763
- :type file: bytearray
759
+ :param create_datapoint_model:
760
+ :type create_datapoint_model: CreateDatapointModel
764
761
  :param _request_timeout: timeout setting for this request. If one
765
762
  number provided, it will be total request
766
763
  timeout. It can also be a pair (tuple) of
@@ -783,9 +780,9 @@ class DatasetApi:
783
780
  :return: Returns the result object.
784
781
  """ # noqa: E501
785
782
 
786
- _param = self._dataset_dataset_id_datapoints_csv_post_serialize(
783
+ _param = self._dataset_dataset_id_datapoint_post_serialize(
787
784
  dataset_id=dataset_id,
788
- file=file,
785
+ create_datapoint_model=create_datapoint_model,
789
786
  _request_auth=_request_auth,
790
787
  _content_type=_content_type,
791
788
  _headers=_headers,
@@ -793,7 +790,7 @@ class DatasetApi:
793
790
  )
794
791
 
795
792
  _response_types_map: Dict[str, Optional[str]] = {
796
- '200': "ImportFromFileResult",
793
+ '200': "CreateDatapointResult",
797
794
  }
798
795
  response_data = self.api_client.call_api(
799
796
  *_param,
@@ -802,10 +799,10 @@ class DatasetApi:
802
799
  return response_data.response
803
800
 
804
801
 
805
- def _dataset_dataset_id_datapoints_csv_post_serialize(
802
+ def _dataset_dataset_id_datapoint_post_serialize(
806
803
  self,
807
804
  dataset_id,
808
- file,
805
+ create_datapoint_model,
809
806
  _request_auth,
810
807
  _content_type,
811
808
  _headers,
@@ -832,9 +829,9 @@ class DatasetApi:
832
829
  # process the query parameters
833
830
  # process the header parameters
834
831
  # process the form parameters
835
- if file is not None:
836
- _files['file'] = file
837
832
  # process the body parameter
833
+ if create_datapoint_model is not None:
834
+ _body_params = create_datapoint_model
838
835
 
839
836
 
840
837
  # set the HTTP header `Accept`
@@ -854,7 +851,9 @@ class DatasetApi:
854
851
  _default_content_type = (
855
852
  self.api_client.select_header_content_type(
856
853
  [
857
- 'multipart/form-data'
854
+ 'application/json',
855
+ 'text/json',
856
+ 'application/*+json'
858
857
  ]
859
858
  )
860
859
  )
@@ -869,7 +868,7 @@ class DatasetApi:
869
868
 
870
869
  return self.api_client.param_serialize(
871
870
  method='POST',
872
- resource_path='/dataset/{datasetId}/datapoints/csv',
871
+ resource_path='/dataset/{datasetId}/datapoint',
873
872
  path_params=_path_params,
874
873
  query_params=_query_params,
875
874
  header_params=_header_params,
@@ -886,9 +885,10 @@ class DatasetApi:
886
885
 
887
886
 
888
887
  @validate_call
889
- def dataset_dataset_id_datapoints_failed_get(
888
+ def dataset_dataset_id_datapoints_csv_post(
890
889
  self,
891
- dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to get the failed datapoints of.")],
890
+ dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to import the datapoints to.")],
891
+ file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="The csv file to import.")] = None,
892
892
  _request_timeout: Union[
893
893
  None,
894
894
  Annotated[StrictFloat, Field(gt=0)],
@@ -901,13 +901,14 @@ class DatasetApi:
901
901
  _content_type: Optional[StrictStr] = None,
902
902
  _headers: Optional[Dict[StrictStr, Any]] = None,
903
903
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
904
- ) -> GetFailedDatapointsResult:
905
- """Gets a list of all datapoints that failed to upload.
904
+ ) -> ImportFromFileResult:
905
+ """Creates multiple datapoints from a csv.
906
906
 
907
- A datapoint usually fails to upload when using a deferred upload mechanism such as when providing a URL and the URL is not accessible.
908
907
 
909
- :param dataset_id: The id of the dataset to get the failed datapoints of. (required)
908
+ :param dataset_id: The id of the dataset to import the datapoints to. (required)
910
909
  :type dataset_id: str
910
+ :param file: The csv file to import.
911
+ :type file: bytearray
911
912
  :param _request_timeout: timeout setting for this request. If one
912
913
  number provided, it will be total request
913
914
  timeout. It can also be a pair (tuple) of
@@ -930,8 +931,9 @@ class DatasetApi:
930
931
  :return: Returns the result object.
931
932
  """ # noqa: E501
932
933
 
933
- _param = self._dataset_dataset_id_datapoints_failed_get_serialize(
934
+ _param = self._dataset_dataset_id_datapoints_csv_post_serialize(
934
935
  dataset_id=dataset_id,
936
+ file=file,
935
937
  _request_auth=_request_auth,
936
938
  _content_type=_content_type,
937
939
  _headers=_headers,
@@ -939,7 +941,7 @@ class DatasetApi:
939
941
  )
940
942
 
941
943
  _response_types_map: Dict[str, Optional[str]] = {
942
- '200': "GetFailedDatapointsResult",
944
+ '200': "ImportFromFileResult",
943
945
  }
944
946
  response_data = self.api_client.call_api(
945
947
  *_param,
@@ -953,9 +955,10 @@ class DatasetApi:
953
955
 
954
956
 
955
957
  @validate_call
956
- def dataset_dataset_id_datapoints_failed_get_with_http_info(
958
+ def dataset_dataset_id_datapoints_csv_post_with_http_info(
957
959
  self,
958
- dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to get the failed datapoints of.")],
960
+ dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to import the datapoints to.")],
961
+ file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="The csv file to import.")] = None,
959
962
  _request_timeout: Union[
960
963
  None,
961
964
  Annotated[StrictFloat, Field(gt=0)],
@@ -968,13 +971,14 @@ class DatasetApi:
968
971
  _content_type: Optional[StrictStr] = None,
969
972
  _headers: Optional[Dict[StrictStr, Any]] = None,
970
973
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
971
- ) -> ApiResponse[GetFailedDatapointsResult]:
972
- """Gets a list of all datapoints that failed to upload.
974
+ ) -> ApiResponse[ImportFromFileResult]:
975
+ """Creates multiple datapoints from a csv.
973
976
 
974
- A datapoint usually fails to upload when using a deferred upload mechanism such as when providing a URL and the URL is not accessible.
975
977
 
976
- :param dataset_id: The id of the dataset to get the failed datapoints of. (required)
978
+ :param dataset_id: The id of the dataset to import the datapoints to. (required)
977
979
  :type dataset_id: str
980
+ :param file: The csv file to import.
981
+ :type file: bytearray
978
982
  :param _request_timeout: timeout setting for this request. If one
979
983
  number provided, it will be total request
980
984
  timeout. It can also be a pair (tuple) of
@@ -997,8 +1001,9 @@ class DatasetApi:
997
1001
  :return: Returns the result object.
998
1002
  """ # noqa: E501
999
1003
 
1000
- _param = self._dataset_dataset_id_datapoints_failed_get_serialize(
1004
+ _param = self._dataset_dataset_id_datapoints_csv_post_serialize(
1001
1005
  dataset_id=dataset_id,
1006
+ file=file,
1002
1007
  _request_auth=_request_auth,
1003
1008
  _content_type=_content_type,
1004
1009
  _headers=_headers,
@@ -1006,7 +1011,7 @@ class DatasetApi:
1006
1011
  )
1007
1012
 
1008
1013
  _response_types_map: Dict[str, Optional[str]] = {
1009
- '200': "GetFailedDatapointsResult",
1014
+ '200': "ImportFromFileResult",
1010
1015
  }
1011
1016
  response_data = self.api_client.call_api(
1012
1017
  *_param,
@@ -1020,9 +1025,10 @@ class DatasetApi:
1020
1025
 
1021
1026
 
1022
1027
  @validate_call
1023
- def dataset_dataset_id_datapoints_failed_get_without_preload_content(
1028
+ def dataset_dataset_id_datapoints_csv_post_without_preload_content(
1024
1029
  self,
1025
- dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to get the failed datapoints of.")],
1030
+ dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to import the datapoints to.")],
1031
+ file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="The csv file to import.")] = None,
1026
1032
  _request_timeout: Union[
1027
1033
  None,
1028
1034
  Annotated[StrictFloat, Field(gt=0)],
@@ -1036,12 +1042,13 @@ class DatasetApi:
1036
1042
  _headers: Optional[Dict[StrictStr, Any]] = None,
1037
1043
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1038
1044
  ) -> RESTResponseType:
1039
- """Gets a list of all datapoints that failed to upload.
1045
+ """Creates multiple datapoints from a csv.
1040
1046
 
1041
- A datapoint usually fails to upload when using a deferred upload mechanism such as when providing a URL and the URL is not accessible.
1042
1047
 
1043
- :param dataset_id: The id of the dataset to get the failed datapoints of. (required)
1048
+ :param dataset_id: The id of the dataset to import the datapoints to. (required)
1044
1049
  :type dataset_id: str
1050
+ :param file: The csv file to import.
1051
+ :type file: bytearray
1045
1052
  :param _request_timeout: timeout setting for this request. If one
1046
1053
  number provided, it will be total request
1047
1054
  timeout. It can also be a pair (tuple) of
@@ -1064,8 +1071,9 @@ class DatasetApi:
1064
1071
  :return: Returns the result object.
1065
1072
  """ # noqa: E501
1066
1073
 
1067
- _param = self._dataset_dataset_id_datapoints_failed_get_serialize(
1074
+ _param = self._dataset_dataset_id_datapoints_csv_post_serialize(
1068
1075
  dataset_id=dataset_id,
1076
+ file=file,
1069
1077
  _request_auth=_request_auth,
1070
1078
  _content_type=_content_type,
1071
1079
  _headers=_headers,
@@ -1073,7 +1081,7 @@ class DatasetApi:
1073
1081
  )
1074
1082
 
1075
1083
  _response_types_map: Dict[str, Optional[str]] = {
1076
- '200': "GetFailedDatapointsResult",
1084
+ '200': "ImportFromFileResult",
1077
1085
  }
1078
1086
  response_data = self.api_client.call_api(
1079
1087
  *_param,
@@ -1082,9 +1090,10 @@ class DatasetApi:
1082
1090
  return response_data.response
1083
1091
 
1084
1092
 
1085
- def _dataset_dataset_id_datapoints_failed_get_serialize(
1093
+ def _dataset_dataset_id_datapoints_csv_post_serialize(
1086
1094
  self,
1087
1095
  dataset_id,
1096
+ file,
1088
1097
  _request_auth,
1089
1098
  _content_type,
1090
1099
  _headers,
@@ -1111,6 +1120,8 @@ class DatasetApi:
1111
1120
  # process the query parameters
1112
1121
  # process the header parameters
1113
1122
  # process the form parameters
1123
+ if file is not None:
1124
+ _files['file'] = file
1114
1125
  # process the body parameter
1115
1126
 
1116
1127
 
@@ -1124,6 +1135,19 @@ class DatasetApi:
1124
1135
  ]
1125
1136
  )
1126
1137
 
1138
+ # set the HTTP header `Content-Type`
1139
+ if _content_type:
1140
+ _header_params['Content-Type'] = _content_type
1141
+ else:
1142
+ _default_content_type = (
1143
+ self.api_client.select_header_content_type(
1144
+ [
1145
+ 'multipart/form-data'
1146
+ ]
1147
+ )
1148
+ )
1149
+ if _default_content_type is not None:
1150
+ _header_params['Content-Type'] = _default_content_type
1127
1151
 
1128
1152
  # authentication setting
1129
1153
  _auth_settings: List[str] = [
@@ -1132,8 +1156,8 @@ class DatasetApi:
1132
1156
  ]
1133
1157
 
1134
1158
  return self.api_client.param_serialize(
1135
- method='GET',
1136
- resource_path='/dataset/{datasetId}/datapoints/failed',
1159
+ method='POST',
1160
+ resource_path='/dataset/{datasetId}/datapoints/csv',
1137
1161
  path_params=_path_params,
1138
1162
  query_params=_query_params,
1139
1163
  header_params=_header_params,
@@ -1150,11 +1174,9 @@ class DatasetApi:
1150
1174
 
1151
1175
 
1152
1176
  @validate_call
1153
- def dataset_dataset_id_datapoints_files_post(
1177
+ def dataset_dataset_id_datapoints_failed_get(
1154
1178
  self,
1155
- dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to create the datapoint in.")],
1156
- files: Optional[List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]]] = None,
1157
- model: Optional[CreateDatapointFromFilesModel] = None,
1179
+ dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to get the failed datapoints of.")],
1158
1180
  _request_timeout: Union[
1159
1181
  None,
1160
1182
  Annotated[StrictFloat, Field(gt=0)],
@@ -1167,17 +1189,13 @@ class DatasetApi:
1167
1189
  _content_type: Optional[StrictStr] = None,
1168
1190
  _headers: Optional[Dict[StrictStr, Any]] = None,
1169
1191
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1170
- ) -> CreateDatapointResult:
1171
- """Creates a single datapoint by uploading files.
1192
+ ) -> GetFailedDatapointsResult:
1193
+ """Gets a list of all datapoints that failed to upload.
1172
1194
 
1173
- If multiple files are uploaded, a multi asset datapoint will be created.
1195
+ A datapoint usually fails to upload when using a deferred upload mechanism such as when providing a URL and the URL is not accessible.
1174
1196
 
1175
- :param dataset_id: The id of the dataset to create the datapoint in. (required)
1197
+ :param dataset_id: The id of the dataset to get the failed datapoints of. (required)
1176
1198
  :type dataset_id: str
1177
- :param files:
1178
- :type files: List[bytearray]
1179
- :param model:
1180
- :type model: CreateDatapointFromFilesModel
1181
1199
  :param _request_timeout: timeout setting for this request. If one
1182
1200
  number provided, it will be total request
1183
1201
  timeout. It can also be a pair (tuple) of
@@ -1200,10 +1218,8 @@ class DatasetApi:
1200
1218
  :return: Returns the result object.
1201
1219
  """ # noqa: E501
1202
1220
 
1203
- _param = self._dataset_dataset_id_datapoints_files_post_serialize(
1221
+ _param = self._dataset_dataset_id_datapoints_failed_get_serialize(
1204
1222
  dataset_id=dataset_id,
1205
- files=files,
1206
- model=model,
1207
1223
  _request_auth=_request_auth,
1208
1224
  _content_type=_content_type,
1209
1225
  _headers=_headers,
@@ -1211,7 +1227,7 @@ class DatasetApi:
1211
1227
  )
1212
1228
 
1213
1229
  _response_types_map: Dict[str, Optional[str]] = {
1214
- '200': "CreateDatapointResult",
1230
+ '200': "GetFailedDatapointsResult",
1215
1231
  }
1216
1232
  response_data = self.api_client.call_api(
1217
1233
  *_param,
@@ -1225,11 +1241,9 @@ class DatasetApi:
1225
1241
 
1226
1242
 
1227
1243
  @validate_call
1228
- def dataset_dataset_id_datapoints_files_post_with_http_info(
1244
+ def dataset_dataset_id_datapoints_failed_get_with_http_info(
1229
1245
  self,
1230
- dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to create the datapoint in.")],
1231
- files: Optional[List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]]] = None,
1232
- model: Optional[CreateDatapointFromFilesModel] = None,
1246
+ dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to get the failed datapoints of.")],
1233
1247
  _request_timeout: Union[
1234
1248
  None,
1235
1249
  Annotated[StrictFloat, Field(gt=0)],
@@ -1242,17 +1256,13 @@ class DatasetApi:
1242
1256
  _content_type: Optional[StrictStr] = None,
1243
1257
  _headers: Optional[Dict[StrictStr, Any]] = None,
1244
1258
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1245
- ) -> ApiResponse[CreateDatapointResult]:
1246
- """Creates a single datapoint by uploading files.
1259
+ ) -> ApiResponse[GetFailedDatapointsResult]:
1260
+ """Gets a list of all datapoints that failed to upload.
1247
1261
 
1248
- If multiple files are uploaded, a multi asset datapoint will be created.
1262
+ A datapoint usually fails to upload when using a deferred upload mechanism such as when providing a URL and the URL is not accessible.
1249
1263
 
1250
- :param dataset_id: The id of the dataset to create the datapoint in. (required)
1264
+ :param dataset_id: The id of the dataset to get the failed datapoints of. (required)
1251
1265
  :type dataset_id: str
1252
- :param files:
1253
- :type files: List[bytearray]
1254
- :param model:
1255
- :type model: CreateDatapointFromFilesModel
1256
1266
  :param _request_timeout: timeout setting for this request. If one
1257
1267
  number provided, it will be total request
1258
1268
  timeout. It can also be a pair (tuple) of
@@ -1275,10 +1285,8 @@ class DatasetApi:
1275
1285
  :return: Returns the result object.
1276
1286
  """ # noqa: E501
1277
1287
 
1278
- _param = self._dataset_dataset_id_datapoints_files_post_serialize(
1288
+ _param = self._dataset_dataset_id_datapoints_failed_get_serialize(
1279
1289
  dataset_id=dataset_id,
1280
- files=files,
1281
- model=model,
1282
1290
  _request_auth=_request_auth,
1283
1291
  _content_type=_content_type,
1284
1292
  _headers=_headers,
@@ -1286,7 +1294,7 @@ class DatasetApi:
1286
1294
  )
1287
1295
 
1288
1296
  _response_types_map: Dict[str, Optional[str]] = {
1289
- '200': "CreateDatapointResult",
1297
+ '200': "GetFailedDatapointsResult",
1290
1298
  }
1291
1299
  response_data = self.api_client.call_api(
1292
1300
  *_param,
@@ -1300,11 +1308,9 @@ class DatasetApi:
1300
1308
 
1301
1309
 
1302
1310
  @validate_call
1303
- def dataset_dataset_id_datapoints_files_post_without_preload_content(
1311
+ def dataset_dataset_id_datapoints_failed_get_without_preload_content(
1304
1312
  self,
1305
- dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to create the datapoint in.")],
1306
- files: Optional[List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]]] = None,
1307
- model: Optional[CreateDatapointFromFilesModel] = None,
1313
+ dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to get the failed datapoints of.")],
1308
1314
  _request_timeout: Union[
1309
1315
  None,
1310
1316
  Annotated[StrictFloat, Field(gt=0)],
@@ -1318,16 +1324,12 @@ class DatasetApi:
1318
1324
  _headers: Optional[Dict[StrictStr, Any]] = None,
1319
1325
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1320
1326
  ) -> RESTResponseType:
1321
- """Creates a single datapoint by uploading files.
1327
+ """Gets a list of all datapoints that failed to upload.
1322
1328
 
1323
- If multiple files are uploaded, a multi asset datapoint will be created.
1329
+ A datapoint usually fails to upload when using a deferred upload mechanism such as when providing a URL and the URL is not accessible.
1324
1330
 
1325
- :param dataset_id: The id of the dataset to create the datapoint in. (required)
1331
+ :param dataset_id: The id of the dataset to get the failed datapoints of. (required)
1326
1332
  :type dataset_id: str
1327
- :param files:
1328
- :type files: List[bytearray]
1329
- :param model:
1330
- :type model: CreateDatapointFromFilesModel
1331
1333
  :param _request_timeout: timeout setting for this request. If one
1332
1334
  number provided, it will be total request
1333
1335
  timeout. It can also be a pair (tuple) of
@@ -1350,10 +1352,8 @@ class DatasetApi:
1350
1352
  :return: Returns the result object.
1351
1353
  """ # noqa: E501
1352
1354
 
1353
- _param = self._dataset_dataset_id_datapoints_files_post_serialize(
1355
+ _param = self._dataset_dataset_id_datapoints_failed_get_serialize(
1354
1356
  dataset_id=dataset_id,
1355
- files=files,
1356
- model=model,
1357
1357
  _request_auth=_request_auth,
1358
1358
  _content_type=_content_type,
1359
1359
  _headers=_headers,
@@ -1361,7 +1361,7 @@ class DatasetApi:
1361
1361
  )
1362
1362
 
1363
1363
  _response_types_map: Dict[str, Optional[str]] = {
1364
- '200': "CreateDatapointResult",
1364
+ '200': "GetFailedDatapointsResult",
1365
1365
  }
1366
1366
  response_data = self.api_client.call_api(
1367
1367
  *_param,
@@ -1370,11 +1370,9 @@ class DatasetApi:
1370
1370
  return response_data.response
1371
1371
 
1372
1372
 
1373
- def _dataset_dataset_id_datapoints_files_post_serialize(
1373
+ def _dataset_dataset_id_datapoints_failed_get_serialize(
1374
1374
  self,
1375
1375
  dataset_id,
1376
- files,
1377
- model,
1378
1376
  _request_auth,
1379
1377
  _content_type,
1380
1378
  _headers,
@@ -1384,7 +1382,6 @@ class DatasetApi:
1384
1382
  _host = None
1385
1383
 
1386
1384
  _collection_formats: Dict[str, str] = {
1387
- 'files': 'multi',
1388
1385
  }
1389
1386
 
1390
1387
  _path_params: Dict[str, str] = {}
@@ -1402,10 +1399,6 @@ class DatasetApi:
1402
1399
  # process the query parameters
1403
1400
  # process the header parameters
1404
1401
  # process the form parameters
1405
- if files is not None:
1406
- _files['files'] = files
1407
- if model is not None:
1408
- _form_params.append(('model', model))
1409
1402
  # process the body parameter
1410
1403
 
1411
1404
 
@@ -1419,19 +1412,6 @@ class DatasetApi:
1419
1412
  ]
1420
1413
  )
1421
1414
 
1422
- # set the HTTP header `Content-Type`
1423
- if _content_type:
1424
- _header_params['Content-Type'] = _content_type
1425
- else:
1426
- _default_content_type = (
1427
- self.api_client.select_header_content_type(
1428
- [
1429
- 'multipart/form-data'
1430
- ]
1431
- )
1432
- )
1433
- if _default_content_type is not None:
1434
- _header_params['Content-Type'] = _default_content_type
1435
1415
 
1436
1416
  # authentication setting
1437
1417
  _auth_settings: List[str] = [
@@ -1440,8 +1420,8 @@ class DatasetApi:
1440
1420
  ]
1441
1421
 
1442
1422
  return self.api_client.param_serialize(
1443
- method='POST',
1444
- resource_path='/dataset/{datasetId}/datapoints/files',
1423
+ method='GET',
1424
+ resource_path='/dataset/{datasetId}/datapoints/failed',
1445
1425
  path_params=_path_params,
1446
1426
  query_params=_query_params,
1447
1427
  header_params=_header_params,
@@ -1736,15 +1716,10 @@ class DatasetApi:
1736
1716
 
1737
1717
 
1738
1718
  @validate_call
1739
- def dataset_dataset_id_datapoints_post(
1719
+ def dataset_dataset_id_datapoints_s3_post(
1740
1720
  self,
1741
- dataset_id: Annotated[StrictStr, Field(description="The id of the dataset")],
1742
- prompt_asset: Optional[List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]]] = None,
1743
- file: Optional[List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]]] = None,
1744
- text: Annotated[Optional[List[StrictStr]], Field(description="The texts to upload. The length limit is set at 256 characters per text.")] = None,
1745
- url: Annotated[Optional[List[StrictStr]], Field(description="Creates an asset from a url. The url needs to point to a publicly accessible resource. The server will download the resource and store it as an asset in the background. <remarks> Additionally, to the urls having to be publicly accessible, they need to support HTTP HEAD requests. </remarks>")] = None,
1746
- metadata: Annotated[Optional[List[DatasetDatasetIdDatapointsPostRequestMetadataInner]], Field(description="Optional metadata to attach to the datapoint.")] = None,
1747
- sort_index: Annotated[Optional[StrictInt], Field(description="The index will be used to keep the datapoints in order. Useful if upload is parallelized")] = None,
1721
+ dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to upload the files to.")],
1722
+ create_datapoints_from_s3_bucket_model: Annotated[Optional[CreateDatapointsFromS3BucketModel], Field(description="The body of the request.")] = None,
1748
1723
  _request_timeout: Union[
1749
1724
  None,
1750
1725
  Annotated[StrictFloat, Field(gt=0)],
@@ -1757,25 +1732,15 @@ class DatasetApi:
1757
1732
  _content_type: Optional[StrictStr] = None,
1758
1733
  _headers: Optional[Dict[StrictStr, Any]] = None,
1759
1734
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1760
- ) -> CreateDatapointResult:
1761
- """Creates a new datapoint from multiple possible sources.
1735
+ ) -> UploadFromS3Result:
1736
+ """Uploads files from an S3 bucket to a dataset.
1762
1737
 
1763
- Multiple files, texts, and urls can be provided. If multiple files are provided, a multi-asset datapoint will be created, meaning that all sources provided will be stored as sub-assets of the datapoint. If multiple datapoints are desired, one should not pass in multiple files, texts, or urls, instead, one should call this endpoint multiple times with the desired file, text, or url per datapoint. The request must be a multipart form request, where each parameter is sent as a separate part. The files, texts, and urls can be mixed and matched as needed, however, at least one of them must be provided, and one should make sure that mixing them makes sense for the dataset.
1738
+ A new datapoint will be created for each file in the bucket.
1764
1739
 
1765
- :param dataset_id: The id of the dataset (required)
1740
+ :param dataset_id: The id of the dataset to upload the files to. (required)
1766
1741
  :type dataset_id: str
1767
- :param prompt_asset:
1768
- :type prompt_asset: List[bytearray]
1769
- :param file:
1770
- :type file: List[bytearray]
1771
- :param text: The texts to upload. The length limit is set at 256 characters per text.
1772
- :type text: List[str]
1773
- :param url: Creates an asset from a url. The url needs to point to a publicly accessible resource. The server will download the resource and store it as an asset in the background. <remarks> Additionally, to the urls having to be publicly accessible, they need to support HTTP HEAD requests. </remarks>
1774
- :type url: List[str]
1775
- :param metadata: Optional metadata to attach to the datapoint.
1776
- :type metadata: List[DatasetDatasetIdDatapointsPostRequestMetadataInner]
1777
- :param sort_index: The index will be used to keep the datapoints in order. Useful if upload is parallelized
1778
- :type sort_index: int
1742
+ :param create_datapoints_from_s3_bucket_model: The body of the request.
1743
+ :type create_datapoints_from_s3_bucket_model: CreateDatapointsFromS3BucketModel
1779
1744
  :param _request_timeout: timeout setting for this request. If one
1780
1745
  number provided, it will be total request
1781
1746
  timeout. It can also be a pair (tuple) of
@@ -1798,14 +1763,9 @@ class DatasetApi:
1798
1763
  :return: Returns the result object.
1799
1764
  """ # noqa: E501
1800
1765
 
1801
- _param = self._dataset_dataset_id_datapoints_post_serialize(
1766
+ _param = self._dataset_dataset_id_datapoints_s3_post_serialize(
1802
1767
  dataset_id=dataset_id,
1803
- prompt_asset=prompt_asset,
1804
- file=file,
1805
- text=text,
1806
- url=url,
1807
- metadata=metadata,
1808
- sort_index=sort_index,
1768
+ create_datapoints_from_s3_bucket_model=create_datapoints_from_s3_bucket_model,
1809
1769
  _request_auth=_request_auth,
1810
1770
  _content_type=_content_type,
1811
1771
  _headers=_headers,
@@ -1813,7 +1773,7 @@ class DatasetApi:
1813
1773
  )
1814
1774
 
1815
1775
  _response_types_map: Dict[str, Optional[str]] = {
1816
- '200': "CreateDatapointResult",
1776
+ '200': "UploadFromS3Result",
1817
1777
  }
1818
1778
  response_data = self.api_client.call_api(
1819
1779
  *_param,
@@ -1827,15 +1787,10 @@ class DatasetApi:
1827
1787
 
1828
1788
 
1829
1789
  @validate_call
1830
- def dataset_dataset_id_datapoints_post_with_http_info(
1790
+ def dataset_dataset_id_datapoints_s3_post_with_http_info(
1831
1791
  self,
1832
- dataset_id: Annotated[StrictStr, Field(description="The id of the dataset")],
1833
- prompt_asset: Optional[List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]]] = None,
1834
- file: Optional[List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]]] = None,
1835
- text: Annotated[Optional[List[StrictStr]], Field(description="The texts to upload. The length limit is set at 256 characters per text.")] = None,
1836
- url: Annotated[Optional[List[StrictStr]], Field(description="Creates an asset from a url. The url needs to point to a publicly accessible resource. The server will download the resource and store it as an asset in the background. <remarks> Additionally, to the urls having to be publicly accessible, they need to support HTTP HEAD requests. </remarks>")] = None,
1837
- metadata: Annotated[Optional[List[DatasetDatasetIdDatapointsPostRequestMetadataInner]], Field(description="Optional metadata to attach to the datapoint.")] = None,
1838
- sort_index: Annotated[Optional[StrictInt], Field(description="The index will be used to keep the datapoints in order. Useful if upload is parallelized")] = None,
1792
+ dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to upload the files to.")],
1793
+ create_datapoints_from_s3_bucket_model: Annotated[Optional[CreateDatapointsFromS3BucketModel], Field(description="The body of the request.")] = None,
1839
1794
  _request_timeout: Union[
1840
1795
  None,
1841
1796
  Annotated[StrictFloat, Field(gt=0)],
@@ -1848,25 +1803,15 @@ class DatasetApi:
1848
1803
  _content_type: Optional[StrictStr] = None,
1849
1804
  _headers: Optional[Dict[StrictStr, Any]] = None,
1850
1805
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1851
- ) -> ApiResponse[CreateDatapointResult]:
1852
- """Creates a new datapoint from multiple possible sources.
1806
+ ) -> ApiResponse[UploadFromS3Result]:
1807
+ """Uploads files from an S3 bucket to a dataset.
1853
1808
 
1854
- Multiple files, texts, and urls can be provided. If multiple files are provided, a multi-asset datapoint will be created, meaning that all sources provided will be stored as sub-assets of the datapoint. If multiple datapoints are desired, one should not pass in multiple files, texts, or urls, instead, one should call this endpoint multiple times with the desired file, text, or url per datapoint. The request must be a multipart form request, where each parameter is sent as a separate part. The files, texts, and urls can be mixed and matched as needed, however, at least one of them must be provided, and one should make sure that mixing them makes sense for the dataset.
1809
+ A new datapoint will be created for each file in the bucket.
1855
1810
 
1856
- :param dataset_id: The id of the dataset (required)
1811
+ :param dataset_id: The id of the dataset to upload the files to. (required)
1857
1812
  :type dataset_id: str
1858
- :param prompt_asset:
1859
- :type prompt_asset: List[bytearray]
1860
- :param file:
1861
- :type file: List[bytearray]
1862
- :param text: The texts to upload. The length limit is set at 256 characters per text.
1863
- :type text: List[str]
1864
- :param url: Creates an asset from a url. The url needs to point to a publicly accessible resource. The server will download the resource and store it as an asset in the background. <remarks> Additionally, to the urls having to be publicly accessible, they need to support HTTP HEAD requests. </remarks>
1865
- :type url: List[str]
1866
- :param metadata: Optional metadata to attach to the datapoint.
1867
- :type metadata: List[DatasetDatasetIdDatapointsPostRequestMetadataInner]
1868
- :param sort_index: The index will be used to keep the datapoints in order. Useful if upload is parallelized
1869
- :type sort_index: int
1813
+ :param create_datapoints_from_s3_bucket_model: The body of the request.
1814
+ :type create_datapoints_from_s3_bucket_model: CreateDatapointsFromS3BucketModel
1870
1815
  :param _request_timeout: timeout setting for this request. If one
1871
1816
  number provided, it will be total request
1872
1817
  timeout. It can also be a pair (tuple) of
@@ -1889,14 +1834,9 @@ class DatasetApi:
1889
1834
  :return: Returns the result object.
1890
1835
  """ # noqa: E501
1891
1836
 
1892
- _param = self._dataset_dataset_id_datapoints_post_serialize(
1837
+ _param = self._dataset_dataset_id_datapoints_s3_post_serialize(
1893
1838
  dataset_id=dataset_id,
1894
- prompt_asset=prompt_asset,
1895
- file=file,
1896
- text=text,
1897
- url=url,
1898
- metadata=metadata,
1899
- sort_index=sort_index,
1839
+ create_datapoints_from_s3_bucket_model=create_datapoints_from_s3_bucket_model,
1900
1840
  _request_auth=_request_auth,
1901
1841
  _content_type=_content_type,
1902
1842
  _headers=_headers,
@@ -1904,7 +1844,7 @@ class DatasetApi:
1904
1844
  )
1905
1845
 
1906
1846
  _response_types_map: Dict[str, Optional[str]] = {
1907
- '200': "CreateDatapointResult",
1847
+ '200': "UploadFromS3Result",
1908
1848
  }
1909
1849
  response_data = self.api_client.call_api(
1910
1850
  *_param,
@@ -1918,15 +1858,10 @@ class DatasetApi:
1918
1858
 
1919
1859
 
1920
1860
  @validate_call
1921
- def dataset_dataset_id_datapoints_post_without_preload_content(
1861
+ def dataset_dataset_id_datapoints_s3_post_without_preload_content(
1922
1862
  self,
1923
- dataset_id: Annotated[StrictStr, Field(description="The id of the dataset")],
1924
- prompt_asset: Optional[List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]]] = None,
1925
- file: Optional[List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]]] = None,
1926
- text: Annotated[Optional[List[StrictStr]], Field(description="The texts to upload. The length limit is set at 256 characters per text.")] = None,
1927
- url: Annotated[Optional[List[StrictStr]], Field(description="Creates an asset from a url. The url needs to point to a publicly accessible resource. The server will download the resource and store it as an asset in the background. <remarks> Additionally, to the urls having to be publicly accessible, they need to support HTTP HEAD requests. </remarks>")] = None,
1928
- metadata: Annotated[Optional[List[DatasetDatasetIdDatapointsPostRequestMetadataInner]], Field(description="Optional metadata to attach to the datapoint.")] = None,
1929
- sort_index: Annotated[Optional[StrictInt], Field(description="The index will be used to keep the datapoints in order. Useful if upload is parallelized")] = None,
1863
+ dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to upload the files to.")],
1864
+ create_datapoints_from_s3_bucket_model: Annotated[Optional[CreateDatapointsFromS3BucketModel], Field(description="The body of the request.")] = None,
1930
1865
  _request_timeout: Union[
1931
1866
  None,
1932
1867
  Annotated[StrictFloat, Field(gt=0)],
@@ -1940,24 +1875,14 @@ class DatasetApi:
1940
1875
  _headers: Optional[Dict[StrictStr, Any]] = None,
1941
1876
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1942
1877
  ) -> RESTResponseType:
1943
- """Creates a new datapoint from multiple possible sources.
1878
+ """Uploads files from an S3 bucket to a dataset.
1944
1879
 
1945
- Multiple files, texts, and urls can be provided. If multiple files are provided, a multi-asset datapoint will be created, meaning that all sources provided will be stored as sub-assets of the datapoint. If multiple datapoints are desired, one should not pass in multiple files, texts, or urls, instead, one should call this endpoint multiple times with the desired file, text, or url per datapoint. The request must be a multipart form request, where each parameter is sent as a separate part. The files, texts, and urls can be mixed and matched as needed, however, at least one of them must be provided, and one should make sure that mixing them makes sense for the dataset.
1880
+ A new datapoint will be created for each file in the bucket.
1946
1881
 
1947
- :param dataset_id: The id of the dataset (required)
1882
+ :param dataset_id: The id of the dataset to upload the files to. (required)
1948
1883
  :type dataset_id: str
1949
- :param prompt_asset:
1950
- :type prompt_asset: List[bytearray]
1951
- :param file:
1952
- :type file: List[bytearray]
1953
- :param text: The texts to upload. The length limit is set at 256 characters per text.
1954
- :type text: List[str]
1955
- :param url: Creates an asset from a url. The url needs to point to a publicly accessible resource. The server will download the resource and store it as an asset in the background. <remarks> Additionally, to the urls having to be publicly accessible, they need to support HTTP HEAD requests. </remarks>
1956
- :type url: List[str]
1957
- :param metadata: Optional metadata to attach to the datapoint.
1958
- :type metadata: List[DatasetDatasetIdDatapointsPostRequestMetadataInner]
1959
- :param sort_index: The index will be used to keep the datapoints in order. Useful if upload is parallelized
1960
- :type sort_index: int
1884
+ :param create_datapoints_from_s3_bucket_model: The body of the request.
1885
+ :type create_datapoints_from_s3_bucket_model: CreateDatapointsFromS3BucketModel
1961
1886
  :param _request_timeout: timeout setting for this request. If one
1962
1887
  number provided, it will be total request
1963
1888
  timeout. It can also be a pair (tuple) of
@@ -1980,14 +1905,9 @@ class DatasetApi:
1980
1905
  :return: Returns the result object.
1981
1906
  """ # noqa: E501
1982
1907
 
1983
- _param = self._dataset_dataset_id_datapoints_post_serialize(
1908
+ _param = self._dataset_dataset_id_datapoints_s3_post_serialize(
1984
1909
  dataset_id=dataset_id,
1985
- prompt_asset=prompt_asset,
1986
- file=file,
1987
- text=text,
1988
- url=url,
1989
- metadata=metadata,
1990
- sort_index=sort_index,
1910
+ create_datapoints_from_s3_bucket_model=create_datapoints_from_s3_bucket_model,
1991
1911
  _request_auth=_request_auth,
1992
1912
  _content_type=_content_type,
1993
1913
  _headers=_headers,
@@ -1995,7 +1915,7 @@ class DatasetApi:
1995
1915
  )
1996
1916
 
1997
1917
  _response_types_map: Dict[str, Optional[str]] = {
1998
- '200': "CreateDatapointResult",
1918
+ '200': "UploadFromS3Result",
1999
1919
  }
2000
1920
  response_data = self.api_client.call_api(
2001
1921
  *_param,
@@ -2004,15 +1924,10 @@ class DatasetApi:
2004
1924
  return response_data.response
2005
1925
 
2006
1926
 
2007
- def _dataset_dataset_id_datapoints_post_serialize(
1927
+ def _dataset_dataset_id_datapoints_s3_post_serialize(
2008
1928
  self,
2009
1929
  dataset_id,
2010
- prompt_asset,
2011
- file,
2012
- text,
2013
- url,
2014
- metadata,
2015
- sort_index,
1930
+ create_datapoints_from_s3_bucket_model,
2016
1931
  _request_auth,
2017
1932
  _content_type,
2018
1933
  _headers,
@@ -2022,11 +1937,6 @@ class DatasetApi:
2022
1937
  _host = None
2023
1938
 
2024
1939
  _collection_formats: Dict[str, str] = {
2025
- 'promptAsset': 'multi',
2026
- 'file': 'multi',
2027
- 'text': 'multi',
2028
- 'url': 'multi',
2029
- 'metadata': 'multi',
2030
1940
  }
2031
1941
 
2032
1942
  _path_params: Dict[str, str] = {}
@@ -2044,19 +1954,9 @@ class DatasetApi:
2044
1954
  # process the query parameters
2045
1955
  # process the header parameters
2046
1956
  # process the form parameters
2047
- if prompt_asset is not None:
2048
- _files['promptAsset'] = prompt_asset
2049
- if file is not None:
2050
- _files['file'] = file
2051
- if text is not None:
2052
- _form_params.append(('text', text))
2053
- if url is not None:
2054
- _form_params.append(('url', url))
2055
- if metadata is not None:
2056
- _form_params.append(('metadata', metadata))
2057
- if sort_index is not None:
2058
- _form_params.append(('sortIndex', sort_index))
2059
1957
  # process the body parameter
1958
+ if create_datapoints_from_s3_bucket_model is not None:
1959
+ _body_params = create_datapoints_from_s3_bucket_model
2060
1960
 
2061
1961
 
2062
1962
  # set the HTTP header `Accept`
@@ -2076,7 +1976,9 @@ class DatasetApi:
2076
1976
  _default_content_type = (
2077
1977
  self.api_client.select_header_content_type(
2078
1978
  [
2079
- 'multipart/form-data'
1979
+ 'application/json',
1980
+ 'text/json',
1981
+ 'application/*+json'
2080
1982
  ]
2081
1983
  )
2082
1984
  )
@@ -2091,889 +1993,7 @@ class DatasetApi:
2091
1993
 
2092
1994
  return self.api_client.param_serialize(
2093
1995
  method='POST',
2094
- resource_path='/dataset/{datasetId}/datapoints',
2095
- path_params=_path_params,
2096
- query_params=_query_params,
2097
- header_params=_header_params,
2098
- body=_body_params,
2099
- post_params=_form_params,
2100
- files=_files,
2101
- auth_settings=_auth_settings,
2102
- collection_formats=_collection_formats,
2103
- _host=_host,
2104
- _request_auth=_request_auth
2105
- )
2106
-
2107
-
2108
-
2109
-
2110
- @validate_call
2111
- def dataset_dataset_id_datapoints_s3_post(
2112
- self,
2113
- dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to upload the files to.")],
2114
- create_datapoints_from_s3_bucket_model: Annotated[Optional[CreateDatapointsFromS3BucketModel], Field(description="The body of the request.")] = None,
2115
- _request_timeout: Union[
2116
- None,
2117
- Annotated[StrictFloat, Field(gt=0)],
2118
- Tuple[
2119
- Annotated[StrictFloat, Field(gt=0)],
2120
- Annotated[StrictFloat, Field(gt=0)]
2121
- ]
2122
- ] = None,
2123
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2124
- _content_type: Optional[StrictStr] = None,
2125
- _headers: Optional[Dict[StrictStr, Any]] = None,
2126
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2127
- ) -> UploadFromS3Result:
2128
- """Uploads files from an S3 bucket to a dataset.
2129
-
2130
- A new datapoint will be created for each file in the bucket.
2131
-
2132
- :param dataset_id: The id of the dataset to upload the files to. (required)
2133
- :type dataset_id: str
2134
- :param create_datapoints_from_s3_bucket_model: The body of the request.
2135
- :type create_datapoints_from_s3_bucket_model: CreateDatapointsFromS3BucketModel
2136
- :param _request_timeout: timeout setting for this request. If one
2137
- number provided, it will be total request
2138
- timeout. It can also be a pair (tuple) of
2139
- (connection, read) timeouts.
2140
- :type _request_timeout: int, tuple(int, int), optional
2141
- :param _request_auth: set to override the auth_settings for an a single
2142
- request; this effectively ignores the
2143
- authentication in the spec for a single request.
2144
- :type _request_auth: dict, optional
2145
- :param _content_type: force content-type for the request.
2146
- :type _content_type: str, Optional
2147
- :param _headers: set to override the headers for a single
2148
- request; this effectively ignores the headers
2149
- in the spec for a single request.
2150
- :type _headers: dict, optional
2151
- :param _host_index: set to override the host_index for a single
2152
- request; this effectively ignores the host_index
2153
- in the spec for a single request.
2154
- :type _host_index: int, optional
2155
- :return: Returns the result object.
2156
- """ # noqa: E501
2157
-
2158
- _param = self._dataset_dataset_id_datapoints_s3_post_serialize(
2159
- dataset_id=dataset_id,
2160
- create_datapoints_from_s3_bucket_model=create_datapoints_from_s3_bucket_model,
2161
- _request_auth=_request_auth,
2162
- _content_type=_content_type,
2163
- _headers=_headers,
2164
- _host_index=_host_index
2165
- )
2166
-
2167
- _response_types_map: Dict[str, Optional[str]] = {
2168
- '200': "UploadFromS3Result",
2169
- }
2170
- response_data = self.api_client.call_api(
2171
- *_param,
2172
- _request_timeout=_request_timeout
2173
- )
2174
- response_data.read()
2175
- return self.api_client.response_deserialize(
2176
- response_data=response_data,
2177
- response_types_map=_response_types_map,
2178
- ).data
2179
-
2180
-
2181
- @validate_call
2182
- def dataset_dataset_id_datapoints_s3_post_with_http_info(
2183
- self,
2184
- dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to upload the files to.")],
2185
- create_datapoints_from_s3_bucket_model: Annotated[Optional[CreateDatapointsFromS3BucketModel], Field(description="The body of the request.")] = None,
2186
- _request_timeout: Union[
2187
- None,
2188
- Annotated[StrictFloat, Field(gt=0)],
2189
- Tuple[
2190
- Annotated[StrictFloat, Field(gt=0)],
2191
- Annotated[StrictFloat, Field(gt=0)]
2192
- ]
2193
- ] = None,
2194
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2195
- _content_type: Optional[StrictStr] = None,
2196
- _headers: Optional[Dict[StrictStr, Any]] = None,
2197
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2198
- ) -> ApiResponse[UploadFromS3Result]:
2199
- """Uploads files from an S3 bucket to a dataset.
2200
-
2201
- A new datapoint will be created for each file in the bucket.
2202
-
2203
- :param dataset_id: The id of the dataset to upload the files to. (required)
2204
- :type dataset_id: str
2205
- :param create_datapoints_from_s3_bucket_model: The body of the request.
2206
- :type create_datapoints_from_s3_bucket_model: CreateDatapointsFromS3BucketModel
2207
- :param _request_timeout: timeout setting for this request. If one
2208
- number provided, it will be total request
2209
- timeout. It can also be a pair (tuple) of
2210
- (connection, read) timeouts.
2211
- :type _request_timeout: int, tuple(int, int), optional
2212
- :param _request_auth: set to override the auth_settings for an a single
2213
- request; this effectively ignores the
2214
- authentication in the spec for a single request.
2215
- :type _request_auth: dict, optional
2216
- :param _content_type: force content-type for the request.
2217
- :type _content_type: str, Optional
2218
- :param _headers: set to override the headers for a single
2219
- request; this effectively ignores the headers
2220
- in the spec for a single request.
2221
- :type _headers: dict, optional
2222
- :param _host_index: set to override the host_index for a single
2223
- request; this effectively ignores the host_index
2224
- in the spec for a single request.
2225
- :type _host_index: int, optional
2226
- :return: Returns the result object.
2227
- """ # noqa: E501
2228
-
2229
- _param = self._dataset_dataset_id_datapoints_s3_post_serialize(
2230
- dataset_id=dataset_id,
2231
- create_datapoints_from_s3_bucket_model=create_datapoints_from_s3_bucket_model,
2232
- _request_auth=_request_auth,
2233
- _content_type=_content_type,
2234
- _headers=_headers,
2235
- _host_index=_host_index
2236
- )
2237
-
2238
- _response_types_map: Dict[str, Optional[str]] = {
2239
- '200': "UploadFromS3Result",
2240
- }
2241
- response_data = self.api_client.call_api(
2242
- *_param,
2243
- _request_timeout=_request_timeout
2244
- )
2245
- response_data.read()
2246
- return self.api_client.response_deserialize(
2247
- response_data=response_data,
2248
- response_types_map=_response_types_map,
2249
- )
2250
-
2251
-
2252
- @validate_call
2253
- def dataset_dataset_id_datapoints_s3_post_without_preload_content(
2254
- self,
2255
- dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to upload the files to.")],
2256
- create_datapoints_from_s3_bucket_model: Annotated[Optional[CreateDatapointsFromS3BucketModel], Field(description="The body of the request.")] = None,
2257
- _request_timeout: Union[
2258
- None,
2259
- Annotated[StrictFloat, Field(gt=0)],
2260
- Tuple[
2261
- Annotated[StrictFloat, Field(gt=0)],
2262
- Annotated[StrictFloat, Field(gt=0)]
2263
- ]
2264
- ] = None,
2265
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2266
- _content_type: Optional[StrictStr] = None,
2267
- _headers: Optional[Dict[StrictStr, Any]] = None,
2268
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2269
- ) -> RESTResponseType:
2270
- """Uploads files from an S3 bucket to a dataset.
2271
-
2272
- A new datapoint will be created for each file in the bucket.
2273
-
2274
- :param dataset_id: The id of the dataset to upload the files to. (required)
2275
- :type dataset_id: str
2276
- :param create_datapoints_from_s3_bucket_model: The body of the request.
2277
- :type create_datapoints_from_s3_bucket_model: CreateDatapointsFromS3BucketModel
2278
- :param _request_timeout: timeout setting for this request. If one
2279
- number provided, it will be total request
2280
- timeout. It can also be a pair (tuple) of
2281
- (connection, read) timeouts.
2282
- :type _request_timeout: int, tuple(int, int), optional
2283
- :param _request_auth: set to override the auth_settings for an a single
2284
- request; this effectively ignores the
2285
- authentication in the spec for a single request.
2286
- :type _request_auth: dict, optional
2287
- :param _content_type: force content-type for the request.
2288
- :type _content_type: str, Optional
2289
- :param _headers: set to override the headers for a single
2290
- request; this effectively ignores the headers
2291
- in the spec for a single request.
2292
- :type _headers: dict, optional
2293
- :param _host_index: set to override the host_index for a single
2294
- request; this effectively ignores the host_index
2295
- in the spec for a single request.
2296
- :type _host_index: int, optional
2297
- :return: Returns the result object.
2298
- """ # noqa: E501
2299
-
2300
- _param = self._dataset_dataset_id_datapoints_s3_post_serialize(
2301
- dataset_id=dataset_id,
2302
- create_datapoints_from_s3_bucket_model=create_datapoints_from_s3_bucket_model,
2303
- _request_auth=_request_auth,
2304
- _content_type=_content_type,
2305
- _headers=_headers,
2306
- _host_index=_host_index
2307
- )
2308
-
2309
- _response_types_map: Dict[str, Optional[str]] = {
2310
- '200': "UploadFromS3Result",
2311
- }
2312
- response_data = self.api_client.call_api(
2313
- *_param,
2314
- _request_timeout=_request_timeout
2315
- )
2316
- return response_data.response
2317
-
2318
-
2319
- def _dataset_dataset_id_datapoints_s3_post_serialize(
2320
- self,
2321
- dataset_id,
2322
- create_datapoints_from_s3_bucket_model,
2323
- _request_auth,
2324
- _content_type,
2325
- _headers,
2326
- _host_index,
2327
- ) -> RequestSerialized:
2328
-
2329
- _host = None
2330
-
2331
- _collection_formats: Dict[str, str] = {
2332
- }
2333
-
2334
- _path_params: Dict[str, str] = {}
2335
- _query_params: List[Tuple[str, str]] = []
2336
- _header_params: Dict[str, Optional[str]] = _headers or {}
2337
- _form_params: List[Tuple[str, str]] = []
2338
- _files: Dict[
2339
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2340
- ] = {}
2341
- _body_params: Optional[bytes] = None
2342
-
2343
- # process the path parameters
2344
- if dataset_id is not None:
2345
- _path_params['datasetId'] = dataset_id
2346
- # process the query parameters
2347
- # process the header parameters
2348
- # process the form parameters
2349
- # process the body parameter
2350
- if create_datapoints_from_s3_bucket_model is not None:
2351
- _body_params = create_datapoints_from_s3_bucket_model
2352
-
2353
-
2354
- # set the HTTP header `Accept`
2355
- if 'Accept' not in _header_params:
2356
- _header_params['Accept'] = self.api_client.select_header_accept(
2357
- [
2358
- 'text/plain',
2359
- 'application/json',
2360
- 'text/json'
2361
- ]
2362
- )
2363
-
2364
- # set the HTTP header `Content-Type`
2365
- if _content_type:
2366
- _header_params['Content-Type'] = _content_type
2367
- else:
2368
- _default_content_type = (
2369
- self.api_client.select_header_content_type(
2370
- [
2371
- 'application/json',
2372
- 'text/json',
2373
- 'application/*+json'
2374
- ]
2375
- )
2376
- )
2377
- if _default_content_type is not None:
2378
- _header_params['Content-Type'] = _default_content_type
2379
-
2380
- # authentication setting
2381
- _auth_settings: List[str] = [
2382
- 'bearer',
2383
- 'oauth2'
2384
- ]
2385
-
2386
- return self.api_client.param_serialize(
2387
- method='POST',
2388
- resource_path='/dataset/{datasetId}/datapoints/s3',
2389
- path_params=_path_params,
2390
- query_params=_query_params,
2391
- header_params=_header_params,
2392
- body=_body_params,
2393
- post_params=_form_params,
2394
- files=_files,
2395
- auth_settings=_auth_settings,
2396
- collection_formats=_collection_formats,
2397
- _host=_host,
2398
- _request_auth=_request_auth
2399
- )
2400
-
2401
-
2402
-
2403
-
2404
- @validate_call
2405
- def dataset_dataset_id_datapoints_texts_post(
2406
- self,
2407
- dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to create the datapoint in.")],
2408
- create_datapoint_from_text_sources_model: Annotated[Optional[CreateDatapointFromTextSourcesModel], Field(description="The body of the request.")] = None,
2409
- _request_timeout: Union[
2410
- None,
2411
- Annotated[StrictFloat, Field(gt=0)],
2412
- Tuple[
2413
- Annotated[StrictFloat, Field(gt=0)],
2414
- Annotated[StrictFloat, Field(gt=0)]
2415
- ]
2416
- ] = None,
2417
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2418
- _content_type: Optional[StrictStr] = None,
2419
- _headers: Optional[Dict[StrictStr, Any]] = None,
2420
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2421
- ) -> CreateDatapointResult:
2422
- """Creates a single datapoint from text sources.
2423
-
2424
- If multiple text sources are uploaded, a multi asset datapoint will be created.
2425
-
2426
- :param dataset_id: The id of the dataset to create the datapoint in. (required)
2427
- :type dataset_id: str
2428
- :param create_datapoint_from_text_sources_model: The body of the request.
2429
- :type create_datapoint_from_text_sources_model: CreateDatapointFromTextSourcesModel
2430
- :param _request_timeout: timeout setting for this request. If one
2431
- number provided, it will be total request
2432
- timeout. It can also be a pair (tuple) of
2433
- (connection, read) timeouts.
2434
- :type _request_timeout: int, tuple(int, int), optional
2435
- :param _request_auth: set to override the auth_settings for an a single
2436
- request; this effectively ignores the
2437
- authentication in the spec for a single request.
2438
- :type _request_auth: dict, optional
2439
- :param _content_type: force content-type for the request.
2440
- :type _content_type: str, Optional
2441
- :param _headers: set to override the headers for a single
2442
- request; this effectively ignores the headers
2443
- in the spec for a single request.
2444
- :type _headers: dict, optional
2445
- :param _host_index: set to override the host_index for a single
2446
- request; this effectively ignores the host_index
2447
- in the spec for a single request.
2448
- :type _host_index: int, optional
2449
- :return: Returns the result object.
2450
- """ # noqa: E501
2451
-
2452
- _param = self._dataset_dataset_id_datapoints_texts_post_serialize(
2453
- dataset_id=dataset_id,
2454
- create_datapoint_from_text_sources_model=create_datapoint_from_text_sources_model,
2455
- _request_auth=_request_auth,
2456
- _content_type=_content_type,
2457
- _headers=_headers,
2458
- _host_index=_host_index
2459
- )
2460
-
2461
- _response_types_map: Dict[str, Optional[str]] = {
2462
- '200': "CreateDatapointResult",
2463
- }
2464
- response_data = self.api_client.call_api(
2465
- *_param,
2466
- _request_timeout=_request_timeout
2467
- )
2468
- response_data.read()
2469
- return self.api_client.response_deserialize(
2470
- response_data=response_data,
2471
- response_types_map=_response_types_map,
2472
- ).data
2473
-
2474
-
2475
- @validate_call
2476
- def dataset_dataset_id_datapoints_texts_post_with_http_info(
2477
- self,
2478
- dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to create the datapoint in.")],
2479
- create_datapoint_from_text_sources_model: Annotated[Optional[CreateDatapointFromTextSourcesModel], Field(description="The body of the request.")] = None,
2480
- _request_timeout: Union[
2481
- None,
2482
- Annotated[StrictFloat, Field(gt=0)],
2483
- Tuple[
2484
- Annotated[StrictFloat, Field(gt=0)],
2485
- Annotated[StrictFloat, Field(gt=0)]
2486
- ]
2487
- ] = None,
2488
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2489
- _content_type: Optional[StrictStr] = None,
2490
- _headers: Optional[Dict[StrictStr, Any]] = None,
2491
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2492
- ) -> ApiResponse[CreateDatapointResult]:
2493
- """Creates a single datapoint from text sources.
2494
-
2495
- If multiple text sources are uploaded, a multi asset datapoint will be created.
2496
-
2497
- :param dataset_id: The id of the dataset to create the datapoint in. (required)
2498
- :type dataset_id: str
2499
- :param create_datapoint_from_text_sources_model: The body of the request.
2500
- :type create_datapoint_from_text_sources_model: CreateDatapointFromTextSourcesModel
2501
- :param _request_timeout: timeout setting for this request. If one
2502
- number provided, it will be total request
2503
- timeout. It can also be a pair (tuple) of
2504
- (connection, read) timeouts.
2505
- :type _request_timeout: int, tuple(int, int), optional
2506
- :param _request_auth: set to override the auth_settings for an a single
2507
- request; this effectively ignores the
2508
- authentication in the spec for a single request.
2509
- :type _request_auth: dict, optional
2510
- :param _content_type: force content-type for the request.
2511
- :type _content_type: str, Optional
2512
- :param _headers: set to override the headers for a single
2513
- request; this effectively ignores the headers
2514
- in the spec for a single request.
2515
- :type _headers: dict, optional
2516
- :param _host_index: set to override the host_index for a single
2517
- request; this effectively ignores the host_index
2518
- in the spec for a single request.
2519
- :type _host_index: int, optional
2520
- :return: Returns the result object.
2521
- """ # noqa: E501
2522
-
2523
- _param = self._dataset_dataset_id_datapoints_texts_post_serialize(
2524
- dataset_id=dataset_id,
2525
- create_datapoint_from_text_sources_model=create_datapoint_from_text_sources_model,
2526
- _request_auth=_request_auth,
2527
- _content_type=_content_type,
2528
- _headers=_headers,
2529
- _host_index=_host_index
2530
- )
2531
-
2532
- _response_types_map: Dict[str, Optional[str]] = {
2533
- '200': "CreateDatapointResult",
2534
- }
2535
- response_data = self.api_client.call_api(
2536
- *_param,
2537
- _request_timeout=_request_timeout
2538
- )
2539
- response_data.read()
2540
- return self.api_client.response_deserialize(
2541
- response_data=response_data,
2542
- response_types_map=_response_types_map,
2543
- )
2544
-
2545
-
2546
- @validate_call
2547
- def dataset_dataset_id_datapoints_texts_post_without_preload_content(
2548
- self,
2549
- dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to create the datapoint in.")],
2550
- create_datapoint_from_text_sources_model: Annotated[Optional[CreateDatapointFromTextSourcesModel], Field(description="The body of the request.")] = None,
2551
- _request_timeout: Union[
2552
- None,
2553
- Annotated[StrictFloat, Field(gt=0)],
2554
- Tuple[
2555
- Annotated[StrictFloat, Field(gt=0)],
2556
- Annotated[StrictFloat, Field(gt=0)]
2557
- ]
2558
- ] = None,
2559
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2560
- _content_type: Optional[StrictStr] = None,
2561
- _headers: Optional[Dict[StrictStr, Any]] = None,
2562
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2563
- ) -> RESTResponseType:
2564
- """Creates a single datapoint from text sources.
2565
-
2566
- If multiple text sources are uploaded, a multi asset datapoint will be created.
2567
-
2568
- :param dataset_id: The id of the dataset to create the datapoint in. (required)
2569
- :type dataset_id: str
2570
- :param create_datapoint_from_text_sources_model: The body of the request.
2571
- :type create_datapoint_from_text_sources_model: CreateDatapointFromTextSourcesModel
2572
- :param _request_timeout: timeout setting for this request. If one
2573
- number provided, it will be total request
2574
- timeout. It can also be a pair (tuple) of
2575
- (connection, read) timeouts.
2576
- :type _request_timeout: int, tuple(int, int), optional
2577
- :param _request_auth: set to override the auth_settings for an a single
2578
- request; this effectively ignores the
2579
- authentication in the spec for a single request.
2580
- :type _request_auth: dict, optional
2581
- :param _content_type: force content-type for the request.
2582
- :type _content_type: str, Optional
2583
- :param _headers: set to override the headers for a single
2584
- request; this effectively ignores the headers
2585
- in the spec for a single request.
2586
- :type _headers: dict, optional
2587
- :param _host_index: set to override the host_index for a single
2588
- request; this effectively ignores the host_index
2589
- in the spec for a single request.
2590
- :type _host_index: int, optional
2591
- :return: Returns the result object.
2592
- """ # noqa: E501
2593
-
2594
- _param = self._dataset_dataset_id_datapoints_texts_post_serialize(
2595
- dataset_id=dataset_id,
2596
- create_datapoint_from_text_sources_model=create_datapoint_from_text_sources_model,
2597
- _request_auth=_request_auth,
2598
- _content_type=_content_type,
2599
- _headers=_headers,
2600
- _host_index=_host_index
2601
- )
2602
-
2603
- _response_types_map: Dict[str, Optional[str]] = {
2604
- '200': "CreateDatapointResult",
2605
- }
2606
- response_data = self.api_client.call_api(
2607
- *_param,
2608
- _request_timeout=_request_timeout
2609
- )
2610
- return response_data.response
2611
-
2612
-
2613
- def _dataset_dataset_id_datapoints_texts_post_serialize(
2614
- self,
2615
- dataset_id,
2616
- create_datapoint_from_text_sources_model,
2617
- _request_auth,
2618
- _content_type,
2619
- _headers,
2620
- _host_index,
2621
- ) -> RequestSerialized:
2622
-
2623
- _host = None
2624
-
2625
- _collection_formats: Dict[str, str] = {
2626
- }
2627
-
2628
- _path_params: Dict[str, str] = {}
2629
- _query_params: List[Tuple[str, str]] = []
2630
- _header_params: Dict[str, Optional[str]] = _headers or {}
2631
- _form_params: List[Tuple[str, str]] = []
2632
- _files: Dict[
2633
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2634
- ] = {}
2635
- _body_params: Optional[bytes] = None
2636
-
2637
- # process the path parameters
2638
- if dataset_id is not None:
2639
- _path_params['datasetId'] = dataset_id
2640
- # process the query parameters
2641
- # process the header parameters
2642
- # process the form parameters
2643
- # process the body parameter
2644
- if create_datapoint_from_text_sources_model is not None:
2645
- _body_params = create_datapoint_from_text_sources_model
2646
-
2647
-
2648
- # set the HTTP header `Accept`
2649
- if 'Accept' not in _header_params:
2650
- _header_params['Accept'] = self.api_client.select_header_accept(
2651
- [
2652
- 'text/plain',
2653
- 'application/json',
2654
- 'text/json'
2655
- ]
2656
- )
2657
-
2658
- # set the HTTP header `Content-Type`
2659
- if _content_type:
2660
- _header_params['Content-Type'] = _content_type
2661
- else:
2662
- _default_content_type = (
2663
- self.api_client.select_header_content_type(
2664
- [
2665
- 'application/json',
2666
- 'text/json',
2667
- 'application/*+json'
2668
- ]
2669
- )
2670
- )
2671
- if _default_content_type is not None:
2672
- _header_params['Content-Type'] = _default_content_type
2673
-
2674
- # authentication setting
2675
- _auth_settings: List[str] = [
2676
- 'bearer',
2677
- 'oauth2'
2678
- ]
2679
-
2680
- return self.api_client.param_serialize(
2681
- method='POST',
2682
- resource_path='/dataset/{datasetId}/datapoints/texts',
2683
- path_params=_path_params,
2684
- query_params=_query_params,
2685
- header_params=_header_params,
2686
- body=_body_params,
2687
- post_params=_form_params,
2688
- files=_files,
2689
- auth_settings=_auth_settings,
2690
- collection_formats=_collection_formats,
2691
- _host=_host,
2692
- _request_auth=_request_auth
2693
- )
2694
-
2695
-
2696
-
2697
-
2698
- @validate_call
2699
- def dataset_dataset_id_datapoints_urls_post(
2700
- self,
2701
- dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to create the datapoint in.")],
2702
- create_datapoint_from_urls_model: Annotated[Optional[CreateDatapointFromUrlsModel], Field(description="The body of the request.")] = None,
2703
- _request_timeout: Union[
2704
- None,
2705
- Annotated[StrictFloat, Field(gt=0)],
2706
- Tuple[
2707
- Annotated[StrictFloat, Field(gt=0)],
2708
- Annotated[StrictFloat, Field(gt=0)]
2709
- ]
2710
- ] = None,
2711
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2712
- _content_type: Optional[StrictStr] = None,
2713
- _headers: Optional[Dict[StrictStr, Any]] = None,
2714
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2715
- ) -> CreateDatapointResult:
2716
- """Creates a single datapoint where the assets are fetched from the specified urls.
2717
-
2718
- Passing in multiple urls will create a single datapoint with a MultiAsset. Each url will be fetched and stored as a sub-asset of the MultiAsset. <para /> If any of the urls are not accessible, the request will fail.
2719
-
2720
- :param dataset_id: The id of the dataset to create the datapoint in. (required)
2721
- :type dataset_id: str
2722
- :param create_datapoint_from_urls_model: The body of the request.
2723
- :type create_datapoint_from_urls_model: CreateDatapointFromUrlsModel
2724
- :param _request_timeout: timeout setting for this request. If one
2725
- number provided, it will be total request
2726
- timeout. It can also be a pair (tuple) of
2727
- (connection, read) timeouts.
2728
- :type _request_timeout: int, tuple(int, int), optional
2729
- :param _request_auth: set to override the auth_settings for an a single
2730
- request; this effectively ignores the
2731
- authentication in the spec for a single request.
2732
- :type _request_auth: dict, optional
2733
- :param _content_type: force content-type for the request.
2734
- :type _content_type: str, Optional
2735
- :param _headers: set to override the headers for a single
2736
- request; this effectively ignores the headers
2737
- in the spec for a single request.
2738
- :type _headers: dict, optional
2739
- :param _host_index: set to override the host_index for a single
2740
- request; this effectively ignores the host_index
2741
- in the spec for a single request.
2742
- :type _host_index: int, optional
2743
- :return: Returns the result object.
2744
- """ # noqa: E501
2745
-
2746
- _param = self._dataset_dataset_id_datapoints_urls_post_serialize(
2747
- dataset_id=dataset_id,
2748
- create_datapoint_from_urls_model=create_datapoint_from_urls_model,
2749
- _request_auth=_request_auth,
2750
- _content_type=_content_type,
2751
- _headers=_headers,
2752
- _host_index=_host_index
2753
- )
2754
-
2755
- _response_types_map: Dict[str, Optional[str]] = {
2756
- '200': "CreateDatapointResult",
2757
- }
2758
- response_data = self.api_client.call_api(
2759
- *_param,
2760
- _request_timeout=_request_timeout
2761
- )
2762
- response_data.read()
2763
- return self.api_client.response_deserialize(
2764
- response_data=response_data,
2765
- response_types_map=_response_types_map,
2766
- ).data
2767
-
2768
-
2769
- @validate_call
2770
- def dataset_dataset_id_datapoints_urls_post_with_http_info(
2771
- self,
2772
- dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to create the datapoint in.")],
2773
- create_datapoint_from_urls_model: Annotated[Optional[CreateDatapointFromUrlsModel], Field(description="The body of the request.")] = None,
2774
- _request_timeout: Union[
2775
- None,
2776
- Annotated[StrictFloat, Field(gt=0)],
2777
- Tuple[
2778
- Annotated[StrictFloat, Field(gt=0)],
2779
- Annotated[StrictFloat, Field(gt=0)]
2780
- ]
2781
- ] = None,
2782
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2783
- _content_type: Optional[StrictStr] = None,
2784
- _headers: Optional[Dict[StrictStr, Any]] = None,
2785
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2786
- ) -> ApiResponse[CreateDatapointResult]:
2787
- """Creates a single datapoint where the assets are fetched from the specified urls.
2788
-
2789
- Passing in multiple urls will create a single datapoint with a MultiAsset. Each url will be fetched and stored as a sub-asset of the MultiAsset. <para /> If any of the urls are not accessible, the request will fail.
2790
-
2791
- :param dataset_id: The id of the dataset to create the datapoint in. (required)
2792
- :type dataset_id: str
2793
- :param create_datapoint_from_urls_model: The body of the request.
2794
- :type create_datapoint_from_urls_model: CreateDatapointFromUrlsModel
2795
- :param _request_timeout: timeout setting for this request. If one
2796
- number provided, it will be total request
2797
- timeout. It can also be a pair (tuple) of
2798
- (connection, read) timeouts.
2799
- :type _request_timeout: int, tuple(int, int), optional
2800
- :param _request_auth: set to override the auth_settings for an a single
2801
- request; this effectively ignores the
2802
- authentication in the spec for a single request.
2803
- :type _request_auth: dict, optional
2804
- :param _content_type: force content-type for the request.
2805
- :type _content_type: str, Optional
2806
- :param _headers: set to override the headers for a single
2807
- request; this effectively ignores the headers
2808
- in the spec for a single request.
2809
- :type _headers: dict, optional
2810
- :param _host_index: set to override the host_index for a single
2811
- request; this effectively ignores the host_index
2812
- in the spec for a single request.
2813
- :type _host_index: int, optional
2814
- :return: Returns the result object.
2815
- """ # noqa: E501
2816
-
2817
- _param = self._dataset_dataset_id_datapoints_urls_post_serialize(
2818
- dataset_id=dataset_id,
2819
- create_datapoint_from_urls_model=create_datapoint_from_urls_model,
2820
- _request_auth=_request_auth,
2821
- _content_type=_content_type,
2822
- _headers=_headers,
2823
- _host_index=_host_index
2824
- )
2825
-
2826
- _response_types_map: Dict[str, Optional[str]] = {
2827
- '200': "CreateDatapointResult",
2828
- }
2829
- response_data = self.api_client.call_api(
2830
- *_param,
2831
- _request_timeout=_request_timeout
2832
- )
2833
- response_data.read()
2834
- return self.api_client.response_deserialize(
2835
- response_data=response_data,
2836
- response_types_map=_response_types_map,
2837
- )
2838
-
2839
-
2840
- @validate_call
2841
- def dataset_dataset_id_datapoints_urls_post_without_preload_content(
2842
- self,
2843
- dataset_id: Annotated[StrictStr, Field(description="The id of the dataset to create the datapoint in.")],
2844
- create_datapoint_from_urls_model: Annotated[Optional[CreateDatapointFromUrlsModel], Field(description="The body of the request.")] = None,
2845
- _request_timeout: Union[
2846
- None,
2847
- Annotated[StrictFloat, Field(gt=0)],
2848
- Tuple[
2849
- Annotated[StrictFloat, Field(gt=0)],
2850
- Annotated[StrictFloat, Field(gt=0)]
2851
- ]
2852
- ] = None,
2853
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2854
- _content_type: Optional[StrictStr] = None,
2855
- _headers: Optional[Dict[StrictStr, Any]] = None,
2856
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2857
- ) -> RESTResponseType:
2858
- """Creates a single datapoint where the assets are fetched from the specified urls.
2859
-
2860
- Passing in multiple urls will create a single datapoint with a MultiAsset. Each url will be fetched and stored as a sub-asset of the MultiAsset. <para /> If any of the urls are not accessible, the request will fail.
2861
-
2862
- :param dataset_id: The id of the dataset to create the datapoint in. (required)
2863
- :type dataset_id: str
2864
- :param create_datapoint_from_urls_model: The body of the request.
2865
- :type create_datapoint_from_urls_model: CreateDatapointFromUrlsModel
2866
- :param _request_timeout: timeout setting for this request. If one
2867
- number provided, it will be total request
2868
- timeout. It can also be a pair (tuple) of
2869
- (connection, read) timeouts.
2870
- :type _request_timeout: int, tuple(int, int), optional
2871
- :param _request_auth: set to override the auth_settings for an a single
2872
- request; this effectively ignores the
2873
- authentication in the spec for a single request.
2874
- :type _request_auth: dict, optional
2875
- :param _content_type: force content-type for the request.
2876
- :type _content_type: str, Optional
2877
- :param _headers: set to override the headers for a single
2878
- request; this effectively ignores the headers
2879
- in the spec for a single request.
2880
- :type _headers: dict, optional
2881
- :param _host_index: set to override the host_index for a single
2882
- request; this effectively ignores the host_index
2883
- in the spec for a single request.
2884
- :type _host_index: int, optional
2885
- :return: Returns the result object.
2886
- """ # noqa: E501
2887
-
2888
- _param = self._dataset_dataset_id_datapoints_urls_post_serialize(
2889
- dataset_id=dataset_id,
2890
- create_datapoint_from_urls_model=create_datapoint_from_urls_model,
2891
- _request_auth=_request_auth,
2892
- _content_type=_content_type,
2893
- _headers=_headers,
2894
- _host_index=_host_index
2895
- )
2896
-
2897
- _response_types_map: Dict[str, Optional[str]] = {
2898
- '200': "CreateDatapointResult",
2899
- }
2900
- response_data = self.api_client.call_api(
2901
- *_param,
2902
- _request_timeout=_request_timeout
2903
- )
2904
- return response_data.response
2905
-
2906
-
2907
- def _dataset_dataset_id_datapoints_urls_post_serialize(
2908
- self,
2909
- dataset_id,
2910
- create_datapoint_from_urls_model,
2911
- _request_auth,
2912
- _content_type,
2913
- _headers,
2914
- _host_index,
2915
- ) -> RequestSerialized:
2916
-
2917
- _host = None
2918
-
2919
- _collection_formats: Dict[str, str] = {
2920
- }
2921
-
2922
- _path_params: Dict[str, str] = {}
2923
- _query_params: List[Tuple[str, str]] = []
2924
- _header_params: Dict[str, Optional[str]] = _headers or {}
2925
- _form_params: List[Tuple[str, str]] = []
2926
- _files: Dict[
2927
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2928
- ] = {}
2929
- _body_params: Optional[bytes] = None
2930
-
2931
- # process the path parameters
2932
- if dataset_id is not None:
2933
- _path_params['datasetId'] = dataset_id
2934
- # process the query parameters
2935
- # process the header parameters
2936
- # process the form parameters
2937
- # process the body parameter
2938
- if create_datapoint_from_urls_model is not None:
2939
- _body_params = create_datapoint_from_urls_model
2940
-
2941
-
2942
- # set the HTTP header `Accept`
2943
- if 'Accept' not in _header_params:
2944
- _header_params['Accept'] = self.api_client.select_header_accept(
2945
- [
2946
- 'text/plain',
2947
- 'application/json',
2948
- 'text/json'
2949
- ]
2950
- )
2951
-
2952
- # set the HTTP header `Content-Type`
2953
- if _content_type:
2954
- _header_params['Content-Type'] = _content_type
2955
- else:
2956
- _default_content_type = (
2957
- self.api_client.select_header_content_type(
2958
- [
2959
- 'application/json',
2960
- 'text/json',
2961
- 'application/*+json'
2962
- ]
2963
- )
2964
- )
2965
- if _default_content_type is not None:
2966
- _header_params['Content-Type'] = _default_content_type
2967
-
2968
- # authentication setting
2969
- _auth_settings: List[str] = [
2970
- 'bearer',
2971
- 'oauth2'
2972
- ]
2973
-
2974
- return self.api_client.param_serialize(
2975
- method='POST',
2976
- resource_path='/dataset/{datasetId}/datapoints/urls',
1996
+ resource_path='/dataset/{datasetId}/datapoints/s3',
2977
1997
  path_params=_path_params,
2978
1998
  query_params=_query_params,
2979
1999
  header_params=_header_params,