Skip to content

Commit

Permalink
Tests aren't passing because I didn't update the autogenerated code t…
Browse files Browse the repository at this point in the history
…o expect a new param
  • Loading branch information
sunildkumar committed Oct 16, 2023
1 parent 67e3edd commit 2477fd5
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 24 deletions.
5 changes: 4 additions & 1 deletion generated/docs/ImageQueriesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ Name | Type | Description | Notes
import time
import openapi_client
from openapi_client.api import image_queries_api
from openapi_client.model.bool import Bool
from openapi_client.model.image_query import ImageQuery
from pprint import pprint
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
Expand All @@ -207,6 +208,7 @@ with openapi_client.ApiClient(configuration) as api_client:
detector_id = "detector_id_example" # str | Choose a detector by its ID.
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)
patience_time = 3.14 # float | How long to wait for a confident response. (optional)
want_async = # Bool | If set to `true`, server returns response immediately and result is computed asynchronously. (optional)
body = open('@path/to/image.jpeg', 'rb') # file_type | (optional)

# example passing only required values which don't have defaults set
Expand All @@ -219,7 +221,7 @@ with openapi_client.ApiClient(configuration) as api_client:
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.submit_image_query(detector_id, human_review=human_review, patience_time=patience_time, body=body)
api_response = api_instance.submit_image_query(detector_id, human_review=human_review, patience_time=patience_time, want_async=want_async, body=body)
pprint(api_response)
except openapi_client.ApiException as e:
print("Exception when calling ImageQueriesApi->submit_image_query: %s\n" % e)
Expand All @@ -233,6 +235,7 @@ Name | Type | Description | Notes
**detector_id** | **str**| Choose a detector by its ID. |
**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]
**patience_time** | **float**| How long to wait for a confident response. | [optional]
**want_async** | **Bool**| If set to `true`, server returns response immediately and result is computed asynchronously. | [optional]
**body** | **file_type**| | [optional]

### Return type
Expand Down
2 changes: 1 addition & 1 deletion generated/model.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: public-api.yaml
# timestamp: 2023-08-09T20:46:11+00:00
# timestamp: 2023-10-16T21:00:27+00:00

from __future__ import annotations

Expand Down
6 changes: 6 additions & 0 deletions generated/openapi_client/api/image_queries_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
none_type,
validate_and_convert_types,
)
from openapi_client.model.bool import Bool
from openapi_client.model.image_query import ImageQuery
from openapi_client.model.paginated_image_query_list import PaginatedImageQueryList

Expand Down Expand Up @@ -133,6 +134,7 @@ def __init__(self, api_client=None):
"detector_id",
"human_review",
"patience_time",
"want_async",
"body",
],
"required": [
Expand All @@ -149,17 +151,20 @@ def __init__(self, api_client=None):
"detector_id": (str,),
"human_review": (str,),
"patience_time": (float,),
"want_async": (Bool,),
"body": (file_type,),
},
"attribute_map": {
"detector_id": "detector_id",
"human_review": "human_review",
"patience_time": "patience_time",
"want_async": "want_async",
},
"location_map": {
"detector_id": "query",
"human_review": "query",
"patience_time": "query",
"want_async": "query",
"body": "body",
},
"collection_format_map": {},
Expand Down Expand Up @@ -299,6 +304,7 @@ def submit_image_query(self, detector_id, **kwargs):
Keyword Args:
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]
patience_time (float): How long to wait for a confident response.. [optional]
want_async (Bool): If set to `true`, server returns response immediately and result is computed asynchronously.. [optional]
body (file_type): [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
Expand Down
50 changes: 28 additions & 22 deletions spec/public-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,28 +126,34 @@ paths:
```
parameters:
- in: query
name: detector_id
schema:
type: string
description: Choose a detector by its ID.
required: true
- in: query
name: human_review
schema:
type: string
description: >
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.
required: false
- in: query
name: patience_time
schema:
type: number
format: float
description: How long to wait for a confident response.
required: false
- in: query
name: detector_id
schema:
type: string
description: Choose a detector by its ID.
required: true
- in: query
name: human_review
schema:
type: string
description: >
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.
required: false
- in: query
name: patience_time
schema:
type: number
format: float
description: How long to wait for a confident response.
required: false
- in: query
name: want_async
schema:
type: bool
description: If set to `true`, server returns response immediately and result is computed asynchronously.
required: false
tags:
- image-queries
requestBody:
Expand Down

0 comments on commit 2477fd5

Please sign in to comment.