Skip to content

Commit 1bda6d3

Browse files
author
brandon
committed
Revert "require class_name for count mode detectors"
This reverts commit 4ed9694.
1 parent 4ed9694 commit 1bda6d3

File tree

8 files changed

+453
-503
lines changed

8 files changed

+453
-503
lines changed

generated/docs/CountModeConfiguration.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**class_name** | **str** | |
87
**max_count** | **int** | | [optional]
98
**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]
109

generated/docs/ImageQueriesApi.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client:
282282
# Create an instance of the API class
283283
api_instance = image_queries_api.ImageQueriesApi(api_client)
284284
detector_id = "detector_id_example" # str | Choose a detector by its ID.
285-
confidence_threshold = 0 # float | The confidence threshold for the image query. (optional)
286285
human_review = "human_review_example" # str | If set to `DEFAULT`, use the regular escalation logic (i.e., send the image query for human review if the ML model is not confident). If set to `ALWAYS`, always send the image query for human review even if the ML model is confident. If set to `NEVER`, never send the image query for human review even if the ML model is not confident. (optional)
287286
image_query_id = "image_query_id_example" # str | The ID to assign to the created image query. (optional)
288287
inspection_id = "inspection_id_example" # str | Associate the image query with an inspection. (optional)
@@ -301,7 +300,7 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client:
301300
# example passing only required values which don't have defaults set
302301
# and optional values
303302
try:
304-
api_response = api_instance.submit_image_query(detector_id, confidence_threshold=confidence_threshold, human_review=human_review, image_query_id=image_query_id, inspection_id=inspection_id, metadata=metadata, patience_time=patience_time, want_async=want_async, body=body)
303+
api_response = api_instance.submit_image_query(detector_id, human_review=human_review, image_query_id=image_query_id, inspection_id=inspection_id, metadata=metadata, patience_time=patience_time, want_async=want_async, body=body)
305304
pprint(api_response)
306305
except groundlight_openapi_client.ApiException as e:
307306
print("Exception when calling ImageQueriesApi->submit_image_query: %s\n" % e)
@@ -313,7 +312,6 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client:
313312
Name | Type | Description | Notes
314313
------------- | ------------- | ------------- | -------------
315314
**detector_id** | **str**| Choose a detector by its ID. |
316-
**confidence_threshold** | **float**| The confidence threshold for the image query. | [optional]
317315
**human_review** | **str**| If set to `DEFAULT`, use the regular escalation logic (i.e., send the image query for human review if the ML model is not confident). If set to `ALWAYS`, always send the image query for human review even if the ML model is confident. If set to `NEVER`, never send the image query for human review even if the ML model is not confident. | [optional]
318316
**image_query_id** | **str**| The ID to assign to the created image query. | [optional]
319317
**inspection_id** | **str**| Associate the image query with an inspection. | [optional]

generated/groundlight_openapi_client/api/image_queries_api.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ def __init__(self, api_client=None):
170170
params_map={
171171
"all": [
172172
"detector_id",
173-
"confidence_threshold",
174173
"human_review",
175174
"image_query_id",
176175
"inspection_id",
@@ -184,21 +183,13 @@ def __init__(self, api_client=None):
184183
],
185184
"nullable": [],
186185
"enum": [],
187-
"validation": [
188-
"confidence_threshold",
189-
],
186+
"validation": [],
190187
},
191188
root_map={
192-
"validations": {
193-
("confidence_threshold",): {
194-
"inclusive_maximum": 1,
195-
"inclusive_minimum": 0,
196-
},
197-
},
189+
"validations": {},
198190
"allowed_values": {},
199191
"openapi_types": {
200192
"detector_id": (str,),
201-
"confidence_threshold": (float,),
202193
"human_review": (str,),
203194
"image_query_id": (str,),
204195
"inspection_id": (str,),
@@ -209,7 +200,6 @@ def __init__(self, api_client=None):
209200
},
210201
"attribute_map": {
211202
"detector_id": "detector_id",
212-
"confidence_threshold": "confidence_threshold",
213203
"human_review": "human_review",
214204
"image_query_id": "image_query_id",
215205
"inspection_id": "inspection_id",
@@ -219,7 +209,6 @@ def __init__(self, api_client=None):
219209
},
220210
"location_map": {
221211
"detector_id": "query",
222-
"confidence_threshold": "query",
223212
"human_review": "query",
224213
"image_query_id": "query",
225214
"inspection_id": "query",
@@ -432,7 +421,6 @@ def submit_image_query(self, detector_id, **kwargs):
432421
detector_id (str): Choose a detector by its ID.
433422
434423
Keyword Args:
435-
confidence_threshold (float): The confidence threshold for the image query.. [optional]
436424
human_review (str): If set to `DEFAULT`, use the regular escalation logic (i.e., send the image query for human review if the ML model is not confident). If set to `ALWAYS`, always send the image query for human review even if the ML model is confident. If set to `NEVER`, never send the image query for human review even if the ML model is not confident.. [optional]
437425
image_query_id (str): The ID to assign to the created image query.. [optional]
438426
inspection_id (str): Associate the image query with an inspection.. [optional]

generated/groundlight_openapi_client/model/count_mode_configuration.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ def openapi_types():
9393
and the value is attribute type.
9494
"""
9595
return {
96-
"class_name": (str,), # noqa: E501
9796
"max_count": (int,), # noqa: E501
9897
}
9998

@@ -102,7 +101,6 @@ def discriminator():
102101
return None
103102

104103
attribute_map = {
105-
"class_name": "class_name", # noqa: E501
106104
"max_count": "max_count", # noqa: E501
107105
}
108106

@@ -112,12 +110,9 @@ def discriminator():
112110

113111
@classmethod
114112
@convert_js_args_to_python_args
115-
def _from_openapi_data(cls, class_name, *args, **kwargs): # noqa: E501
113+
def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
116114
"""CountModeConfiguration - a model defined in OpenAPI
117115
118-
Args:
119-
class_name (str):
120-
121116
Keyword Args:
122117
_check_type (bool): if True, values for parameters in openapi_types
123118
will be type checked and a TypeError will be
@@ -178,7 +173,6 @@ def _from_openapi_data(cls, class_name, *args, **kwargs): # noqa: E501
178173
self._configuration = _configuration
179174
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
180175

181-
self.class_name = class_name
182176
for var_name, var_value in kwargs.items():
183177
if (
184178
var_name not in self.attribute_map
@@ -201,12 +195,9 @@ def _from_openapi_data(cls, class_name, *args, **kwargs): # noqa: E501
201195
])
202196

203197
@convert_js_args_to_python_args
204-
def __init__(self, class_name, *args, **kwargs): # noqa: E501
198+
def __init__(self, *args, **kwargs): # noqa: E501
205199
"""CountModeConfiguration - a model defined in OpenAPI
206200
207-
Args:
208-
class_name (str):
209-
210201
Keyword Args:
211202
_check_type (bool): if True, values for parameters in openapi_types
212203
will be type checked and a TypeError will be
@@ -265,7 +256,6 @@ def __init__(self, class_name, *args, **kwargs): # noqa: E501
265256
self._configuration = _configuration
266257
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
267258

268-
self.class_name = class_name
269259
for var_name, var_value in kwargs.items():
270260
if (
271261
var_name not in self.attribute_map

generated/groundlight_openapi_client/model/counting_result.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ class CountingResult(ModelNormal):
6464
}
6565

6666
validations = {
67-
("count",): {
68-
"inclusive_minimum": 0,
69-
},
7067
("confidence",): {
7168
"inclusive_maximum": 1.0,
7269
"inclusive_minimum": 0.0,

generated/model.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: public-api.yaml
3-
# timestamp: 2024-12-07T00:51:02+00:00
3+
# timestamp: 2024-12-05T21:27:07+00:00
44

55
from __future__ import annotations
66

@@ -200,7 +200,7 @@ class BinaryClassificationResult(BaseModel):
200200
class CountingResult(BaseModel):
201201
confidence: Optional[confloat(ge=0.0, le=1.0)] = None
202202
source: Optional[Source] = None
203-
count: conint(ge=0)
203+
count: int
204204
greater_than_max: Optional[bool] = None
205205

206206

@@ -212,7 +212,6 @@ class MultiClassificationResult(BaseModel):
212212

213213
class CountModeConfiguration(BaseModel):
214214
max_count: Optional[conint(ge=1, le=50)] = None
215-
class_name: str
216215

217216

218217
class MultiClassModeConfiguration(BaseModel):

0 commit comments

Comments
 (0)