@@ -637,6 +637,7 @@ def submit_image_query( # noqa: PLR0913 # pylint: disable=too-many-arguments, t
637637 inspection_id : Optional [str ] = None ,
638638 metadata : Union [dict , str , None ] = None ,
639639 image_query_id : Optional [str ] = None ,
640+ request_timeout : Optional [float ] = None ,
640641 ) -> ImageQuery :
641642 """
642643 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
718719 :param image_query_id: The ID for the image query. This is to enable specific functionality
719720 and is not intended for general external use. If not set, a random ID
720721 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.
721724
722725 :return: ImageQuery with query details and result (if wait > 0)
723726 :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
731734
732735 image_bytesio : ByteStreamWrapper = parse_supported_image_types (image )
733736
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+ }
735742
736743 if patience_time is not None :
737744 params ["patience_time" ] = patience_time
0 commit comments