Skip to content

Commit be6d1d3

Browse files
CoreyEWoodAuto-format Bot
andauthored
Allow specifying an ID when submitting an image query (#271)
Adds optional parameter `image_query_id` to methods which allow submitting an image query. Adds tests for new parameter. Updates generated code based on new spec. --------- Co-authored-by: Auto-format Bot <[email protected]>
1 parent 9820c18 commit be6d1d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+139
-110
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,13 @@ test-4edge: install ## Run tests against the prod API via the edge-endpoint (ne
4949
${PYTEST} ${PROFILING_ARGS} ${TEST_ARGS} ${EDGE_FILTERS} test
5050

5151
test-local: install ## Run tests against a localhost API (needs GROUNDLIGHT_API_TOKEN and a local API server)
52-
GROUNDLIGHT_ENDPOINT="http://localhost:8000/" ${PYTEST} ${TEST_ARGS} ${CLOUD_FILTERS} test
52+
GROUNDLIGHT_ENDPOINT="http://localhost:8000/" $(MAKE) test
5353

5454
test-integ: install ## Run tests against the integ API server (needs GROUNDLIGHT_API_TOKEN)
55-
GROUNDLIGHT_ENDPOINT="https://api.integ.groundlight.ai/" ${PYTEST} ${TEST_ARGS} ${CLOUD_FILTERS} test
55+
GROUNDLIGHT_ENDPOINT="https://api.integ.groundlight.ai/" $(MAKE) test
56+
57+
test-dev: install ## Run tests against a dev API server (needs GROUNDLIGHT_API_TOKEN and properly configured dns-hostmap)
58+
GROUNDLIGHT_ENDPOINT="https://api.dev.groundlight.ai/" $(MAKE) test
5659

5760
test-docs: install ## Run the example code and tests in our docs against the prod API (needs GROUNDLIGHT_API_TOKEN)
5861
${PYTEST} --markdown-docs ${TEST_ARGS} docs README.md

docs/docs/building-applications/7-edge.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ and for communicating with the Groundlight cloud service.
1414

1515
To use the edge endpoint, simply configure the Groundlight SDK to use the edge endpoint's URL instead of the cloud endpoint.
1616
All application logic will work seamlessly and unchanged with the Groundlight Edge Endpoint, except some ML answers will
17-
return much faster locally. The only visible difference is that image queries answered at the edge endpoint will have the prefix `iqe_` instead of `iq_` for image queries answered in the cloud. `iqe_` stands for "image query edge". Edge-originated
18-
image queries will not appear in the cloud dashboard.
17+
return much faster locally. Image queries answered at the edge endpoint will not appear in the cloud dashboard unless
18+
specifically configured to do so, in which case the edge prediction will not be reflected on the image query in the cloud.
1919

2020
## Configuring the Edge Endpoint
2121

generated/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Groundlight makes it simple to understand images. You can easily create computer
33

44
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
55

6-
- API version: 0.18.1
6+
- API version: 0.18.2
77
- Package version: 1.0.0
88
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
99

generated/docs/BinaryClassificationResult.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**label** | **str** | |
88
**confidence** | **float** | | [optional]
9-
**source** | **str** | Source is optional to support edge v0.2 | [optional]
9+
**source** | **str** | | [optional]
1010
**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]
1111

1212
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

generated/docs/CountingResult.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**count** | **int** | |
88
**confidence** | **float** | | [optional]
9-
**source** | **str** | Source is optional to support edge v0.2 | [optional]
9+
**source** | **str** | | [optional]
1010
**greater_than_max** | **bool** | | [optional]
1111
**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]
1212

generated/docs/ImageQueriesApi.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ Name | Type | Description | Notes
248248
249249

250250

251-
Submit an image query against a detector. You must use `\"Content-Type: image/jpeg\"` for the image data. For example: ```Bash $ curl https://api.groundlight.ai/device-api/v1/image-queries?detector_id=det_abc123 \\ --header \"Content-Type: image/jpeg\" \\ --data-binary @path/to/filename.jpeg ```
251+
Submit an image query against a detector. You must use `\"Content-Type: image/jpeg\"` or similar (image/png, image/webp, etc) for the image data. For example: ```Bash $ curl https://api.groundlight.ai/device-api/v1/image-queries?detector_id=det_abc123 \\ --header \"Content-Type: image/jpeg\" \\ --data-binary @path/to/filename.jpeg ```
252252

253253
### Example
254254

@@ -283,6 +283,7 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client:
283283
api_instance = image_queries_api.ImageQueriesApi(api_client)
284284
detector_id = "detector_id_example" # str | Choose a detector by its ID.
285285
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)
286+
image_query_id = "image_query_id_example" # str | The ID to assign to the created image query. (optional)
286287
inspection_id = "inspection_id_example" # str | Associate the image query with an inspection. (optional)
287288
metadata = "metadata_example" # str | A dictionary of custom key/value metadata to associate with the image query (limited to 1KB). (optional)
288289
patience_time = 3.14 # float | How long to wait for a confident response. (optional)
@@ -299,7 +300,7 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client:
299300
# example passing only required values which don't have defaults set
300301
# and optional values
301302
try:
302-
api_response = api_instance.submit_image_query(detector_id, human_review=human_review, 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)
303304
pprint(api_response)
304305
except groundlight_openapi_client.ApiException as e:
305306
print("Exception when calling ImageQueriesApi->submit_image_query: %s\n" % e)
@@ -312,6 +313,7 @@ Name | Type | Description | Notes
312313
------------- | ------------- | ------------- | -------------
313314
**detector_id** | **str**| Choose a detector by its ID. |
314315
**human_review** | **str**| If set to &#x60;DEFAULT&#x60;, use the regular escalation logic (i.e., send the image query for human review if the ML model is not confident). If set to &#x60;ALWAYS&#x60;, always send the image query for human review even if the ML model is confident. If set to &#x60;NEVER&#x60;, never send the image query for human review even if the ML model is not confident. | [optional]
316+
**image_query_id** | **str**| The ID to assign to the created image query. | [optional]
315317
**inspection_id** | **str**| Associate the image query with an inspection. | [optional]
316318
**metadata** | **str**| A dictionary of custom key/value metadata to associate with the image query (limited to 1KB). | [optional]
317319
**patience_time** | **float**| How long to wait for a confident response. | [optional]

generated/docs/LabelValue.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ Name | Type | Description | Notes
99
**annotations_requested** | **[bool, date, datetime, dict, float, int, list, str, none_type]** | | [readonly]
1010
**created_at** | **datetime** | | [readonly]
1111
**detector_id** | **int, none_type** | | [readonly]
12+
**source** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [readonly]
1213
**text** | **str, none_type** | Text annotations | [readonly]
1314
**rois** | [**[ROI], none_type**](ROI.md) | | [optional]
14-
**source** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] [readonly]
1515
**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]
1616

1717
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

generated/docs/MultiClassificationResult.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**label** | **str** | |
88
**confidence** | **float** | | [optional]
9-
**source** | **str** | Source is optional to support edge v0.2 | [optional]
9+
**source** | **str** | | [optional]
1010
**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]
1111

1212
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

generated/groundlight_openapi_client/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
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
77
8-
The version of the OpenAPI document: 0.18.1
8+
The version of the OpenAPI document: 0.18.2
99
1010
Generated by: https://openapi-generator.tech
1111
"""

generated/groundlight_openapi_client/api/actions_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
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
55
6-
The version of the OpenAPI document: 0.18.1
6+
The version of the OpenAPI document: 0.18.2
77
88
Generated by: https://openapi-generator.tech
99
"""

0 commit comments

Comments
 (0)