diff --git a/generated/README.md b/generated/README.md index 4a84c1f2..086d2c24 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, }, 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/InlineResponse2001EvaluationResults.md b/generated/docs/InlineResponse2001EvaluationResults.md index 01f845e5..ed507395 100644 --- a/generated/docs/InlineResponse2001EvaluationResults.md +++ b/generated/docs/InlineResponse2001EvaluationResults.md @@ -7,11 +7,11 @@ Name | Type | Description | Notes **eval_timestamp** | **datetime** | | [optional] **total_ground_truth_examples** | **int, none_type** | | [optional] **kfold_pooled__balanced_accuracy** | **float** | | [optional] -**kfold_pooled__positive_accuracy** | **float** | | [optional] -**kfold_pooled__negative_accuracy** | **float** | | [optional] -**balanced_system_accuracies** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] -**positive_system_accuracies** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] -**negative_system_accuracies** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] +**kfold_pooled__positive_accuracy** | **float, none_type** | | [optional] +**kfold_pooled__negative_accuracy** | **float, none_type** | | [optional] +**balanced_system_accuracies** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [optional] +**positive_system_accuracies** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [optional] +**negative_system_accuracies** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, 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/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/inline_response2001_evaluation_results.py b/generated/groundlight_openapi_client/model/inline_response2001_evaluation_results.py index 987a8fcc..e3221b58 100644 --- a/generated/groundlight_openapi_client/model/inline_response2001_evaluation_results.py +++ b/generated/groundlight_openapi_client/model/inline_response2001_evaluation_results.py @@ -94,16 +94,25 @@ def openapi_types(): none_type, ), # noqa: E501 "kfold_pooled__balanced_accuracy": (float,), # noqa: E501 - "kfold_pooled__positive_accuracy": (float,), # noqa: E501 - "kfold_pooled__negative_accuracy": (float,), # noqa: E501 + "kfold_pooled__positive_accuracy": ( + float, + none_type, + ), # noqa: E501 + "kfold_pooled__negative_accuracy": ( + float, + none_type, + ), # noqa: E501 "balanced_system_accuracies": ( {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, + none_type, ), # noqa: E501 "positive_system_accuracies": ( {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, + none_type, ), # noqa: E501 "negative_system_accuracies": ( {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, + none_type, ), # noqa: E501 } @@ -165,11 +174,11 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 eval_timestamp (datetime): [optional] # noqa: E501 total_ground_truth_examples (int, none_type): [optional] # noqa: E501 kfold_pooled__balanced_accuracy (float): [optional] # noqa: E501 - kfold_pooled__positive_accuracy (float): [optional] # noqa: E501 - kfold_pooled__negative_accuracy (float): [optional] # noqa: E501 - balanced_system_accuracies ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - positive_system_accuracies ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - negative_system_accuracies ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + kfold_pooled__positive_accuracy (float, none_type): [optional] # noqa: E501 + kfold_pooled__negative_accuracy (float, none_type): [optional] # noqa: E501 + balanced_system_accuracies ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + positive_system_accuracies ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + negative_system_accuracies ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -257,11 +266,11 @@ def __init__(self, *args, **kwargs): # noqa: E501 eval_timestamp (datetime): [optional] # noqa: E501 total_ground_truth_examples (int, none_type): [optional] # noqa: E501 kfold_pooled__balanced_accuracy (float): [optional] # noqa: E501 - kfold_pooled__positive_accuracy (float): [optional] # noqa: E501 - kfold_pooled__negative_accuracy (float): [optional] # noqa: E501 - balanced_system_accuracies ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - positive_system_accuracies ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - negative_system_accuracies ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + kfold_pooled__positive_accuracy (float, none_type): [optional] # noqa: E501 + kfold_pooled__negative_accuracy (float, none_type): [optional] # noqa: E501 + balanced_system_accuracies ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + positive_system_accuracies ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + negative_system_accuracies ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) 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/model.py b/generated/model.py index 480c1e0d..bf04bc1a 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-02T20:50:30+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,35 @@ 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 AllNotes(BaseModel): """ Serializes all notes for a given detector, grouped by type as listed in UserProfile.NoteCategoryChoices @@ -354,16 +294,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 +319,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 +407,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 +456,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/spec/public-api.yaml b/spec/public-api.yaml index 1859dbf0..528d7cc2 100644 --- a/spec/public-api.yaml +++ b/spec/public-api.yaml @@ -407,18 +407,23 @@ paths: kfold_pooled__positive_accuracy: type: number format: float + nullable: true kfold_pooled__negative_accuracy: type: number format: float + nullable: true balanced_system_accuracies: type: object additionalProperties: true + nullable: true positive_system_accuracies: type: object additionalProperties: true + nullable: true negative_system_accuracies: type: object additionalProperties: true + nullable: true nullable: true description: '' /v1/edge/fetch-model-urls/{detector_id}/: @@ -756,14 +761,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 +820,7 @@ components: type: object properties: verb: - $ref: '#/components/schemas/VerbEnum' + type: string parameters: type: object additionalProperties: {} @@ -834,7 +831,7 @@ components: type: object properties: verb: - $ref: '#/components/schemas/VerbEnum' + type: string parameters: type: object additionalProperties: {} @@ -898,8 +895,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 +907,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 +1030,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 +1143,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 +1154,7 @@ components: nullable: true readOnly: true source: - allOf: - - $ref: '#/components/schemas/SourceEnum' + type: string readOnly: true text: type: string @@ -1214,13 +1189,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 +1329,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 +1494,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 +1502,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 +1562,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 +1581,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 +1604,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 +1624,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 +1647,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 +1724,35 @@ 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 securitySchemes: ApiToken: name: x-api-token @@ -1854,4 +1766,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..bf096084 100644 --- a/src/groundlight/binary_labels.py +++ b/src/groundlight/binary_labels.py @@ -8,11 +8,17 @@ from enum import Enum from typing import Union -from model import Detector, ImageQuery, Label +from model import Detector, ImageQuery logger = logging.getLogger(__name__) +class Label(str, Enum): + YES = "YES" + NO = "NO" + UNCLEAR = "UNCLEAR" + + VALID_DISPLAY_LABELS = {Label.YES, Label.NO, Label.UNCLEAR} diff --git a/src/groundlight/experimental_api.py b/src/groundlight/experimental_api.py index 73511dcc..98c3754e 100644 --- a/src/groundlight/experimental_api.py +++ b/src/groundlight/experimental_api.py @@ -24,13 +24,11 @@ from groundlight_openapi_client.model.condition_request import ConditionRequest from groundlight_openapi_client.model.count_mode_configuration import CountModeConfiguration from groundlight_openapi_client.model.detector_group_request import DetectorGroupRequest -from groundlight_openapi_client.model.escalation_type_enum import EscalationTypeEnum from groundlight_openapi_client.model.multi_class_mode_configuration import MultiClassModeConfiguration from groundlight_openapi_client.model.patched_detector_request import PatchedDetectorRequest from groundlight_openapi_client.model.payload_template_request import PayloadTemplateRequest from groundlight_openapi_client.model.rule_request import RuleRequest from groundlight_openapi_client.model.status_enum import StatusEnum -from groundlight_openapi_client.model.verb_enum import VerbEnum from groundlight_openapi_client.model.webhook_action_request import WebhookActionRequest from model import ( ROI, @@ -302,7 +300,7 @@ def create_alert( # pylint: disable=too-many-locals, too-many-arguments # noqa name=name, enabled=enabled, action=actions, - condition=ConditionRequest(verb=VerbEnum(condition.verb), parameters=condition.parameters), + condition=ConditionRequest(verb=condition.verb, parameters=condition.parameters), snooze_time_enabled=snooze_time_enabled, snooze_time_value=snooze_time_value, snooze_time_unit=snooze_time_unit, @@ -318,7 +316,7 @@ def create_rule( # pylint: disable=too-many-locals # noqa: PLR0913 channel: Union[str, ChannelEnum], recipient: str, *, - alert_on: Union[str, VerbEnum] = "CHANGED_TO", + alert_on: str = "CHANGED_TO", enabled: bool = True, include_image: bool = False, condition_parameters: Union[str, dict, None] = None, @@ -393,8 +391,6 @@ def create_rule( # pylint: disable=too-many-locals # noqa: PLR0913 if condition_parameters is None: condition_parameters = {} - if isinstance(alert_on, str): - alert_on = VerbEnum(alert_on.upper()) if isinstance(channel, str): channel = ChannelEnum(channel.upper()) if isinstance(condition_parameters, str): @@ -839,7 +835,7 @@ def update_detector_escalation_type(self, detector: Union[str, Detector], escala raise ValueError("escalation_type must be either 'STANDARD' or 'NO_HUMAN_LABELING'") self.detectors_api.update_detector( detector, - patched_detector_request=PatchedDetectorRequest(escalation_type=EscalationTypeEnum(escalation_type)), + patched_detector_request=PatchedDetectorRequest(escalation_type=escalation_type), ) def create_counting_detector( # noqa: PLR0913 # pylint: disable=too-many-arguments, too-many-locals diff --git a/src/groundlight/internalapi.py b/src/groundlight/internalapi.py index 10e1791d..7c3c6849 100644 --- a/src/groundlight/internalapi.py +++ b/src/groundlight/internalapi.py @@ -12,7 +12,7 @@ import requests from groundlight_openapi_client.api_client import ApiClient, ApiException -from model import Detector, ImageQuery, Source +from model import Detector, ImageQuery from groundlight.status_codes import is_ok from groundlight.version import get_version @@ -76,7 +76,7 @@ def iq_is_answered(iq: ImageQuery) -> bool: """ if not iq.result or not iq.result.source: return False - if (iq.result.source == Source.STILL_PROCESSING) or (iq.result.source is None): # Should never be None + if (iq.result.source == "STILL_PROCESSING") or (iq.result.source is None): # Should never be None return False return True diff --git a/test/unit/test_experimental.py b/test/unit/test_experimental.py index 2dacdccc..0b597649 100644 --- a/test/unit/test_experimental.py +++ b/test/unit/test_experimental.py @@ -60,10 +60,10 @@ def test_update_detector_escalation_type(gl_experimental: ExperimentalApi): detector = gl_experimental.get_or_create_detector(f"test {datetime.utcnow()}", "Is there a dog?") gl_experimental.update_detector_escalation_type(detector.id, "NO_HUMAN_LABELING") updated_detector = gl_experimental.get_detector(detector.id) - updated_detector.escalation_type.value == "NO_HUMAN_LABELING" + updated_detector.escalation_type == "NO_HUMAN_LABELING" gl_experimental.update_detector_escalation_type(detector.id, "STANDARD") updated_detector = gl_experimental.get_detector(detector.id) - updated_detector.escalation_type.value == "STANDARD" + updated_detector.escalation_type == "STANDARD" @pytest.mark.skip(