Skip to content

Commit

Permalink
fixing params issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Huff committed Aug 11, 2023
1 parent 04c40a1 commit 3175123
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/groundlight/internalapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ class InternalApiError(ApiException, RuntimeError):
def __init__(self, status=None, reason=None, http_resp=None):
super().__init__(status, reason, http_resp)




class RequestsRetryDecorator:
"""
Expand Down Expand Up @@ -243,7 +245,12 @@ def submit_image_query_with_inspection( # noqa: PLR0913 # pylint: disable=too-m

url = f"{self.configuration.host}/posichecks"

params = {"inspection_id": inspection_id, "predictor_id": detector_id, "patience_time": patience_time}
params = {
"inspection_id": inspection_id,
"predictor_id": detector_id,
"patience_time": patience_time
}

# In the API, 'send_notification' is used to control human_review escalation. This will eventually
# be deprecated, but for now we need to support it in the following manner:
if human_review == "ALWAYS":
Expand All @@ -256,7 +263,7 @@ def submit_image_query_with_inspection( # noqa: PLR0913 # pylint: disable=too-m
headers = self._headers()
headers["Content-Type"] = "image/jpeg"

response = requests.request("POST", url, headers=headers, data=body.read())
response = requests.request("POST", url, headers=headers, params=params, data=body.read())

if not is_ok(response.status_code):
logger.info(response)
Expand Down

0 comments on commit 3175123

Please sign in to comment.