From c1a8581453f8c184ca0b86794e65c3664b3fac95 Mon Sep 17 00:00:00 2001 From: Alex Arvanitidis Date: Tue, 17 Dec 2024 16:02:17 +0200 Subject: [PATCH] chore: update openapi specs --- src/jaqpot_api_client/api/dataset_api.py | 611 +++++++++++++++++++ src/jaqpot_api_client/models/dataset.py | 4 +- src/jaqpot_api_client/models/dataset_type.py | 1 + src/jaqpot_api_client/models/model_type.py | 1 + 4 files changed, 616 insertions(+), 1 deletion(-) diff --git a/src/jaqpot_api_client/api/dataset_api.py b/src/jaqpot_api_client/api/dataset_api.py index fe82e26..c1d611f 100644 --- a/src/jaqpot_api_client/api/dataset_api.py +++ b/src/jaqpot_api_client/api/dataset_api.py @@ -41,6 +41,301 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client + @validate_call + def create_dataset( + self, + model_id: StrictInt, + dataset: Dataset, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Dataset: + """Create a dataset + + Create a new dataset from the provided data + + :param model_id: (required) + :type model_id: int + :param dataset: (required) + :type dataset: Dataset + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_dataset_serialize( + model_id=model_id, + dataset=dataset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Dataset", + '400': None, + '401': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_dataset_with_http_info( + self, + model_id: StrictInt, + dataset: Dataset, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Dataset]: + """Create a dataset + + Create a new dataset from the provided data + + :param model_id: (required) + :type model_id: int + :param dataset: (required) + :type dataset: Dataset + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_dataset_serialize( + model_id=model_id, + dataset=dataset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Dataset", + '400': None, + '401': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_dataset_without_preload_content( + self, + model_id: StrictInt, + dataset: Dataset, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a dataset + + Create a new dataset from the provided data + + :param model_id: (required) + :type model_id: int + :param dataset: (required) + :type dataset: Dataset + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_dataset_serialize( + model_id=model_id, + dataset=dataset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Dataset", + '400': None, + '401': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_dataset_serialize( + self, + model_id, + dataset, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if model_id is not None: + _path_params['modelId'] = model_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if dataset is not None: + _body_params = dataset + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/user/models/{modelId}/datasets', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def get_dataset_by_id( self, @@ -604,3 +899,319 @@ def _get_datasets_serialize( ) + + + @validate_call + def get_datasets_by_model_id( + self, + model_id: StrictInt, + page: Optional[StrictInt] = None, + size: Optional[StrictInt] = None, + sort: Optional[List[StrictStr]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetDatasets200Response: + """Get Datasets by Model ID + + Retrieve all datasets associated with a specific model ID + + :param model_id: (required) + :type model_id: int + :param page: + :type page: int + :param size: + :type size: int + :param sort: + :type sort: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_datasets_by_model_id_serialize( + model_id=model_id, + page=page, + size=size, + sort=sort, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetDatasets200Response", + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_datasets_by_model_id_with_http_info( + self, + model_id: StrictInt, + page: Optional[StrictInt] = None, + size: Optional[StrictInt] = None, + sort: Optional[List[StrictStr]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetDatasets200Response]: + """Get Datasets by Model ID + + Retrieve all datasets associated with a specific model ID + + :param model_id: (required) + :type model_id: int + :param page: + :type page: int + :param size: + :type size: int + :param sort: + :type sort: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_datasets_by_model_id_serialize( + model_id=model_id, + page=page, + size=size, + sort=sort, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetDatasets200Response", + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_datasets_by_model_id_without_preload_content( + self, + model_id: StrictInt, + page: Optional[StrictInt] = None, + size: Optional[StrictInt] = None, + sort: Optional[List[StrictStr]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Datasets by Model ID + + Retrieve all datasets associated with a specific model ID + + :param model_id: (required) + :type model_id: int + :param page: + :type page: int + :param size: + :type size: int + :param sort: + :type sort: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_datasets_by_model_id_serialize( + model_id=model_id, + page=page, + size=size, + sort=sort, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetDatasets200Response", + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_datasets_by_model_id_serialize( + self, + model_id, + page, + size, + sort, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'sort': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if model_id is not None: + _path_params['modelId'] = model_id + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/user/models/{modelId}/datasets', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/src/jaqpot_api_client/models/dataset.py b/src/jaqpot_api_client/models/dataset.py index 0956376..b242b15 100644 --- a/src/jaqpot_api_client/models/dataset.py +++ b/src/jaqpot_api_client/models/dataset.py @@ -31,6 +31,7 @@ class Dataset(BaseModel): Dataset """ # noqa: E501 id: Optional[StrictInt] = None + name: Optional[StrictStr] = None type: DatasetType entry_type: StrictStr = Field(alias="entryType") input: Annotated[List[Any], Field(max_length=100)] @@ -44,7 +45,7 @@ class Dataset(BaseModel): execution_finished_at: Optional[datetime] = Field(default=None, alias="executionFinishedAt") created_at: Optional[datetime] = Field(default=None, alias="createdAt") updated_at: Optional[datetime] = Field(default=None, alias="updatedAt") - __properties: ClassVar[List[str]] = ["id", "type", "entryType", "input", "result", "status", "failureReason", "userId", "modelId", "modelName", "executedAt", "executionFinishedAt", "createdAt", "updatedAt"] + __properties: ClassVar[List[str]] = ["id", "name", "type", "entryType", "input", "result", "status", "failureReason", "userId", "modelId", "modelName", "executedAt", "executionFinishedAt", "createdAt", "updatedAt"] @field_validator('entry_type') def entry_type_validate_enum(cls, value): @@ -115,6 +116,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "id": obj.get("id"), + "name": obj.get("name"), "type": obj.get("type"), "entryType": obj.get("entryType"), "input": obj.get("input"), diff --git a/src/jaqpot_api_client/models/dataset_type.py b/src/jaqpot_api_client/models/dataset_type.py index b0eb3b2..602bfc9 100644 --- a/src/jaqpot_api_client/models/dataset_type.py +++ b/src/jaqpot_api_client/models/dataset_type.py @@ -28,6 +28,7 @@ class DatasetType(str, Enum): allowed enum values """ PREDICTION = 'PREDICTION' + CHAT = 'CHAT' @classmethod def from_json(cls, json_str: str) -> Self: diff --git a/src/jaqpot_api_client/models/model_type.py b/src/jaqpot_api_client/models/model_type.py index bbf6e47..893316c 100644 --- a/src/jaqpot_api_client/models/model_type.py +++ b/src/jaqpot_api_client/models/model_type.py @@ -42,6 +42,7 @@ class ModelType(str, Enum): R_TREE_CLASS = 'R_TREE_CLASS' R_TREE_REGR = 'R_TREE_REGR' DOCKER = 'DOCKER' + DOCKER_LLM = 'DOCKER_LLM' QSAR_TOOLBOX_CALCULATOR = 'QSAR_TOOLBOX_CALCULATOR' QSAR_TOOLBOX_QSAR_MODEL = 'QSAR_TOOLBOX_QSAR_MODEL' QSAR_TOOLBOX_PROFILER = 'QSAR_TOOLBOX_PROFILER'