@@ -307,9 +307,7 @@ def default_headers(self) -> dict[str, str | Omit]:
307307
308308 @override
309309 def _validate_headers (self , headers : Headers , custom_headers : Headers ) -> None :
310- if (self .api_key or self .agent_key or self .inference_key ) and headers .get (
311- "Authorization"
312- ):
310+ if (self .api_key or self .agent_key or self .inference_key ) and headers .get ("Authorization" ):
313311 return
314312 if isinstance (custom_headers .get ("Authorization" ), Omit ):
315313 return
@@ -339,14 +337,10 @@ def copy(
339337 Create a new client instance re-using the same options given to the current client with optional overriding.
340338 """
341339 if default_headers is not None and set_default_headers is not None :
342- raise ValueError (
343- "The `default_headers` and `set_default_headers` arguments are mutually exclusive"
344- )
340+ raise ValueError ("The `default_headers` and `set_default_headers` arguments are mutually exclusive" )
345341
346342 if default_query is not None and set_default_query is not None :
347- raise ValueError (
348- "The `default_query` and `set_default_query` arguments are mutually exclusive"
349- )
343+ raise ValueError ("The `default_query` and `set_default_query` arguments are mutually exclusive" )
350344
351345 headers = self ._custom_headers
352346 if default_headers is not None :
@@ -393,14 +387,10 @@ def _make_status_error(
393387 return _exceptions .BadRequestError (err_msg , response = response , body = body )
394388
395389 if response .status_code == 401 :
396- return _exceptions .AuthenticationError (
397- err_msg , response = response , body = body
398- )
390+ return _exceptions .AuthenticationError (err_msg , response = response , body = body )
399391
400392 if response .status_code == 403 :
401- return _exceptions .PermissionDeniedError (
402- err_msg , response = response , body = body
403- )
393+ return _exceptions .PermissionDeniedError (err_msg , response = response , body = body )
404394
405395 if response .status_code == 404 :
406396 return _exceptions .NotFoundError (err_msg , response = response , body = body )
@@ -409,17 +399,13 @@ def _make_status_error(
409399 return _exceptions .ConflictError (err_msg , response = response , body = body )
410400
411401 if response .status_code == 422 :
412- return _exceptions .UnprocessableEntityError (
413- err_msg , response = response , body = body
414- )
402+ return _exceptions .UnprocessableEntityError (err_msg , response = response , body = body )
415403
416404 if response .status_code == 429 :
417405 return _exceptions .RateLimitError (err_msg , response = response , body = body )
418406
419407 if response .status_code >= 500 :
420- return _exceptions .InternalServerError (
421- err_msg , response = response , body = body
422- )
408+ return _exceptions .InternalServerError (err_msg , response = response , body = body )
423409 return APIStatusError (err_msg , response = response , body = body )
424410
425411
@@ -589,9 +575,7 @@ def default_headers(self) -> dict[str, str | Omit]:
589575
590576 @override
591577 def _validate_headers (self , headers : Headers , custom_headers : Headers ) -> None :
592- if (self .api_key or self .agent_key or self .inference_key ) and headers .get (
593- "Authorization"
594- ):
578+ if (self .api_key or self .agent_key or self .inference_key ) and headers .get ("Authorization" ):
595579 return
596580 if isinstance (custom_headers .get ("Authorization" ), Omit ):
597581 return
@@ -621,14 +605,10 @@ def copy(
621605 Create a new client instance re-using the same options given to the current client with optional overriding.
622606 """
623607 if default_headers is not None and set_default_headers is not None :
624- raise ValueError (
625- "The `default_headers` and `set_default_headers` arguments are mutually exclusive"
626- )
608+ raise ValueError ("The `default_headers` and `set_default_headers` arguments are mutually exclusive" )
627609
628610 if default_query is not None and set_default_query is not None :
629- raise ValueError (
630- "The `default_query` and `set_default_query` arguments are mutually exclusive"
631- )
611+ raise ValueError ("The `default_query` and `set_default_query` arguments are mutually exclusive" )
632612
633613 headers = self ._custom_headers
634614 if default_headers is not None :
@@ -675,14 +655,10 @@ def _make_status_error(
675655 return _exceptions .BadRequestError (err_msg , response = response , body = body )
676656
677657 if response .status_code == 401 :
678- return _exceptions .AuthenticationError (
679- err_msg , response = response , body = body
680- )
658+ return _exceptions .AuthenticationError (err_msg , response = response , body = body )
681659
682660 if response .status_code == 403 :
683- return _exceptions .PermissionDeniedError (
684- err_msg , response = response , body = body
685- )
661+ return _exceptions .PermissionDeniedError (err_msg , response = response , body = body )
686662
687663 if response .status_code == 404 :
688664 return _exceptions .NotFoundError (err_msg , response = response , body = body )
@@ -691,17 +667,13 @@ def _make_status_error(
691667 return _exceptions .ConflictError (err_msg , response = response , body = body )
692668
693669 if response .status_code == 422 :
694- return _exceptions .UnprocessableEntityError (
695- err_msg , response = response , body = body
696- )
670+ return _exceptions .UnprocessableEntityError (err_msg , response = response , body = body )
697671
698672 if response .status_code == 429 :
699673 return _exceptions .RateLimitError (err_msg , response = response , body = body )
700674
701675 if response .status_code >= 500 :
702- return _exceptions .InternalServerError (
703- err_msg , response = response , body = body
704- )
676+ return _exceptions .InternalServerError (err_msg , response = response , body = body )
705677 return APIStatusError (err_msg , response = response , body = body )
706678
707679
@@ -920,9 +892,7 @@ def knowledge_bases(
920892 AsyncKnowledgeBasesResourceWithStreamingResponse ,
921893 )
922894
923- return AsyncKnowledgeBasesResourceWithStreamingResponse (
924- self ._client .knowledge_bases
925- )
895+ return AsyncKnowledgeBasesResourceWithStreamingResponse (self ._client .knowledge_bases )
926896
927897 @cached_property
928898 def models (self ) -> models .AsyncModelsResourceWithStreamingResponse :
0 commit comments