diff --git a/generated/.openapi-generator/FILES b/generated/.openapi-generator/FILES index 27ddbd5d..c6bdc7b8 100644 --- a/generated/.openapi-generator/FILES +++ b/generated/.openapi-generator/FILES @@ -9,6 +9,8 @@ docs/BBoxGeometry.md docs/BBoxGeometryRequest.md docs/BinaryClassificationResult.md docs/BlankEnum.md +docs/BoundingBoxModeConfiguration.md +docs/BoundingBoxResult.md docs/ChannelEnum.md docs/Condition.md docs/ConditionRequest.md @@ -88,6 +90,8 @@ groundlight_openapi_client/model/b_box_geometry.py groundlight_openapi_client/model/b_box_geometry_request.py groundlight_openapi_client/model/binary_classification_result.py groundlight_openapi_client/model/blank_enum.py +groundlight_openapi_client/model/bounding_box_mode_configuration.py +groundlight_openapi_client/model/bounding_box_result.py groundlight_openapi_client/model/channel_enum.py groundlight_openapi_client/model/condition.py groundlight_openapi_client/model/condition_request.py diff --git a/generated/README.md b/generated/README.md index 373577ba..4a84c1f2 100644 --- a/generated/README.md +++ b/generated/README.md @@ -95,6 +95,9 @@ rule_request = RuleRequest( url="url_example", include_image=True, payload_template=None, + last_message_failed=True, + last_failure_error="last_failure_error_example", + last_failed_at=dateutil_parser('1970-01-01T00:00:00.00Z'), ), ], ) # RuleRequest | @@ -127,6 +130,7 @@ Class | Method | HTTP request | Description *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* | [**edge_report_metrics_create**](docs/EdgeApi.md#edge_report_metrics_create) | **POST** /v1/edge/report-metrics | *EdgeApi* | [**get_model_urls**](docs/EdgeApi.md#get_model_urls) | **GET** /v1/edge/fetch-model-urls/{detector_id}/ | *ImageQueriesApi* | [**get_image**](docs/ImageQueriesApi.md#get_image) | **GET** /v1/image-queries/{id}/image | *ImageQueriesApi* | [**get_image_query**](docs/ImageQueriesApi.md#get_image_query) | **GET** /v1/image-queries/{id} | @@ -148,6 +152,8 @@ Class | Method | HTTP request | Description - [BBoxGeometryRequest](docs/BBoxGeometryRequest.md) - [BinaryClassificationResult](docs/BinaryClassificationResult.md) - [BlankEnum](docs/BlankEnum.md) + - [BoundingBoxModeConfiguration](docs/BoundingBoxModeConfiguration.md) + - [BoundingBoxResult](docs/BoundingBoxResult.md) - [ChannelEnum](docs/ChannelEnum.md) - [Condition](docs/Condition.md) - [ConditionRequest](docs/ConditionRequest.md) diff --git a/generated/docs/ActionsApi.md b/generated/docs/ActionsApi.md index 9bf52c09..ae3b580b 100644 --- a/generated/docs/ActionsApi.md +++ b/generated/docs/ActionsApi.md @@ -70,6 +70,9 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client: url="url_example", include_image=True, payload_template=None, + last_message_failed=True, + last_failure_error="last_failure_error_example", + last_failed_at=dateutil_parser('1970-01-01T00:00:00.00Z'), ), ], ) # RuleRequest | diff --git a/generated/docs/BinaryClassificationResult.md b/generated/docs/BinaryClassificationResult.md index 4a9fb8fb..a98a3b70 100644 --- a/generated/docs/BinaryClassificationResult.md +++ b/generated/docs/BinaryClassificationResult.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **confidence** | **float, none_type** | | [optional] **source** | **str** | | [optional] **result_type** | **str** | | [optional] if omitted the server will use the default value of "binary_classification" +**from_edge** | **bool** | | [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/BoundingBoxModeConfiguration.md b/generated/docs/BoundingBoxModeConfiguration.md new file mode 100644 index 00000000..5a27bed3 --- /dev/null +++ b/generated/docs/BoundingBoxModeConfiguration.md @@ -0,0 +1,13 @@ +# BoundingBoxModeConfiguration + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | +**max_num_bboxes** | **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/BoundingBoxResult.md b/generated/docs/BoundingBoxResult.md new file mode 100644 index 00000000..7a089d95 --- /dev/null +++ b/generated/docs/BoundingBoxResult.md @@ -0,0 +1,16 @@ +# BoundingBoxResult + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **str** | | +**confidence** | **float, none_type** | | [optional] +**source** | **str** | | [optional] +**result_type** | **str** | | [optional] if omitted the server will use the default value of "bounding_box" +**from_edge** | **bool** | | [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/CountingResult.md b/generated/docs/CountingResult.md index a79620db..f9db3d5d 100644 --- a/generated/docs/CountingResult.md +++ b/generated/docs/CountingResult.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **confidence** | **float, none_type** | | [optional] **source** | **str** | | [optional] **result_type** | **str** | | [optional] if omitted the server will use the default value of "counting" +**from_edge** | **bool** | | [optional] **greater_than_max** | **bool** | | [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] diff --git a/generated/docs/DetectorCreationInputRequest.md b/generated/docs/DetectorCreationInputRequest.md index fe683f5d..16adba94 100644 --- a/generated/docs/DetectorCreationInputRequest.md +++ b/generated/docs/DetectorCreationInputRequest.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **patience_time** | **float** | How long Groundlight will attempt to generate a confident prediction | [optional] if omitted the server will use the default value of 30.0 **pipeline_config** | **str, none_type** | (Advanced usage) Configuration needed to instantiate a prediction pipeline. | [optional] **metadata** | **str** | Base64-encoded metadata for the detector. This should be a JSON object with string keys. The size after encoding should not exceed 1362 bytes, corresponding to 1KiB before encoding. | [optional] -**mode** | **bool, date, datetime, dict, float, int, list, str, none_type** | Mode in which this detector will work. * `BINARY` - BINARY * `COUNT` - COUNT * `MULTI_CLASS` - MULTI_CLASS * `TEXT` - TEXT | [optional] +**mode** | **bool, date, datetime, dict, float, int, list, str, none_type** | Mode in which this detector will work. * `BINARY` - BINARY * `COUNT` - COUNT * `MULTI_CLASS` - MULTI_CLASS * `TEXT` - TEXT * `BOUNDING_BOX` - BOUNDING_BOX | [optional] **mode_configuration** | **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] diff --git a/generated/docs/EdgeApi.md b/generated/docs/EdgeApi.md index a702b352..04976261 100644 --- a/generated/docs/EdgeApi.md +++ b/generated/docs/EdgeApi.md @@ -4,9 +4,81 @@ All URIs are relative to *https://api.groundlight.ai/device-api* Method | HTTP request | Description ------------- | ------------- | ------------- +[**edge_report_metrics_create**](EdgeApi.md#edge_report_metrics_create) | **POST** /v1/edge/report-metrics | [**get_model_urls**](EdgeApi.md#get_model_urls) | **GET** /v1/edge/fetch-model-urls/{detector_id}/ | +# **edge_report_metrics_create** +> edge_report_metrics_create() + + + +Edge server periodically calls this to report metrics. POST body will have JSON data that we log. + +### Example + +* Api Key Authentication (ApiToken): + +```python +import time +import groundlight_openapi_client +from groundlight_openapi_client.api import edge_api +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 = edge_api.EdgeApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_instance.edge_report_metrics_create() + except groundlight_openapi_client.ApiException as e: + print("Exception when calling EdgeApi->edge_report_metrics_create: %s\n" % e) +``` + + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +[ApiToken](../README.md#ApiToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | No response body | - | + +[[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_model_urls** > EdgeModelInfo get_model_urls(detector_id) diff --git a/generated/docs/ModeEnum.md b/generated/docs/ModeEnum.md index c14a5aca..720ccf3e 100644 --- a/generated/docs/ModeEnum.md +++ b/generated/docs/ModeEnum.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | | must be one of ["BINARY", "COUNT", "MULTI_CLASS", "TEXT", ] +**value** | **str** | | must be one of ["BINARY", "COUNT", "MULTI_CLASS", "TEXT", "BOUNDING_BOX", ] [[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/MultiClassificationResult.md b/generated/docs/MultiClassificationResult.md index 8b928073..d048a5da 100644 --- a/generated/docs/MultiClassificationResult.md +++ b/generated/docs/MultiClassificationResult.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **confidence** | **float, none_type** | | [optional] **source** | **str** | | [optional] **result_type** | **str** | | [optional] if omitted the server will use the default value of "multi_classification" +**from_edge** | **bool** | | [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/ResultTypeEnum.md b/generated/docs/ResultTypeEnum.md index 0f03cf6c..0146b794 100644 --- a/generated/docs/ResultTypeEnum.md +++ b/generated/docs/ResultTypeEnum.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | | must be one of ["binary_classification", "counting", "multi_classification", "text_recognition", ] +**value** | **str** | | must be one of ["binary_classification", "counting", "multi_classification", "text_recognition", "bounding_box", ] [[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/TextRecognitionResult.md b/generated/docs/TextRecognitionResult.md index 0d5aeedb..f518a26b 100644 --- a/generated/docs/TextRecognitionResult.md +++ b/generated/docs/TextRecognitionResult.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **confidence** | **float, none_type** | | [optional] **source** | **str** | | [optional] **result_type** | **str** | | [optional] if omitted the server will use the default value of "text_recognition" +**from_edge** | **bool** | | [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/WebhookAction.md b/generated/docs/WebhookAction.md index a1f6cf2b..3635866d 100644 --- a/generated/docs/WebhookAction.md +++ b/generated/docs/WebhookAction.md @@ -7,6 +7,9 @@ Name | Type | Description | Notes **url** | **str** | | **include_image** | **bool** | | [optional] **payload_template** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] +**last_message_failed** | **bool** | | [optional] +**last_failure_error** | **str, none_type** | | [optional] +**last_failed_at** | **datetime, 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/WebhookActionRequest.md b/generated/docs/WebhookActionRequest.md index e3b1c59e..0910602a 100644 --- a/generated/docs/WebhookActionRequest.md +++ b/generated/docs/WebhookActionRequest.md @@ -7,6 +7,9 @@ Name | Type | Description | Notes **url** | **str** | | **include_image** | **bool** | | [optional] **payload_template** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] +**last_message_failed** | **bool** | | [optional] +**last_failure_error** | **str, none_type** | | [optional] +**last_failed_at** | **datetime, 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/groundlight_openapi_client/api/edge_api.py b/generated/groundlight_openapi_client/api/edge_api.py index 7d6e4c85..a0b3187d 100644 --- a/generated/groundlight_openapi_client/api/edge_api.py +++ b/generated/groundlight_openapi_client/api/edge_api.py @@ -35,6 +35,30 @@ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client + self.edge_report_metrics_create_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["ApiToken"], + "endpoint_path": "/v1/edge/report-metrics", + "operation_id": "edge_report_metrics_create", + "http_method": "POST", + "servers": None, + }, + params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []}, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": {}, + "attribute_map": {}, + "location_map": {}, + "collection_format_map": {}, + }, + headers_map={ + "accept": [], + "content_type": [], + }, + api_client=api_client, + ) self.get_model_urls_endpoint = _Endpoint( settings={ "response_type": (EdgeModelInfo,), @@ -76,6 +100,61 @@ def __init__(self, api_client=None): api_client=api_client, ) + def edge_report_metrics_create(self, **kwargs): + """edge_report_metrics_create # noqa: E501 + + Edge server periodically calls this to report metrics. POST body will have JSON data that we log. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.edge_report_metrics_create(async_req=True) + >>> result = thread.get() + + + 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: + None + 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") + return self.edge_report_metrics_create_endpoint.call_with_http_info(**kwargs) + def get_model_urls(self, detector_id, **kwargs): """get_model_urls # noqa: E501 diff --git a/generated/groundlight_openapi_client/model/binary_classification_result.py b/generated/groundlight_openapi_client/model/binary_classification_result.py index 53c63b1b..25ef477e 100644 --- a/generated/groundlight_openapi_client/model/binary_classification_result.py +++ b/generated/groundlight_openapi_client/model/binary_classification_result.py @@ -117,6 +117,7 @@ def openapi_types(): ), # noqa: E501 "source": (str,), # noqa: E501 "result_type": (str,), # noqa: E501 + "from_edge": (bool,), # noqa: E501 } @cached_property @@ -128,6 +129,7 @@ def discriminator(): "confidence": "confidence", # noqa: E501 "source": "source", # noqa: E501 "result_type": "result_type", # noqa: E501 + "from_edge": "from_edge", # noqa: E501 } read_only_vars = {} @@ -176,6 +178,7 @@ def _from_openapi_data(cls, label, *args, **kwargs): # noqa: E501 confidence (float, none_type): [optional] # noqa: E501 source (str): [optional] # noqa: E501 result_type (str): [optional] if omitted the server will use the default value of "binary_classification" # noqa: E501 + from_edge (bool): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -267,6 +270,7 @@ def __init__(self, label, *args, **kwargs): # noqa: E501 confidence (float, none_type): [optional] # noqa: E501 source (str): [optional] # noqa: E501 result_type (str): [optional] if omitted the server will use the default value of "binary_classification" # noqa: E501 + from_edge (bool): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) diff --git a/generated/groundlight_openapi_client/model/bounding_box_mode_configuration.py b/generated/groundlight_openapi_client/model/bounding_box_mode_configuration.py new file mode 100644 index 00000000..bcf98f27 --- /dev/null +++ b/generated/groundlight_openapi_client/model/bounding_box_mode_configuration.py @@ -0,0 +1,283 @@ +""" + 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 BoundingBoxModeConfiguration(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 = { + ("max_num_bboxes",): { + "inclusive_maximum": 50, + "inclusive_minimum": 1, + }, + } + + @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 { + "class_name": (str,), # noqa: E501 + "max_num_bboxes": (int,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "class_name": "class_name", # noqa: E501 + "max_num_bboxes": "max_num_bboxes", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, class_name, *args, **kwargs): # noqa: E501 + """BoundingBoxModeConfiguration - a model defined in OpenAPI + + Args: + class_name (str): + + 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,) + max_num_bboxes (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__,) + + self.class_name = class_name + 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, class_name, *args, **kwargs): # noqa: E501 + """BoundingBoxModeConfiguration - a model defined in OpenAPI + + Args: + class_name (str): + + 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,) + max_num_bboxes (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__,) + + self.class_name = class_name + 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/bounding_box_result.py b/generated/groundlight_openapi_client/model/bounding_box_result.py new file mode 100644 index 00000000..3c18763d --- /dev/null +++ b/generated/groundlight_openapi_client/model/bounding_box_result.py @@ -0,0 +1,315 @@ +""" + 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 BoundingBoxResult(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 = { + ("label",): { + "BOUNDING_BOX": "BOUNDING_BOX", + "GREATER_THAN_MAX": "GREATER_THAN_MAX", + "UNCLEAR": "UNCLEAR", + }, + ("source",): { + "STILL_PROCESSING": "STILL_PROCESSING", + "CLOUD": "CLOUD", + "USER": "USER", + "CLOUD_ENSEMBLE": "CLOUD_ENSEMBLE", + "ALGORITHM": "ALGORITHM", + "EDGE": "EDGE", + }, + ("result_type",): { + "BOUNDING_BOX": "bounding_box", + }, + } + + validations = { + ("confidence",): { + "inclusive_maximum": 1.0, + "inclusive_minimum": 0.0, + }, + } + + @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 { + "label": (str,), # noqa: E501 + "confidence": ( + float, + none_type, + ), # noqa: E501 + "source": (str,), # noqa: E501 + "result_type": (str,), # noqa: E501 + "from_edge": (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "label": "label", # noqa: E501 + "confidence": "confidence", # noqa: E501 + "source": "source", # noqa: E501 + "result_type": "result_type", # noqa: E501 + "from_edge": "from_edge", # noqa: E501 + } + + read_only_vars = {} + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, label, *args, **kwargs): # noqa: E501 + """BoundingBoxResult - a model defined in OpenAPI + + Args: + label (str): + + 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,) + confidence (float, none_type): [optional] # noqa: E501 + source (str): [optional] # noqa: E501 + result_type (str): [optional] if omitted the server will use the default value of "bounding_box" # noqa: E501 + from_edge (bool): [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__,) + + self.label = label + 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, label, *args, **kwargs): # noqa: E501 + """BoundingBoxResult - a model defined in OpenAPI + + Args: + label (str): + + 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,) + confidence (float, none_type): [optional] # noqa: E501 + source (str): [optional] # noqa: E501 + result_type (str): [optional] if omitted the server will use the default value of "bounding_box" # noqa: E501 + from_edge (bool): [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__,) + + self.label = label + 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/counting_result.py b/generated/groundlight_openapi_client/model/counting_result.py index 00dfc34a..9d7ff477 100644 --- a/generated/groundlight_openapi_client/model/counting_result.py +++ b/generated/groundlight_openapi_client/model/counting_result.py @@ -118,6 +118,7 @@ def openapi_types(): ), # noqa: E501 "source": (str,), # noqa: E501 "result_type": (str,), # noqa: E501 + "from_edge": (bool,), # noqa: E501 "greater_than_max": (bool,), # noqa: E501 } @@ -130,6 +131,7 @@ def discriminator(): "confidence": "confidence", # noqa: E501 "source": "source", # noqa: E501 "result_type": "result_type", # noqa: E501 + "from_edge": "from_edge", # noqa: E501 "greater_than_max": "greater_than_max", # noqa: E501 } @@ -179,6 +181,7 @@ def _from_openapi_data(cls, count, *args, **kwargs): # noqa: E501 confidence (float, none_type): [optional] # noqa: E501 source (str): [optional] # noqa: E501 result_type (str): [optional] if omitted the server will use the default value of "counting" # noqa: E501 + from_edge (bool): [optional] # noqa: E501 greater_than_max (bool): [optional] # noqa: E501 """ @@ -271,6 +274,7 @@ def __init__(self, count, *args, **kwargs): # noqa: E501 confidence (float, none_type): [optional] # noqa: E501 source (str): [optional] # noqa: E501 result_type (str): [optional] if omitted the server will use the default value of "counting" # noqa: E501 + from_edge (bool): [optional] # noqa: E501 greater_than_max (bool): [optional] # noqa: E501 """ diff --git a/generated/groundlight_openapi_client/model/detector_creation_input_request.py b/generated/groundlight_openapi_client/model/detector_creation_input_request.py index ee4d485a..ca1b1563 100644 --- a/generated/groundlight_openapi_client/model/detector_creation_input_request.py +++ b/generated/groundlight_openapi_client/model/detector_creation_input_request.py @@ -30,11 +30,13 @@ def lazy_import(): + from groundlight_openapi_client.model.bounding_box_mode_configuration import BoundingBoxModeConfiguration from groundlight_openapi_client.model.count_mode_configuration import CountModeConfiguration from groundlight_openapi_client.model.mode_enum import ModeEnum from groundlight_openapi_client.model.multi_class_mode_configuration import MultiClassModeConfiguration from groundlight_openapi_client.model.text_mode_configuration import TextModeConfiguration + globals()["BoundingBoxModeConfiguration"] = BoundingBoxModeConfiguration globals()["CountModeConfiguration"] = CountModeConfiguration globals()["ModeEnum"] = ModeEnum globals()["MultiClassModeConfiguration"] = MultiClassModeConfiguration @@ -229,7 +231,7 @@ def _from_openapi_data(cls, name, query, *args, **kwargs): # noqa: E501 patience_time (float): How long Groundlight will attempt to generate a confident prediction. [optional] if omitted the server will use the default value of 30.0 # noqa: E501 pipeline_config (str, none_type): (Advanced usage) Configuration needed to instantiate a prediction pipeline.. [optional] # noqa: E501 metadata (str): Base64-encoded metadata for the detector. This should be a JSON object with string keys. The size after encoding should not exceed 1362 bytes, corresponding to 1KiB before encoding.. [optional] # noqa: E501 - mode (bool, date, datetime, dict, float, int, list, str, none_type): Mode in which this detector will work. * `BINARY` - BINARY * `COUNT` - COUNT * `MULTI_CLASS` - MULTI_CLASS * `TEXT` - TEXT. [optional] # noqa: E501 + mode (bool, date, datetime, dict, float, int, list, str, none_type): Mode in which this detector will work. * `BINARY` - BINARY * `COUNT` - COUNT * `MULTI_CLASS` - MULTI_CLASS * `TEXT` - TEXT * `BOUNDING_BOX` - BOUNDING_BOX. [optional] # noqa: E501 mode_configuration (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 """ @@ -326,7 +328,7 @@ def __init__(self, name, query, *args, **kwargs): # noqa: E501 patience_time (float): How long Groundlight will attempt to generate a confident prediction. [optional] if omitted the server will use the default value of 30.0 # noqa: E501 pipeline_config (str, none_type): (Advanced usage) Configuration needed to instantiate a prediction pipeline.. [optional] # noqa: E501 metadata (str): Base64-encoded metadata for the detector. This should be a JSON object with string keys. The size after encoding should not exceed 1362 bytes, corresponding to 1KiB before encoding.. [optional] # noqa: E501 - mode (bool, date, datetime, dict, float, int, list, str, none_type): Mode in which this detector will work. * `BINARY` - BINARY * `COUNT` - COUNT * `MULTI_CLASS` - MULTI_CLASS * `TEXT` - TEXT. [optional] # noqa: E501 + mode (bool, date, datetime, dict, float, int, list, str, none_type): Mode in which this detector will work. * `BINARY` - BINARY * `COUNT` - COUNT * `MULTI_CLASS` - MULTI_CLASS * `TEXT` - TEXT * `BOUNDING_BOX` - BOUNDING_BOX. [optional] # noqa: E501 mode_configuration (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 """ diff --git a/generated/groundlight_openapi_client/model/image_query.py b/generated/groundlight_openapi_client/model/image_query.py index 3cb597b7..79cf0179 100644 --- a/generated/groundlight_openapi_client/model/image_query.py +++ b/generated/groundlight_openapi_client/model/image_query.py @@ -31,6 +31,7 @@ def lazy_import(): from groundlight_openapi_client.model.binary_classification_result import BinaryClassificationResult + from groundlight_openapi_client.model.bounding_box_result import BoundingBoxResult from groundlight_openapi_client.model.counting_result import CountingResult from groundlight_openapi_client.model.image_query_type_enum import ImageQueryTypeEnum from groundlight_openapi_client.model.multi_classification_result import MultiClassificationResult @@ -39,6 +40,7 @@ def lazy_import(): from groundlight_openapi_client.model.text_recognition_result import TextRecognitionResult globals()["BinaryClassificationResult"] = BinaryClassificationResult + globals()["BoundingBoxResult"] = BoundingBoxResult globals()["CountingResult"] = CountingResult globals()["ImageQueryTypeEnum"] = ImageQueryTypeEnum globals()["MultiClassificationResult"] = MultiClassificationResult diff --git a/generated/groundlight_openapi_client/model/mode_enum.py b/generated/groundlight_openapi_client/model/mode_enum.py index a947ba8c..b35a3833 100644 --- a/generated/groundlight_openapi_client/model/mode_enum.py +++ b/generated/groundlight_openapi_client/model/mode_enum.py @@ -55,6 +55,7 @@ class ModeEnum(ModelSimple): "COUNT": "COUNT", "MULTI_CLASS": "MULTI_CLASS", "TEXT": "TEXT", + "BOUNDING_BOX": "BOUNDING_BOX", }, } @@ -104,10 +105,10 @@ def __init__(self, *args, **kwargs): Note that value can be passed either in args or in kwargs, but not in both. Args: - args[0] (str):, must be one of ["BINARY", "COUNT", "MULTI_CLASS", "TEXT", ] # noqa: E501 + args[0] (str):, must be one of ["BINARY", "COUNT", "MULTI_CLASS", "TEXT", "BOUNDING_BOX", ] # noqa: E501 Keyword Args: - value (str):, must be one of ["BINARY", "COUNT", "MULTI_CLASS", "TEXT", ] # noqa: E501 + value (str):, must be one of ["BINARY", "COUNT", "MULTI_CLASS", "TEXT", "BOUNDING_BOX", ] # noqa: E501 _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. @@ -196,10 +197,10 @@ def _from_openapi_data(cls, *args, **kwargs): Note that value can be passed either in args or in kwargs, but not in both. Args: - args[0] (str):, must be one of ["BINARY", "COUNT", "MULTI_CLASS", "TEXT", ] # noqa: E501 + args[0] (str):, must be one of ["BINARY", "COUNT", "MULTI_CLASS", "TEXT", "BOUNDING_BOX", ] # noqa: E501 Keyword Args: - value (str):, must be one of ["BINARY", "COUNT", "MULTI_CLASS", "TEXT", ] # noqa: E501 + value (str):, must be one of ["BINARY", "COUNT", "MULTI_CLASS", "TEXT", "BOUNDING_BOX", ] # noqa: E501 _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. diff --git a/generated/groundlight_openapi_client/model/multi_classification_result.py b/generated/groundlight_openapi_client/model/multi_classification_result.py index 97c66110..ddd68bd7 100644 --- a/generated/groundlight_openapi_client/model/multi_classification_result.py +++ b/generated/groundlight_openapi_client/model/multi_classification_result.py @@ -112,6 +112,7 @@ def openapi_types(): ), # noqa: E501 "source": (str,), # noqa: E501 "result_type": (str,), # noqa: E501 + "from_edge": (bool,), # noqa: E501 } @cached_property @@ -123,6 +124,7 @@ def discriminator(): "confidence": "confidence", # noqa: E501 "source": "source", # noqa: E501 "result_type": "result_type", # noqa: E501 + "from_edge": "from_edge", # noqa: E501 } read_only_vars = {} @@ -171,6 +173,7 @@ def _from_openapi_data(cls, label, *args, **kwargs): # noqa: E501 confidence (float, none_type): [optional] # noqa: E501 source (str): [optional] # noqa: E501 result_type (str): [optional] if omitted the server will use the default value of "multi_classification" # noqa: E501 + from_edge (bool): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -262,6 +265,7 @@ def __init__(self, label, *args, **kwargs): # noqa: E501 confidence (float, none_type): [optional] # noqa: E501 source (str): [optional] # noqa: E501 result_type (str): [optional] if omitted the server will use the default value of "multi_classification" # noqa: E501 + from_edge (bool): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) diff --git a/generated/groundlight_openapi_client/model/result_type_enum.py b/generated/groundlight_openapi_client/model/result_type_enum.py index 4fff6840..c4b954fd 100644 --- a/generated/groundlight_openapi_client/model/result_type_enum.py +++ b/generated/groundlight_openapi_client/model/result_type_enum.py @@ -55,6 +55,7 @@ class ResultTypeEnum(ModelSimple): "COUNTING": "counting", "MULTI_CLASSIFICATION": "multi_classification", "TEXT_RECOGNITION": "text_recognition", + "BOUNDING_BOX": "bounding_box", }, } @@ -104,10 +105,10 @@ def __init__(self, *args, **kwargs): Note that value can be passed either in args or in kwargs, but not in both. Args: - args[0] (str):, must be one of ["binary_classification", "counting", "multi_classification", "text_recognition", ] # noqa: E501 + args[0] (str):, must be one of ["binary_classification", "counting", "multi_classification", "text_recognition", "bounding_box", ] # noqa: E501 Keyword Args: - value (str):, must be one of ["binary_classification", "counting", "multi_classification", "text_recognition", ] # noqa: E501 + value (str):, must be one of ["binary_classification", "counting", "multi_classification", "text_recognition", "bounding_box", ] # noqa: E501 _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. @@ -196,10 +197,10 @@ def _from_openapi_data(cls, *args, **kwargs): Note that value can be passed either in args or in kwargs, but not in both. Args: - args[0] (str):, must be one of ["binary_classification", "counting", "multi_classification", "text_recognition", ] # noqa: E501 + args[0] (str):, must be one of ["binary_classification", "counting", "multi_classification", "text_recognition", "bounding_box", ] # noqa: E501 Keyword Args: - value (str):, must be one of ["binary_classification", "counting", "multi_classification", "text_recognition", ] # noqa: E501 + value (str):, must be one of ["binary_classification", "counting", "multi_classification", "text_recognition", "bounding_box", ] # noqa: E501 _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. diff --git a/generated/groundlight_openapi_client/model/text_recognition_result.py b/generated/groundlight_openapi_client/model/text_recognition_result.py index 9b12e960..25add8f1 100644 --- a/generated/groundlight_openapi_client/model/text_recognition_result.py +++ b/generated/groundlight_openapi_client/model/text_recognition_result.py @@ -116,6 +116,7 @@ def openapi_types(): ), # noqa: E501 "source": (str,), # noqa: E501 "result_type": (str,), # noqa: E501 + "from_edge": (bool,), # noqa: E501 } @cached_property @@ -128,6 +129,7 @@ def discriminator(): "confidence": "confidence", # noqa: E501 "source": "source", # noqa: E501 "result_type": "result_type", # noqa: E501 + "from_edge": "from_edge", # noqa: E501 } read_only_vars = {} @@ -177,6 +179,7 @@ def _from_openapi_data(cls, text, truncated, *args, **kwargs): # noqa: E501 confidence (float, none_type): [optional] # noqa: E501 source (str): [optional] # noqa: E501 result_type (str): [optional] if omitted the server will use the default value of "text_recognition" # noqa: E501 + from_edge (bool): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -270,6 +273,7 @@ def __init__(self, text, truncated, *args, **kwargs): # noqa: E501 confidence (float, none_type): [optional] # noqa: E501 source (str): [optional] # noqa: E501 result_type (str): [optional] if omitted the server will use the default value of "text_recognition" # noqa: E501 + from_edge (bool): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) diff --git a/generated/groundlight_openapi_client/model/webhook_action.py b/generated/groundlight_openapi_client/model/webhook_action.py index d272aad8..33f70f3c 100644 --- a/generated/groundlight_openapi_client/model/webhook_action.py +++ b/generated/groundlight_openapi_client/model/webhook_action.py @@ -113,6 +113,15 @@ def openapi_types(): str, none_type, ), # noqa: E501 + "last_message_failed": (bool,), # noqa: E501 + "last_failure_error": ( + str, + none_type, + ), # noqa: E501 + "last_failed_at": ( + datetime, + none_type, + ), # noqa: E501 } @cached_property @@ -123,6 +132,9 @@ def discriminator(): "url": "url", # noqa: E501 "include_image": "include_image", # noqa: E501 "payload_template": "payload_template", # noqa: E501 + "last_message_failed": "last_message_failed", # noqa: E501 + "last_failure_error": "last_failure_error", # noqa: E501 + "last_failed_at": "last_failed_at", # noqa: E501 } read_only_vars = {} @@ -170,6 +182,9 @@ def _from_openapi_data(cls, url, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) include_image (bool): [optional] # noqa: E501 payload_template (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 + last_message_failed (bool): [optional] # noqa: E501 + last_failure_error (str, none_type): [optional] # noqa: E501 + last_failed_at (datetime, none_type): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -260,6 +275,9 @@ def __init__(self, url, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) include_image (bool): [optional] # noqa: E501 payload_template (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 + last_message_failed (bool): [optional] # noqa: E501 + last_failure_error (str, none_type): [optional] # noqa: E501 + last_failed_at (datetime, none_type): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) diff --git a/generated/groundlight_openapi_client/model/webhook_action_request.py b/generated/groundlight_openapi_client/model/webhook_action_request.py index 053d1a77..cd98a99b 100644 --- a/generated/groundlight_openapi_client/model/webhook_action_request.py +++ b/generated/groundlight_openapi_client/model/webhook_action_request.py @@ -114,6 +114,15 @@ def openapi_types(): str, none_type, ), # noqa: E501 + "last_message_failed": (bool,), # noqa: E501 + "last_failure_error": ( + str, + none_type, + ), # noqa: E501 + "last_failed_at": ( + datetime, + none_type, + ), # noqa: E501 } @cached_property @@ -124,6 +133,9 @@ def discriminator(): "url": "url", # noqa: E501 "include_image": "include_image", # noqa: E501 "payload_template": "payload_template", # noqa: E501 + "last_message_failed": "last_message_failed", # noqa: E501 + "last_failure_error": "last_failure_error", # noqa: E501 + "last_failed_at": "last_failed_at", # noqa: E501 } read_only_vars = {} @@ -171,6 +183,9 @@ def _from_openapi_data(cls, url, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) include_image (bool): [optional] # noqa: E501 payload_template (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 + last_message_failed (bool): [optional] # noqa: E501 + last_failure_error (str, none_type): [optional] # noqa: E501 + last_failed_at (datetime, none_type): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -261,6 +276,9 @@ def __init__(self, url, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) include_image (bool): [optional] # noqa: E501 payload_template (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 + last_message_failed (bool): [optional] # noqa: E501 + last_failure_error (str, none_type): [optional] # noqa: E501 + last_failed_at (datetime, 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 6f7e77be..705cc1c0 100644 --- a/generated/groundlight_openapi_client/models/__init__.py +++ b/generated/groundlight_openapi_client/models/__init__.py @@ -17,6 +17,8 @@ from groundlight_openapi_client.model.b_box_geometry_request import BBoxGeometryRequest from groundlight_openapi_client.model.binary_classification_result import BinaryClassificationResult from groundlight_openapi_client.model.blank_enum import BlankEnum +from groundlight_openapi_client.model.bounding_box_mode_configuration import BoundingBoxModeConfiguration +from groundlight_openapi_client.model.bounding_box_result import BoundingBoxResult from groundlight_openapi_client.model.channel_enum import ChannelEnum from groundlight_openapi_client.model.condition import Condition from groundlight_openapi_client.model.condition_request import ConditionRequest diff --git a/generated/model.py b/generated/model.py index 66f5927d..480c1e0d 100644 --- a/generated/model.py +++ b/generated/model.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: public-api.yaml -# timestamp: 2025-03-11T18:57:57+00:00 +# timestamp: 2025-03-31T23:28:33+00:00 from __future__ import annotations @@ -95,6 +95,7 @@ class ModeEnum(str, Enum): COUNT = "COUNT" MULTI_CLASS = "MULTI_CLASS" TEXT = "TEXT" + BOUNDING_BOX = "BOUNDING_BOX" class Note(BaseModel): @@ -143,6 +144,7 @@ class ResultTypeEnum(str, Enum): counting = "counting" multi_classification = "multi_classification" text_recognition = "text_recognition" + bounding_box = "bounding_box" class SnoozeTimeUnitEnum(str, Enum): @@ -211,12 +213,18 @@ class WebhookAction(BaseModel): url: AnyUrl include_image: Optional[bool] = None payload_template: Optional[PayloadTemplate] = None + last_message_failed: Optional[bool] = None + last_failure_error: Optional[str] = None + last_failed_at: Optional[datetime] = None class WebhookActionRequest(BaseModel): url: AnyUrl include_image: Optional[bool] = None payload_template: Optional[PayloadTemplateRequest] = None + last_message_failed: Optional[bool] = None + last_failure_error: Optional[str] = None + last_failed_at: Optional[datetime] = None class Source(str, Enum): @@ -242,6 +250,7 @@ class BinaryClassificationResult(BaseModel): confidence: Optional[confloat(ge=0.0, le=1.0)] = None source: Optional[Source] = None result_type: Optional[ResultType] = None + from_edge: Optional[bool] = None label: Label @@ -253,6 +262,7 @@ class CountingResult(BaseModel): confidence: Optional[confloat(ge=0.0, le=1.0)] = None source: Optional[Source] = None result_type: Optional[ResultType2] = None + from_edge: Optional[bool] = None count: Optional[conint(ge=0)] = Field(...) greater_than_max: Optional[bool] = None @@ -265,6 +275,7 @@ class MultiClassificationResult(BaseModel): confidence: Optional[confloat(ge=0.0, le=1.0)] = None source: Optional[Source] = None result_type: Optional[ResultType3] = None + from_edge: Optional[bool] = None label: str @@ -276,10 +287,29 @@ class TextRecognitionResult(BaseModel): confidence: Optional[confloat(ge=0.0, le=1.0)] = None source: Optional[Source] = None result_type: Optional[ResultType4] = None + from_edge: Optional[bool] = None text: Optional[str] = Field(...) truncated: bool +class ResultType5(str, Enum): + bounding_box = "bounding_box" + + +class Label1(str, Enum): + BOUNDING_BOX = "BOUNDING_BOX" + GREATER_THAN_MAX = "GREATER_THAN_MAX" + UNCLEAR = "UNCLEAR" + + +class BoundingBoxResult(BaseModel): + confidence: Optional[confloat(ge=0.0, le=1.0)] = None + source: Optional[Source] = None + result_type: Optional[ResultType5] = None + from_edge: Optional[bool] = None + label: Label1 + + class CountModeConfiguration(BaseModel): max_count: Optional[conint(ge=1, le=50)] = None class_name: str @@ -294,6 +324,11 @@ class TextModeConfiguration(BaseModel): value_max_length: Optional[conint(ge=1, le=250)] = None +class BoundingBoxModeConfiguration(BaseModel): + class_name: str + max_num_bboxes: Optional[conint(ge=1, le=50)] = None + + class ChannelEnum(str, Enum): TEXT = "TEXT" EMAIL = "EMAIL" @@ -399,12 +434,12 @@ class DetectorCreationInputRequest(BaseModel): "BINARY", description=( "Mode in which this detector will work.\n\n* `BINARY` - BINARY\n* `COUNT` - COUNT\n* `MULTI_CLASS` -" - " MULTI_CLASS\n* `TEXT` - TEXT" + " MULTI_CLASS\n* `TEXT` - TEXT\n* `BOUNDING_BOX` - BOUNDING_BOX" ), ) - mode_configuration: Optional[Union[CountModeConfiguration, MultiClassModeConfiguration, TextModeConfiguration]] = ( - None - ) + mode_configuration: Optional[ + Union[CountModeConfiguration, MultiClassModeConfiguration, TextModeConfiguration, BoundingBoxModeConfiguration] + ] = None class ImageQuery(BaseModel): @@ -420,7 +455,13 @@ class ImageQuery(BaseModel): detector_id: str = Field(..., description="Which detector was used on this image query?") result_type: ResultTypeEnum = Field(..., description="What type of result are we returning?") result: Optional[ - Union[BinaryClassificationResult, CountingResult, MultiClassificationResult, TextRecognitionResult] + Union[ + BinaryClassificationResult, + CountingResult, + MultiClassificationResult, + TextRecognitionResult, + BoundingBoxResult, + ] ] = Field(...) patience_time: float = Field(..., description="How long to wait for a confident response.") confidence_threshold: float = Field( diff --git a/generated/test/test_bounding_box_mode_configuration.py b/generated/test/test_bounding_box_mode_configuration.py new file mode 100644 index 00000000..67b2b472 --- /dev/null +++ b/generated/test/test_bounding_box_mode_configuration.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.bounding_box_mode_configuration import BoundingBoxModeConfiguration + + +class TestBoundingBoxModeConfiguration(unittest.TestCase): + """BoundingBoxModeConfiguration unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBoundingBoxModeConfiguration(self): + """Test BoundingBoxModeConfiguration""" + # FIXME: construct object with mandatory attributes with example values + # model = BoundingBoxModeConfiguration() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/generated/test/test_bounding_box_result.py b/generated/test/test_bounding_box_result.py new file mode 100644 index 00000000..4608b05e --- /dev/null +++ b/generated/test/test_bounding_box_result.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.bounding_box_result import BoundingBoxResult + + +class TestBoundingBoxResult(unittest.TestCase): + """BoundingBoxResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBoundingBoxResult(self): + """Test BoundingBoxResult""" + # FIXME: construct object with mandatory attributes with example values + # model = BoundingBoxResult() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/pyproject.toml b/pyproject.toml index 4db58220..56f944b5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ packages = [ {include = "**/*.py", from = "src"}, ] readme = "README.md" -version = "0.22.3" +version = "0.22.4" [tool.poetry.dependencies] # For certifi, use ">=" instead of "^" since it upgrades its "major version" every year, not really following semver diff --git a/spec/public-api.yaml b/spec/public-api.yaml index bb11e4ff..1859dbf0 100644 --- a/spec/public-api.yaml +++ b/spec/public-api.yaml @@ -443,6 +443,20 @@ paths: schema: $ref: '#/components/schemas/EdgeModelInfo' description: '' + /v1/edge/report-metrics: + post: + operationId: edge_report_metrics_create + description: |- + Edge server periodically calls this to report metrics. + + POST body will have JSON data that we log. + tags: + - edge + security: + - ApiToken: [] + responses: + '200': + description: No response body /v1/image-queries: get: operationId: List image queries @@ -973,11 +987,13 @@ components: * `COUNT` - COUNT * `MULTI_CLASS` - MULTI_CLASS * `TEXT` - TEXT + * `BOUNDING_BOX` - BOUNDING_BOX mode_configuration: oneOf: - $ref: '#/components/schemas/CountModeConfiguration' - $ref: '#/components/schemas/MultiClassModeConfiguration' - $ref: '#/components/schemas/TextModeConfiguration' + - $ref: '#/components/schemas/BoundingBoxModeConfiguration' nullable: true required: - name @@ -1076,6 +1092,7 @@ components: - $ref: '#/components/schemas/CountingResult' - $ref: '#/components/schemas/MultiClassificationResult' - $ref: '#/components/schemas/TextRecognitionResult' + - $ref: '#/components/schemas/BoundingBoxResult' nullable: true patience_time: type: number @@ -1202,6 +1219,7 @@ components: - COUNT - MULTI_CLASS - TEXT + - BOUNDING_BOX type: string Note: type: object @@ -1407,6 +1425,7 @@ components: - counting - multi_classification - text_recognition + - bounding_box type: string Rule: type: object @@ -1560,6 +1579,15 @@ components: allOf: - $ref: '#/components/schemas/PayloadTemplate' nullable: true + last_message_failed: + type: boolean + last_failure_error: + type: string + nullable: true + last_failed_at: + type: string + format: date-time + nullable: true required: - url WebhookActionRequest: @@ -1576,6 +1604,15 @@ components: allOf: - $ref: '#/components/schemas/PayloadTemplateRequest' nullable: true + last_message_failed: + type: boolean + last_failure_error: + type: string + nullable: true + last_failed_at: + type: string + format: date-time + nullable: true required: - url BinaryClassificationResult: @@ -1600,6 +1637,8 @@ components: type: string enum: - binary_classification + from_edge: + type: boolean label: type: string enum: @@ -1630,6 +1669,8 @@ components: type: string enum: - counting + from_edge: + type: boolean count: type: integer minimum: 0 @@ -1660,6 +1701,8 @@ components: type: string enum: - multi_classification + from_edge: + type: boolean label: type: string nullable: false @@ -1687,6 +1730,8 @@ components: type: string enum: - text_recognition + from_edge: + type: boolean text: type: string nullable: true @@ -1695,6 +1740,38 @@ components: required: - text - truncated + BoundingBoxResult: + type: object + properties: + confidence: + type: number + format: float + minimum: 0.0 + maximum: 1.0 + nullable: true + source: + type: string + enum: + - STILL_PROCESSING + - CLOUD + - USER + - CLOUD_ENSEMBLE + - ALGORITHM + - EDGE + result_type: + type: string + enum: + - bounding_box + from_edge: + type: boolean + label: + type: string + enum: + - BOUNDING_BOX + - GREATER_THAN_MAX + - UNCLEAR + required: + - label CountModeConfiguration: type: object properties: @@ -1729,6 +1806,19 @@ components: minimum: 1 maximum: 250 nullable: false + BoundingBoxModeConfiguration: + type: object + properties: + class_name: + type: string + nullable: false + max_num_bboxes: + type: integer + minimum: 1 + maximum: 50 + nullable: false + required: + - class_name ChannelEnum: type: string enum: @@ -1764,4 +1854,4 @@ servers: - url: https://device.positronix.ai/device-api description: Device Prod - url: https://device.integ.positronix.ai/device-api - description: Device Integ + description: Device Integ \ No newline at end of file