Skip to content

Commit b7455f3

Browse files
committed
"Someday, I'm gonna be a real parameter!"
1 parent 2fc2182 commit b7455f3

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/groundlight/client.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,6 @@ def _fixup_image_query(iq: ImageQuery) -> ImageQuery:
233233
iq.result.label = convert_internal_label_to_display(iq, iq.result.label)
234234
return iq
235235

236-
def _get_request_timeout(self, **kwargs):
237-
"""Extract request_timeout from kwargs or use default."""
238-
return kwargs.get("request_timeout", DEFAULT_REQUEST_TIMEOUT)
239-
240236
def whoami(self) -> str:
241237
"""
242238
Return the username (email address) associated with the current API token.
@@ -641,7 +637,7 @@ def submit_image_query( # noqa: PLR0913 # pylint: disable=too-many-arguments, t
641637
inspection_id: Optional[str] = None,
642638
metadata: Union[dict, str, None] = None,
643639
image_query_id: Optional[str] = None,
644-
**kwargs,
640+
request_timeout: Optional[float] = None,
645641
) -> ImageQuery:
646642
"""
647643
Evaluates an image with Groundlight. This is the core method for getting predictions about images.
@@ -723,6 +719,8 @@ def submit_image_query( # noqa: PLR0913 # pylint: disable=too-many-arguments, t
723719
:param image_query_id: The ID for the image query. This is to enable specific functionality
724720
and is not intended for general external use. If not set, a random ID
725721
will be generated.
722+
:param request_timeout: The total request timeout for the image query submission API request. Most users will
723+
not need to modify this. If not set, the default value will be used.
726724
727725
:return: ImageQuery with query details and result (if wait > 0)
728726
:raises ValueError: If wait > 0 when want_async=True
@@ -739,7 +737,7 @@ def submit_image_query( # noqa: PLR0913 # pylint: disable=too-many-arguments, t
739737
params = {
740738
"detector_id": detector_id,
741739
"body": image_bytesio,
742-
"_request_timeout": self._get_request_timeout(**kwargs),
740+
"_request_timeout": request_timeout if request_timeout is not None else DEFAULT_REQUEST_TIMEOUT,
743741
}
744742

745743
if patience_time is not None:

0 commit comments

Comments
 (0)