@@ -637,6 +637,7 @@ def submit_image_query( # noqa: PLR0913 # pylint: disable=too-many-arguments, t
637
637
inspection_id : Optional [str ] = None ,
638
638
metadata : Union [dict , str , None ] = None ,
639
639
image_query_id : Optional [str ] = None ,
640
+ request_timeout : Optional [float ] = None ,
640
641
) -> ImageQuery :
641
642
"""
642
643
Evaluates an image with Groundlight. This is the core method for getting predictions about images.
@@ -718,6 +719,8 @@ def submit_image_query( # noqa: PLR0913 # pylint: disable=too-many-arguments, t
718
719
:param image_query_id: The ID for the image query. This is to enable specific functionality
719
720
and is not intended for general external use. If not set, a random ID
720
721
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.
721
724
722
725
:return: ImageQuery with query details and result (if wait > 0)
723
726
:raises ValueError: If wait > 0 when want_async=True
@@ -731,7 +734,11 @@ def submit_image_query( # noqa: PLR0913 # pylint: disable=too-many-arguments, t
731
734
732
735
image_bytesio : ByteStreamWrapper = parse_supported_image_types (image )
733
736
734
- params = {"detector_id" : detector_id , "body" : image_bytesio , "_request_timeout" : DEFAULT_REQUEST_TIMEOUT }
737
+ params = {
738
+ "detector_id" : detector_id ,
739
+ "body" : image_bytesio ,
740
+ "_request_timeout" : request_timeout if request_timeout is not None else DEFAULT_REQUEST_TIMEOUT ,
741
+ }
735
742
736
743
if patience_time is not None :
737
744
params ["patience_time" ] = patience_time
0 commit comments