@@ -396,7 +396,7 @@ def _query(
396396 version_number : Optional [int ],
397397 text_input : Optional [str ],
398398 images_input : Optional [List [str ]],
399- return_reasoning : Optional [bool ]
399+ return_reasoning : Optional [bool ],
400400 ) -> Union [Dict [str , Any ], Coroutine [Any , Any , Dict [str , Any ]]]:
401401 """Internal method to handle both synchronous and asynchronous query requests.
402402
@@ -440,7 +440,13 @@ def _query(
440440
441441 # Make the request
442442 endpoint = "query"
443- data = {"name" : fn_name , "text" : text_input , "images" : image_urls , "version_number" : version_number , "return_reasoning" : return_reasoning }
443+ data = {
444+ "name" : fn_name ,
445+ "text" : text_input ,
446+ "images" : image_urls ,
447+ "version_number" : version_number ,
448+ "return_reasoning" : return_reasoning ,
449+ }
444450 request = self ._make_request (endpoint = endpoint , data = data , is_async = is_async )
445451
446452 if is_async :
@@ -460,7 +466,7 @@ async def aquery(
460466 version_number : Optional [int ] = - 1 ,
461467 text_input : Optional [str ] = "" ,
462468 images_input : Optional [List [str ]] = [],
463- return_reasoning : Optional [bool ] = False
469+ return_reasoning : Optional [bool ] = False ,
464470 ) -> Dict [str , Any ]:
465471 """Asynchronously queries a function with the given function ID and input.
466472
@@ -484,7 +490,12 @@ async def aquery(
484490 and the latency in milliseconds.
485491 """
486492 return await self ._query (
487- fn_name = fn_name , version_number = version_number , text_input = text_input , images_input = images_input , return_reasoning = return_reasoning , is_async = True
493+ fn_name = fn_name ,
494+ version_number = version_number ,
495+ text_input = text_input ,
496+ images_input = images_input ,
497+ return_reasoning = return_reasoning ,
498+ is_async = True ,
488499 )
489500
490501 def query (
@@ -493,7 +504,7 @@ def query(
493504 version_number : Optional [int ] = - 1 ,
494505 text_input : Optional [str ] = "" ,
495506 images_input : Optional [List [str ]] = [],
496- return_reasoning : Optional [bool ] = False
507+ return_reasoning : Optional [bool ] = False ,
497508 ) -> Dict [str , Any ]:
498509 """Synchronously queries a function with the given function ID and input.
499510
@@ -517,11 +528,20 @@ def query(
517528 and the latency in milliseconds.
518529 """
519530 return self ._query (
520- fn_name = fn_name , version_number = version_number , text_input = text_input , images_input = images_input , return_reasoning = return_reasoning , is_async = False
531+ fn_name = fn_name ,
532+ version_number = version_number ,
533+ text_input = text_input ,
534+ images_input = images_input ,
535+ return_reasoning = return_reasoning ,
536+ is_async = False ,
521537 )
522538
523539 def batch_query (
524- self , fn_name : str , batch_inputs : List [Dict [str , Any ]], version_number : Optional [int ] = - 1 , return_reasoning : Optional [bool ] = False
540+ self ,
541+ fn_name : str ,
542+ batch_inputs : List [Dict [str , Any ]],
543+ version_number : Optional [int ] = - 1 ,
544+ return_reasoning : Optional [bool ] = False ,
525545 ) -> List [Dict [str , Any ]]:
526546 """Batch queries a function version with a list of inputs.
527547
@@ -547,7 +567,12 @@ def batch_query(
547567
548568 async def run_queries ():
549569 tasks = list (
550- map (lambda fn_input : self .aquery (fn_name = fn_name , version_number = version_number , return_reasoning = return_reasoning , ** fn_input ), batch_inputs )
570+ map (
571+ lambda fn_input : self .aquery (
572+ fn_name = fn_name , version_number = version_number , return_reasoning = return_reasoning , ** fn_input
573+ ),
574+ batch_inputs ,
575+ )
551576 )
552577 return await asyncio .gather (* tasks )
553578
0 commit comments