From 19c670c500caecf5747070eba0a5ee8962264336 Mon Sep 17 00:00:00 2001 From: Francine Wright Date: Tue, 25 Feb 2025 18:22:54 +0000 Subject: [PATCH] generated --- generated/.openapi-generator/FILES | 15 + generated/README.md | 7 + generated/docs/DetectorsApi.md | 156 +++++++++ generated/docs/InlineResponse200.md | 2 +- generated/docs/InlineResponse2001.md | 12 + .../InlineResponse2001EvaluationResults.md | 19 ++ generated/docs/InlineResponse2002.md | 12 + generated/docs/InlineResponse200Summary.md | 16 + .../InlineResponse200SummaryClassCounts.md | 16 + generated/docs/PayloadTemplate.md | 2 +- generated/docs/PayloadTemplateRequest.md | 2 +- generated/docs/UserApi.md | 6 +- .../api/detectors_api.py | 198 ++++++++++++ .../api/user_api.py | 6 +- .../model/inline_response200.py | 16 +- .../model/inline_response2001.py | 278 ++++++++++++++++ .../inline_response2001_evaluation_results.py | 305 ++++++++++++++++++ .../model/inline_response2002.py | 268 +++++++++++++++ .../model/inline_response200_summary.py | 296 +++++++++++++++++ ...inline_response200_summary_class_counts.py | 284 ++++++++++++++++ .../model/payload_template.py | 13 +- .../model/payload_template_request.py | 13 +- .../models/__init__.py | 5 + generated/model.py | 6 +- generated/test/test_inline_response2001.py | 38 +++ ..._inline_response2001_evaluation_results.py | 35 ++ generated/test/test_inline_response2002.py | 35 ++ .../test/test_inline_response200_summary.py | 38 +++ ...inline_response200_summary_class_counts.py | 35 ++ spec/public-api.yaml | 108 +++++++ 30 files changed, 2206 insertions(+), 36 deletions(-) create mode 100644 generated/docs/InlineResponse2001.md create mode 100644 generated/docs/InlineResponse2001EvaluationResults.md create mode 100644 generated/docs/InlineResponse2002.md create mode 100644 generated/docs/InlineResponse200Summary.md create mode 100644 generated/docs/InlineResponse200SummaryClassCounts.md create mode 100644 generated/groundlight_openapi_client/model/inline_response2001.py create mode 100644 generated/groundlight_openapi_client/model/inline_response2001_evaluation_results.py create mode 100644 generated/groundlight_openapi_client/model/inline_response2002.py create mode 100644 generated/groundlight_openapi_client/model/inline_response200_summary.py create mode 100644 generated/groundlight_openapi_client/model/inline_response200_summary_class_counts.py create mode 100644 generated/test/test_inline_response2001.py create mode 100644 generated/test/test_inline_response2001_evaluation_results.py create mode 100644 generated/test/test_inline_response2002.py create mode 100644 generated/test/test_inline_response200_summary.py create mode 100644 generated/test/test_inline_response200_summary_class_counts.py diff --git a/generated/.openapi-generator/FILES b/generated/.openapi-generator/FILES index 53c314c1..aa80bd56 100644 --- a/generated/.openapi-generator/FILES +++ b/generated/.openapi-generator/FILES @@ -29,6 +29,11 @@ docs/ImageQueriesApi.md docs/ImageQuery.md docs/ImageQueryTypeEnum.md docs/InlineResponse200.md +docs/InlineResponse2001.md +docs/InlineResponse2001EvaluationResults.md +docs/InlineResponse2002.md +docs/InlineResponse200Summary.md +docs/InlineResponse200SummaryClassCounts.md docs/LabelValue.md docs/LabelValueRequest.md docs/LabelsApi.md @@ -98,6 +103,11 @@ groundlight_openapi_client/model/escalation_type_enum.py groundlight_openapi_client/model/image_query.py groundlight_openapi_client/model/image_query_type_enum.py groundlight_openapi_client/model/inline_response200.py +groundlight_openapi_client/model/inline_response2001.py +groundlight_openapi_client/model/inline_response2001_evaluation_results.py +groundlight_openapi_client/model/inline_response2002.py +groundlight_openapi_client/model/inline_response200_summary.py +groundlight_openapi_client/model/inline_response200_summary_class_counts.py groundlight_openapi_client/model/label_value.py groundlight_openapi_client/model/label_value_request.py groundlight_openapi_client/model/mode_enum.py @@ -132,4 +142,9 @@ setup.cfg setup.py test-requirements.txt test/__init__.py +test/test_inline_response2001.py +test/test_inline_response2001_evaluation_results.py +test/test_inline_response2002.py +test/test_inline_response200_summary.py +test/test_inline_response200_summary_class_counts.py tox.ini diff --git a/generated/README.md b/generated/README.md index 32c53279..373577ba 100644 --- a/generated/README.md +++ b/generated/README.md @@ -123,6 +123,8 @@ Class | Method | HTTP request | Description *DetectorsApi* | [**create_detector**](docs/DetectorsApi.md#create_detector) | **POST** /v1/detectors | *DetectorsApi* | [**delete_detector**](docs/DetectorsApi.md#delete_detector) | **DELETE** /v1/detectors/{id} | *DetectorsApi* | [**get_detector**](docs/DetectorsApi.md#get_detector) | **GET** /v1/detectors/{id} | +*DetectorsApi* | [**get_detector_evaluation**](docs/DetectorsApi.md#get_detector_evaluation) | **GET** /v1/detectors/{id}/evaluation | +*DetectorsApi* | [**get_detector_metrics**](docs/DetectorsApi.md#get_detector_metrics) | **GET** /v1/detectors/{detector_id}/metrics | *DetectorsApi* | [**list_detectors**](docs/DetectorsApi.md#list_detectors) | **GET** /v1/detectors | *DetectorsApi* | [**update_detector**](docs/DetectorsApi.md#update_detector) | **PATCH** /v1/detectors/{id} | *EdgeApi* | [**get_model_urls**](docs/EdgeApi.md#get_model_urls) | **GET** /v1/edge/fetch-model-urls/{detector_id}/ | @@ -161,6 +163,11 @@ Class | Method | HTTP request | Description - [ImageQuery](docs/ImageQuery.md) - [ImageQueryTypeEnum](docs/ImageQueryTypeEnum.md) - [InlineResponse200](docs/InlineResponse200.md) + - [InlineResponse2001](docs/InlineResponse2001.md) + - [InlineResponse2001EvaluationResults](docs/InlineResponse2001EvaluationResults.md) + - [InlineResponse2002](docs/InlineResponse2002.md) + - [InlineResponse200Summary](docs/InlineResponse200Summary.md) + - [InlineResponse200SummaryClassCounts](docs/InlineResponse200SummaryClassCounts.md) - [LabelValue](docs/LabelValue.md) - [LabelValueRequest](docs/LabelValueRequest.md) - [ModeEnum](docs/ModeEnum.md) diff --git a/generated/docs/DetectorsApi.md b/generated/docs/DetectorsApi.md index b0eeb292..51cc1d1c 100644 --- a/generated/docs/DetectorsApi.md +++ b/generated/docs/DetectorsApi.md @@ -7,6 +7,8 @@ Method | HTTP request | Description [**create_detector**](DetectorsApi.md#create_detector) | **POST** /v1/detectors | [**delete_detector**](DetectorsApi.md#delete_detector) | **DELETE** /v1/detectors/{id} | [**get_detector**](DetectorsApi.md#get_detector) | **GET** /v1/detectors/{id} | +[**get_detector_evaluation**](DetectorsApi.md#get_detector_evaluation) | **GET** /v1/detectors/{id}/evaluation | +[**get_detector_metrics**](DetectorsApi.md#get_detector_metrics) | **GET** /v1/detectors/{detector_id}/metrics | [**list_detectors**](DetectorsApi.md#list_detectors) | **GET** /v1/detectors | [**update_detector**](DetectorsApi.md#update_detector) | **PATCH** /v1/detectors/{id} | @@ -243,6 +245,160 @@ Name | Type | Description | Notes - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_detector_evaluation** +> InlineResponse2001 get_detector_evaluation(id) + + + +Get Detector evaluation results. The result is null if there isn't enough ground truth data to evaluate the detector. Returns the time of the evaulation, total ground truth labels, the ml based kfold accuracies, and the system accuracies at different confidence thresholds + +### Example + +* Api Key Authentication (ApiToken): + +```python +import time +import groundlight_openapi_client +from groundlight_openapi_client.api import detectors_api +from groundlight_openapi_client.model.inline_response2001 import InlineResponse2001 +from pprint import pprint +# Defining the host is optional and defaults to https://api.groundlight.ai/device-api +# See configuration.py for a list of all supported configuration parameters. +configuration = groundlight_openapi_client.Configuration( + host = "https://api.groundlight.ai/device-api" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiToken +configuration.api_key['ApiToken'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiToken'] = 'Bearer' + +# Enter a context with an instance of the API client +with groundlight_openapi_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = detectors_api.DetectorsApi(api_client) + id = "id_example" # str | + + # example passing only required values which don't have defaults set + try: + api_response = api_instance.get_detector_evaluation(id) + pprint(api_response) + except groundlight_openapi_client.ApiException as e: + print("Exception when calling DetectorsApi->get_detector_evaluation: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + +### Return type + +[**InlineResponse2001**](InlineResponse2001.md) + +### Authorization + +[ApiToken](../README.md#ApiToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_detector_metrics** +> InlineResponse200 get_detector_metrics(detector_id) + + + +Get Detector metrics, primarily the counts of different types of labels + +### Example + +* Api Key Authentication (ApiToken): + +```python +import time +import groundlight_openapi_client +from groundlight_openapi_client.api import detectors_api +from groundlight_openapi_client.model.inline_response200 import InlineResponse200 +from pprint import pprint +# Defining the host is optional and defaults to https://api.groundlight.ai/device-api +# See configuration.py for a list of all supported configuration parameters. +configuration = groundlight_openapi_client.Configuration( + host = "https://api.groundlight.ai/device-api" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiToken +configuration.api_key['ApiToken'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiToken'] = 'Bearer' + +# Enter a context with an instance of the API client +with groundlight_openapi_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = detectors_api.DetectorsApi(api_client) + detector_id = "detector_id_example" # str | + + # example passing only required values which don't have defaults set + try: + api_response = api_instance.get_detector_metrics(detector_id) + pprint(api_response) + except groundlight_openapi_client.ApiException as e: + print("Exception when calling DetectorsApi->get_detector_metrics: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **detector_id** | **str**| | + +### Return type + +[**InlineResponse200**](InlineResponse200.md) + +### Authorization + +[ApiToken](../README.md#ApiToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + ### HTTP response details | Status code | Description | Response headers | diff --git a/generated/docs/InlineResponse200.md b/generated/docs/InlineResponse200.md index 020894d5..23dc2df0 100644 --- a/generated/docs/InlineResponse200.md +++ b/generated/docs/InlineResponse200.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**username** | **str** | The user's username | [optional] +**summary** | [**InlineResponse200Summary**](InlineResponse200Summary.md) | | [optional] **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/generated/docs/InlineResponse2001.md b/generated/docs/InlineResponse2001.md new file mode 100644 index 00000000..aa7bbe38 --- /dev/null +++ b/generated/docs/InlineResponse2001.md @@ -0,0 +1,12 @@ +# InlineResponse2001 + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**evaluation_results** | [**InlineResponse2001EvaluationResults**](InlineResponse2001EvaluationResults.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/docs/InlineResponse2001EvaluationResults.md b/generated/docs/InlineResponse2001EvaluationResults.md new file mode 100644 index 00000000..01f845e5 --- /dev/null +++ b/generated/docs/InlineResponse2001EvaluationResults.md @@ -0,0 +1,19 @@ +# InlineResponse2001EvaluationResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**eval_timestamp** | **datetime** | | [optional] +**total_ground_truth_examples** | **int, none_type** | | [optional] +**kfold_pooled__balanced_accuracy** | **float** | | [optional] +**kfold_pooled__positive_accuracy** | **float** | | [optional] +**kfold_pooled__negative_accuracy** | **float** | | [optional] +**balanced_system_accuracies** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] +**positive_system_accuracies** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] +**negative_system_accuracies** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/docs/InlineResponse2002.md b/generated/docs/InlineResponse2002.md new file mode 100644 index 00000000..59b1a320 --- /dev/null +++ b/generated/docs/InlineResponse2002.md @@ -0,0 +1,12 @@ +# InlineResponse2002 + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | **str** | The user's username | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/docs/InlineResponse200Summary.md b/generated/docs/InlineResponse200Summary.md new file mode 100644 index 00000000..aebcac9c --- /dev/null +++ b/generated/docs/InlineResponse200Summary.md @@ -0,0 +1,16 @@ +# InlineResponse200Summary + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**num_ground_truth** | **int** | | [optional] +**num_current_source_human** | **int** | | [optional] +**class_counts** | [**InlineResponse200SummaryClassCounts**](InlineResponse200SummaryClassCounts.md) | | [optional] +**unconfident_counts** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] +**total_iqs** | **int** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/docs/InlineResponse200SummaryClassCounts.md b/generated/docs/InlineResponse200SummaryClassCounts.md new file mode 100644 index 00000000..463959ad --- /dev/null +++ b/generated/docs/InlineResponse200SummaryClassCounts.md @@ -0,0 +1,16 @@ +# InlineResponse200SummaryClassCounts + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source_ml** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] +**source_human** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] +**cloud_labeler** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] +**cloud** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] +**total** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/docs/PayloadTemplate.md b/generated/docs/PayloadTemplate.md index b8a029c7..b2f39495 100644 --- a/generated/docs/PayloadTemplate.md +++ b/generated/docs/PayloadTemplate.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **template** | **str** | | -**headers** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] +**headers** | **{str: (str,)}, none_type** | | [optional] **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/generated/docs/PayloadTemplateRequest.md b/generated/docs/PayloadTemplateRequest.md index c14ec34d..83e8c3c3 100644 --- a/generated/docs/PayloadTemplateRequest.md +++ b/generated/docs/PayloadTemplateRequest.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **template** | **str** | | -**headers** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] +**headers** | **{str: (str,)}, none_type** | | [optional] **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/generated/docs/UserApi.md b/generated/docs/UserApi.md index 7e7d864d..b10f06bc 100644 --- a/generated/docs/UserApi.md +++ b/generated/docs/UserApi.md @@ -8,7 +8,7 @@ Method | HTTP request | Description # **who_am_i** -> InlineResponse200 who_am_i() +> InlineResponse2002 who_am_i() @@ -22,7 +22,7 @@ Retrieve the current user. import time import groundlight_openapi_client from groundlight_openapi_client.api import user_api -from groundlight_openapi_client.model.inline_response200 import InlineResponse200 +from groundlight_openapi_client.model.inline_response2002 import InlineResponse2002 from pprint import pprint # Defining the host is optional and defaults to https://api.groundlight.ai/device-api # See configuration.py for a list of all supported configuration parameters. @@ -60,7 +60,7 @@ This endpoint does not need any parameter. ### Return type -[**InlineResponse200**](InlineResponse200.md) +[**InlineResponse2002**](InlineResponse2002.md) ### Authorization diff --git a/generated/groundlight_openapi_client/api/detectors_api.py b/generated/groundlight_openapi_client/api/detectors_api.py index a46e110f..eca18f45 100644 --- a/generated/groundlight_openapi_client/api/detectors_api.py +++ b/generated/groundlight_openapi_client/api/detectors_api.py @@ -23,6 +23,8 @@ ) from groundlight_openapi_client.model.detector import Detector from groundlight_openapi_client.model.detector_creation_input_request import DetectorCreationInputRequest +from groundlight_openapi_client.model.inline_response200 import InlineResponse200 +from groundlight_openapi_client.model.inline_response2001 import InlineResponse2001 from groundlight_openapi_client.model.paginated_detector_list import PaginatedDetectorList from groundlight_openapi_client.model.patched_detector_request import PatchedDetectorRequest @@ -153,6 +155,86 @@ def __init__(self, api_client=None): }, api_client=api_client, ) + self.get_detector_evaluation_endpoint = _Endpoint( + settings={ + "response_type": (InlineResponse2001,), + "auth": ["ApiToken"], + "endpoint_path": "/v1/detectors/{id}/evaluation", + "operation_id": "get_detector_evaluation", + "http_method": "GET", + "servers": None, + }, + params_map={ + "all": [ + "id", + ], + "required": [ + "id", + ], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "id": (str,), + }, + "attribute_map": { + "id": "id", + }, + "location_map": { + "id": "path", + }, + "collection_format_map": {}, + }, + headers_map={ + "accept": ["application/json"], + "content_type": [], + }, + api_client=api_client, + ) + self.get_detector_metrics_endpoint = _Endpoint( + settings={ + "response_type": (InlineResponse200,), + "auth": ["ApiToken"], + "endpoint_path": "/v1/detectors/{detector_id}/metrics", + "operation_id": "get_detector_metrics", + "http_method": "GET", + "servers": None, + }, + params_map={ + "all": [ + "detector_id", + ], + "required": [ + "detector_id", + ], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "detector_id": (str,), + }, + "attribute_map": { + "detector_id": "detector_id", + }, + "location_map": { + "detector_id": "path", + }, + "collection_format_map": {}, + }, + headers_map={ + "accept": ["application/json"], + "content_type": [], + }, + api_client=api_client, + ) self.list_detectors_endpoint = _Endpoint( settings={ "response_type": (PaginatedDetectorList,), @@ -413,6 +495,122 @@ def get_detector(self, id, **kwargs): kwargs["id"] = id return self.get_detector_endpoint.call_with_http_info(**kwargs) + def get_detector_evaluation(self, id, **kwargs): + """get_detector_evaluation # noqa: E501 + + Get Detector evaluation results. The result is null if there isn't enough ground truth data to evaluate the detector. Returns the time of the evaulation, total ground truth labels, the ml based kfold accuracies, and the system accuracies at different confidence thresholds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_detector_evaluation(id, async_req=True) + >>> result = thread.get() + + Args: + id (str): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): 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. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + InlineResponse2001 + If the method is called asynchronously, returns the request + thread. + """ + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) + kwargs["_content_type"] = kwargs.get("_content_type") + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["id"] = id + return self.get_detector_evaluation_endpoint.call_with_http_info(**kwargs) + + def get_detector_metrics(self, detector_id, **kwargs): + """get_detector_metrics # noqa: E501 + + Get Detector metrics, primarily the counts of different types of labels # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_detector_metrics(detector_id, async_req=True) + >>> result = thread.get() + + Args: + detector_id (str): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): 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. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + InlineResponse200 + If the method is called asynchronously, returns the request + thread. + """ + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) + kwargs["_content_type"] = kwargs.get("_content_type") + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["detector_id"] = detector_id + return self.get_detector_metrics_endpoint.call_with_http_info(**kwargs) + def list_detectors(self, **kwargs): """list_detectors # noqa: E501 diff --git a/generated/groundlight_openapi_client/api/user_api.py b/generated/groundlight_openapi_client/api/user_api.py index fa851468..a14200f2 100644 --- a/generated/groundlight_openapi_client/api/user_api.py +++ b/generated/groundlight_openapi_client/api/user_api.py @@ -21,7 +21,7 @@ none_type, validate_and_convert_types, ) -from groundlight_openapi_client.model.inline_response200 import InlineResponse200 +from groundlight_openapi_client.model.inline_response2002 import InlineResponse2002 class UserApi(object): @@ -37,7 +37,7 @@ def __init__(self, api_client=None): self.api_client = api_client self.who_am_i_endpoint = _Endpoint( settings={ - "response_type": (InlineResponse200,), + "response_type": (InlineResponse2002,), "auth": ["ApiToken"], "endpoint_path": "/v1/me", "operation_id": "who_am_i", @@ -100,7 +100,7 @@ def who_am_i(self, **kwargs): async_req (bool): execute request asynchronously Returns: - InlineResponse200 + InlineResponse2002 If the method is called asynchronously, returns the request thread. """ diff --git a/generated/groundlight_openapi_client/model/inline_response200.py b/generated/groundlight_openapi_client/model/inline_response200.py index 7e25ac59..62e2494f 100644 --- a/generated/groundlight_openapi_client/model/inline_response200.py +++ b/generated/groundlight_openapi_client/model/inline_response200.py @@ -29,6 +29,12 @@ from groundlight_openapi_client.exceptions import ApiAttributeError +def lazy_import(): + from groundlight_openapi_client.model.inline_response200_summary import InlineResponse200Summary + + globals()["InlineResponse200Summary"] = InlineResponse200Summary + + class InlineResponse200(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -63,6 +69,7 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ + lazy_import() return ( bool, date, @@ -87,8 +94,9 @@ def openapi_types(): openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { - "username": (str,), # noqa: E501 + "summary": (InlineResponse200Summary,), # noqa: E501 } @cached_property @@ -96,7 +104,7 @@ def discriminator(): return None attribute_map = { - "username": "username", # noqa: E501 + "summary": "summary", # noqa: E501 } read_only_vars = {} @@ -139,7 +147,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - username (str): The user's username. [optional] # noqa: E501 + summary (InlineResponse200Summary): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -224,7 +232,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - username (str): The user's username. [optional] # noqa: E501 + summary (InlineResponse200Summary): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) diff --git a/generated/groundlight_openapi_client/model/inline_response2001.py b/generated/groundlight_openapi_client/model/inline_response2001.py new file mode 100644 index 00000000..cdb30032 --- /dev/null +++ b/generated/groundlight_openapi_client/model/inline_response2001.py @@ -0,0 +1,278 @@ +""" + Groundlight API + + Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501 + + The version of the OpenAPI document: 0.18.2 + Contact: support@groundlight.ai + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from groundlight_openapi_client.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from groundlight_openapi_client.exceptions import ApiAttributeError + + +def lazy_import(): + from groundlight_openapi_client.model.inline_response2001_evaluation_results import ( + InlineResponse2001EvaluationResults, + ) + + globals()["InlineResponse2001EvaluationResults"] = InlineResponse2001EvaluationResults + + +class InlineResponse2001(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = {} + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + "evaluation_results": (InlineResponse2001EvaluationResults,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "evaluation_results": "evaluation_results", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """InlineResponse2001 - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + evaluation_results (InlineResponse2001EvaluationResults): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """InlineResponse2001 - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + evaluation_results (InlineResponse2001EvaluationResults): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + "class with read only attributes." + ) diff --git a/generated/groundlight_openapi_client/model/inline_response2001_evaluation_results.py b/generated/groundlight_openapi_client/model/inline_response2001_evaluation_results.py new file mode 100644 index 00000000..987a8fcc --- /dev/null +++ b/generated/groundlight_openapi_client/model/inline_response2001_evaluation_results.py @@ -0,0 +1,305 @@ +""" + Groundlight API + + Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501 + + The version of the OpenAPI document: 0.18.2 + Contact: support@groundlight.ai + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from groundlight_openapi_client.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from groundlight_openapi_client.exceptions import ApiAttributeError + + +class InlineResponse2001EvaluationResults(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = {} + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "eval_timestamp": (datetime,), # noqa: E501 + "total_ground_truth_examples": ( + int, + none_type, + ), # noqa: E501 + "kfold_pooled__balanced_accuracy": (float,), # noqa: E501 + "kfold_pooled__positive_accuracy": (float,), # noqa: E501 + "kfold_pooled__negative_accuracy": (float,), # noqa: E501 + "balanced_system_accuracies": ( + {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, + ), # noqa: E501 + "positive_system_accuracies": ( + {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, + ), # noqa: E501 + "negative_system_accuracies": ( + {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, + ), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "eval_timestamp": "eval_timestamp", # noqa: E501 + "total_ground_truth_examples": "total_ground_truth_examples", # noqa: E501 + "kfold_pooled__balanced_accuracy": "kfold_pooled__balanced_accuracy", # noqa: E501 + "kfold_pooled__positive_accuracy": "kfold_pooled__positive_accuracy", # noqa: E501 + "kfold_pooled__negative_accuracy": "kfold_pooled__negative_accuracy", # noqa: E501 + "balanced_system_accuracies": "balanced_system_accuracies", # noqa: E501 + "positive_system_accuracies": "positive_system_accuracies", # noqa: E501 + "negative_system_accuracies": "negative_system_accuracies", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """InlineResponse2001EvaluationResults - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + eval_timestamp (datetime): [optional] # noqa: E501 + total_ground_truth_examples (int, none_type): [optional] # noqa: E501 + kfold_pooled__balanced_accuracy (float): [optional] # noqa: E501 + kfold_pooled__positive_accuracy (float): [optional] # noqa: E501 + kfold_pooled__negative_accuracy (float): [optional] # noqa: E501 + balanced_system_accuracies ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + positive_system_accuracies ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + negative_system_accuracies ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """InlineResponse2001EvaluationResults - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + eval_timestamp (datetime): [optional] # noqa: E501 + total_ground_truth_examples (int, none_type): [optional] # noqa: E501 + kfold_pooled__balanced_accuracy (float): [optional] # noqa: E501 + kfold_pooled__positive_accuracy (float): [optional] # noqa: E501 + kfold_pooled__negative_accuracy (float): [optional] # noqa: E501 + balanced_system_accuracies ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + positive_system_accuracies ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + negative_system_accuracies ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + "class with read only attributes." + ) diff --git a/generated/groundlight_openapi_client/model/inline_response2002.py b/generated/groundlight_openapi_client/model/inline_response2002.py new file mode 100644 index 00000000..1fbfd51d --- /dev/null +++ b/generated/groundlight_openapi_client/model/inline_response2002.py @@ -0,0 +1,268 @@ +""" + Groundlight API + + Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501 + + The version of the OpenAPI document: 0.18.2 + Contact: support@groundlight.ai + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from groundlight_openapi_client.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from groundlight_openapi_client.exceptions import ApiAttributeError + + +class InlineResponse2002(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = {} + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "username": (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "username": "username", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """InlineResponse2002 - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + username (str): The user's username. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """InlineResponse2002 - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + username (str): The user's username. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + "class with read only attributes." + ) diff --git a/generated/groundlight_openapi_client/model/inline_response200_summary.py b/generated/groundlight_openapi_client/model/inline_response200_summary.py new file mode 100644 index 00000000..d5c30a12 --- /dev/null +++ b/generated/groundlight_openapi_client/model/inline_response200_summary.py @@ -0,0 +1,296 @@ +""" + Groundlight API + + Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501 + + The version of the OpenAPI document: 0.18.2 + Contact: support@groundlight.ai + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from groundlight_openapi_client.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from groundlight_openapi_client.exceptions import ApiAttributeError + + +def lazy_import(): + from groundlight_openapi_client.model.inline_response200_summary_class_counts import ( + InlineResponse200SummaryClassCounts, + ) + + globals()["InlineResponse200SummaryClassCounts"] = InlineResponse200SummaryClassCounts + + +class InlineResponse200Summary(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = {} + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + "num_ground_truth": (int,), # noqa: E501 + "num_current_source_human": (int,), # noqa: E501 + "class_counts": (InlineResponse200SummaryClassCounts,), # noqa: E501 + "unconfident_counts": ( + {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, + ), # noqa: E501 + "total_iqs": (int,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "num_ground_truth": "num_ground_truth", # noqa: E501 + "num_current_source_human": "num_current_source_human", # noqa: E501 + "class_counts": "class_counts", # noqa: E501 + "unconfident_counts": "unconfident_counts", # noqa: E501 + "total_iqs": "total_iqs", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """InlineResponse200Summary - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + num_ground_truth (int): [optional] # noqa: E501 + num_current_source_human (int): [optional] # noqa: E501 + class_counts (InlineResponse200SummaryClassCounts): [optional] # noqa: E501 + unconfident_counts ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + total_iqs (int): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """InlineResponse200Summary - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + num_ground_truth (int): [optional] # noqa: E501 + num_current_source_human (int): [optional] # noqa: E501 + class_counts (InlineResponse200SummaryClassCounts): [optional] # noqa: E501 + unconfident_counts ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + total_iqs (int): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + "class with read only attributes." + ) diff --git a/generated/groundlight_openapi_client/model/inline_response200_summary_class_counts.py b/generated/groundlight_openapi_client/model/inline_response200_summary_class_counts.py new file mode 100644 index 00000000..b2eb180b --- /dev/null +++ b/generated/groundlight_openapi_client/model/inline_response200_summary_class_counts.py @@ -0,0 +1,284 @@ +""" + Groundlight API + + Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501 + + The version of the OpenAPI document: 0.18.2 + Contact: support@groundlight.ai + Generated by: https://openapi-generator.tech +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from groundlight_openapi_client.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel, +) +from groundlight_openapi_client.exceptions import ApiAttributeError + + +class InlineResponse200SummaryClassCounts(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = {} + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "source_ml": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + "source_human": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + "cloud_labeler": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + "cloud": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + "total": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "source_ml": "source_ml", # noqa: E501 + "source_human": "source_human", # noqa: E501 + "cloud_labeler": "cloud_labeler", # noqa: E501 + "cloud": "cloud", # noqa: E501 + "total": "total", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """InlineResponse200SummaryClassCounts - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + source_ml ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + source_human ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + cloud_labeler ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + cloud ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + total ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """InlineResponse200SummaryClassCounts - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + source_ml ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + source_human ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + cloud_labeler ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + cloud ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + total ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + "class with read only attributes." + ) diff --git a/generated/groundlight_openapi_client/model/payload_template.py b/generated/groundlight_openapi_client/model/payload_template.py index dae73ae2..a721bb4c 100644 --- a/generated/groundlight_openapi_client/model/payload_template.py +++ b/generated/groundlight_openapi_client/model/payload_template.py @@ -90,14 +90,7 @@ def openapi_types(): return { "template": (str,), # noqa: E501 "headers": ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, + {str: (str,)}, none_type, ), # noqa: E501 } @@ -154,7 +147,7 @@ def _from_openapi_data(cls, template, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - headers (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 + headers ({str: (str,)}, none_type): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -243,7 +236,7 @@ def __init__(self, template, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - headers (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 + headers ({str: (str,)}, none_type): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) diff --git a/generated/groundlight_openapi_client/model/payload_template_request.py b/generated/groundlight_openapi_client/model/payload_template_request.py index 8ba75a3d..3a0f12a2 100644 --- a/generated/groundlight_openapi_client/model/payload_template_request.py +++ b/generated/groundlight_openapi_client/model/payload_template_request.py @@ -94,14 +94,7 @@ def openapi_types(): return { "template": (str,), # noqa: E501 "headers": ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, + {str: (str,)}, none_type, ), # noqa: E501 } @@ -158,7 +151,7 @@ def _from_openapi_data(cls, template, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - headers (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 + headers ({str: (str,)}, none_type): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -247,7 +240,7 @@ def __init__(self, template, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - headers (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 + headers ({str: (str,)}, none_type): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) diff --git a/generated/groundlight_openapi_client/models/__init__.py b/generated/groundlight_openapi_client/models/__init__.py index dc3f8705..6f7e77be 100644 --- a/generated/groundlight_openapi_client/models/__init__.py +++ b/generated/groundlight_openapi_client/models/__init__.py @@ -32,6 +32,11 @@ from groundlight_openapi_client.model.image_query import ImageQuery from groundlight_openapi_client.model.image_query_type_enum import ImageQueryTypeEnum from groundlight_openapi_client.model.inline_response200 import InlineResponse200 +from groundlight_openapi_client.model.inline_response2001 import InlineResponse2001 +from groundlight_openapi_client.model.inline_response2001_evaluation_results import InlineResponse2001EvaluationResults +from groundlight_openapi_client.model.inline_response2002 import InlineResponse2002 +from groundlight_openapi_client.model.inline_response200_summary import InlineResponse200Summary +from groundlight_openapi_client.model.inline_response200_summary_class_counts import InlineResponse200SummaryClassCounts from groundlight_openapi_client.model.label_value import LabelValue from groundlight_openapi_client.model.label_value_request import LabelValueRequest from groundlight_openapi_client.model.mode_enum import ModeEnum diff --git a/generated/model.py b/generated/model.py index 57b50633..c3279390 100644 --- a/generated/model.py +++ b/generated/model.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: public-api.yaml -# timestamp: 2025-02-25T17:44:24+00:00 +# timestamp: 2025-02-25T18:22:23+00:00 from __future__ import annotations @@ -111,12 +111,12 @@ class NoteRequest(BaseModel): class PayloadTemplate(BaseModel): template: str - headers: Optional[Any] = None + headers: Optional[Dict[str, str]] = None class PayloadTemplateRequest(BaseModel): template: constr(min_length=1) - headers: Optional[Any] = None + headers: Optional[Dict[str, constr(min_length=1)]] = None class ROI(BaseModel): diff --git a/generated/test/test_inline_response2001.py b/generated/test/test_inline_response2001.py new file mode 100644 index 00000000..04e1f999 --- /dev/null +++ b/generated/test/test_inline_response2001.py @@ -0,0 +1,38 @@ +""" + Groundlight API + + Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501 + + The version of the OpenAPI document: 0.18.2 + Contact: support@groundlight.ai + Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import groundlight_openapi_client +from groundlight_openapi_client.model.inline_response2001_evaluation_results import InlineResponse2001EvaluationResults + +globals()["InlineResponse2001EvaluationResults"] = InlineResponse2001EvaluationResults +from groundlight_openapi_client.model.inline_response2001 import InlineResponse2001 + + +class TestInlineResponse2001(unittest.TestCase): + """InlineResponse2001 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineResponse2001(self): + """Test InlineResponse2001""" + # FIXME: construct object with mandatory attributes with example values + # model = InlineResponse2001() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/generated/test/test_inline_response2001_evaluation_results.py b/generated/test/test_inline_response2001_evaluation_results.py new file mode 100644 index 00000000..75e6fffa --- /dev/null +++ b/generated/test/test_inline_response2001_evaluation_results.py @@ -0,0 +1,35 @@ +""" + Groundlight API + + Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501 + + The version of the OpenAPI document: 0.18.2 + Contact: support@groundlight.ai + Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import groundlight_openapi_client +from groundlight_openapi_client.model.inline_response2001_evaluation_results import InlineResponse2001EvaluationResults + + +class TestInlineResponse2001EvaluationResults(unittest.TestCase): + """InlineResponse2001EvaluationResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineResponse2001EvaluationResults(self): + """Test InlineResponse2001EvaluationResults""" + # FIXME: construct object with mandatory attributes with example values + # model = InlineResponse2001EvaluationResults() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/generated/test/test_inline_response2002.py b/generated/test/test_inline_response2002.py new file mode 100644 index 00000000..84922f0f --- /dev/null +++ b/generated/test/test_inline_response2002.py @@ -0,0 +1,35 @@ +""" + Groundlight API + + Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501 + + The version of the OpenAPI document: 0.18.2 + Contact: support@groundlight.ai + Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import groundlight_openapi_client +from groundlight_openapi_client.model.inline_response2002 import InlineResponse2002 + + +class TestInlineResponse2002(unittest.TestCase): + """InlineResponse2002 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineResponse2002(self): + """Test InlineResponse2002""" + # FIXME: construct object with mandatory attributes with example values + # model = InlineResponse2002() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/generated/test/test_inline_response200_summary.py b/generated/test/test_inline_response200_summary.py new file mode 100644 index 00000000..add3206c --- /dev/null +++ b/generated/test/test_inline_response200_summary.py @@ -0,0 +1,38 @@ +""" + Groundlight API + + Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501 + + The version of the OpenAPI document: 0.18.2 + Contact: support@groundlight.ai + Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import groundlight_openapi_client +from groundlight_openapi_client.model.inline_response200_summary_class_counts import InlineResponse200SummaryClassCounts + +globals()["InlineResponse200SummaryClassCounts"] = InlineResponse200SummaryClassCounts +from groundlight_openapi_client.model.inline_response200_summary import InlineResponse200Summary + + +class TestInlineResponse200Summary(unittest.TestCase): + """InlineResponse200Summary unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineResponse200Summary(self): + """Test InlineResponse200Summary""" + # FIXME: construct object with mandatory attributes with example values + # model = InlineResponse200Summary() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/generated/test/test_inline_response200_summary_class_counts.py b/generated/test/test_inline_response200_summary_class_counts.py new file mode 100644 index 00000000..c5bf4ec4 --- /dev/null +++ b/generated/test/test_inline_response200_summary_class_counts.py @@ -0,0 +1,35 @@ +""" + Groundlight API + + Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501 + + The version of the OpenAPI document: 0.18.2 + Contact: support@groundlight.ai + Generated by: https://openapi-generator.tech +""" + +import sys +import unittest + +import groundlight_openapi_client +from groundlight_openapi_client.model.inline_response200_summary_class_counts import InlineResponse200SummaryClassCounts + + +class TestInlineResponse200SummaryClassCounts(unittest.TestCase): + """InlineResponse200SummaryClassCounts unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineResponse200SummaryClassCounts(self): + """Test InlineResponse200SummaryClassCounts""" + # FIXME: construct object with mandatory attributes with example values + # model = InlineResponse200SummaryClassCounts() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/spec/public-api.yaml b/spec/public-api.yaml index ce323311..e2112f72 100644 --- a/spec/public-api.yaml +++ b/spec/public-api.yaml @@ -250,6 +250,54 @@ paths: schema: $ref: '#/components/schemas/Detector' description: '' + /v1/detectors/{detector_id}/metrics: + get: + operationId: get detector metrics + description: Get Detector metrics, primarily the counts of different types of + labels + parameters: + - in: path + name: detector_id + schema: + type: string + required: true + tags: + - detectors + security: + - ApiToken: [] + responses: + '200': + content: + application/json: + schema: + type: object + properties: + summary: + type: object + properties: + num_ground_truth: + type: integer + num_current_source_human: + type: integer + class_counts: + type: object + properties: + source_ml: + type: object + source_human: + type: object + cloud_labeler: + type: object + cloud: + type: object + total: + type: object + unconfident_counts: + type: object + total_iqs: + type: integer + nullable: true + description: '' /v1/detectors/{id}: get: operationId: Get detector @@ -320,6 +368,59 @@ paths: responses: '204': description: No response body + /v1/detectors/{id}/evaluation: + get: + operationId: get detector evaluation + description: Get Detector evaluation results. The result is null if there isn't + enough ground truth data to evaluate the detector. Returns the time of the + evaulation, total ground truth labels, the ml based kfold accuracies, and + the system accuracies at different confidence thresholds + parameters: + - in: path + name: id + schema: + type: string + required: true + tags: + - detectors + security: + - ApiToken: [] + responses: + '200': + content: + application/json: + schema: + type: object + properties: + evaluation_results: + type: object + properties: + eval_timestamp: + type: string + format: date-time + total_ground_truth_examples: + type: integer + nullable: true + kfold_pooled__balanced_accuracy: + type: number + format: float + kfold_pooled__positive_accuracy: + type: number + format: float + kfold_pooled__negative_accuracy: + type: number + format: float + balanced_system_accuracies: + type: object + additionalProperties: true + positive_system_accuracies: + type: object + additionalProperties: true + negative_system_accuracies: + type: object + additionalProperties: true + nullable: true + description: '' /v1/edge/fetch-model-urls/{detector_id}/: get: operationId: Get Model URLs @@ -1243,6 +1344,9 @@ components: template: type: string headers: + type: object + additionalProperties: + type: string nullable: true required: - template @@ -1253,6 +1357,10 @@ components: type: string minLength: 1 headers: + type: object + additionalProperties: + type: string + minLength: 1 nullable: true required: - template