@@ -139,7 +139,7 @@ def __init__(
139139 self ._in_process = False
140140 self ._async_client : Optional [httpx .AsyncClient ] = None
141141
142- async def info (self ) -> dict [str , Any ]:
142+ def info (self ) -> dict [str , Any ]:
143143 """
144144 :return: Dictionary containing backend configuration details.
145145 """
@@ -190,7 +190,7 @@ async def process_shutdown(self):
190190 if not self ._in_process :
191191 raise RuntimeError ("Backend not started up for process." )
192192
193- await self ._async_client .aclose ()
193+ await self ._async_client .aclose () # type: ignore [union-attr]
194194 self ._async_client = None
195195 self ._in_process = False
196196
@@ -210,7 +210,7 @@ async def validate(self):
210210 # Model is set, use /health endpoint as first check
211211 target = f"{ self .target } { self .HEALTH_PATH } "
212212 headers = self ._get_headers ()
213- response = await self ._async_client .get (target , headers = headers )
213+ response = await self ._async_client .get (target , headers = headers ) # type: ignore [union-attr]
214214 response .raise_for_status ()
215215
216216 return
@@ -258,7 +258,7 @@ async def available_models(self) -> list[str]:
258258 target = f"{ self .target } { self .MODELS_PATH } "
259259 headers = self ._get_headers ()
260260 params = self ._get_params (self .MODELS_KEY )
261- response = await self ._async_client .get (target , headers = headers , params = params )
261+ response = await self ._async_client .get (target , headers = headers , params = params ) # type: ignore [union-attr]
262262 response .raise_for_status ()
263263
264264 return [item ["id" ] for item in response .json ()["data" ]]
@@ -305,7 +305,7 @@ async def resolve(
305305 request_id = request .request_id ,
306306 request_args = {
307307 "request_type" : request .request_type ,
308- "output_token_count" : request .constraints .get ("max_output_tokens " ),
308+ "output_token_count" : request .constraints .get ("output_tokens " ),
309309 ** request .params ,
310310 },
311311 value = "" ,
@@ -324,15 +324,15 @@ async def resolve(
324324 {
325325 "prompt" : request .content ,
326326 "request_id" : request .request_id ,
327- "output_token_count" : request .constraints .get ("max_output_tokens " ),
327+ "output_token_count" : request .constraints .get ("output_tokens " ),
328328 "stream_response" : request .params .get ("stream" , self .stream_response ),
329329 ** request .params ,
330330 }
331331 if request .request_type == "text_completions"
332332 else {
333333 "content" : request .content ,
334334 "request_id" : request .request_id ,
335- "output_token_count" : request .constraints .get ("max_output_tokens " ),
335+ "output_token_count" : request .constraints .get ("output_tokens " ),
336336 "stream_response" : request .params .get ("stream" , self .stream_response ),
337337 ** request .params ,
338338 }
@@ -345,7 +345,7 @@ async def resolve(
345345 if delta is not None :
346346 if request_info .request_timings .first_iteration is None :
347347 request_info .request_timings .first_iteration = time .time ()
348- response .value += delta
348+ response .value += delta # type: ignore [operator]
349349 response .delta = delta
350350 request_info .request_timings .last_iteration = time .time ()
351351 response .iterations += 1
@@ -396,7 +396,7 @@ async def text_completions(
396396 yield None , None # Initial yield for async iterator to signal start
397397
398398 if not stream_response :
399- response = await self ._async_client .post (
399+ response = await self ._async_client .post ( # type: ignore [union-attr]
400400 target ,
401401 headers = headers ,
402402 params = params ,
@@ -411,7 +411,7 @@ async def text_completions(
411411 return
412412
413413 body .update ({"stream" : True , "stream_options" : {"include_usage" : True }})
414- async with self ._async_client .stream (
414+ async with self ._async_client .stream ( # type: ignore [union-attr]
415415 "POST" ,
416416 target ,
417417 headers = headers ,
@@ -474,7 +474,7 @@ async def chat_completions(
474474 yield None , None # Initial yield for async iterator to signal start
475475
476476 if not stream_response :
477- response = await self ._async_client .post (
477+ response = await self ._async_client .post ( # type: ignore [union-attr]
478478 target , headers = headers , params = params , json = body
479479 )
480480 response .raise_for_status ()
@@ -486,7 +486,7 @@ async def chat_completions(
486486 return
487487
488488 body .update ({"stream" : True , "stream_options" : {"include_usage" : True }})
489- async with self ._async_client .stream (
489+ async with self ._async_client .stream ( # type: ignore [union-attr]
490490 "POST" , target , headers = headers , params = params , json = body
491491 ) as stream :
492492 stream .raise_for_status ()
0 commit comments