diff --git a/generated/.openapi-generator/FILES b/generated/.openapi-generator/FILES index c6bdc7b8..330dcfd0 100644 --- a/generated/.openapi-generator/FILES +++ b/generated/.openapi-generator/FILES @@ -36,6 +36,7 @@ docs/InlineResponse2001EvaluationResults.md docs/InlineResponse2002.md docs/InlineResponse200Summary.md docs/InlineResponse200SummaryClassCounts.md +docs/LabelEnum.md docs/LabelValue.md docs/LabelValueRequest.md docs/LabelsApi.md @@ -112,6 +113,7 @@ 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_enum.py groundlight_openapi_client/model/label_value.py groundlight_openapi_client/model/label_value_request.py groundlight_openapi_client/model/mode_enum.py @@ -146,4 +148,5 @@ setup.cfg setup.py test-requirements.txt test/__init__.py +test/test_label_enum.py tox.ini diff --git a/generated/README.md b/generated/README.md index 4a84c1f2..16d05a16 100644 --- a/generated/README.md +++ b/generated/README.md @@ -84,7 +84,7 @@ rule_request = RuleRequest( snooze_time_unit=None, human_review_required=False, condition=ConditionRequest( - verb=VerbEnum("ANSWERED_CONSECUTIVELY"), + verb="verb_example", parameters={ "key": None, }, @@ -174,6 +174,7 @@ Class | Method | HTTP request | Description - [InlineResponse2002](docs/InlineResponse2002.md) - [InlineResponse200Summary](docs/InlineResponse200Summary.md) - [InlineResponse200SummaryClassCounts](docs/InlineResponse200SummaryClassCounts.md) + - [LabelEnum](docs/LabelEnum.md) - [LabelValue](docs/LabelValue.md) - [LabelValueRequest](docs/LabelValueRequest.md) - [ModeEnum](docs/ModeEnum.md) diff --git a/generated/docs/ActionsApi.md b/generated/docs/ActionsApi.md index ae3b580b..099d468f 100644 --- a/generated/docs/ActionsApi.md +++ b/generated/docs/ActionsApi.md @@ -59,7 +59,7 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client: snooze_time_unit=None, human_review_required=False, condition=ConditionRequest( - verb=VerbEnum("ANSWERED_CONSECUTIVELY"), + verb="verb_example", parameters={ "key": None, }, diff --git a/generated/docs/AnnotationsRequestedEnum.md b/generated/docs/AnnotationsRequestedEnum.md index fd366f01..31b444e4 100644 --- a/generated/docs/AnnotationsRequestedEnum.md +++ b/generated/docs/AnnotationsRequestedEnum.md @@ -1,11 +1,10 @@ # AnnotationsRequestedEnum -* `BINARY_CLASSIFICATION` - Binary Classification * `BOUNDING_BOXES` - Bounding Boxes ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | * `BINARY_CLASSIFICATION` - Binary Classification * `BOUNDING_BOXES` - Bounding Boxes | must be one of ["BINARY_CLASSIFICATION", "BOUNDING_BOXES", ] +**value** | **str** | | must be one of ["BINARY_CLASSIFICATION", "BOUNDING_BOXES", ] [[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/BinaryClassificationResult.md b/generated/docs/BinaryClassificationResult.md index a98a3b70..0ddc4f9e 100644 --- a/generated/docs/BinaryClassificationResult.md +++ b/generated/docs/BinaryClassificationResult.md @@ -7,7 +7,7 @@ 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 "binary_classification" +**result_type** | **str** | | [optional] **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] diff --git a/generated/docs/BoundingBoxResult.md b/generated/docs/BoundingBoxResult.md index 7a089d95..aab5d925 100644 --- a/generated/docs/BoundingBoxResult.md +++ b/generated/docs/BoundingBoxResult.md @@ -7,7 +7,7 @@ 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" +**result_type** | **str** | | [optional] **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] diff --git a/generated/docs/Condition.md b/generated/docs/Condition.md index edfe01a8..e54e1ad5 100644 --- a/generated/docs/Condition.md +++ b/generated/docs/Condition.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**verb** | [**VerbEnum**](VerbEnum.md) | | +**verb** | **str** | | **parameters** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | **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/ConditionRequest.md b/generated/docs/ConditionRequest.md index a9a2cead..60a6d034 100644 --- a/generated/docs/ConditionRequest.md +++ b/generated/docs/ConditionRequest.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**verb** | [**VerbEnum**](VerbEnum.md) | | +**verb** | **str** | | **parameters** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | **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/CountingResult.md b/generated/docs/CountingResult.md index f9db3d5d..deb8cbe6 100644 --- a/generated/docs/CountingResult.md +++ b/generated/docs/CountingResult.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **count** | **int, none_type** | | **confidence** | **float, none_type** | | [optional] **source** | **str** | | [optional] -**result_type** | **str** | | [optional] if omitted the server will use the default value of "counting" +**result_type** | **str** | | [optional] **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/Detector.md b/generated/docs/Detector.md index 133bfeba..b2f9f86e 100644 --- a/generated/docs/Detector.md +++ b/generated/docs/Detector.md @@ -12,12 +12,12 @@ Name | Type | Description | Notes **query** | **str** | A question about the image. | [readonly] **group_name** | **str** | Which group should this detector be part of? | [readonly] **metadata** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | Metadata about the detector. | [readonly] -**mode** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [readonly] +**mode** | **str** | | [readonly] **mode_configuration** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [readonly] **confidence_threshold** | **float** | If the detector's prediction is below this confidence threshold, send the image query for human review. | [optional] if omitted the server will use the default value of 0.9 **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 **status** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] -**escalation_type** | **bool, date, datetime, dict, float, int, list, str, none_type** | Category that define internal proccess for labeling image queries * `STANDARD` - STANDARD * `NO_HUMAN_LABELING` - NO_HUMAN_LABELING | [optional] +**escalation_type** | **str** | | [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/DetectorsApi.md b/generated/docs/DetectorsApi.md index 51cc1d1c..9f5355e5 100644 --- a/generated/docs/DetectorsApi.md +++ b/generated/docs/DetectorsApi.md @@ -532,7 +532,7 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client: confidence_threshold=0.9, patience_time=30.0, status=None, - escalation_type=None, + escalation_type="escalation_type_example", ) # PatchedDetectorRequest | (optional) # example passing only required values which don't have defaults set diff --git a/generated/docs/EscalationTypeEnum.md b/generated/docs/EscalationTypeEnum.md index 36e1e46e..d7842681 100644 --- a/generated/docs/EscalationTypeEnum.md +++ b/generated/docs/EscalationTypeEnum.md @@ -1,11 +1,10 @@ # EscalationTypeEnum -* `STANDARD` - STANDARD * `NO_HUMAN_LABELING` - NO_HUMAN_LABELING ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | * `STANDARD` - STANDARD * `NO_HUMAN_LABELING` - NO_HUMAN_LABELING | must be one of ["STANDARD", "NO_HUMAN_LABELING", ] +**value** | **str** | | must be one of ["STANDARD", "NO_HUMAN_LABELING", ] [[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/LabelEnum.md b/generated/docs/LabelEnum.md new file mode 100644 index 00000000..823f21d5 --- /dev/null +++ b/generated/docs/LabelEnum.md @@ -0,0 +1,11 @@ +# LabelEnum + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | must be one of ["YES", "NO", "UNCLEAR", ] + +[[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/LabelValue.md b/generated/docs/LabelValue.md index acbb0e6f..da087687 100644 --- a/generated/docs/LabelValue.md +++ b/generated/docs/LabelValue.md @@ -6,10 +6,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **confidence** | **float, none_type** | | [readonly] **class_name** | **str, none_type** | Return a human-readable class name for this label (e.g. YES/NO) | [readonly] -**annotations_requested** | **[bool, date, datetime, dict, float, int, list, str, none_type]** | | [readonly] +**annotations_requested** | **[str]** | | [readonly] **created_at** | **datetime** | | [readonly] **detector_id** | **int, none_type** | | [readonly] -**source** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [readonly] +**source** | **str** | | [readonly] **text** | **str, none_type** | Text annotations | [readonly] **rois** | [**[ROI], none_type**](ROI.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] diff --git a/generated/docs/MultiClassificationResult.md b/generated/docs/MultiClassificationResult.md index d048a5da..04aad82f 100644 --- a/generated/docs/MultiClassificationResult.md +++ b/generated/docs/MultiClassificationResult.md @@ -7,7 +7,7 @@ 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 "multi_classification" +**result_type** | **str** | | [optional] **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] diff --git a/generated/docs/PatchedDetectorRequest.md b/generated/docs/PatchedDetectorRequest.md index 819310b8..eb594561 100644 --- a/generated/docs/PatchedDetectorRequest.md +++ b/generated/docs/PatchedDetectorRequest.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **confidence_threshold** | **float** | If the detector's prediction is below this confidence threshold, send the image query for human review. | [optional] if omitted the server will use the default value of 0.9 **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 **status** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] -**escalation_type** | **bool, date, datetime, dict, float, int, list, str, none_type** | Category that define internal proccess for labeling image queries * `STANDARD` - STANDARD * `NO_HUMAN_LABELING` - NO_HUMAN_LABELING | [optional] +**escalation_type** | **str** | | [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/SourceEnum.md b/generated/docs/SourceEnum.md index 65fe757d..a382414e 100644 --- a/generated/docs/SourceEnum.md +++ b/generated/docs/SourceEnum.md @@ -1,11 +1,10 @@ # SourceEnum -* `INITIAL_PLACEHOLDER` - InitialPlaceholder * `CLOUD` - HumanCloud * `CUST` - HumanCustomer * `HUMAN_CLOUD_ENSEMBLE` - HumanCloudEnsemble * `ALG` - Algorithm * `ALG_REC` - AlgorithmReconciled * `ALG_UNCLEAR` - AlgorithmUnclear * `EDGE` - EDGE ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | * `INITIAL_PLACEHOLDER` - InitialPlaceholder * `CLOUD` - HumanCloud * `CUST` - HumanCustomer * `HUMAN_CLOUD_ENSEMBLE` - HumanCloudEnsemble * `ALG` - Algorithm * `ALG_REC` - AlgorithmReconciled * `ALG_UNCLEAR` - AlgorithmUnclear * `EDGE` - EDGE | must be one of ["INITIAL_PLACEHOLDER", "CLOUD", "CUST", "HUMAN_CLOUD_ENSEMBLE", "ALG", "ALG_REC", "ALG_UNCLEAR", "EDGE", ] +**value** | **str** | | must be one of ["INITIAL_PLACEHOLDER", "CLOUD", "CUST", "HUMAN_CLOUD_ENSEMBLE", "ALG", "ALG_REC", "ALG_UNCLEAR", "EDGE", ] [[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 f518a26b..736bec34 100644 --- a/generated/docs/TextRecognitionResult.md +++ b/generated/docs/TextRecognitionResult.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **truncated** | **bool** | | **confidence** | **float, none_type** | | [optional] **source** | **str** | | [optional] -**result_type** | **str** | | [optional] if omitted the server will use the default value of "text_recognition" +**result_type** | **str** | | [optional] **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] diff --git a/generated/docs/VerbEnum.md b/generated/docs/VerbEnum.md index a76351de..57a334c2 100644 --- a/generated/docs/VerbEnum.md +++ b/generated/docs/VerbEnum.md @@ -1,11 +1,10 @@ # VerbEnum -* `ANSWERED_CONSECUTIVELY` - ANSWERED_CONSECUTIVELY * `ANSWERED_WITHIN_TIME` - ANSWERED_WITHIN_TIME * `CHANGED_TO` - CHANGED_TO * `NO_CHANGE` - NO_CHANGE * `NO_QUERIES` - NO_QUERIES ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | * `ANSWERED_CONSECUTIVELY` - ANSWERED_CONSECUTIVELY * `ANSWERED_WITHIN_TIME` - ANSWERED_WITHIN_TIME * `CHANGED_TO` - CHANGED_TO * `NO_CHANGE` - NO_CHANGE * `NO_QUERIES` - NO_QUERIES | must be one of ["ANSWERED_CONSECUTIVELY", "ANSWERED_WITHIN_TIME", "CHANGED_TO", "NO_CHANGE", "NO_QUERIES", ] +**value** | **str** | | must be one of ["ANSWERED_CONSECUTIVELY", "ANSWERED_WITHIN_TIME", "CHANGED_TO", "NO_CHANGE", "NO_QUERIES", ] [[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/model/annotations_requested_enum.py b/generated/groundlight_openapi_client/model/annotations_requested_enum.py index d951c99e..1e1f6b8f 100644 --- a/generated/groundlight_openapi_client/model/annotations_requested_enum.py +++ b/generated/groundlight_openapi_client/model/annotations_requested_enum.py @@ -102,10 +102,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): * `BINARY_CLASSIFICATION` - Binary Classification * `BOUNDING_BOXES` - Bounding Boxes., must be one of ["BINARY_CLASSIFICATION", "BOUNDING_BOXES", ] # noqa: E501 + args[0] (str):, must be one of ["BINARY_CLASSIFICATION", "BOUNDING_BOXES", ] # noqa: E501 Keyword Args: - value (str): * `BINARY_CLASSIFICATION` - Binary Classification * `BOUNDING_BOXES` - Bounding Boxes., must be one of ["BINARY_CLASSIFICATION", "BOUNDING_BOXES", ] # noqa: E501 + value (str):, must be one of ["BINARY_CLASSIFICATION", "BOUNDING_BOXES", ] # 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. @@ -194,10 +194,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): * `BINARY_CLASSIFICATION` - Binary Classification * `BOUNDING_BOXES` - Bounding Boxes., must be one of ["BINARY_CLASSIFICATION", "BOUNDING_BOXES", ] # noqa: E501 + args[0] (str):, must be one of ["BINARY_CLASSIFICATION", "BOUNDING_BOXES", ] # noqa: E501 Keyword Args: - value (str): * `BINARY_CLASSIFICATION` - Binary Classification * `BOUNDING_BOXES` - Bounding Boxes., must be one of ["BINARY_CLASSIFICATION", "BOUNDING_BOXES", ] # noqa: E501 + value (str):, must be one of ["BINARY_CLASSIFICATION", "BOUNDING_BOXES", ] # 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/binary_classification_result.py b/generated/groundlight_openapi_client/model/binary_classification_result.py index 25ef477e..605685dc 100644 --- a/generated/groundlight_openapi_client/model/binary_classification_result.py +++ b/generated/groundlight_openapi_client/model/binary_classification_result.py @@ -53,24 +53,7 @@ class BinaryClassificationResult(ModelNormal): as additional properties values. """ - allowed_values = { - ("label",): { - "YES": "YES", - "NO": "NO", - "UNCLEAR": "UNCLEAR", - }, - ("source",): { - "STILL_PROCESSING": "STILL_PROCESSING", - "CLOUD": "CLOUD", - "USER": "USER", - "CLOUD_ENSEMBLE": "CLOUD_ENSEMBLE", - "ALGORITHM": "ALGORITHM", - "EDGE": "EDGE", - }, - ("result_type",): { - "BINARY_CLASSIFICATION": "binary_classification", - }, - } + allowed_values = {} validations = { ("confidence",): { @@ -177,7 +160,7 @@ def _from_openapi_data(cls, label, *args, **kwargs): # noqa: E501 _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 "binary_classification" # noqa: E501 + result_type (str): [optional] # noqa: E501 from_edge (bool): [optional] # noqa: E501 """ @@ -269,7 +252,7 @@ def __init__(self, label, *args, **kwargs): # noqa: E501 _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 "binary_classification" # noqa: E501 + result_type (str): [optional] # noqa: E501 from_edge (bool): [optional] # noqa: E501 """ diff --git a/generated/groundlight_openapi_client/model/bounding_box_result.py b/generated/groundlight_openapi_client/model/bounding_box_result.py index 3c18763d..be4daaba 100644 --- a/generated/groundlight_openapi_client/model/bounding_box_result.py +++ b/generated/groundlight_openapi_client/model/bounding_box_result.py @@ -53,24 +53,7 @@ class BoundingBoxResult(ModelNormal): 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", - }, - } + allowed_values = {} validations = { ("confidence",): { @@ -177,7 +160,7 @@ def _from_openapi_data(cls, label, *args, **kwargs): # noqa: E501 _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 + result_type (str): [optional] # noqa: E501 from_edge (bool): [optional] # noqa: E501 """ @@ -269,7 +252,7 @@ def __init__(self, label, *args, **kwargs): # noqa: E501 _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 + result_type (str): [optional] # noqa: E501 from_edge (bool): [optional] # noqa: E501 """ diff --git a/generated/groundlight_openapi_client/model/condition.py b/generated/groundlight_openapi_client/model/condition.py index 6e12ea64..65a2861f 100644 --- a/generated/groundlight_openapi_client/model/condition.py +++ b/generated/groundlight_openapi_client/model/condition.py @@ -29,12 +29,6 @@ from groundlight_openapi_client.exceptions import ApiAttributeError -def lazy_import(): - from groundlight_openapi_client.model.verb_enum import VerbEnum - - globals()["VerbEnum"] = VerbEnum - - class Condition(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -69,7 +63,6 @@ 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, @@ -94,9 +87,8 @@ def openapi_types(): openapi_types (dict): The key is attribute name and the value is attribute type. """ - lazy_import() return { - "verb": (VerbEnum,), # noqa: E501 + "verb": (str,), # noqa: E501 "parameters": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 } @@ -119,7 +111,7 @@ def _from_openapi_data(cls, verb, parameters, *args, **kwargs): # noqa: E501 """Condition - a model defined in OpenAPI Args: - verb (VerbEnum): + verb (str): parameters ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Keyword Args: @@ -209,7 +201,7 @@ def __init__(self, verb, parameters, *args, **kwargs): # noqa: E501 """Condition - a model defined in OpenAPI Args: - verb (VerbEnum): + verb (str): parameters ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Keyword Args: diff --git a/generated/groundlight_openapi_client/model/condition_request.py b/generated/groundlight_openapi_client/model/condition_request.py index 3172892a..674578a6 100644 --- a/generated/groundlight_openapi_client/model/condition_request.py +++ b/generated/groundlight_openapi_client/model/condition_request.py @@ -29,12 +29,6 @@ from groundlight_openapi_client.exceptions import ApiAttributeError -def lazy_import(): - from groundlight_openapi_client.model.verb_enum import VerbEnum - - globals()["VerbEnum"] = VerbEnum - - class ConditionRequest(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -69,7 +63,6 @@ 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, @@ -94,9 +87,8 @@ def openapi_types(): openapi_types (dict): The key is attribute name and the value is attribute type. """ - lazy_import() return { - "verb": (VerbEnum,), # noqa: E501 + "verb": (str,), # noqa: E501 "parameters": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 } @@ -119,7 +111,7 @@ def _from_openapi_data(cls, verb, parameters, *args, **kwargs): # noqa: E501 """ConditionRequest - a model defined in OpenAPI Args: - verb (VerbEnum): + verb (str): parameters ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Keyword Args: @@ -209,7 +201,7 @@ def __init__(self, verb, parameters, *args, **kwargs): # noqa: E501 """ConditionRequest - a model defined in OpenAPI Args: - verb (VerbEnum): + verb (str): parameters ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Keyword Args: diff --git a/generated/groundlight_openapi_client/model/counting_result.py b/generated/groundlight_openapi_client/model/counting_result.py index 9d7ff477..08d2f6db 100644 --- a/generated/groundlight_openapi_client/model/counting_result.py +++ b/generated/groundlight_openapi_client/model/counting_result.py @@ -53,19 +53,7 @@ class CountingResult(ModelNormal): as additional properties values. """ - allowed_values = { - ("source",): { - "STILL_PROCESSING": "STILL_PROCESSING", - "CLOUD": "CLOUD", - "USER": "USER", - "CLOUD_ENSEMBLE": "CLOUD_ENSEMBLE", - "ALGORITHM": "ALGORITHM", - "EDGE": "EDGE", - }, - ("result_type",): { - "COUNTING": "counting", - }, - } + allowed_values = {} validations = { ("count",): { @@ -180,7 +168,7 @@ def _from_openapi_data(cls, count, *args, **kwargs): # noqa: E501 _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 "counting" # noqa: E501 + result_type (str): [optional] # noqa: E501 from_edge (bool): [optional] # noqa: E501 greater_than_max (bool): [optional] # noqa: E501 """ @@ -273,7 +261,7 @@ def __init__(self, count, *args, **kwargs): # noqa: E501 _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 "counting" # noqa: E501 + result_type (str): [optional] # noqa: E501 from_edge (bool): [optional] # noqa: E501 greater_than_max (bool): [optional] # noqa: E501 """ diff --git a/generated/groundlight_openapi_client/model/detector.py b/generated/groundlight_openapi_client/model/detector.py index 04c6beb8..2cde7991 100644 --- a/generated/groundlight_openapi_client/model/detector.py +++ b/generated/groundlight_openapi_client/model/detector.py @@ -32,14 +32,10 @@ def lazy_import(): from groundlight_openapi_client.model.blank_enum import BlankEnum from groundlight_openapi_client.model.detector_type_enum import DetectorTypeEnum - from groundlight_openapi_client.model.escalation_type_enum import EscalationTypeEnum - from groundlight_openapi_client.model.mode_enum import ModeEnum from groundlight_openapi_client.model.status_enum import StatusEnum globals()["BlankEnum"] = BlankEnum globals()["DetectorTypeEnum"] = DetectorTypeEnum - globals()["EscalationTypeEnum"] = EscalationTypeEnum - globals()["ModeEnum"] = ModeEnum globals()["StatusEnum"] = StatusEnum @@ -136,17 +132,7 @@ def openapi_types(): {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type, ), # noqa: E501 - "mode": ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ), # noqa: E501 + "mode": (str,), # noqa: E501 "mode_configuration": ( {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type, @@ -164,17 +150,7 @@ def openapi_types(): str, none_type, ), # noqa: E501 - "escalation_type": ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ), # noqa: E501 + "escalation_type": (str,), # noqa: E501 } @cached_property @@ -225,7 +201,7 @@ def _from_openapi_data( query (str): A question about the image. group_name (str): Which group should this detector be part of? metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): Metadata about the detector. - mode (bool, date, datetime, dict, float, int, list, str, none_type): + mode (str): mode_configuration ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): Keyword Args: @@ -262,7 +238,7 @@ def _from_openapi_data( confidence_threshold (float): If the detector's prediction is below this confidence threshold, send the image query for human review.. [optional] if omitted the server will use the default value of 0.9 # 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 status (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - escalation_type (bool, date, datetime, dict, float, int, list, str, none_type): Category that define internal proccess for labeling image queries * `STANDARD` - STANDARD * `NO_HUMAN_LABELING` - NO_HUMAN_LABELING. [optional] # noqa: E501 + escalation_type (str): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -360,7 +336,7 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 confidence_threshold (float): If the detector's prediction is below this confidence threshold, send the image query for human review.. [optional] if omitted the server will use the default value of 0.9 # 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 status (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - escalation_type (bool, date, datetime, dict, float, int, list, str, none_type): Category that define internal proccess for labeling image queries * `STANDARD` - STANDARD * `NO_HUMAN_LABELING` - NO_HUMAN_LABELING. [optional] # noqa: E501 + escalation_type (str): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) diff --git a/generated/groundlight_openapi_client/model/escalation_type_enum.py b/generated/groundlight_openapi_client/model/escalation_type_enum.py index d28cb1ed..2b80360e 100644 --- a/generated/groundlight_openapi_client/model/escalation_type_enum.py +++ b/generated/groundlight_openapi_client/model/escalation_type_enum.py @@ -102,10 +102,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): * `STANDARD` - STANDARD * `NO_HUMAN_LABELING` - NO_HUMAN_LABELING., must be one of ["STANDARD", "NO_HUMAN_LABELING", ] # noqa: E501 + args[0] (str):, must be one of ["STANDARD", "NO_HUMAN_LABELING", ] # noqa: E501 Keyword Args: - value (str): * `STANDARD` - STANDARD * `NO_HUMAN_LABELING` - NO_HUMAN_LABELING., must be one of ["STANDARD", "NO_HUMAN_LABELING", ] # noqa: E501 + value (str):, must be one of ["STANDARD", "NO_HUMAN_LABELING", ] # 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. @@ -194,10 +194,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): * `STANDARD` - STANDARD * `NO_HUMAN_LABELING` - NO_HUMAN_LABELING., must be one of ["STANDARD", "NO_HUMAN_LABELING", ] # noqa: E501 + args[0] (str):, must be one of ["STANDARD", "NO_HUMAN_LABELING", ] # noqa: E501 Keyword Args: - value (str): * `STANDARD` - STANDARD * `NO_HUMAN_LABELING` - NO_HUMAN_LABELING., must be one of ["STANDARD", "NO_HUMAN_LABELING", ] # noqa: E501 + value (str):, must be one of ["STANDARD", "NO_HUMAN_LABELING", ] # 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/label_enum.py b/generated/groundlight_openapi_client/model/label_enum.py new file mode 100644 index 00000000..af81fe56 --- /dev/null +++ b/generated/groundlight_openapi_client/model/label_enum.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 LabelEnum(ModelSimple): + """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. + 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 = { + ("value",): { + "YES": "YES", + "NO": "NO", + "UNCLEAR": "UNCLEAR", + }, + } + + validations = {} + + additional_properties_type = None + + _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 { + "value": (str,), + } + + @cached_property + def discriminator(): + return None + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + 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): + """LabelEnum - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["YES", "NO", "UNCLEAR", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["YES", "NO", "UNCLEAR", ] # 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. + 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,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _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.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LabelEnum - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["YES", "NO", "UNCLEAR", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["YES", "NO", "UNCLEAR", ] # 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. + 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,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _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.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/generated/groundlight_openapi_client/model/label_value.py b/generated/groundlight_openapi_client/model/label_value.py index d2981b5d..ee9b73e9 100644 --- a/generated/groundlight_openapi_client/model/label_value.py +++ b/generated/groundlight_openapi_client/model/label_value.py @@ -30,13 +30,9 @@ def lazy_import(): - from groundlight_openapi_client.model.annotations_requested_enum import AnnotationsRequestedEnum from groundlight_openapi_client.model.roi import ROI - from groundlight_openapi_client.model.source_enum import SourceEnum - globals()["AnnotationsRequestedEnum"] = AnnotationsRequestedEnum globals()["ROI"] = ROI - globals()["SourceEnum"] = SourceEnum class LabelValue(ModelNormal): @@ -108,23 +104,13 @@ def openapi_types(): str, none_type, ), # noqa: E501 - "annotations_requested": ([bool, date, datetime, dict, float, int, list, str, none_type],), # noqa: E501 + "annotations_requested": ([str],), # noqa: E501 "created_at": (datetime,), # noqa: E501 "detector_id": ( int, none_type, ), # noqa: E501 - "source": ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ), # noqa: E501 + "source": (str,), # noqa: E501 "text": ( str, none_type, @@ -172,10 +158,10 @@ def _from_openapi_data( Args: confidence (float, none_type): class_name (str, none_type): Return a human-readable class name for this label (e.g. YES/NO) - annotations_requested ([bool, date, datetime, dict, float, int, list, str, none_type]): + annotations_requested ([str]): created_at (datetime): detector_id (int, none_type): - source (bool, date, datetime, dict, float, int, list, str, none_type): + source (str): text (str, none_type): Text annotations Keyword Args: diff --git a/generated/groundlight_openapi_client/model/multi_classification_result.py b/generated/groundlight_openapi_client/model/multi_classification_result.py index ddd68bd7..798c1615 100644 --- a/generated/groundlight_openapi_client/model/multi_classification_result.py +++ b/generated/groundlight_openapi_client/model/multi_classification_result.py @@ -53,19 +53,7 @@ class MultiClassificationResult(ModelNormal): as additional properties values. """ - allowed_values = { - ("source",): { - "STILL_PROCESSING": "STILL_PROCESSING", - "CLOUD": "CLOUD", - "USER": "USER", - "CLOUD_ENSEMBLE": "CLOUD_ENSEMBLE", - "ALGORITHM": "ALGORITHM", - "EDGE": "EDGE", - }, - ("result_type",): { - "MULTI_CLASSIFICATION": "multi_classification", - }, - } + allowed_values = {} validations = { ("confidence",): { @@ -172,7 +160,7 @@ def _from_openapi_data(cls, label, *args, **kwargs): # noqa: E501 _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 "multi_classification" # noqa: E501 + result_type (str): [optional] # noqa: E501 from_edge (bool): [optional] # noqa: E501 """ @@ -264,7 +252,7 @@ def __init__(self, label, *args, **kwargs): # noqa: E501 _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 "multi_classification" # noqa: E501 + result_type (str): [optional] # noqa: E501 from_edge (bool): [optional] # noqa: E501 """ diff --git a/generated/groundlight_openapi_client/model/patched_detector_request.py b/generated/groundlight_openapi_client/model/patched_detector_request.py index 251cb75d..7e7a5813 100644 --- a/generated/groundlight_openapi_client/model/patched_detector_request.py +++ b/generated/groundlight_openapi_client/model/patched_detector_request.py @@ -31,11 +31,9 @@ def lazy_import(): from groundlight_openapi_client.model.blank_enum import BlankEnum - from groundlight_openapi_client.model.escalation_type_enum import EscalationTypeEnum from groundlight_openapi_client.model.status_enum import StatusEnum globals()["BlankEnum"] = BlankEnum - globals()["EscalationTypeEnum"] = EscalationTypeEnum globals()["StatusEnum"] = StatusEnum @@ -78,6 +76,9 @@ class PatchedDetectorRequest(ModelNormal): "inclusive_maximum": 3600, "inclusive_minimum": 0, }, + ("escalation_type",): { + "min_length": 1, + }, } @cached_property @@ -127,17 +128,7 @@ def openapi_types(): str, none_type, ), # noqa: E501 - "escalation_type": ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ), # noqa: E501 + "escalation_type": (str,), # noqa: E501 } @cached_property @@ -196,7 +187,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 confidence_threshold (float): If the detector's prediction is below this confidence threshold, send the image query for human review.. [optional] if omitted the server will use the default value of 0.9 # 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 status (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - escalation_type (bool, date, datetime, dict, float, int, list, str, none_type): Category that define internal proccess for labeling image queries * `STANDARD` - STANDARD * `NO_HUMAN_LABELING` - NO_HUMAN_LABELING. [optional] # noqa: E501 + escalation_type (str): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -285,7 +276,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 confidence_threshold (float): If the detector's prediction is below this confidence threshold, send the image query for human review.. [optional] if omitted the server will use the default value of 0.9 # 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 status (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - escalation_type (bool, date, datetime, dict, float, int, list, str, none_type): Category that define internal proccess for labeling image queries * `STANDARD` - STANDARD * `NO_HUMAN_LABELING` - NO_HUMAN_LABELING. [optional] # noqa: E501 + escalation_type (str): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) diff --git a/generated/groundlight_openapi_client/model/source_enum.py b/generated/groundlight_openapi_client/model/source_enum.py index 4addbc10..8a2746ab 100644 --- a/generated/groundlight_openapi_client/model/source_enum.py +++ b/generated/groundlight_openapi_client/model/source_enum.py @@ -108,10 +108,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): * `INITIAL_PLACEHOLDER` - InitialPlaceholder * `CLOUD` - HumanCloud * `CUST` - HumanCustomer * `HUMAN_CLOUD_ENSEMBLE` - HumanCloudEnsemble * `ALG` - Algorithm * `ALG_REC` - AlgorithmReconciled * `ALG_UNCLEAR` - AlgorithmUnclear * `EDGE` - EDGE., must be one of ["INITIAL_PLACEHOLDER", "CLOUD", "CUST", "HUMAN_CLOUD_ENSEMBLE", "ALG", "ALG_REC", "ALG_UNCLEAR", "EDGE", ] # noqa: E501 + args[0] (str):, must be one of ["INITIAL_PLACEHOLDER", "CLOUD", "CUST", "HUMAN_CLOUD_ENSEMBLE", "ALG", "ALG_REC", "ALG_UNCLEAR", "EDGE", ] # noqa: E501 Keyword Args: - value (str): * `INITIAL_PLACEHOLDER` - InitialPlaceholder * `CLOUD` - HumanCloud * `CUST` - HumanCustomer * `HUMAN_CLOUD_ENSEMBLE` - HumanCloudEnsemble * `ALG` - Algorithm * `ALG_REC` - AlgorithmReconciled * `ALG_UNCLEAR` - AlgorithmUnclear * `EDGE` - EDGE., must be one of ["INITIAL_PLACEHOLDER", "CLOUD", "CUST", "HUMAN_CLOUD_ENSEMBLE", "ALG", "ALG_REC", "ALG_UNCLEAR", "EDGE", ] # noqa: E501 + value (str):, must be one of ["INITIAL_PLACEHOLDER", "CLOUD", "CUST", "HUMAN_CLOUD_ENSEMBLE", "ALG", "ALG_REC", "ALG_UNCLEAR", "EDGE", ] # 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. @@ -200,10 +200,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): * `INITIAL_PLACEHOLDER` - InitialPlaceholder * `CLOUD` - HumanCloud * `CUST` - HumanCustomer * `HUMAN_CLOUD_ENSEMBLE` - HumanCloudEnsemble * `ALG` - Algorithm * `ALG_REC` - AlgorithmReconciled * `ALG_UNCLEAR` - AlgorithmUnclear * `EDGE` - EDGE., must be one of ["INITIAL_PLACEHOLDER", "CLOUD", "CUST", "HUMAN_CLOUD_ENSEMBLE", "ALG", "ALG_REC", "ALG_UNCLEAR", "EDGE", ] # noqa: E501 + args[0] (str):, must be one of ["INITIAL_PLACEHOLDER", "CLOUD", "CUST", "HUMAN_CLOUD_ENSEMBLE", "ALG", "ALG_REC", "ALG_UNCLEAR", "EDGE", ] # noqa: E501 Keyword Args: - value (str): * `INITIAL_PLACEHOLDER` - InitialPlaceholder * `CLOUD` - HumanCloud * `CUST` - HumanCustomer * `HUMAN_CLOUD_ENSEMBLE` - HumanCloudEnsemble * `ALG` - Algorithm * `ALG_REC` - AlgorithmReconciled * `ALG_UNCLEAR` - AlgorithmUnclear * `EDGE` - EDGE., must be one of ["INITIAL_PLACEHOLDER", "CLOUD", "CUST", "HUMAN_CLOUD_ENSEMBLE", "ALG", "ALG_REC", "ALG_UNCLEAR", "EDGE", ] # noqa: E501 + value (str):, must be one of ["INITIAL_PLACEHOLDER", "CLOUD", "CUST", "HUMAN_CLOUD_ENSEMBLE", "ALG", "ALG_REC", "ALG_UNCLEAR", "EDGE", ] # 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 25add8f1..e0937650 100644 --- a/generated/groundlight_openapi_client/model/text_recognition_result.py +++ b/generated/groundlight_openapi_client/model/text_recognition_result.py @@ -53,19 +53,7 @@ class TextRecognitionResult(ModelNormal): as additional properties values. """ - allowed_values = { - ("source",): { - "STILL_PROCESSING": "STILL_PROCESSING", - "CLOUD": "CLOUD", - "USER": "USER", - "CLOUD_ENSEMBLE": "CLOUD_ENSEMBLE", - "ALGORITHM": "ALGORITHM", - "EDGE": "EDGE", - }, - ("result_type",): { - "TEXT_RECOGNITION": "text_recognition", - }, - } + allowed_values = {} validations = { ("confidence",): { @@ -178,7 +166,7 @@ def _from_openapi_data(cls, text, truncated, *args, **kwargs): # noqa: E501 _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 "text_recognition" # noqa: E501 + result_type (str): [optional] # noqa: E501 from_edge (bool): [optional] # noqa: E501 """ @@ -272,7 +260,7 @@ def __init__(self, text, truncated, *args, **kwargs): # noqa: E501 _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 "text_recognition" # noqa: E501 + result_type (str): [optional] # noqa: E501 from_edge (bool): [optional] # noqa: E501 """ diff --git a/generated/groundlight_openapi_client/model/verb_enum.py b/generated/groundlight_openapi_client/model/verb_enum.py index 8d138449..789dd77c 100644 --- a/generated/groundlight_openapi_client/model/verb_enum.py +++ b/generated/groundlight_openapi_client/model/verb_enum.py @@ -105,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): * `ANSWERED_CONSECUTIVELY` - ANSWERED_CONSECUTIVELY * `ANSWERED_WITHIN_TIME` - ANSWERED_WITHIN_TIME * `CHANGED_TO` - CHANGED_TO * `NO_CHANGE` - NO_CHANGE * `NO_QUERIES` - NO_QUERIES., must be one of ["ANSWERED_CONSECUTIVELY", "ANSWERED_WITHIN_TIME", "CHANGED_TO", "NO_CHANGE", "NO_QUERIES", ] # noqa: E501 + args[0] (str):, must be one of ["ANSWERED_CONSECUTIVELY", "ANSWERED_WITHIN_TIME", "CHANGED_TO", "NO_CHANGE", "NO_QUERIES", ] # noqa: E501 Keyword Args: - value (str): * `ANSWERED_CONSECUTIVELY` - ANSWERED_CONSECUTIVELY * `ANSWERED_WITHIN_TIME` - ANSWERED_WITHIN_TIME * `CHANGED_TO` - CHANGED_TO * `NO_CHANGE` - NO_CHANGE * `NO_QUERIES` - NO_QUERIES., must be one of ["ANSWERED_CONSECUTIVELY", "ANSWERED_WITHIN_TIME", "CHANGED_TO", "NO_CHANGE", "NO_QUERIES", ] # noqa: E501 + value (str):, must be one of ["ANSWERED_CONSECUTIVELY", "ANSWERED_WITHIN_TIME", "CHANGED_TO", "NO_CHANGE", "NO_QUERIES", ] # 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. @@ -197,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): * `ANSWERED_CONSECUTIVELY` - ANSWERED_CONSECUTIVELY * `ANSWERED_WITHIN_TIME` - ANSWERED_WITHIN_TIME * `CHANGED_TO` - CHANGED_TO * `NO_CHANGE` - NO_CHANGE * `NO_QUERIES` - NO_QUERIES., must be one of ["ANSWERED_CONSECUTIVELY", "ANSWERED_WITHIN_TIME", "CHANGED_TO", "NO_CHANGE", "NO_QUERIES", ] # noqa: E501 + args[0] (str):, must be one of ["ANSWERED_CONSECUTIVELY", "ANSWERED_WITHIN_TIME", "CHANGED_TO", "NO_CHANGE", "NO_QUERIES", ] # noqa: E501 Keyword Args: - value (str): * `ANSWERED_CONSECUTIVELY` - ANSWERED_CONSECUTIVELY * `ANSWERED_WITHIN_TIME` - ANSWERED_WITHIN_TIME * `CHANGED_TO` - CHANGED_TO * `NO_CHANGE` - NO_CHANGE * `NO_QUERIES` - NO_QUERIES., must be one of ["ANSWERED_CONSECUTIVELY", "ANSWERED_WITHIN_TIME", "CHANGED_TO", "NO_CHANGE", "NO_QUERIES", ] # noqa: E501 + value (str):, must be one of ["ANSWERED_CONSECUTIVELY", "ANSWERED_WITHIN_TIME", "CHANGED_TO", "NO_CHANGE", "NO_QUERIES", ] # 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/models/__init__.py b/generated/groundlight_openapi_client/models/__init__.py index 705cc1c0..8ed6e15f 100644 --- a/generated/groundlight_openapi_client/models/__init__.py +++ b/generated/groundlight_openapi_client/models/__init__.py @@ -39,6 +39,7 @@ 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_enum import LabelEnum 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 480c1e0d..9de15c31 100644 --- a/generated/model.py +++ b/generated/model.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: public-api.yaml -# timestamp: 2025-03-31T23:28:33+00:00 +# timestamp: 2025-04-02T21:22:01+00:00 from __future__ import annotations @@ -11,16 +11,6 @@ from pydantic import AnyUrl, BaseModel, Field, RootModel, confloat, conint, constr -class AnnotationsRequestedEnum(str, Enum): - """ - * `BINARY_CLASSIFICATION` - Binary Classification - * `BOUNDING_BOXES` - Bounding Boxes - """ - - BINARY_CLASSIFICATION = "BINARY_CLASSIFICATION" - BOUNDING_BOXES = "BOUNDING_BOXES" - - class BBoxGeometry(BaseModel): """ Mixin for serializers to handle data in the StrictBaseModel format @@ -49,6 +39,16 @@ class BlankEnum(Enum): field_ = "" +class Condition(BaseModel): + verb: str + parameters: Dict[str, Any] + + +class ConditionRequest(BaseModel): + verb: str + parameters: Dict[str, Any] + + class DetectorGroup(BaseModel): id: str name: constr(max_length=100) @@ -76,16 +76,6 @@ class EdgeModelInfo(BaseModel): predictor_metadata: Optional[Any] = None -class EscalationTypeEnum(str, Enum): - """ - * `STANDARD` - STANDARD - * `NO_HUMAN_LABELING` - NO_HUMAN_LABELING - """ - - STANDARD = "STANDARD" - NO_HUMAN_LABELING = "NO_HUMAN_LABELING" - - class ImageQueryTypeEnum(str, Enum): image_query = "image_query" @@ -161,28 +151,6 @@ class SnoozeTimeUnitEnum(str, Enum): SECONDS = "SECONDS" -class SourceEnum(str, Enum): - """ - * `INITIAL_PLACEHOLDER` - InitialPlaceholder - * `CLOUD` - HumanCloud - * `CUST` - HumanCustomer - * `HUMAN_CLOUD_ENSEMBLE` - HumanCloudEnsemble - * `ALG` - Algorithm - * `ALG_REC` - AlgorithmReconciled - * `ALG_UNCLEAR` - AlgorithmUnclear - * `EDGE` - EDGE - """ - - INITIAL_PLACEHOLDER = "INITIAL_PLACEHOLDER" - CLOUD = "CLOUD" - CUST = "CUST" - HUMAN_CLOUD_ENSEMBLE = "HUMAN_CLOUD_ENSEMBLE" - ALG = "ALG" - ALG_REC = "ALG_REC" - ALG_UNCLEAR = "ALG_UNCLEAR" - EDGE = "EDGE" - - class StatusEnum(str, Enum): """ * `ON` - ON @@ -193,22 +161,6 @@ class StatusEnum(str, Enum): OFF = "OFF" -class VerbEnum(str, Enum): - """ - * `ANSWERED_CONSECUTIVELY` - ANSWERED_CONSECUTIVELY - * `ANSWERED_WITHIN_TIME` - ANSWERED_WITHIN_TIME - * `CHANGED_TO` - CHANGED_TO - * `NO_CHANGE` - NO_CHANGE - * `NO_QUERIES` - NO_QUERIES - """ - - ANSWERED_CONSECUTIVELY = "ANSWERED_CONSECUTIVELY" - ANSWERED_WITHIN_TIME = "ANSWERED_WITHIN_TIME" - CHANGED_TO = "CHANGED_TO" - NO_CHANGE = "NO_CHANGE" - NO_QUERIES = "NO_QUERIES" - - class WebhookAction(BaseModel): url: AnyUrl include_image: Optional[bool] = None @@ -227,87 +179,46 @@ class WebhookActionRequest(BaseModel): last_failed_at: Optional[datetime] = None -class Source(str, Enum): - STILL_PROCESSING = "STILL_PROCESSING" - CLOUD = "CLOUD" - USER = "USER" - CLOUD_ENSEMBLE = "CLOUD_ENSEMBLE" - ALGORITHM = "ALGORITHM" - EDGE = "EDGE" - - -class ResultType(str, Enum): - binary_classification = "binary_classification" - - -class Label(str, Enum): - YES = "YES" - NO = "NO" - UNCLEAR = "UNCLEAR" - - class BinaryClassificationResult(BaseModel): confidence: Optional[confloat(ge=0.0, le=1.0)] = None - source: Optional[Source] = None - result_type: Optional[ResultType] = None + source: Optional[str] = None + result_type: Optional[str] = None from_edge: Optional[bool] = None - label: Label - - -class ResultType2(str, Enum): - counting = "counting" + label: str class CountingResult(BaseModel): confidence: Optional[confloat(ge=0.0, le=1.0)] = None - source: Optional[Source] = None - result_type: Optional[ResultType2] = None + source: Optional[str] = None + result_type: Optional[str] = None from_edge: Optional[bool] = None count: Optional[conint(ge=0)] = Field(...) greater_than_max: Optional[bool] = None -class ResultType3(str, Enum): - multi_classification = "multi_classification" - - class MultiClassificationResult(BaseModel): confidence: Optional[confloat(ge=0.0, le=1.0)] = None - source: Optional[Source] = None - result_type: Optional[ResultType3] = None + source: Optional[str] = None + result_type: Optional[str] = None from_edge: Optional[bool] = None label: str -class ResultType4(str, Enum): - text_recognition = "text_recognition" - - class TextRecognitionResult(BaseModel): confidence: Optional[confloat(ge=0.0, le=1.0)] = None - source: Optional[Source] = None - result_type: Optional[ResultType4] = None + source: Optional[str] = None + result_type: Optional[str] = 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 + source: Optional[str] = None + result_type: Optional[str] = None from_edge: Optional[bool] = None - label: Label1 + label: str class CountModeConfiguration(BaseModel): @@ -344,6 +255,41 @@ class ActionList(RootModel[List[Action]]): root: List[Action] +class AnnotationsRequestedEnum(str, Enum): + BINARY_CLASSIFICATION = "BINARY_CLASSIFICATION" + BOUNDING_BOXES = "BOUNDING_BOXES" + + +class EscalationTypeEnum(str, Enum): + STANDARD = "STANDARD" + NO_HUMAN_LABELING = "NO_HUMAN_LABELING" + + +class SourceEnum(str, Enum): + INITIAL_PLACEHOLDER = "INITIAL_PLACEHOLDER" + CLOUD = "CLOUD" + CUST = "CUST" + HUMAN_CLOUD_ENSEMBLE = "HUMAN_CLOUD_ENSEMBLE" + ALG = "ALG" + ALG_REC = "ALG_REC" + ALG_UNCLEAR = "ALG_UNCLEAR" + EDGE = "EDGE" + + +class VerbEnum(str, Enum): + ANSWERED_CONSECUTIVELY = "ANSWERED_CONSECUTIVELY" + ANSWERED_WITHIN_TIME = "ANSWERED_WITHIN_TIME" + CHANGED_TO = "CHANGED_TO" + NO_CHANGE = "NO_CHANGE" + NO_QUERIES = "NO_QUERIES" + + +class LabelEnum(str, Enum): + YES = "YES" + NO = "NO" + UNCLEAR = "UNCLEAR" + + class AllNotes(BaseModel): """ Serializes all notes for a given detector, grouped by type as listed in UserProfile.NoteCategoryChoices @@ -354,16 +300,6 @@ class AllNotes(BaseModel): GL: List[Note] -class Condition(BaseModel): - verb: VerbEnum - parameters: Dict[str, Any] - - -class ConditionRequest(BaseModel): - verb: VerbEnum - parameters: Dict[str, Any] - - class Detector(BaseModel): """ Groundlight Detectors provide answers to natural language questions about images. @@ -389,16 +325,10 @@ class Detector(BaseModel): 30.0, description="How long Groundlight will attempt to generate a confident prediction" ) metadata: Optional[Dict[str, Any]] = Field(..., description="Metadata about the detector.") - mode: ModeEnum + mode: str mode_configuration: Optional[Dict[str, Any]] = Field(...) status: Optional[Union[StatusEnum, BlankEnum]] = None - escalation_type: Optional[EscalationTypeEnum] = Field( - None, - description=( - "Category that define internal proccess for labeling image queries\n\n* `STANDARD` - STANDARD\n*" - " `NO_HUMAN_LABELING` - NO_HUMAN_LABELING" - ), - ) + escalation_type: Optional[str] = None class DetectorCreationInputRequest(BaseModel): @@ -483,10 +413,10 @@ class LabelValue(BaseModel): ..., description="Return a human-readable class name for this label (e.g. YES/NO)" ) rois: Optional[List[ROI]] = None - annotations_requested: List[AnnotationsRequestedEnum] + annotations_requested: List[str] created_at: datetime detector_id: Optional[int] = Field(...) - source: SourceEnum + source: str text: Optional[str] = Field(..., description="Text annotations") @@ -532,13 +462,7 @@ class PatchedDetectorRequest(BaseModel): 30.0, description="How long Groundlight will attempt to generate a confident prediction" ) status: Optional[Union[StatusEnum, BlankEnum]] = None - escalation_type: Optional[EscalationTypeEnum] = Field( - None, - description=( - "Category that define internal proccess for labeling image queries\n\n* `STANDARD` - STANDARD\n*" - " `NO_HUMAN_LABELING` - NO_HUMAN_LABELING" - ), - ) + escalation_type: Optional[constr(min_length=1)] = None class Rule(BaseModel): diff --git a/generated/test/test_label_enum.py b/generated/test/test_label_enum.py new file mode 100644 index 00000000..bf0ac1e2 --- /dev/null +++ b/generated/test/test_label_enum.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.label_enum import LabelEnum + + +class TestLabelEnum(unittest.TestCase): + """LabelEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testLabelEnum(self): + """Test LabelEnum""" + # FIXME: construct object with mandatory attributes with example values + # model = LabelEnum() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/spec/public-api.yaml b/spec/public-api.yaml index 1859dbf0..a395e58b 100644 --- a/spec/public-api.yaml +++ b/spec/public-api.yaml @@ -756,14 +756,6 @@ components: required: - CUSTOMER - GL - AnnotationsRequestedEnum: - enum: - - BINARY_CLASSIFICATION - - BOUNDING_BOXES - type: string - description: |- - * `BINARY_CLASSIFICATION` - Binary Classification - * `BOUNDING_BOXES` - Bounding Boxes BBoxGeometry: type: object description: Mixin for serializers to handle data in the StrictBaseModel format @@ -823,7 +815,7 @@ components: type: object properties: verb: - $ref: '#/components/schemas/VerbEnum' + type: string parameters: type: object additionalProperties: {} @@ -834,7 +826,7 @@ components: type: object properties: verb: - $ref: '#/components/schemas/VerbEnum' + type: string parameters: type: object additionalProperties: {} @@ -898,8 +890,7 @@ components: readOnly: true description: Metadata about the detector. mode: - allOf: - - $ref: '#/components/schemas/ModeEnum' + type: string readOnly: true mode_configuration: type: object @@ -911,13 +902,7 @@ components: - $ref: '#/components/schemas/StatusEnum' - $ref: '#/components/schemas/BlankEnum' escalation_type: - allOf: - - $ref: '#/components/schemas/EscalationTypeEnum' - description: |- - Category that define internal proccess for labeling image queries - - * `STANDARD` - STANDARD - * `NO_HUMAN_LABELING` - NO_HUMAN_LABELING + type: string required: - created_at - group_name @@ -1040,14 +1025,6 @@ components: pipeline_config: {} oodd_pipeline_config: {} predictor_metadata: {} - EscalationTypeEnum: - enum: - - STANDARD - - NO_HUMAN_LABELING - type: string - description: |- - * `STANDARD` - STANDARD - * `NO_HUMAN_LABELING` - NO_HUMAN_LABELING ImageQuery: type: object description: ImageQuery objects are the answers to natural language questions @@ -1161,13 +1138,7 @@ components: annotations_requested: type: array items: - allOf: - - $ref: '#/components/schemas/AnnotationsRequestedEnum' - description: |- - The type of annotation requested - - * `BINARY_CLASSIFICATION` - Binary Classification - * `BOUNDING_BOXES` - Bounding Boxes + type: string readOnly: true created_at: type: string @@ -1178,8 +1149,7 @@ components: nullable: true readOnly: true source: - allOf: - - $ref: '#/components/schemas/SourceEnum' + type: string readOnly: true text: type: string @@ -1214,13 +1184,13 @@ components: - image_query_id - label ModeEnum: + type: string enum: - BINARY - COUNT - MULTI_CLASS - TEXT - BOUNDING_BOX - type: string Note: type: object properties: @@ -1354,13 +1324,8 @@ components: - $ref: '#/components/schemas/StatusEnum' - $ref: '#/components/schemas/BlankEnum' escalation_type: - allOf: - - $ref: '#/components/schemas/EscalationTypeEnum' - description: |- - Category that define internal proccess for labeling image queries - - * `STANDARD` - STANDARD - * `NO_HUMAN_LABELING` - NO_HUMAN_LABELING + type: string + minLength: 1 x-internal: true PayloadTemplate: type: object @@ -1524,26 +1489,6 @@ components: * `HOURS` - HOURS * `MINUTES` - MINUTES * `SECONDS` - SECONDS - SourceEnum: - enum: - - INITIAL_PLACEHOLDER - - CLOUD - - CUST - - HUMAN_CLOUD_ENSEMBLE - - ALG - - ALG_REC - - ALG_UNCLEAR - - EDGE - type: string - description: |- - * `INITIAL_PLACEHOLDER` - InitialPlaceholder - * `CLOUD` - HumanCloud - * `CUST` - HumanCustomer - * `HUMAN_CLOUD_ENSEMBLE` - HumanCloudEnsemble - * `ALG` - Algorithm - * `ALG_REC` - AlgorithmReconciled - * `ALG_UNCLEAR` - AlgorithmUnclear - * `EDGE` - EDGE StatusEnum: enum: - 'ON' @@ -1552,20 +1497,6 @@ components: description: |- * `ON` - ON * `OFF` - OFF - VerbEnum: - enum: - - ANSWERED_CONSECUTIVELY - - ANSWERED_WITHIN_TIME - - CHANGED_TO - - NO_CHANGE - - NO_QUERIES - type: string - description: |- - * `ANSWERED_CONSECUTIVELY` - ANSWERED_CONSECUTIVELY - * `ANSWERED_WITHIN_TIME` - ANSWERED_WITHIN_TIME - * `CHANGED_TO` - CHANGED_TO - * `NO_CHANGE` - NO_CHANGE - * `NO_QUERIES` - NO_QUERIES WebhookAction: type: object properties: @@ -1626,25 +1557,12 @@ components: nullable: true source: type: string - enum: - - STILL_PROCESSING - - CLOUD - - USER - - CLOUD_ENSEMBLE - - ALGORITHM - - EDGE result_type: type: string - enum: - - binary_classification from_edge: type: boolean label: type: string - enum: - - 'YES' - - 'NO' - - UNCLEAR required: - label CountingResult: @@ -1658,17 +1576,8 @@ components: nullable: true source: type: string - enum: - - STILL_PROCESSING - - CLOUD - - USER - - CLOUD_ENSEMBLE - - ALGORITHM - - EDGE result_type: type: string - enum: - - counting from_edge: type: boolean count: @@ -1690,17 +1599,8 @@ components: nullable: true source: type: string - enum: - - STILL_PROCESSING - - CLOUD - - USER - - CLOUD_ENSEMBLE - - ALGORITHM - - EDGE result_type: type: string - enum: - - multi_classification from_edge: type: boolean label: @@ -1719,17 +1619,8 @@ components: nullable: true source: type: string - enum: - - STILL_PROCESSING - - CLOUD - - USER - - CLOUD_ENSEMBLE - - ALGORITHM - - EDGE result_type: type: string - enum: - - text_recognition from_edge: type: boolean text: @@ -1751,25 +1642,12 @@ components: 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: @@ -1841,6 +1719,41 @@ components: type: array items: $ref: '#/components/schemas/Action' + AnnotationsRequestedEnum: + type: string + enum: + - BINARY_CLASSIFICATION + - BOUNDING_BOXES + EscalationTypeEnum: + type: string + enum: + - STANDARD + - NO_HUMAN_LABELING + SourceEnum: + type: string + enum: + - INITIAL_PLACEHOLDER + - CLOUD + - CUST + - HUMAN_CLOUD_ENSEMBLE + - ALG + - ALG_REC + - ALG_UNCLEAR + - EDGE + VerbEnum: + type: string + enum: + - ANSWERED_CONSECUTIVELY + - ANSWERED_WITHIN_TIME + - CHANGED_TO + - NO_CHANGE + - NO_QUERIES + LabelEnum: + type: string + enum: + - 'YES' + - 'NO' + - UNCLEAR securitySchemes: ApiToken: name: x-api-token @@ -1854,4 +1767,4 @@ servers: - url: https://device.positronix.ai/device-api description: Device Prod - url: https://device.integ.positronix.ai/device-api - description: Device Integ \ No newline at end of file + description: Device Integ diff --git a/src/groundlight/binary_labels.py b/src/groundlight/binary_labels.py index 557a4245..5264ebcd 100644 --- a/src/groundlight/binary_labels.py +++ b/src/groundlight/binary_labels.py @@ -8,12 +8,12 @@ from enum import Enum from typing import Union -from model import Detector, ImageQuery, Label +from model import Detector, ImageQuery, LabelEnum logger = logging.getLogger(__name__) -VALID_DISPLAY_LABELS = {Label.YES, Label.NO, Label.UNCLEAR} +VALID_DISPLAY_LABELS = {LabelEnum.YES, LabelEnum.NO, LabelEnum.UNCLEAR} class DeprecatedLabel(str, Enum): @@ -34,22 +34,22 @@ class DeprecatedLabel(str, Enum): def convert_internal_label_to_display( context: Union[ImageQuery, Detector, str], # pylint: disable=unused-argument label: str, -) -> Union[Label, str]: +) -> Union[LabelEnum, str]: """Convert a label that comes from our API into the label string enum that we show to the user. NOTE: We return UPPERCASE label strings to the user, unless there is a custom label (which shouldn't be happening at this time). """ # NOTE: We should be able to do nothing here now, keeping for radiation proofing - if not isinstance(label, str) and not isinstance(label, Label): + if not isinstance(label, str) and not isinstance(label, LabelEnum): raise ValueError(f"Expected a string label, but got {label} of type {type(label)}") upper = label.upper() - if upper in {Label.YES, DeprecatedLabel.PASS}: - return Label.YES - if upper in {Label.NO, DeprecatedLabel.FAIL}: - return Label.NO - if upper in {Label.UNCLEAR, DeprecatedLabel.NEEDS_REVIEW, DeprecatedLabel.UNSURE}: - return Label.UNCLEAR + if upper in {LabelEnum.YES, DeprecatedLabel.PASS}: + return LabelEnum.YES + if upper in {LabelEnum.NO, DeprecatedLabel.FAIL}: + return LabelEnum.NO + if upper in {LabelEnum.UNCLEAR, DeprecatedLabel.NEEDS_REVIEW, DeprecatedLabel.UNSURE}: + return LabelEnum.UNCLEAR logger.warning(f"Unrecognized internal label {label} - leaving it alone as a string.") return label